Freeform shape, volume and center of gravity

Теги:
  • Reinforcement
  • Rebar
  • Solids
  • Volume
  • Center
  • Ofgravity

Hi everyone,

I'm really ask for any help.

I've had problem with creating the "free form" rebar. When I'm passing the arguments then the Pyhton gives me back an error like in "Screen2" attachment. I defined the function like in "Screen 3" attachement. I was wondering why it is not working maybe I've passed the point list in the incorect way but if we look at the "create_freeform_shape_with_hooks" "Screen 1" method there is there for loop which unpack the point list an put them to the AllplanGeo.Point2D() method. Only possible way, which I know to instanse thath method by ONE argument is puting existing 2D point (it is also mensioned in the documentation).

I also have problem with getting the volume and center of gravity from the solids I've created. I've tried to find corresponding parameter name to get that but I couldn't found that.

I was trying to find the answer in the examples python parts but I couldn't find that as well.

Thank You in advance for any help.

Вложения (3)

Type: image/png
Загружено 37 раз
Size: 550,83 KiB
Type: image/png
Загружено 26 раз
Size: 27,88 KiB
Type: image/png
Загружено 26 раз
Size: 47,20 KiB

Show most helpful answer Hide most helpful answer

Цитируется из: Daviscio94
So now I'm waiting for good person who will be willing to solve the second part of my issue

Hi,

you just passed the wrong type of object to the argument concrete_cover of the funciton create_freeform_shape_with_hooks. This function is not well documented in the 2024 API reference, but we've done it better in the 2025 version. As you can see, you must pass a simple floating point there. You passed a ConcreteCoverProperties object.

Best,
Bart

Hi,

You should use the CalcMass function for this.

err, volume, surface, center_of_gravity = Geometry.CalcMass(geo)

example here

Best
Christophe

Thank you this is what I was exactly looking for Now is working, I wanted to show real time volume in pallete like on screen down below.
Btw. the .pyp file You linked above is yours? I wanted to ask you something else on PW if you don't mind.

So now I'm waiting for good person who will be willing to solve the second part of my issue

Вложения (1)

Type: image/png
Загружено 12 раз
Size: 2,95 KiB

Hi,

The examples given are indeed mine.

They were developed as part of tutorials on my blog and are 100% open source (more details for the reinforced column are coming soon).

If you have any questions and/or comments, you're welcome.

For your other issue, have you read this example for free form placement ?

Christophe

Цитируется из: Daviscio94
So now I'm waiting for good person who will be willing to solve the second part of my issue

Hi,

you just passed the wrong type of object to the argument concrete_cover of the funciton create_freeform_shape_with_hooks. This function is not well documented in the 2024 API reference, but we've done it better in the 2025 version. As you can see, you must pass a simple floating point there. You passed a ConcreteCoverProperties object.

Best,
Bart