Zitiert von: ZihanDeng
Hi,
Thanks for your quick reply!
Just as you said, what I want is using PythonPart to change the attributes that I've assigned. For example I have defined a cuboid with 3000,3000,3000. But now I want to change those attributes to maybe 3000,2000,1000 using python parts.
I have already used the ElementsAttributesServer but what I got from GetAttributes is an empty list of attributes.Is that means I need to define the Length or Height again?
Thanks!
Best
Hi!
If you created the cuboid using native Allplan function, or created the cuboid with a python script, without putting it into a PythonPart container at the end of your script, the information about length, width and height is lost. When the cuboid is created in the drawing file, it is saved as a collection of 8 vertices, 12 edges and 6 faces. To be more specific, from that moment its geometry is described with a Polyhedron3D object. There is a way to modify the coordinates of those vertices or generally perform geometrical operations on that cuboid. But this is complicated, and is not just changing a value of height. Cuboid3D is an object, that you can use to create a cuboid only, but after that it is just a Polyhedron3D.
As Christophe mentioned, you can create a parametric object: a PythonPart. In this case you will not lose this information after creation. It will be kept in PythonPart parameters. Optionally it can be kept also in Attributes.
If you want to go the first way: modifying the vertices of a Polyhedron: we will soon publish some examples showing how you can modify a geometry. But I recommend the second way: create a PythonPart at the end of the script.
Best regards,
Bart