======================== Model (hwx.inspire.core) ======================== The active Inspire model. Model is a subclass of Assembly class. It can be retrieved from and saved to a file. Is contains all the parts, joints, fasteners, load cases, and any other information required for its analysis. ---------- Attributes ---------- +--------------------------------+--------------------------------+--------------------------------+ | active_: Bool | autoCalculateCG_: Bool | autoCalculateMass_: Bool | +--------------------------------+--------------------------------+--------------------------------+ | autoCalculateMeshSize_: Bool | autoCalculateMoment_: Bool | autoCalculateThickness_: Bool | +--------------------------------+--------------------------------+--------------------------------+ | cg_: Location | color_: Color | contactSearchDistance_: Double | +--------------------------------+--------------------------------+--------------------------------+ | detectCollisions_: Bool | gravityDirection_: Direction | gravityMagnitude_: Double | +--------------------------------+--------------------------------+--------------------------------+ | ground_: Bool | ip_: Inertia | limitNumberOfElements_: Bool | +--------------------------------+--------------------------------+--------------------------------+ | mass_: Double | material_: Attribute | maxMeshSize_: Double | +--------------------------------+--------------------------------+--------------------------------+ | maxThickness_: Double | minMeshSize_: Double | minThickness_: Double | +--------------------------------+--------------------------------+--------------------------------+ | modifiable_: Bool | morphable_: Bool | movable_: Bool | +--------------------------------+--------------------------------+--------------------------------+ | name_: Attribute | numberOfElements_: Int | position_: Attribute | +--------------------------------+--------------------------------+--------------------------------+ | transparency_: Double | visible_: Bool | volume_: Double | +--------------------------------+--------------------------------+--------------------------------+ ---------- Properties ---------- +--------------------+--------------------+--------------------+ | cavities_ | contacts_ | fasteners_ | +--------------------+--------------------+--------------------+ | gravityComponents_ | holes_ | loadCases_ | +--------------------+--------------------+--------------------+ | measures_ | spotWelds_ | systems_ | +--------------------+--------------------+--------------------+ | variables_ | | +--------------------+-----------------------------------------+ -------------- Public Methods -------------- +---------------------------------------------------------------------------------------------------------------------------------------+ | getSkinMesh_ (self, parts, local=False) | +---------------------------------------------------------------------------------------------------------------------------------------+ | save_ (self, file) | +---------------------------------------------------------------------------------------------------------------------------------------+ | switchToDesignParts_ (self) | +---------------------------------------------------------------------------------------------------------------------------------------+ | updateContacts_ (self, parts=None, searchDistance=-1, visibleOnly=True, ignoreGroups='rigid ground', useExistingSearchDistances=True) | +---------------------------------------------------------------------------------------------------------------------------------------+ ----------------- Attribute Details ----------------- .. _active: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ active : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Returns or sets the object activeness. Setting this on or off sets all children. Setting to True sets all the parents active too. .. _autoCalculateCG: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ autoCalculateCG : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Determines whether the center of gravity is auto calculated. .. _autoCalculateMass: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ autoCalculateMass : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Determines whether the mass value is automatically calculated based upon volume and material density. .. _autoCalculateMeshSize: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ autoCalculateMeshSize : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Indicates whether the minimum and average element sizes used for the solution are automatically calculated. Set to False to enter these values manually. Decreasing the minimum element size will increase the detail of your results in areas that use a number of small elements. The average element size controls the overall detail of your results. .. _autoCalculateMoment: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ autoCalculateMoment : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Determines whether the mass moment of inertia is automatically calculated. .. _autoCalculateThickness: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ autoCalculateThickness : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Determines whether the minimum and maximum thickness values are automatically calculated. All parts are taken into account during the calculation. .. _cg: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cg : :ref:`Location ` (units="length") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Returns the object's global center of gravity as a point. .. _color: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ color : :ref:`Color ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Determines the color assigned to the object when it is displayed in the modeling window. The default color for parts is gray, but a different color can be assigned. .. _contactSearchDistance: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ contactSearchDistance : :ref:`Double ` (units="length") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The global contact search distance for model. .. _detectCollisions: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ detectCollisions : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Determines whether to detect collision. It prevents parts in the model from overlapping and has been enabled by default. .. _gravityDirection: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ gravityDirection : :ref:`Direction ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Returns or sets unitless gravity direction. May not be normalized. .. _gravityMagnitude: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ gravityMagnitude : :ref:`Double ` (units="acceleration") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Returns or sets gravity acceleration scalar. .. _ground: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ground : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Returns or sets the object to be ground or immovable. .. _ip: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ip : :ref:`Inertia ` (units="massMI") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Specifies the inertial properties of this object. Resistance to change in motion (ixx, iyy, izz, ixy, izy, ixz). .. _limitNumberOfElements: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ limitNumberOfElements : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If True, limits the mesh size by number of elements. .. _mass: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mass : :ref:`Double ` (units="m") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The mass of the object. .. _material: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ material : :ref:`Attribute ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The material of the object. Every part in the model has a material assigned to it. The default material is steel, but a different material can be assigned. .. _maxMeshSize: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ maxMeshSize : :ref:`Double ` (units="length") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Returns or sets the maximum mesh size of the part. .. _maxThickness: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ maxThickness : :ref:`Double ` (units="length") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The maximum thickness value. .. _minMeshSize: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ minMeshSize : :ref:`Double ` (units="length") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Returns or sets the minimum mesh size of the part. .. _minThickness: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ minThickness : :ref:`Double ` (units="length") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The minimum thickness value. .. _modifiable: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ modifiable : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Determines whether the selected object can be edited. .. _morphable: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ morphable : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Determines whether the selected object shape can be changed. .. _movable: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ movable : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Determines whether the selected object can be translated in the modeling window or has been locked in place. .. _name: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ name : :ref:`Attribute ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Returns or sets the name of the object. It can be any text string, including spaces, although it's best to avoid using the following characters: " ' * ? and $. While these characters are allowed, they could create difficulties when you export the model to other applications. .. _numberOfElements: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ numberOfElements : :ref:`Int ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Specifies the number of elements in the mesh. .. _position: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ position : :ref:`Attribute ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Specifies the global transform as a Matrix44. .. _transparency: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ transparency : :ref:`Double ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Specifies the transparency of the object. Allows you to change the transparency, according to a percentage. By default, objects are 0% transparent(opaque). .. _visible: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ visible : :ref:`Bool ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Determines whether the object is visible in the modeling window. Setting this on or off sets all children. Setting to True sets all the parents visible too. .. _volume: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ volume : :ref:`Double ` (units="volume") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The volume of the object in the assembly. ---------------- Property Details ---------------- .. _cavities: .. method:: cavities A list of all the cavities in the model. .. _contacts: .. method:: contacts A list of all the contacts in the model. .. _fasteners: .. method:: fasteners A list of all the fasteners (Bolt, Screw, ...) in the model. .. _gravityComponents: .. method:: gravityComponents Returns gravity acceleration vector. .. _holes: .. method:: holes A list of all the holes in the model. .. _loadCases: .. method:: loadCases A list of all the loadcases in the model. .. _measures: .. method:: measures A list of all the measures object in the model. .. _spotWelds: .. method:: spotWelds A list of all the spotWelds in the model. .. _systems: .. method:: systems A list of all the systems object in the model. .. _variables: .. method:: variables Variables used in sketching and geometry operations. -------------- Method Details -------------- .. _getSkinMesh: .. method:: getSkinMesh(self, parts, local=False) Returns a dictionary of parts to the skin mesh (nodes and faces). :param parts: Specify the parts to skin mesh. :type parts: list[Part] :param local: If True, uses the local part collection, else occurrence collection. Recommended to use as defaults. :type local: bool :returns: Dictionary of parts to the skin mesh (nodes and faces). :rtype: dict .. _save: .. method:: save(self, file) Save the active model to the path specified in file. :param file: File name and path, where the file needs to be saved. :type file: str :returns: True, if file save is successful else False. :rtype: bool .. _switchToDesignParts: .. method:: switchToDesignParts(self) Change all part alternatives to the design space .. _updateContacts: .. method:: updateContacts(self, parts=None, searchDistance=-1, visibleOnly=True, ignoreGroups='rigid ground', useExistingSearchDistances=True) Create or update contacts in model to account for part creation or movement. Always call before querying Contact objects. Note that this may also delete contacts, for example between grounded parts. :param parts: List of parts to update the contact for. :type parts: list[Part] :param searchDistance: Contact search distance. :type searchDistance: float :param visibleOnly: Searche only visible parts. :type visibleOnly: bool :param ignoreGroups: Ignores the group parts during contact updates. :type ignoreGroups: rigid ground :param useExistingSearchDistances: To use existing search distance. :type useExistingSearchDistances: bool :returns: True, if contacts where updated successfully else False. :rtype: bool