# Methods¶

## Public Methods¶

getModel()

Returns the active model.

returns: The active model. Model
getActiveProject()

Return the active project.

returns: The active project. Project
getMaterials()

Return a dictionary of defined material keys to the material name.

returns: Ordered dictionary of materials. OrderedDict
getUnits()

Returns the units manager that manage various unit systems used throughout the application.

returns: Units manager. 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’,… Units, str All the action are applicable within the context. ContextManager
openFile(file)

Returns the active model after opening the model defined in file.

param file: Absolute path to the file. str The active model. 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. str
newModel()

Clears the current model and returns a new one.

returns: The active model. Model
getSystemDirectory()

Returns the path to the installation directory.

returns: Application installation directory. 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. str Absolute path to the file in tutorial models directory. str
openTutorialFile(file)

Opens the given input model from tutorial directory.

param file: Valid path after tutorial models directory. str The active model. 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. str
getSettings(setting=None, default=None)

Returns the user preference value for a given setting.

param setting: The preference option path with ‘/’. str The preference value for a given setting. str
setSetting(setting, value)

Sets the user preference value for a given setting.

param setting: Path to preference option with ‘/’. str Valid value in string format. 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. Feature True if it a round or partially hole, else False. bool
runningInBatch()

Return True if the application runs in batch mode, False otherwise.

returns: Returns True in batch mode, else False. 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. 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. str
clearMessage()

Removes a message from the status bar.