Support Forum

[Frage] How to create multiple separate objects

Schlagworte:
  • Visual scripting

Hello,

I am currently developing a script to place elements based on coordinates from an Excel file. And I want every element to get an unique attribute. The problem is that after running the script all the elements are part of one pythonpart. What I really want is that all the elements become “normal” Allplan elements and that each element can have an unique attribute.

Is this possible with Visual Scripting and how would I achieve this?

Thanks in advance.

Best regards,
Frenk

Anhänge (2)

Typ: image/png
76-mal heruntergeladen
Größe: 11,60 KiB
Typ: application/zip
1103-mal heruntergeladen
Größe: 3,65 KiB

Hi Frenk,

You can use "unlink smart symbol (Macro auflösen)" to convert a PythonPart to normal ALLPLAN elements. But after that, they lose all the parameters.

Currently, it is impossible in VS to assign an attribute to the elements inside a PythonPart.

VG
Xinling

Product Owner API, Allplan GmbH

Hi Xinling,

Thank you for your response. I was aware of the "unlink smart symbol" function, but I don't want to lose my newly assigned attributes. In the end my goal is to also have the attributes assigned based on the same excel file I use to place the elements on coordinates. Do you know if this would be possible if I develop a PythonPart without the use of VS?

Also is assigning attributes to elements inside A PythonPart something you are planning to add in the future?

Best regards,
Frenk

Hi Frenk,

After asking the dev team, it is currently impossible to add attributes to elements inside a PythonPart or separately for each object, even you develop a PythonPart directly.

But it is planned for the future.

Regards
Xinling

Product Owner API, Allplan GmbH

Hello Frenk, Hello Xingling,

I'm struggeling with the same problem. Is there still no way to attach the attributes?

If not I'm currently testing a work arround, that seems to work quite well. I'm using csv and/or xlsx files (csv should be prefered) to store a list with all ellements and their attributes. When starting the program the file is read into a list and after finishing the VS the data is stored in the same or another file/sheet, as wished by the user. I'm not shure yet if the editing of that data can be made comfortable or not. But at least this is a way to add this functionality. You might have to addit some of the ImportExport Nodes to do so, but i attached mine.

Regards
Clemens

Anhänge (1)

Typ: application/x-7z-compressed
736-mal heruntergeladen
Größe: 2,34 KiB

Zitiert von: ClemensWilke
I'm struggeling with the same problem. Is there still no way to attach the attributes?

Hello Clemens,
As far as I know, the only option to have attributes on the object inside a PythonPart is to use PythonPart group. It is currently only available with coded PythonPart. The schematic structure of that object looks like:
PythonPart group
  ├─ PythonPart object A
  ├─ PythonPart object B
  ├─ PythonPart object C
  └─ ...

Each PythonPart object (A,B,C,...) inside that PythonPart group could have its own attributes or same attributes with different values. You can also generate reports based on individual PythonPart objects.

The only caveat is that users don't have the direct access to the PythonPart objects inside that PythonPart group. (Right click is still able to detect the individual PythonPart object though.)

P.S. please, next time, don't post a message to a thread, which is inactive about 2y old... You can create a new one...

Product Owner API, Allplan GmbH