Support Forum

[Question] How to create multiple separate objects


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

Attachments (2)

Type: image/png
Downloaded 52 times
Size: 11,60 KiB
Type: application/zip
Downloaded 462 times
Size: 3,65 KiB
1 - 6 (6)
  • 1

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 – Visual Scripting

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 – Visual Scripting

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

Attachments (1)

Type: application/x-7z-compressed
Downloaded 48 times
Size: 2,34 KiB

Quote by 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 – Visual Scripting

1 - 6 (6)
  • 1

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

Accept