Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mass from different Levels of Detail

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Anonymous
1023 Views, 5 Replies

Mass from different Levels of Detail

Hi, 

 

I want to write the mass of 3 different LODs in one Drawing. How can I calculate the mass for those LODs and show it on the Drawing? 

 

Thanks!

5 REPLIES 5
Message 2 of 6
rossano_praderi
in reply to: Anonymous

Hi Goncalves,

here attached there is a possible solution for your question.

 

I've create this sample with the release 2016, let me know if you have any trouble.

 

 

 

Bregs

Rossano Praderi



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
Message 3 of 6
xiaodong_liang
in reply to: Anonymous

Hi F.Goncalves,

 

I believe what Rossano Praderi shared in message 2 is the solution. Thank you Rossano Praderi!

 

To help more customers, I posted a blog based on this solution. I made some adjustment on the code. 

Could you check it and mark message of  Rossano Praderi or me as the solution?

 

http://adndevblog.typepad.com/manufacturing/2016/03/inventor-ilogic-dislay-mass-from-different-lod-o...

 

core codes:

'get RepresentationsManager
Dim repMgr As RepresentationsManager = ThisApplication.ActiveDocument.ComponentDefinition.RepresentationsManager

'record current LevelOfDetailRepresentation
Dim oCurrentRepName As String  = repMgr.ActiveLevelOfDetailRepresentation.Name 

Dim oRep As LevelOfDetailRepresentation
Dim oRepName  
Dim oMass 

For Each oRep In repMgr.LevelOfDetailRepresentations
    oRepName = oRep.Name
    'activate this LOD
    repMgr.LevelOfDetailRepresentations.Item(oRepName).Activate
    'get mass
     oMass = iProperties.Mass
     'update value of custom property
     iProperties.Value("Custom", oRepName) = iProperties.Mass
Next

'restore 
repMgr.LevelOfDetailRepresentations.Item(oCurrentRepName).Activate

 

 

 

Message 4 of 6

Hi Xiaodong Liang,

I was pleasantly surprised by your message and I want to thank you for giving me mentioned in your blog post "Manufacturing Devblog".

 

Also, I think that your explanation published on the blog is more complete and clear of mine, therefore more helpful.

 

Bregs

Rossano Praderi



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
Message 5 of 6
software
in reply to: Anonymous

Hi,

 

i tried to apply the solution of getting mass for different level of detail. but in the drawing output, i couldnt find a way to change the decimal points to zero. inventor puts in the mass value with 10 decimal places. i even tried changing the units of assembly in document settings but did not succeed.

 

can you please let me know how to change this.

Message 6 of 6
rossano_praderi
in reply to: software

Dear Mr.Software....

....below you can find a possible solution....

 

iProperties.Value("Custom","Mass")=Str(Floor(iProperties.Mass)).Replace(",","")

 

 

Bregs

Rossano Praderi



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report