Get Density from iProperties

Get Density from iProperties

SharkDesign
Mentor Mentor
1,285 Views
3 Replies
Message 1 of 4

Get Density from iProperties

SharkDesign
Mentor
Mentor

How do I read the current value in the Density box of the iProperties?

 

Thanks

  Inventor Certified Professional
0 Likes
Accepted solutions (1)
1,286 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor
Accepted solution

Hi @SharkDesign.

I believe the 'Density' iProperty is Item# 42 in the 'Design Tracking Properties' iProperty set.

So either:

iProperties.Value("Project", "Density")

or

ThisDoc.Document.PropertySets.Item("Design Tracking Properties").Item("Density").Value

or

ThisDoc.Document.PropertySets(3).Item(42).Value

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 4

SharkDesign
Mentor
Mentor

As simple as that. 

So confusing when it's not on the 'Project tab' and everything else on the physical tab is:

iproperties.mass

iproperties.volume

  Inventor Certified Professional
0 Likes
Message 4 of 4

WCrihfield
Mentor
Mentor

To take it another step.   I noticed that the Mass and Volume are in 'document units', but the Density shown in on the Physical tab of the iProperties and returned by the iProperty is in grams per centimeters cubed units (database units I suspect).  So, since I use Inches (in) & Pounds (lbmass), I'm expecting the Density to be in pounds per inches cubed (lbmass/in^3).  In order to get that, I do the math using the two given values, which are already in document units.

 

Dim oD As Double = (iProperties.Mass / iProperties.Volume)
'or
'oD = (CDbl(iProperties.Mass) / CDbl(iProperties.Volume))
MsgBox("Density = " & oD, , "")

 

When working with iProperties directly, the value's data type isn't pre-defined, so you sometimes have to help it along by specifying the data type you are expecting, or the stuff you are trying to do with it might fail.  This routine returns the Density value in the units I'm expecting.  It's an odd situation there.  In the 'Document Settings' dialog > Units tab, you can specify Length, Angle, Time, & Mass units, but not Area, Density, and other measurable unit types.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes