Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Center of Gravity not correct for LOD

29 REPLIES 29
SOLVED
Reply
Message 1 of 30
karthur1
6139 Views, 29 Replies

Center of Gravity not correct for LOD

I have a LOD in my assembly to suppress some of the components. In the assembly, it looks like the center of gravity is correct for the LOD.  Now I place this assembly in an idw with the LOD active.  Now I right-click on the assembly in the idw and choose "Center of Gravity".  The center of gravity shown here does not represent the center of gravity for this LOD.  The CG shown represents the CG of the master LOD.

 

Is it possible to get the center of gravity to show on the idw that represent the CG of an LOD?

29 REPLIES 29
Message 2 of 30
Daniela_Koloszko
in reply to: karthur1

LOD (Level of Detail) is only visual representation of the model - BOM, mass and other physical properties are still the same. Purpose of LOD is to reduce memory consumption by unloading components you don't need at the moment. Actual assembly structure doesn't change.  That's why COG is not updated in drawings.


Even if you update the mass via Manage->Update Mass and you will see that CoG is the same for all the LODs.


Users should use iAssemblies to achieve different assembly configurations where they can update center of gravity, partlist, and so forth.



Daniela Koloszko

Message 3 of 30
karthur1
in reply to: Daniela_Koloszko

The COG shows correct in the iam with the LOD active.  I was able to work around it by measuring from the COG in the iam to a known point.

iAssemblies are too complex and troublesome.  What took me a few minutes to do with LOD would have taken an hour or more to do with iAssemblies.

 

Thanks

Message 4 of 30
MjDeck
in reply to: karthur1

I think this is a bug on the drawing side.  As you say, in an assembly the COG reflects the LOD.

 

I have a workaround that uses iLogic.  It will create or update a workpoint at the LOD COG.  This can be shown in a drawing.  It doesn't update it automatically, but it can do it every time you save the assembly.

 


Mike Deck
Software Developer
Autodesk, Inc.

Message 5 of 30
Daniela_Koloszko
in reply to: MjDeck

This was logged as a wish list some time ago to our development team. The wish was closed "as designed". Development explanaition is that LODs and Design View reps are SPECIFICALLY DESIGNED to have no impact on mass properties.
 



Daniela Koloszko

Message 6 of 30
karthur1
in reply to: MjDeck


@MjDeck wrote:

I think this is a bug on the drawing side.  As you say, in an assembly the COG reflects the LOD.

 

I have a workaround that uses iLogic.  It will create or update a workpoint at the COG.  This can be shown in a drawing.  It doesn't update it automatically, but it can do it every time you save the assembly.

 


Thanks Mike, I was thinking that something was not right since it did not show correctly in the idw.  Can you share the iLogic code?

 

Thanks

Message 7 of 30
MjDeck
in reply to: karthur1

The rule code is in the attachment.  You can create a new rule in your assembly and cut and paste the text into it.  Or you can save it as an external rule that can be shared between assemblies.

 

 To make it run and update the point every time the assembly is saved, use Manage -> iLogic -> Event Triggers. Select the Before Save Document event and add the rule under it.

 


Mike Deck
Software Developer
Autodesk, Inc.

Message 8 of 30
cadfish1
in reply to: MjDeck

Attached is the VBA (macro) version converted from the iLogic.

Message 9 of 30
A.Furlong
in reply to: karthur1

I used this rule in iLogic. It worked the first time I saved. It created the point called Center of Gravity. Then I changed the Level of Detail and hit save again and it gave me the following error:

Error in rule: Work Point at CoG, in document: 5600 - SWRX SDU Foundation Base.iam

Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

 

Under More Info:

System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
   at Inventor.MassProperties.get_CenterOfMass()
   at LmiRuleScript.Main()
   at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
   at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

Message 10 of 30
MjDeck
in reply to: A.Furlong

Thanks for finding this. I verified that the rule will fail if the LOD has all parts suppressed, or if there are no unsuppressed parts with solid bodies. Here's a version that will handle it: it won't try to update the point in that case. Maybe a better approach would be to delete the point.

 If this version doesn't run without error on your system, please let me know. Which version of Inventor are you running?


Mike Deck
Software Developer
Autodesk, Inc.

Message 11 of 30
A.Furlong
in reply to: karthur1

I am using Inventor Pro 2013.

 

The file that it gave the error in, didn't have all parts suppressed, and all the parts that were unsuppressed were solid bodies. I'll try the new .txt file and let you know if I get any more errors. Thanks.

 

EDIT:

I just tried the new rule and all seems to work fine. I save in one LOD and the point is on the CoG, I changed LOD and saved again, and the point moved to suit that LOD's CoG.

 

The only problem I can see now, is that if I have 2 idw's, each showing a different LOD. If I show that point to represent the CoG in each drawing, it will only be correct in one drawing.

If I saved the assembly with LOD1 active, then drawing1 will show the CoG for LOD1, and drawing2 will show the CoG for LOD1. This point will be on the CoG for whichever LOD was active when I last saved the iam.

Message 12 of 30
MjDeck
in reply to: A.Furlong

Here's a new version. This one will create a separate point for each LOD (in which you run it). The workpoint name is set by this line of code:
Dim workPointName As String = lodName & " Center Of Gravity"
You can change that format if required.
In each drawing view, you have to manually show only the point that matches the LOD. Then it will follow the assembly.


Mike Deck
Software Developer
Autodesk, Inc.

Message 13 of 30
vuchkobg
in reply to: MjDeck

Thanks Mike,

I see nobody reads the wishlists... Your solution is very helpful!


BR,

VuCHkO
Message 14 of 30
snowflake30
in reply to: MjDeck

Great piece of code, found this really useful. Can it be easily adjusted so it can be applied to a part file? Or is there an easier way of reporting part CoGs whilst within an assembly? I tried adjusting the code but my coding skills are lacking in the extreme. Any help much appreciated.

 

 

Message 15 of 30
skylinejeff
in reply to: snowflake30

My goodness I've been looking for a way to do this for at least three years!  

 

No more hand-sketching the COG on a specific LOD in an idw that I've printed out on PDF's.  Props!

Message 16 of 30
swalton
in reply to: MjDeck

Mike,


This is a very useful code snippit.


Would you mind if I posted it to the custimozation forum with a request to extend it a bit?  I need something that gives me a COG workpoint for each combination of LOD and Position Rep in an assembly.  If I have a Loaded and and Unloaded LOD and 3 different Position Reps, I would need 6 different workpoints that I can show on a print


Thanks for posting this.

Steve Walton
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Inventor 2023
Vault Professional 2023
Message 17 of 30
snowflake30
in reply to: swalton

I was just about to ask this very question. Have you been able to make any headway with this request? I'm not sure my coding skills are up to the task of achieving this....

Message 18 of 30
MjDeck
in reply to: snowflake30

Here's a version that will put both the LOD and positional representation into the workpoint name. If either one of those by itself is Master, then it will leave it out. But if both are Master, then it will call the point "Master Center Of Gravity".


Mike Deck
Software Developer
Autodesk, Inc.

Message 19 of 30
MjDeck
in reply to: snowflake30

Hi snowflake30,

Here's the original version of this rule. It will run in either a part or an assembly, but in an assembly it won't take the LOD or PosRep into account. You can use the other rule in an assembly, and this one in a part. 
Note: it won't automatically create points in each part within an assembly. You have to run it separately in each part.


Mike Deck
Software Developer
Autodesk, Inc.

Message 20 of 30
snowflake30
in reply to: MjDeck

Hi MjDeck,

 

Thanks for your effort on this bit of coding (more than I can do). I have run the code in my test model and got it to replicate what i think you have set out to achieve i.e. for a different LOD or pos rep then inventor outputs a datum point for that individual representation. I think the code is outputing the CofG for a given LOD at the master posrep and the choosen posrep defaulting to the master LOD. What I'd really like to achieve was a combination of LOD and pos reps.

 

Swalton in the earlier posts is after a similiar thing, i think. So....

 

If I have an assembly that have 2 LODs to represent 2 model configurations. Say the model is a cylinder with a large mass on the end of it. Config 1 has a smalller mass, config 2 has a larger mass. The cylinder can move from a retracted position to a fully extended one. Lets say for arguements sake we have a 3rd intermittent position that is mid way between the first 2. As a result we end up with 6 different CofG positions, generated by the 2configs x 3posrep combinations. The resulting CofGs as follows:

 

  1. Config A- Extended
  2. Config A- Intermittent
  3. Config A- Retracted
  4. Config B- Extended
  5. Config B- Intermittent
  6. Config B- Retracted

Do you think its possible to code such a rule? Many thanks for your help so far. Hope this isnt too much of a head scratcher.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report