[Вопрос] Assign attribute to geometry object [Решен]

Теги:

Hi, how can I assign attribute to a geometry object? there is a way to convert it to a model object?
I've tried with StandardAttributePalette or AttributeModifier but I don't understand how to use them.

Вложения (1)

Type: image/png
Загружено 99 раз
Size: 107,59 KiB

Show solution Hide solution

It is possible with the node SetValueToAttribute. You can find the example under:
\Attributes\LabelNodePortsAsAllplanUserAttributes.pyp

With that script, you can generate one PythonPart with user-defined attributes.

Product Owner – Visual Scripting, Allplan GmbH

Вложения (1)

Type: image/png
Загружено 170 раз
Size: 46,36 KiB

Hello Daniele,

first I need to know, whether your final result is a PythonPart?

Best regards
Horst

Hi Horst, I need to export a generic object with attribute.
Usually in ALLPLAN I convert a solid into a "architectural object" (corpo architettonico in italian), and then I assign attributes.

But in VS I see that, to assign attributes, the node requires only "ModelObject" and you can't assign attributes to a "GeometryObject"

Вложения (1)

Type: image/png
Загружено 58 раз
Size: 209,21 KiB

We have a built-in example for assigning attributes to existing ModelObject. You can find the VS example under:

\ModelObjects\Modification\AssignAttributes.pyp

If you start the script you can choose the attribute you want to assign from the side panel. Does that solve your problem?

Product Owner – Visual Scripting, Allplan GmbH

Hi Xinling, what I would like to do is to create an object, like simple box for example, and assign to it some attributes.

Is it possible with VS?

It is possible with the node SetValueToAttribute. You can find the example under:
\Attributes\LabelNodePortsAsAllplanUserAttributes.pyp

With that script, you can generate one PythonPart with user-defined attributes.

Product Owner – Visual Scripting, Allplan GmbH

Вложения (1)

Type: image/png
Загружено 170 раз
Size: 46,36 KiB

thanks Xinling

Hi Xinling, is it possible to assign also a standard attribute in the same way? like "name" or "object name" ?


https://campus.allplan.com/ uses cookies  -  More information

Accept