Move object's pivot position with Python

Hi Folks,

We’re importing an IFC file (with number of nodes/features in it) into the program. And by default, pivots are not quite constant for each object (we would prefer for them to consistently be in the center of each object). I can see that in the UI we can manually fix things by moving Object’s pivot positions, but is there a way to adjust the object’s pivot without moving the object through Python API? Screenshot 2021-11-11 08.29.00
ched)

Any tips would be helpful,
Simon

1 Like

Hy,

you mean in the center of its geometry boundingbox? → That should be possible by python script…

Regards
Feature

@captain_feature Yep, that is what I mean. Having the pivot be reset to the center of the geometry without actually moving anything in the world.

Thanks,
Simon

Hy,

it looks like there is no direct Python-API for this… → But I would try follwing:

  • Loop all features in all nodes
  • Calculate for each the vector from its boundingbox-center to component origin.
  • Shift each feature to component origin (0;0;0) then shift the node containing the geometries back to calculated position.

Regards
Feature

2 Likes

@captain_feature, thank you for the trick!

Simon