[Question] A few questions about VS’s workflow [Solved]


Hello, I have a few questions around Visual script and its workflow, so I will just list them here:

1. Is there any option to create a hotkey in Allplan’s interface (actionbar) to a specific script? In other words: to bind a key which will first launch visual script, open a specific script and then run it? Possibly even without displaying the visual script workplace?

2. Is there any way to save a generated 3D object without having to close Allplan Visual Script first? Context: When the script is heavier, sometimes VS doesn’t save the generated 3D object. I had this problem in 2 scenarios:
- I don’t the prompt to save the generated object upon exiting VS
- I have the prompt to save the generated object, but it automatically deletes the object upon exiting, despite having "Generate 3D object" checked on

3. Is there way to organize the order of the nodes in the nodes palette while working the in the AllPlan drawing screen?

4. Is there a node that can work as a button in AllPlan nodes palette? I saw there is a “RadioButtons” node but it seems to come with pre-determined values with no way to customize the number of buttons?
Context: I want to create 4 buttons with specific values (X,Y/-X,Y/X,-Y/-X,-Y) which can be selected in the Allplan Nodes palette

Note: when I say AllPlan Nodes Palette I refer to the menu that usually replaces the properties in the drawing screen, NOT the one while in the Visual script menu.

Thanks in advance, to anyone who manages to answer any of those questions.
Dobromir

Show solution Hide solution

Quote by DGeorgiev
1. Is there any option to create a hotkey in Allplan’s interface (actionbar) to a specific script? In other words: to bind a key which will first launch visual script, open a specific script and then run it? Possibly even without displaying the visual script workplace?

Yes, it is possible with PythonPart. As VS creates PythonPart directly, you can also bind it on Actionbar, for that you need two additional icons for your custom function. In that way it will start the script directly and VS won't pop up, just like it starts from library. Please check "PythonPartInActionbar.png".

Quote by DGeorgiev
2. Is there any way to save a generated 3D object without having to close Allplan Visual Script first? Context: When the script is heavier, sometimes VS doesn’t save the generated 3D object. I had this problem in 2 scenarios:
- I don’t the prompt to save the generated object upon exiting VS
- I have the prompt to save the generated object, but it automatically deletes the object upon exiting, despite having "Generate 3D object" checked on

No. Currently, it is not possible to create object without closing VS first. But we are working on that.
Generally, VS should detect it correctly and ask you to save script or/and the objects. Normally, objects in black will be generated in Allplan after VS is closed. Could you provide your script for us to check the problem?
Quote by DGeorgiev
3. Is there way to organize the order of the nodes in the nodes palette while working the in the AllPlan drawing screen?

No. It is only possible to reorganize the palette with the Palette Designer in VS.
Quote by DGeorgiev
4. Is there a node that can work as a button in AllPlan nodes palette? I saw there is a “RadioButtons” node but it seems to come with pre-determined values with no way to customize the number of buttons?

Context: I want to create 4 buttons with specific values (X,Y/-X,Y/X,-Y/-X,-Y) which can be selected in the Allplan Nodes palette
Note: when I say AllPlan Nodes Palette I refer to the menu that usually replaces the properties in the drawing screen, NOT the one while in the Visual script menu.


I'm not sure what kind of button do you want. You can try nodes for combo-box to have 4 different options in your palette. It is flexible and you can use the index for further calculation. Please check "ComboBox.png".

Product Owner API, Allplan GmbH

Attachments (2)

Type: image/png
Downloaded 131 times
Size: 80,59 KiB
Type: image/png
Downloaded 109 times
Size: 26,60 KiB

Quote by DGeorgiev
1. Is there any option to create a hotkey in Allplan’s interface (actionbar) to a specific script? In other words: to bind a key which will first launch visual script, open a specific script and then run it? Possibly even without displaying the visual script workplace?

Yes, it is possible with PythonPart. As VS creates PythonPart directly, you can also bind it on Actionbar, for that you need two additional icons for your custom function. In that way it will start the script directly and VS won't pop up, just like it starts from library. Please check "PythonPartInActionbar.png".

Quote by DGeorgiev
2. Is there any way to save a generated 3D object without having to close Allplan Visual Script first? Context: When the script is heavier, sometimes VS doesn’t save the generated 3D object. I had this problem in 2 scenarios:
- I don’t the prompt to save the generated object upon exiting VS
- I have the prompt to save the generated object, but it automatically deletes the object upon exiting, despite having "Generate 3D object" checked on

No. Currently, it is not possible to create object without closing VS first. But we are working on that.
Generally, VS should detect it correctly and ask you to save script or/and the objects. Normally, objects in black will be generated in Allplan after VS is closed. Could you provide your script for us to check the problem?
Quote by DGeorgiev
3. Is there way to organize the order of the nodes in the nodes palette while working the in the AllPlan drawing screen?

No. It is only possible to reorganize the palette with the Palette Designer in VS.
Quote by DGeorgiev
4. Is there a node that can work as a button in AllPlan nodes palette? I saw there is a “RadioButtons” node but it seems to come with pre-determined values with no way to customize the number of buttons?

Context: I want to create 4 buttons with specific values (X,Y/-X,Y/X,-Y/-X,-Y) which can be selected in the Allplan Nodes palette
Note: when I say AllPlan Nodes Palette I refer to the menu that usually replaces the properties in the drawing screen, NOT the one while in the Visual script menu.


I'm not sure what kind of button do you want. You can try nodes for combo-box to have 4 different options in your palette. It is flexible and you can use the index for further calculation. Please check "ComboBox.png".

Product Owner API, Allplan GmbH

Attachments (2)

Type: image/png
Downloaded 131 times
Size: 80,59 KiB
Type: image/png
Downloaded 109 times
Size: 26,60 KiB

Thank you for your reply Xinling,

(3.) About question number 3, in that case how does VS determine the order of the nodes in the palette? See image "Node Palette AllPlan.png" where I have numbered the nodes in the way it usually(often) orders them.

(2.) I attached the script bellow (see "Tile area" script). The script is a little messy so I will try to give you a brief description:

Script purpose: As the name suggest create a tiled area. In other words - select a starting point of tiling -> select tiling area -> specify dimensions of the tile and gap between them -> done

How does it work: After selecting starting point, area, tile size and gap, the script measures the length to the most distant point and makes a 3D object based on the distance and the selected area (substract object)
Then it generates a field of tiles based on a grid point and the gap dimensions (object substracted from)
Finally there is the substract command, where it cuts the tiled field using the Substract object, leaving the tiles within the pre-selected area.

I hope I managed to give some insight to the problem.
Dobromir

Attachments (2)

Type: image/png
Downloaded 82 times
Size: 40,19 KiB
Type: text/xml
Downloaded 553 times
Size: 32,33 KiB

No. Currently, it is not possible to create object without closing VS first. But we are working on that.
Generally, VS should detect it correctly and ask you to save script or/and the objects. Normally, objects in black will be generated in Allplan after VS is closed. Could you provide your script for us to check the problem?

Hello, I am still trying to isolate the problem and it seems to be coming from the last node "Subtraction" and the overall size of the script:

The size - As the script operates on the subtraction of 2 large masses, when deleting one half of the script it successfully generates the other object and vice-versa.

Subtraction: So I generated both large object separately and tried to subtract them via a script (see "Selection nodes.png") but nothing happens upon selection. Could the problem be that the Subtract node requires "Polyhedron3D or BRep" to be be selected, while the selected object are, well 3D objects or even python parts (See "Selection nodes outcome.png"?
Sorry, I still cant understand if there is a difference between BRep and a 3D object when it comes to those commands.

Dobromir

Attachments (2)

Type: image/png
Downloaded 75 times
Size: 45,67 KiB
Type: image/png
Downloaded 44 times
Size: 36,77 KiB

Quote by DGeorgiev
About question number 3, in that case how does VS determine the order of the nodes in the palette? See image "Node Palette AllPlan.png" where I have numbered the nodes in the way it usually(often) orders them.

You can use Palette Designer to rearrange the Allplan Palette in VS. If it didn't pop up by default, you can access it via "View → Palette Designer". We introduced it in this post a little bit. Check attached PaletteDesigner.gif for a simple demo. If you don't arrange it by yourselves, it will follow the order in unassigned the area. Newly added nodes will be placed at the top of the list.

Quote by DGeorgiev
Subtraction: So I generated both large object separately and tried to subtract them via a script (see "Selection nodes.png") but nothing happens upon selection. Could the problem be that the Subtract node requires "Polyhedron3D or BRep" to be be selected, while the selected object are, well 3D objects or even python parts (See "Selection nodes outcome.png")?

I checked your original script. I think the node "Subtraction" does cause the problem. We will try to fix that. If we describe subtraction as A-B, the problem might be that solid A is smaller than solid B. That will cause the subtraction to return an invalid result and failed to generate the reset of valid result.
A workaround will be add a node Union between node CopyAlongPath and Subtraction. It will take some additional time to calculate that union step. But you will get the result... Check attached Union.png

Product Owner API, Allplan GmbH

Attachments (2)

Type: image/gif
Downloaded 66 times
Size: 159,65 KiB
Type: image/png
Downloaded 65 times
Size: 77,84 KiB

You can use Palette Designer to rearrange the Allplan Palette in VS. If it didn't pop up by default, you can access it via "View → Palette" Designer. We introduced it in this post a little bit. Check attached PaletteDesigner.gif for a simple demo. If you don't arrange it by yourselves, it will follow the order in unassigned the area. Newly added nodes will be placed at the top of the list.

Oh, I see. I misunderstood you the first time. That is perfect and it will make the script much more user-friendly.

I checked your original script. I think the node "Subtraction" does cause the problem. We will try to fix that. If we describe subtraction as A-B, the problem might be that solid A is smaller then solid B. That will cause the subtraction to return an invalid result and failed to generate the reset of valid result.
A workaround will be add a node Union between node CopyAlongPath and Subtraction. It will take some additional time to calculate that union step. But you will get the result... Check attached Union.png

Thank you. You are absolutely right, the union command manages to bypass the problem, which is one step closer, even if adding some process time. However, it would be best if the output is in separate elements due to the texture placement. While unified I can only apply seamless textures to the object, while as separate objects it will generate much better renders. Technically, one could cut the elements 1 by 1 while in AllPlan, but it would take too much time, and as far as I know there is no "Explode" command which separates unconnected elements. So I was wondering if it is possible to cut the elements using the "CutBRepWithPlane" node, based on the grid points? I tried this method but I get the exact same problem as the "Subtract" node, where it doesn't generate the objects at all (see "CutBRep.jpeg") I guess VS can't handle modification operations on multiple small objects at once, at the moment?

Attachments (1)

Type: image/jpeg
Downloaded 51 times
Size: 136,92 KiB

Quote by DGeorgiev

Thank you. You are absolutely right, the union command manages to bypass the problem, which is one step closer, even if adding some process time. However, it would be best if the output is in separate elements due to the texture placement. While unified I can only apply seamless textures to the object, while as separate objects it will generate much better renders. Technically, one could cut the elements 1 by 1 while in AllPlan, but it would take too much time, and as far as I know there is no "Explode" command which separates unconnected elements. So I was wondering if it is possible to cut the elements using the "CutBRepWithPlane" node, based on the grid points? I tried this method but I get the exact same problem as the "Subtract" node, where it doesn't generate the objects at all (see "CutBRep.jpeg") I guess VS can't handle modification operations on multiple small objects at once, at the moment?

VS can handle multiple objects and it should do. As I mentioned, due to the bug from the node "Subtraction", it currently doesn't work as you expected.

But I think for the geometry you want, you should try to use node "Intersection" instead of "Subtraction". It is much faster and more efficient, because you can skip both union and sweep, which is normally expensive. And you will get separated boxes after you explode the PythonPart object in Allplan. Please check attached Intersection.png

Product Owner API, Allplan GmbH

Attachments (1)

Type: image/png
Downloaded 114 times
Size: 134,00 KiB

VS can handle multiple objects and it should do. As I mentioned, due to the bug from the node "Subtraction", it currently doesn't work as you expected.
But I think for the geometry you want, you should try to use node "Intersection" instead of "Subtraction". It is much faster and more efficient, because you can skip both union and sweep, which is normally expensive. And you will get separated boxes after you explode the PythonPart object in Allplan. Please check attached Intersection.png

That is absolutely amazing. The script now runs flawlessly and with no delays between changes in parameters, while generating the required objects. Thank you Xinling.


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

Accept