3D Model Annotations Value

3D Model Annotations Value

marco_bonacina5834P
Enthusiast Enthusiast
236 Views
2 Replies
Message 1 of 3

3D Model Annotations Value

marco_bonacina5834P
Enthusiast
Enthusiast

Hi all,
I am trying to get the value of a certain dimension from 3D annotations, I tried with this code but I had no success, any help is appreciated.

 

Dim oADoc As AssemblyDocument = ThisDoc.Document
Dim oMAs As ModelAnnotations = oADoc.ComponentDefinition.ModelAnnotations
Dim oMGN As ModelDimensions = oMAs.ModelDimensions.LinearModelDimensions.Item("Quota lineare 1").Value
MessageBox.Show(oMGN)

marco_bonacina5834P_1-1736518550118.png

Thanks

0 Likes
Accepted solutions (1)
237 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor
Accepted solution

Hi @marco_bonacina5834P.  Try changing the last property name in Line 3 of your code from "Value", to "ModelValue",instead.  See online help documentation about that object types properties, one of which is ModelValue.

LinearModelDimension

Edit:  Also, your very last line of code is trying to show a dimension object as the message.  That won't work.  So, either the variable Type in Line 3 will need to change, or you will need to access that ModelValue property within your MsgBox call.

Well, it may be easier to just copy, edit, the post the code back here, because there are more issues than that.

Dim oADoc As AssemblyDocument = ThisDoc.Document
Dim oMAs As ModelAnnotations = oADoc.ComponentDefinition.ModelAnnotations
Dim oLDMs As LinearModelDimensions = oMAs.ModelDimensions.LinearModelDimensions
Dim oLDM As LinearModelDimension = oLDMs.Item("Quota lineare 1")
Dim sValue As String = oLDM.ModelValue.ToString
MessageBox.Show(sValue)

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

marco_bonacina5834P
Enthusiast
Enthusiast

Thanks, now it works.

0 Likes