Drawing, Edit Dim: Model Value

serpennica
Advocate
Advocate

Drawing, Edit Dim: Model Value

serpennica
Advocate
Advocate

Model Vaule in Dim.JPG

I noticed this Model Value when editing dimensions.

I am trying to get a total length of dimensions from my drawing.

I have several dimensions to add up. From the drawing, Is there a way to capture the Model value from several different dimensions and add them up.

not much of a programmer, but illogic is easy.

trying to figure out linear feet of walk way, on a crane.

thank you.

0 Likes
Reply
Accepted solutions (2)
608 Views
3 Replies
Replies (3)

johnsonshiue
Community Manager
Community Manager
Accepted solution

Hi! It should be doable. Based on Inventor API Help. "GeneralDimension Object" has a property called "ModelValue". It should return the value from the model.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes

serpennica
Advocate
Advocate

now what, not my skill set.

still struggle with getting the VB started.

I found this in the VB API search, just a bit more that i can work with. need to get back to school for this.modle value API.JPG

0 Likes

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi @serpennica 

 

Here is a quick ilogic rule that will add up the model value of all the selected dimensions. You can just paste this code into a new ilogic rule in your drawing and run it.

 

aaa.JPG

 

Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

Dim uom As UnitsOfMeasure
uom = ThisDoc.Document.UnitsOfMeasure

oSpaces = "         "

Dim oSSet As SelectSet = ThisDoc.Document.SelectSet

If oSSet.Count = 0 Then
	MessageBox.Show("Select at least one dimension", "iLogic", _
	MessageBoxButtons.OK,MessageBoxIcon.Information)
	Exit Sub
Else

	For Each obj As Object In oSSet
		'filter dimensions, ignore other selected entities
		If TypeOf obj Is GeneralDimension Then
			Dim oDim As GeneralDimension = obj	
			oValue = uom.GetStringFromValue(oDim.ModelValue, kDefaultDisplayLengthUnits)
			oMessage = oMessage & vbLf & oSpaces & oValue
			oSumTotal = oSumTotal + oDim.ModelValue 		
		End If
	Next
End If

oSumTotal = uom.GetStringFromValue(oSumTotal, kDefaultDisplayLengthUnits)
MessageBox.Show(oMessage & vbLf &  "+  _____________ " & vbLf &  oSpaces & oSumTotal, "iLogic")

 

EESignature