[Frage] Unlink script in script pythonpart as multiple single pythonparts

Schlagworte:
  • Allplan
  • 2022
  • Visual
  • Scripting

Hello,

I have a question.

Is it possible when I create a pythonpart with a script and then place it at various points with another script, that they all become separate pythonparts?

As an example the dome script in the examples.
The script creates 1 dome, I run that loose in the model so that I have 1 pythonpart of 1 dome.
I close visualscripting and open a new script that will place a selected object on various points.
I select the pythonpart dome and let it be placed at a number of points.
When I close the script the multiple domes become 1 pythonpart. When I use unlink smart symbol it becomes all non smart objects and not single pythonparts, even though it was a single pythonpart.

Is there a possibility that I can place a pythonpart multiple times and it doesn't become 1 large python part, but all become separate pythonparts?

I'm not very sure, if it is currently possible to do that with VS. I have to check with the team.

But what you want to accomplish is:

You have a PyP-script A which can generate a PyP-object A in Allplan. And you would like to have another PyP-script B to use the PyP-script A to generate several PyP-object A in Allplan. And all those PyP-objects generated/distributed by PyP-script B should be individual PyP-object A.

If we use the dome script, which you mentioned, from the example library as an example, what you would like to have is, that all domes generated should be individual separated PyP-object instead of a huge PyP-object. Correct?

Please correct me, if I didn't get your point.

Product Owner API, Allplan GmbH

Hi Xinling,

that's exactly what i mean.

when I have Pyp-script A which then creates object A. I want to use Pyp-script B to place object A at points that I have defined. If Pyp-script B has placed the objects A, it must be several separate objects A and not a large object B.

Thank you for your time and I like to hear from you.

After discussion with the team, it is currently not possible to accomplish that with VS, although it is possible with coded PyP-script.

But we plan to extend that feature for VS in future.

Product Owner API, Allplan GmbH

Thank you Xinling for your time and reaction!
I'll wait until it's possible.

In the meantime, do you have an example of the coded PyP-script?

You can try the example HauchReinforcementFromFileInteractor.pyp (pyp B) under Etc\Examples\PythonParts\InteractorExamples.
It reads values for parameters of another PythonPart Etc\Library\PythonParts\Reinforcement objects\HaunchReinforcement.pyp (pyp A) from a csv table and place several of that PythonPart object (pyp A) in Allplan. You will get several individual PythonParts (pyp A) after run the script successfully.

The py script HaunchReinforcementFromFileInteractor.py for the example (pyp B) can be found under Etc\PythonPartsExampleScripts\InteractorExamples

For some reason, the example file might not be installed correctly on your PC. If you don't have the csv file, please put the file HaunchReinforcementData.csv (attached) under Etc\PythonPartsScripts\InteractorExamples

Product Owner API, Allplan GmbH

Anhänge (2)

Typ: image/gif
71-mal heruntergeladen
Größe: 402,17 KiB
Typ: text/plain
765-mal heruntergeladen
Größe: 290,00 B