Presentation is loading. Please wait.

Presentation is loading. Please wait.

Innovation Intelligence ® 1 Chapter 7: The MotionView Client.

Similar presentations


Presentation on theme: "Innovation Intelligence ® 1 Chapter 7: The MotionView Client."— Presentation transcript:

1 Innovation Intelligence ® 1 Chapter 7: The MotionView Client

2 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 22 The MotionView Model Client – Overview Model Window Loading mdl model Creating blank model Export a model Running MotionSolve Model Object Getting the model handle Adding new entity Model Tree Grabbing Properties of an entity Interpret Properties of an entity

3 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 33 The MotionView Model Client – Model Window In any window, you can set the client type to Model Creates the model object Example: hwi OpenStack hwi GetSessionHandle session1 session1 GetProjectHandle project1 project1 GetPageHandle page1 1 page1 GetWindowHandle win1 1 win1 SetClientType Model hwi CloseStack

4 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 44 The MotionView Model Client – Model Window After setting the client type you can access the model client and get full access to its functionality using the GetClientHandle command page1 GetWindowHandle win1 1 win1 GetClientHandle client Object Hierarchy for mdlI The prefix “mdlI” is used internally for naming the classes within the model client. It stands for “model Interface”.

5 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 55 The MotionView Model Client – Model Window Load an existing model (mdl) file into the model client CreateModel command is used Requires 2 arguments – the filename and type of file page1 GetWindowHandle win1 1 win1 GetClientHandle client client CreateModel full_car.mdl mdl Create a blank model CreateBlankModel command is used page1 GetWindowHandle win1 1 win1 GetClientHandle client client CreateBlankModel

6 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 66 The MotionView Model Client – Model Window Export an existing model ExportModel command is used Requires that a filename be given for the file that is bieng written out page1 GetWindowHandle win1 1 win1 GetClientHandle client client ExportModel “full_car.xml” Run MotionSolve RunSolverScript command is used Requires that a filename to which the results should be written to be given page1 GetWindowHandle win1 1 win1 GetClientHandle client client RunSolverScript “full_car.xml”

7 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 77 The MotionView Model Client – Model Object Getting the model handle using GetModelHandle command page1 GetWindowHandle win1 1 win1 GetClientHandle client client GetModelHandle mod Adding a new entity using InterpretEntity The InterpretEntity command adds a new entity using the MDL statement keyword, the variable name and label. client CreateBlankModel client GetModelHandle mod mod InterpretEntity p_handle Point p_new “\”Point 0\”” mod Evaluate Use Evaluate command on the model object to evaluate all the expressions in the model an update the values

8 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 88 The MotionView Model Client – Model Object Adding a new entity using AppendMdl Directly use an mdl statement as an input argument mdl statement to add a point: *Point (p_0, “Pivot”) In TCL using AppendMdl: client CreateBlankModel client GetModelHandle mod mod AppendMdl “*Point( p_0, \” Pivot \”)” mod Evaluate Notice the back slash “\” which needs to be used because the mdl statement has quotes “ “

9 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 99 The MotionView Model Client – Model Object Adding a new entity using AddEntity adds a new entity using the class varname from the MDF file MDF file contains the definitions of the attributes of a data member such as point, body, marker, etc client CreateBlankModel client GetModelHandle mod mod AddEntity p_handle point_ent p_new false mod Evaluate

10 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 10 The MotionView Model Client – The Model Tree Examine how MotionView Model Tree is organized Use Expression Builder to get the reference of an entity For an example, let’s add a point and a body using the MotionView interface Add a point at 10, 20, 30 using the Points panel 1. Go to the Points Panel 2. Add a point (leave label and variable set to defaults) 3. Set Coordinates to 10, 20, 30

11 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 11 The MotionView Model Client – The Model Tree Add a body using the Bodies panel Set Center of Mass Coordinate of Body 0 to Point 0 1. Bodies panel 2. Add a body (leaving the label and variable set to defaults) 3. Click on CM Coordinates 4. Check box for use center of mass coordinate system and specify Point 0 for Origin

12 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 12 The MotionView Model Client – The Model Tree From the Properties tab click in field for mass and then click f(x) to access Expression Builder 1. Click on Properties Tab 3. Click f(x) for Expression Builder 2. Click in field for Mass

13 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 13 The MotionView Model Client – The Model Tree Expression Builder Populated with model tree To refer to idstring of the point locate the parent point’ Expand the folder Points and then Points 0 By expanding the child you can now select idstring

14 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 14 The MotionView Model Client – The Model Tree Click Add, you will notice the Expression Builder will have the expression “the_model.p_0.idstring”. “the_model” references the system in which an entity is created. “p_0” is the variable name of the point “Point 0” “the_model.p_0.idstring” returns the idstring of the point. Notice that we require “dot” operator to refer to a property of an entity. Likewise, you may use the Expression Builder to refer to any property of an entity.

15 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 15 Grabbing Properties of an entity Grab the properties of an entity using GetDataValue X coordinate of a point Mass of a body Stiffness value of a spring GetDataValue returns the current value for a data member To get the X co-ordinate of a point (with var name p_0) using GetDataValue : page1 GetWindowHandle win1 1 win1 GetClientHandle client client CreateBlankModel client GetModelHandle mod mod GetDataValue “the_model.p_0.x” mod Evaluate Use the Model Tree in the Expression Builder to get the required property (the_model.p_0.x)

16 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 16 Grabbing Properties of an entity Grab the properties of an entity using GetChildHandle To get the X co-ordinate of a point (with var name p_0) using GetDataValue : page1 GetWindowHandle win1 1 win1 GetClientHandle client client CreateBlankModel client GetModelHandle mod mod GetChildHandle xcord “p_0.x” xcord GetEvaluatedValue One other way of accomplishing this would be: page1 GetWindowHandle win1 1 win1 GetClientHandle client client CreateBlankModel client GetModelHandle mod mod GetChildHandle poi p_0 poi GetChildHandle xcor x xcor GetEvaluatedValue

17 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 17 Interpret the properties of an entity Interpret the properties of an entity using SetDataValue SetDataValue command changes the value for an item using a value or expression Change the X coordinate of a point (with var name p_0) using a value client GetModelHandle mod mod SetDataValue “the_model.p_0.x” 50 mod Evaluate Change the X coordinate of a point (with var name p_0) using an expression client GetModelHandle mod mod SetDataValue “the_model.p_0.x” “the_model.p_0.y+50” mod Evaluate

18 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 18 Interpret the properties of an entity Interpret the properties of an entity using InterpretSet InterpretSet command adds a new set statement to the system Change the X coordinate of a point (with var name p_0) using a value page1 GetWindowHandle win1 1 win1 GetClientHandle client client CreateBlankModel client GetModelHandle mod mod InterpretSet SetPoint p_0 “10” “20” “30” mod Evaluate The InterpretSet command requires us to specify the keyword of the new entity’s MDL statement ( SetPoint in the above example) and the remaining arguments for the corresponding mdl statement.

19 Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 19 The MotionView Model Client - Exercises Please reference exercises 7a, 7b, and 7c in your manual


Download ppt "Innovation Intelligence ® 1 Chapter 7: The MotionView Client."

Similar presentations


Ads by Google