Methods¶
Public Methods¶
-
getActiveModel()¶
Returns the active model.
| returns: | The active model. |
|---|---|
| rtype: | Model |
-
getActiveProject()¶
Return the active project.
| returns: | The active project. |
|---|---|
| rtype: | Project |
-
getMaterials()¶
Return a dictionary of defined material keys to the material name.
| returns: | Ordered dictionary of materials. |
|---|---|
| rtype: | OrderedDict |
-
getUnits()¶
Returns the units manager that manage various unit systems used throughout the application.
| returns: | Units manager. |
|---|---|
| rtype: | UnitsManager |
-
usingUnits(type)¶
To specify unit system to set or get data model values.
| param type: | Type of units system. It can be, “base”, “gui”, “solver”, “MKS”, “CGS’,… |
|---|---|
| type type: | Units, str |
| returns: | All the action are applicable within the context. |
| rtype: | ContextManager |
-
openFile(file)¶
Returns the active model after opening the model defined in file.
| param file: | Absolute path to the file. |
|---|---|
| type file: | str |
| returns: | The active model. |
| rtype: | Model |
-
importFile(file)¶
Imports and merges a saved model with the current model.
The imported model is inserted as an assembly under the top-level folder in the Model Browser.
| param file: | Absolute path to the file. |
|---|---|
| type file: | str |
-
newModel()¶
Clears the current model and returns a new one.
| returns: | The active model. |
|---|---|
| rtype: | Model |
-
getSystemDirectory()¶
Returns the path to the installation directory.
| returns: | Application installation directory. |
|---|---|
| rtype: | str |
-
getTutorialFilePath(file)¶
Returns the absolute path to the tutorial models directory for a given input file.
| param file: | Valid path after tutorial models directory. |
|---|---|
| type file: | str |
| returns: | Absolute path to the file in tutorial models directory. |
| rtype: | str |
-
openTutorialFile(file)¶
Opens the given input model from tutorial directory.
| param file: | Valid path after tutorial models directory. |
|---|---|
| type file: | str |
| returns: | The active model. |
| rtype: | Model |
-
importTutorialFile(file)¶
Opens the model from the tutorials folder and add it to the active model.
| param file: | The filename with path relative to tutorials folder. |
|---|---|
| type file: | str |
-
getSettings(setting=None, default=None)¶
Returns the user preference value for a given setting.
| param setting: | The preference option path with ‘/’. |
|---|---|
| type setting: | str |
| returns: | The preference value for a given setting. |
| rtype: | str |
-
setSetting(setting, value)¶
Sets the user preference value for a given setting.
| param setting: | Path to preference option with ‘/’. |
|---|---|
| type setting: | str |
| param value: | Valid value in string format. |
| type value: | str |
-
ishole(f)
Returns True if the given object is a round or partially round hole, False otherwise.
| param f: | Part feature with type FeatureCylindrical, FeatureCircular..etc. |
|---|---|
| type f: | Feature |
| returns: | True if it a round or partially hole, else False. |
| rtype: | bool |
-
runningInBatch()¶
Return True if the application runs in batch mode, False otherwise.
| returns: | Returns True in batch mode, else False. |
|---|---|
| rtype: | bool |
-
fitView()¶
Ensures all visible objects can be seen in the view.
-
orientView(direction='top', up=None)¶
Rotates your model to a standard view, an isometric view, to the closest principal axis, or so that the sketch plane is normal to the grid.
| param direction: | |
|---|---|
| View direction. Valid choices are: - “front” - “back” - “left” - “right” - “top” - “bottom” - “iso” | |
| type direction: | str |
| param up: | Specifies the vector that points up on the screen. |
| type up: | vector |
-
isolate(obj)
Isolates objects in the modeling window.
Isolating an object zooms in and temporarily hides all other objects.
| param obj: | Inspire objects. |
|---|---|
| type obj: | Union[Model, Part, BoundaryCondition] |
-
redrawView(processEvents=False)¶
Forces a redraw of the active graphics window. Useful when executing commands from the Console and the graphics are cached or updating the view for animation.
| param processEvents: | |
|---|---|
| True, makes gui responsive to the user. | |
| type processEvents: | |
| bool | |
-
showMessage(msg)¶
Displays a message in the status bar.
| param msg: | Message to be displayed in the status bar. |
|---|---|
| type msg: | str |
-
clearMessage()¶
Removes a message from the status bar.