Habla sobre los modelos
Bases: object
Class used to represent the arborescense contained in a File .stp.A Product can be simple or an assembly, if it is an assembly in links we will guard the information about other Product that compose it.
There are two ways of generating a Product, reading the file .stp across the class StepImporter ( will refill the attribute label_reference for every Product), or reading a file .arb related to a ArbreFile . Therefore there exist two ways of distinguishing the different Product, by means of the attribute label_reference if this one is not False , or by means of the combination of attributes id and doc_id.
Model attributes: | |
---|---|
If the product is an assembly, links stores one or more openPLM.apps.document3D.classes.Link references to the products that compose it
When we generate an arborescense using StepImporter , here we will store the label that represents the Product , if we generate the arborescense reading a file .geo, this attribute will be False
Name of Product ,if the name is empty and there exists a Link at the Product , we will assign the name of the Link to the Product
Id of the DocumentFile that contains the Product , in the case of File .stp decomposed them doc_id may be different for every Product of the arborescense
Path of the File represented by the DocumentFile that contains the product
Used in the decomposition, it indicates the Part where the Product was decomposed
If geometry is True (>=1) then the Product is single (without links ) , and his value refers to the index that we will use to recover a GeometryFile
Depth in the arborescense
Used in the decomposition , indicates if a Product has been visited in the tour of the arborescense
If it is an assembly and any Product contents in its links are defined (doc_id) in another DocumentFile (doc_id)
If it is an assembly and any Product contents in its links are defined (doc_id) in the same DocumentFile (doc_id)
Returns a new Product built from arbre. arbre is a serialized version as returned by to_list().
Example:
To generate a product of a single file .arb
tree=Product.from_list(json.loads(new_ArbreFile.file.read()))To generate a product of a single file .arb and link this one like a branch of a certain product_root_node of an already existing product_root
product=Product.from_list(json.loads(new_ArbreFile.file.read()),product=False, product_root=product_root, deep=xxx, to_update_product_root=product_root_node)This method generates the Link between product_root_node and product , BUT it does not add the occurrences, generally this occurrences are stored in the existing Location_link
After generating the product and the Link, we will have to refill the Link calling the function add_occurrence() for the Link:
for location in locations: product_root_node.links[-1].add_occurrence(location.name,location)
Paramètres: |
|
---|
Bases: object
Class used to represent a parent child link between two .Product. A Link can have several references, each one with its name and transformation matrix.
Model attributes: | |
---|---|
Name of each instances of the Link , if the instance does not have name, it gets the name of its Product child
TransformationMatrix of each instances of the Link
Bases: object
Defines a non-persistent transformation in 3D space
x1 x2 x3 x4 x = x’ y1 y2 y3 y4 y = y’ z1 z2 z3 z4 z = z’ 0 0 0 1 1 = 1
Checks if a Product is already present in an arborescense Product (product_root) There are two manners of comparison, across label_reference ( generated for StepImporter for every Product), or across id and doc_id (extracted of a file .geo for every Product)
Paramètres: |
---|