Is possible to get value of specified attribute like @767@ via PythonParts? Something like cell option in Allplan?
- Forum
- CAD Parametric Modelling
- PythonParts
[Вопрос] Cell or labelstyle information
Show most helpful answer Hide most helpful answer
Hi Krzysztof,
the @766@ is also not a drawing file attribute. It is an internal attribute, which delivers a value only in certain situations. E.g. when called in a legend. It is true, what you said: you are not able to access it by accessing object attributes, because it is simply not there. But it is also not in the drawing file. It is calculated on the fly.
At the moment, accessing the existing rebars through the Python API is limited only to the information that you can get from the BaseElementAdapter. Adapter contains element attributes, among others the number of bars in a linear placement, stored in Factor (@230@) in the Adapter or type BarsLinearPlacement_TypeUUID. But on the other hand, the adapter does not contain the information about the mark number. For that, you would need to get the BarPlacement object from the BaseElementAdapter. We're working on that
Best regards,
Bart
Hi,
There is an example => GetObjectAttributesInteractor (with an interactor PythonPart)
First, with GetAttributes you can receive all the attributes of an object in a dict and then, get a specified one with the correct @id@.
Best
Hi,
this example is fine for elements' attributes. I'm looking for how get attributes for drawing file. For example @766@ number of bars in active drawing file (this isn't any element, any project attribute)
Hi,
Unfortunately, I haven't had this scenario yet
I'll try to find a solution to help you.
Best Regards
Hi,
It look that I think this functionalitty is not accessible yet.
I think this is huge area where pythonpart can optimize designers work - access to all attributes gives powerfull tool to manage drawing file from scripts ;)
best regards,
Krzysztof
Hi Krzysztof,
the @766@ is also not a drawing file attribute. It is an internal attribute, which delivers a value only in certain situations. E.g. when called in a legend. It is true, what you said: you are not able to access it by accessing object attributes, because it is simply not there. But it is also not in the drawing file. It is calculated on the fly.
At the moment, accessing the existing rebars through the Python API is limited only to the information that you can get from the BaseElementAdapter. Adapter contains element attributes, among others the number of bars in a linear placement, stored in Factor (@230@) in the Adapter or type BarsLinearPlacement_TypeUUID. But on the other hand, the adapter does not contain the information about the mark number. For that, you would need to get the BarPlacement object from the BaseElementAdapter. We're working on that
Best regards,
Bart