PRINCIPAL AXES OF INERTIA

Programming and macros
Mattia Bianchi
Posts: 2
Joined: Wed Jul 13, 2022 7:55 am
Answers: 0
x 1

PRINCIPAL AXES OF INERTIA

Unread post by Mattia Bianchi »

Hi Everybody,
after changing coordinate system I need to extract new mass properties.

In particular, I need to get principal intertia axes: I thought the function PrincipalAxesOfIntertia (IMass2) did exactly this.
I found the data extracted are not the same as those I found on mass properties window (I have same absolute values but different signs on x and y array and same data on z array).

Does anyone know why? Does exist another function to do this task?

Thanks in advance,

Mattia
by artem » Wed Aug 10, 2022 6:39 am
Hi @Mattia Bianchi, is there any chance you can send this model so I can troubleshoot? I have a lot of problems with IMassProperty2 (not as many as I had with IMassProperty), but I have found a few workarounds so want to give it a run on your model). The workarounds are applied in xCAD: https://github.com/xarial/xcad/blob/mas ... roperty.cs
Go to full post
User avatar
AlexB
Posts: 493
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 27
x 265
x 440

Re: PRINCIPAL AXES OF INERTIA

Unread post by AlexB »

If using IMassProperty2, you can set the coordinate system and then recalculate the mass properties.

https://help.solidworks.com/2021/englis ... ystem.html
Mattia Bianchi
Posts: 2
Joined: Wed Jul 13, 2022 7:55 am
Answers: 0
x 1

Re: PRINCIPAL AXES OF INERTIA

Unread post by Mattia Bianchi »

That's what I did: I created a new coordinate system, set it and finally recalculated mass properties.
Then I extract all mass properties and I can see the values are the same as those I can read into mass properties window.
Only Principal Axes of Inertia make an exception: they have all the absolute value that I expected but different signs (in particulare opposite signs in x-y arrays and same sign in z array).
artem
Posts: 26
Joined: Thu Mar 18, 2021 1:31 pm
Answers: 3
x 9
x 74

Re: PRINCIPAL AXES OF INERTIA

Unread post by artem »

Hi @Mattia Bianchi, is there any chance you can send this model so I can troubleshoot? I have a lot of problems with IMassProperty2 (not as many as I had with IMassProperty), but I have found a few workarounds so want to give it a run on your model). The workarounds are applied in xCAD: https://github.com/xarial/xcad/blob/mas ... roperty.cs
Thanks,
Artem
xarial.com - making your CAD better
codestack.net - SOLIDWORKS API macros and tutorials
Post Reply