Support Forum

[Question] Attributes from smartparts [Solved]


Is there any way of extracting information from a smartpart's attributes, such as it's volume? The "Volume" command in Allplan requires a solid for it to work. Does the final product need to be converted to a solid, or is there another way of reading ALL the element's geometrical information? Since it's linear dimensions are set in the "Parameter" tab in the script, those are available and can be read.

Show solution Hide solution

Hello,

Once you created your volume in the 3D script, add the command:

myvar = VOLUME3D 0

Then, "myvar" will contains the volume in m3.
You can create a specific parameter linked to the attribute "Volume" and then you'll get the volume in the attributes of your SmartPart (in "Modifiy attributes").


1 - 7 (7)
  • 1

Hello,

Once you created your volume in the 3D script, add the command:

myvar = VOLUME3D 0

Then, "myvar" will contains the volume in m3.
You can create a specific parameter linked to the attribute "Volume" and then you'll get the volume in the attributes of your SmartPart (in "Modifiy attributes").


Okay... so I have entered the VOLUME3D command and it works. But in the Parameters tab, after adding a new parameter I scrolled through all the attributes but couldn't find "Volume" anywhere. So I'm kind of stuck at the moment...

Hello,

Click to get "All attributes" at the top of the window.
Your parameter must be a decimal number.
And check if you are already using a parameter related to this attribute. You can only use an attribute once.


Hello, Bernard!

Thank you, once again. I got the volume attribute to show up in the element's attributes, but it won't read anything. If in my parameter I insert any number, it will show up in attributes, but that's not what I'm looking for. The VOLUME3D command has to read the element's volume automatically, right?

Hello Alex,

Don't forget to add "PARAMETER <the_var> = <the_var>" (where <the_var> is the parameter where you store the volume value).
Maybe, post your code to have a look.

PS: My name is Bertrand...


My apologies. Between reading all this new information and writing scripts (which is all to new for me), I misread your username.

R&D has currently been postponed for more pressing matters and I'll post the code next week. I really appreciate the time you invested in helping out! Have a great weekend!

1 - 7 (7)
  • 1

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

Accept