Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
696 Views, 5 Replies

Fastest Way To Access Point/Vector Information to Get Center of Mass

Hello,

 

As the title suggests, I am looking for speed-saving methods to access underlying geometric information of Points, Vectors, etc. Namely, I am looking to get the center of mass of an EdgeLoop. Two methods I have come up with to get this are 

edgeLoop.RangeBox.MinPoint.GetPointData(ref minPtData);
edgeLoop.RangeBox.MaxPoint.GetPointData(ref maxPtData);

then scaling by half and getting to the center, or the more obvious method of collecting the start/end point of each edge and getting the average.

The problem is that the Inventor API calls are incredibly slow, even just to access properties. The above two lines take ~200ms which means when I collect on the order of 100/1000 center points, this takes way too much time to be viable.

 

Does anyone have an idea or know how to do this more efficiently? I have locally made versions of Points and Vectors to ease with the math once they are there, but to actually get the information from a Part/Assembly is where I am struggling.