pycatia.base_interfaces.context.CATIADocHandler(file_name=None, new_document=None)¶A context manager to open or create a CATIA document.
Warning
The CATIA document will be closed (and not automatically saved) upon exit.
Only file_name __or__ new_document are required as one document is handled at a time.
>>> from pycatia.base_interfaces.context import CATIADocHandler
>>> catia_part = 'tests//CF_catia_measurable_part.CATPart'
>>> with CATIADocHandler(catia_part) as handler:
>>> # create the documents object.
>>> documents = handler.documents
>>> # create the document object.
>>> document = handler.document
>>> # do some stuff
>>> # save document!
>>> document.save()
>>> from pycatia.base_interfaces.context import CATIADocHandler
>>> with CATIADocHandler(new_document='Part') as handler:
>>> # create the CATIA() object.
>>> catia = handler.catia
>>> # create the documents object.
>>> documents = handler.documents
>>> # create the document object.
>>> document = handler.document
>>> # save document!
>>> document.save()
file_name (str) – (optional) path filename to file
new_document (str) – (optional) ‘Part’, ‘Product’ or ‘Drawing’.
pycatia.base_interfaces.move.Move(com_object)¶Note
CAA V5 Visual Basic help
Represents an object associated with any kind of objects whichretrieves the corresponding movable object.An object can be moved onlyif it is independent from other objects. For example, a pad can bemoved, and is as such a movable object, while an edge cannot be movedindividually. It should be moved with all the objects making up thepad to which it belongs as a whole. In this case, the underlyingedge’s movable object is the pad.
apply(i_transformation_array)¶Note
CAA V5 Visual Basic help
Applyo Sub Apply( CATSafeArrayVariant iTransformationArray)Applies a move transformation to a movable object.Parameters:TransformationArrayThe linear transformation array initialized successively by thefour columns of the transformation matrix.The first nine components represent the rotation matrix.The last three components represent the translation vector.Examples:This example applies the transformation (45 degrees-rotation aroundthe x axis and a translation) stored in TransformationArrayto the Move object associated with myMovableObject:Dim TransformationArray( 11 )‘Rotation( 45 degrees around the x axis) componentsTransformationArray( 0 ) = 1.000TransformationArray( 1 ) = 0TransformationArray( 2 ) = 0TransformationArray( 3 ) = 0TransformationArray( 4 ) = 0.707TransformationArray( 5 ) = 0.707TransformationArray( 6 ) = 0TransformationArray( 7 ) = -0.707TransformationArray( 8 ) = 0.707‘Translation Vector (10,20,30)TransformationArray( 9 ) = 10.000TransformationArray( 10 ) = 20.000TransformationArray( 11 ) = 30.000MyMovableObject.Move.Apply TransformationArray
movable_object¶Note
CAA V5 Visual Basic help
MovableObjecto Property MovableObject() As MoveReturns the movable object associated with the used object. Example:This example retrieves the myMovableObject from Move objectassociated with MyObject. Dim myMovableObject As Move SetmyMovableObject = MyObject.Move.MovableObjectParameters: