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: 

Calculate Length using Mass

10 REPLIES 10
Reply
Message 1 of 11
Dion
1080 Views, 10 Replies

Calculate Length using Mass

Hi,
I would like to use the Mass property to calculate the length of some swept components (pipe, RHS etc).
Is there any way to bring the mass property into the Parameters box?
Inventor doesnt seem to actually calculate the formula if it's input in the BOM, simply display the values (e.g "=<mass>/11.15" returns "34.776723/11.15"), or am I missing something out?

Going through each component to manually add the dimensions neccessay to the swept path to calculate the length of the centreline gets time consuming.
Of course if anyone has a way to calculate the length of as uniform shape through various swept paths that would be great too.

Thanks,
Dion

Inv Suite 2010 64bit
Vista 64
ATI 4850
8Gb RAM
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Dion


A possible solution:

 


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi,
I
would like to use the Mass property to calculate the length of some swept
components (pipe, RHS etc).
Is there any way to bring the mass property
into the Parameters box?
Inventor doesnt seem to actually calculate the
formula if it's input in the BOM, simply display the values (e.g
"=<mass>/11.15" returns "34.776723/11.15"), or am I missing something
out?

Going through each component to manually add the dimensions
neccessay to the swept path to calculate the length of the centreline gets
time consuming.
Of course if anyone has a way to calculate the length of
as uniform shape through various swept paths that would be great
too.

Thanks,
Dion

Inv Suite 2010 64bit
Vista 64
ATI
4850
8Gb RAM
Message 3 of 11
Dion
in reply to: Dion

Thanks for that, it works quite well for what I was after.

I'm still interested in finding out if there is a way to either
A) Bring a property (like mass) into Parameters for equations or,
B) Have equations solved in the BOM.

Any information would be great,
Thanks,
Dion
Message 4 of 11
andrewiv
in reply to: Dion

You could meausure the length of your swept path. Just use the measure loop command and select the path of your swept. This will only give you the length and not allow you to use it in a BOM/Parameter.

Also, there is a way to put mass into a parameter, but you have to use a VB macro. Try asking on the customization discussion group for this.

Andrew In’t Veld
Designer

Message 5 of 11
nmunro
in reply to: Dion

A. Bring Mass into Parameters for equations

It could be done via some customization, but it is not supported natively. It would be of little use though since including Mass in an equation that affected the model would result in an unending cyclical update. Equation involving mass drives model > model changes > mass changes >... (This behavior could be blocked, but it's not a trivial undertaking).

B. Have equations solved in the BOM

There is no direct equation support. The BOM (and associated parts lists) display property information. Exported parameters can be included since they are exported as custom properties. You can accomplish summing of values in parts list columns. So, if you need calculated values in the BOM or parts list, you must accomplish the calculations via parameters, and export the value to a custom property. The add-in mentioned above enables live updates to measured geometry in a part model, automatically updating the associated custom property (exported parameter) as the model changes.

        


https://c3mcad.com

Message 6 of 11
Dion
in reply to: Dion

Thanks for the great answer.
For me, I don't need to drive the model from this equation, simply be able to show the length in the parts list, so this sounds like the perfect solution.
I'll have an ask around in the customisation forum as unfortunately my VB skills are non-existant at this stage.
Of course if anyone here has some code lying around that will pull a iprop into parameters, that would be fantastic

Thanks again for the info,
Dion
Message 7 of 11
Yijiang.Cai
in reply to: Dion

It is easy to be accomplished by iLogic. You could create a user parameter named "Length" = 0 and using iLogic to create a rule like "Length=iProperties.Mass/11.5", that will work fine.

As to the macro, please see the code section below -

Public Sub CreateUserParameters()

Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument

' Set a reference to the compdef.
Dim oCompDef As PartComponentDefinition
Set oCompDef = oPartDoc.ComponentDefinition


'Get the mass
Dim oMass As Double
oMass = oCompDef.MassProperties.Mass

' Create a user parameter with unit "cm"
Call oCompDef.Parameters.UserParameters.AddByValue("Length", oMass / 11.5, kCentimeterLengthUnits)

End Sub

Thanks,
River
Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com
Message 8 of 11
MjDeck
in reply to: Dion

As River says, you can use iLogic to get the mass value into a parameter. To make sure it is up to date, you should force a part Update in the rule before retrieving the mass. Sample rule code:

InventorVb.DocumentUpdate()
Length = iProperties.Mass / 11.5

This rule will not guarantee that the Length parameter is up to date after changes in the part. You can set it to run on the Any Model Parameter Change event, but other things besides parameter changes can cause the mass to change.

You may have to run this rule manually to make sure the Length is up to date.

Mike

Mike Deck
Software Developer
Autodesk, Inc.

Message 9 of 11
MjDeck
in reply to: Dion

Note: you can also make this rule run on the Before Save Document event. This would make sure that the Length is up to date when the part is saved.

Mike Deck
Software Developer
Autodesk, Inc.

Message 10 of 11
Dion
in reply to: Dion

Thanks to everyone who took the time to answer. I'll be having a go with both of those options (as soon as I download iLogic) to see which works the best for me.

Thanks,
Dion
Message 11 of 11
klausburmeister
in reply to: Dion

Hi MjDeck!

Can you really update the physical proprieties (MASS, VOLUME, etc) when your model is a sweep for example, or a revolve??!
I don't see any problem to update the length, considering you really got the updated mass. To do this I would trigger my rule:

Length = iProperties.Mass / (Section.Area * ThisDoc.Document.ComponentDefinition.Material.Density)

by "Any Model Parameter Change" and by "Material Change".

My problem is that I can not update the Physical Properties once I have a "sweep", a "revolve" or a "loft".
InventorVb.DocumentUpdate(), makes the update from my document, but not from the Physical Properties if I am using one of these features.

If you know someway to do this, you would help me a LOT!!!

Thank you,

Klaus Burmeister

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

Post to forums  

Autodesk Design & Make Report