pycatia.dnb_device_interfaces.device_sim¶
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-09-25 14:34:21.593357
Warning
The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.
- class pycatia.dnb_device_interfaces.device_sim.DeviceSim(com_object)¶
Note
CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
System.IUnknownSystem.IDispatchSystem.CATBaseUnknownSystem.CATBaseDispatchSystem.AnyObjectDeviceSimInterface allowing simulation of a Device.Role: This interface is used to simulate the devices that are available in theDevice Building workbench. This includes devices created in both V5 andD5.The following code snippet can be used to obtain a device in a CATProductdocument.Dim objDeviceSim As DeviceSimSet objDeviceSim = CATIA.ActiveDocument.Product.GetTechnologicalObject(“DeviceSim”)- finalize() None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub Finalize()Cleans the WDM world. Please note that no reference counting will bemaintained. Cleanup should be done on each device before another device isInitializedReturns:an HRESULT value.Example:Dim objDeviceSim As DeviceSimSet objDeviceSim = CATIA.ActiveDocument.Product.GetTechnologicalObject(“DeviceSim”)objDeviceSim.Initialize…objDevice.Finalize
- Return type:
None
- get_dof_values(i_mechanism: AnyObject) tuple ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Func GetDOFValues(CATBaseDispatch iMechanism) AsCATSafeArrayVariantGet the DOF values for the device.Parameters:iMechanismThis inner parameter contains a handle to the mechanismoValuesThis outer parameter contains a list of the current DOF values.Please note that distances are measured in meters and angles in radians.Returns:an HRESULT value.Example:Dim ListMechanisms As MechanismsSet ListMechanisms = CATIA.ActiveDocument.Product.GetTechnologicalObject(“Mechanisms”)On Error Resume NextDim mechSet mech = ListMechanisms.Item(1)If Err.Number <> 0 Then‘If there are no mechanisms (i.e. D5 devices), use the device simhandle insteadSet mech = CATIA.ActiveDocument.Product.GetTechnologicalObject(“DeviceSim”)End IfOn Error GoTo 0Dim objDeviceSim As DeviceSimSet objDeviceSim = CATIA.ActiveDocument.Product.GetTechnologicalObject(“DeviceSim”)objDeviceSim.InitializeDim ListOfDOFValuesListOfDOFValues = objDevice.GetDOFValues (mech)…
- Parameters:
i_mechanism (AnyObject) –
- Return type:
tuple
- initialize() None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub Initialize()Initializes the WDM world. Required for calls toGet/SetDOFValuesReturns:an HRESULT value.Example:Dim objDeviceSim As DeviceSimSet objDeviceSim = CATIA.ActiveDocument.Product.GetTechnologicalObject(“DeviceSim”)objDeviceSim.Initialize
- Return type:
None
- set_dof_values(i_mechanism: AnyObject, i_values: tuple, i_is_relative: bool) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub SetDOFValues(CATBaseDispatch iMechanism,CATSafeArrayVariant iValues,boolean iIsRelative)Set the DOF values for the device.Parameters:iValuesThis inner parameter contains a list of the DOF values to beapplied. Size of iValues should be equal to the number of DOFs. Please notethat distances are measured in meters and angles in radians.iMechanismThis inner parameter contains a handle to the mechanism. For D5devices the device itself should be used as the mechanism (sample below)iIsRelativeThis inner parameter indicates if iValues is relative to theexisting DOF values. If set to TRUE, iValues will be added to the existingvaluesReturns:an HRESULT value.Example:Dim ListMechanisms As MechanismsSet ListMechanisms = CATIA.ActiveDocument.Product.GetTechnologicalObject(“Mechanisms”)On Error Resume NextDim mechSet mech = ListMechanisms.Item(1)If Err.Number <> 0 Then‘If there are no mechanisms (i.e. D5 devices), use the devicehandle insteadSet mech = CATIA.ActiveDocument.Product.GetTechnologicalObject(“DeviceSim”)End IfOn Error GoTo 0Dim objDeviceSim As DeviceSimSet objDeviceSim = CATIA.ActiveDocument.Product.GetTechnologicalObject(“DeviceSim”)objDeviceSim.InitializeDim ListOfDOFValues (5)‘Populate ListOfDOFValues with some values…objDevice.SetDOFValues mech, ListOfDOFValues, TRUE…
- Parameters:
i_mechanism (AnyObject) –
i_values (tuple) –
i_is_relative (bool) –
- Return type:
None