Mass from different Levels of Detail

Mass from different Levels of Detail

Anonymous
Not applicable
1,374 Views
5 Replies
Message 1 of 6

Mass from different Levels of Detail

Anonymous
Not applicable

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!

0 Likes
Accepted solutions (2)
1,375 Views
5 Replies
Replies (5)
Message 2 of 6

rossano_praderi
Collaborator
Collaborator
Accepted solution

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
Autodesk Support
Autodesk Support
Accepted solution

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

rossano_praderi
Collaborator
Collaborator

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!
---------------
0 Likes
Message 5 of 6

software
Explorer
Explorer

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.

0 Likes
Message 6 of 6

rossano_praderi
Collaborator
Collaborator

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!
---------------
0 Likes