Hello there,
I've made a visual script to try and get the gravity center but get error every time (cf pictures) and i don't know what to do to resolve the issue. If you have any idea i take it !
Thanks for answering
Hello there,
I've made a visual script to try and get the gravity center but get error every time (cf pictures) and i don't know what to do to resolve the issue. If you have any idea i take it !
Thanks for answering
Hi
Here a starting point for your script (ALLPLAN 2025)
The idea is to select by mouse the objects, then I made a filter based on the geometry (I made it in Python, maybe can be done with nodes....)
import NemAll_Python_Geometry as Geometry
def function_to_execute(ele_list) -> list[Geometry.Polyhedron3D]:
""" implement the script code here """
polyh_list = []
for ele in ele_list:
if isinstance(ele, Geometry.Polyhedron3D):
polyh_list.append(ele)
return polyh_listThen Union and finally CalculateMass
Christophe
The CalcMass-Node and also the underlaying function accepts only 3D-Solids, like Polyhedron3D, BRep3D and others shown in the message. You have obviously select a 2D-Line!
If you want the Centerpoint of the line, please use other Node to get it!
I need to find the gravity center of this 3D model what node should I use to get CalcMass to function correctly ?
Maybe filter the Elements with Geometry of Polyhedron3D or BRep3D first!
If I may ask: What is the point of gravity needed for?
Doesn't the center of the bounding box do the same thing?
I did try with bounding box but got the exact same problems.
I tried something else but i think i miss something (Cf video)
Hi,
Here an example
1) you select the objects
2) the script make an union of the objects
3) then it calculates the gravity point
Best
Christophe
I copy what you did but i get : "Union: Attemting to append an invalid type"
Is it because I selected multiple objects or not ?
I tried with some 3D objects, but not with arch elements.
Can you post your drawing file with your objects?
I hope this is helpful
Hi
Here a starting point for your script (ALLPLAN 2025)
The idea is to select by mouse the objects, then I made a filter based on the geometry (I made it in Python, maybe can be done with nodes....)
import NemAll_Python_Geometry as Geometry
def function_to_execute(ele_list) -> list[Geometry.Polyhedron3D]:
""" implement the script code here """
polyh_list = []
for ele in ele_list:
if isinstance(ele, Geometry.Polyhedron3D):
polyh_list.append(ele)
return polyh_listThen Union and finally CalculateMass
Christophe