Das Wissen aller Anwender nutzen

Im Allplan Connect Forum tauschen sich Anwender aus, geben wertvolle Tipps oder beraten sich bei ganz konkreten Aufgabenstellungen − auch international.
Und damit wirklich keine Frage unbeantwortet bleibt, unterstützen die Mitarbeiter des Technischen Supports ebenfalls aktiv das Forum.

Es erwarten Sie:

  • Foren-Vielfalt aus CAD Architektur, CAD Ingenieurbau uvm.
  • Tipps von User für User
  • international: Deutsch, Englisch, Italienisch, Französisch und Tschechisch

Melden Sie sich jetzt an und diskutieren Sie mit!

Zur Registrierung

Freeform shape, volume and center of gravity


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.

Anhänge (3)

Typ: image/png
36-mal heruntergeladen
Größe: 550,83 KiB
Typ: image/png
24-mal heruntergeladen
Größe: 27,88 KiB
Typ: image/png
26-mal heruntergeladen
Größe: 47,20 KiB

Hilfreichste Antwort anzeigen Hilfreichste Antwort verbergen

Zitiert von: 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

Anhänge (1)

Typ: image/png
12-mal heruntergeladen
Größe: 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

Zitiert von: 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


https://campus.allplan.com/ verwendet Cookies  -  Mehr Informationen

Akzeptieren