Getting DrawingCurve object from dimension

Getting DrawingCurve object from dimension

akAMYTB
Enthusiast Enthusiast
656 Views
2 Replies
Message 1 of 3

Getting DrawingCurve object from dimension

akAMYTB
Enthusiast
Enthusiast

Hi 

 

I am trying to make Inventor tell me the length of two lines used by an angular dimension in a drawing document. Below is my code so far. How do I get the DrawingCurve obje, which I understand is used by the GeometryIntent objects which i used by the dimension. I've looked at examples where a code adds a dimension between two selected lines in a drawing view ( http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-968D16DA-408E-4ED8-A87A-EE8972C644F5 ), but I sort of need it to work the other way around, since I have the dimension. 

 

Dim App As Application
Set App = ThisApplication

Dim DrwDoc As DrawingDocument
Set DrwDoc = App.ActiveDocument

 

Dim Sheet As Sheet
Set Sheet = DrwDoc.ActiveSheet

Dim DrawingDimensions As DrawingDimensions
Set DrawingDimensions = Sheet.DrawingDimensions

Dim DrawingDimension As DrawingDimension

 

For Each DrawingDimension In DrawingDimensions

Dim LineOne As DrawingCurve
Set LineOne = ???
Dim LineTwo As DrawingCurve
Set LineTwo = ???

Next

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

clutsa
Collaborator
Collaborator
Accepted solution

This seems to be working for me.

Dim App As Application
Set App = ThisApplication

Dim DrwDoc As DrawingDocument
Set DrwDoc = App.ActiveDocument

 

Dim Sheet As Sheet
Set Sheet = DrwDoc.ActiveSheet

Dim DrawingDimensions As DrawingDimensions
Set DrawingDimensions = Sheet.DrawingDimensions

Dim DrawingDimension As DrawingDimension

 

For Each DrawingDimension In DrawingDimensions

Dim LineOne As DrawingCurve
Set LineOne = DrawingDimension.IntentOne.Geometry.Segments(1).Parent
Dim LineTwo As DrawingCurve
Set LineTwo = DrawingDimension.IntentTwo.Geometry.Segments(1).Parent
If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

0 Likes
Message 3 of 3

akAMYTB
Enthusiast
Enthusiast

Thanks alot. Did the trick 🙂 

 

Cheers - Anders

0 Likes