======= Methods ======= -------------- Public Methods -------------- +----------------------+----------------------+----------------------+ | getActiveModel_ | getActiveProject_ | getMaterials_ | +----------------------+----------------------+----------------------+ | getUnits_ | usingUnits_ | openFile_ | +----------------------+----------------------+----------------------+ | importFile_ | newModel_ | getSystemDirectory_ | +----------------------+----------------------+----------------------+ | getTutorialFilePath_ | openTutorialFile_ | importTutorialFile_ | +----------------------+----------------------+----------------------+ | getSettings_ | setSetting_ | ishole_ | +----------------------+----------------------+----------------------+ | runningInBatch_ | fitView_ | orientView_ | +----------------------+----------------------+----------------------+ | isolate_ | redrawView_ | showMessage_ | +----------------------+----------------------+----------------------+ | clearMessage_ | | +----------------------+---------------------------------------------+ .. _getActiveModel: .. method:: getActiveModel() Returns the active model. :returns: The active model. :rtype: Model .. _getActiveProject: .. method:: getActiveProject() Return the active project. :returns: The active project. :rtype: Project .. _getMaterials: .. method:: getMaterials() Return a dictionary of defined material keys to the material name. :returns: Ordered dictionary of materials. :rtype: OrderedDict .. _getUnits: .. method:: getUnits() Returns the units manager that manage various unit systems used throughout the application. :returns: Units manager. :rtype: UnitsManager .. _usingUnits: .. method:: 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: .. method:: 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: .. method:: 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: .. method:: newModel() Clears the current model and returns a new one. :returns: The active model. :rtype: Model .. _getSystemDirectory: .. method:: getSystemDirectory() Returns the path to the installation directory. :returns: Application installation directory. :rtype: str .. _getTutorialFilePath: .. method:: 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: .. method:: 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: .. method:: 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: .. method:: 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: .. method:: 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: .. method:: 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: .. method:: runningInBatch() Return True if the application runs in batch mode, False otherwise. :returns: Returns True in batch mode, else False. :rtype: bool .. _fitView: .. method:: fitView() Ensures all visible objects can be seen in the view. .. _orientView: .. method:: 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: .. method:: 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: .. method:: 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: .. method:: showMessage(msg) Displays a message in the status bar. :param msg: Message to be displayed in the status bar. :type msg: str .. _clearMessage: .. method:: clearMessage() Removes a message from the status bar.