@@ -19,6 +19,7 @@ You will almost always want to import the `catia`
1919.. code-block :: python
2020
2121 from pycatia import catia
22+ from pycatia.mec_mod_interfaces.part_document import PartDocument
2223 # initialise the catia automation appliction. CATIA V5 should already be running.
2324 caa = catia()
2425 documents = caa.documents
@@ -28,27 +29,20 @@ class.
2829
2930.. code-block :: python
3031
31- documents.add(' Part' )
32+ part_document: PartDocument = documents.add(' Part' )
3233
3334 the add method of the documents class expects the string 'Part', 'Product' or
3435'Drawing'. ``documents.add('Part') `` adds a new CATPart to the documents
35- collection.
36-
37- We want to work on this new document. Since this has just been added it's the
38- active document.
39-
40- .. code-block :: python
41-
42- document = caa.active_document
36+ collection and returns a `Document`` object. In this case it is a `PartDocument `.
4337
4438The document object :ref: `Document<Document> ` has a
4539number of properties that can be accessed.
4640
4741.. code-block :: python
4842
49- document .name
43+ part_document .name
5044 # returns the name of the new document.
51- document .path
45+ part_document .path
5246 # returns the pathlib.Path object of the document.
5347
5448
@@ -61,7 +55,7 @@ create one here anyway.
6155
6256.. code-block :: python
6357
64- part = document .part()
58+ part = part_document .part
6559 hybrid_bodies = part.hybrid_bodies
6660 new_set = hybrid_bodies.add()
6761 new_set.name
@@ -71,7 +65,6 @@ create one here anyway.
7165
7266
7367
74-
7568 For more detailed examples on how to interact with pycatia see the
7669:ref: `examples ` page. There contain several scripts that can be run in the
7770terminal.
0 commit comments