Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Drawing curves/entities a dimension is attached to

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Raider_71
215 Views, 3 Replies

Get Drawing curves/entities a dimension is attached to

Hi,

 

Is there a way to find the drawing curves (in my case 2 lines for an angular dim) of a dimension?

 

I had a quick look and can't seem to find a way to retrieve the entities a dimension is attached to from the "GeneralDimension" object.

 

Any pointers?

 

Cheers

3 REPLIES 3
Message 2 of 4

Hi @Raider_71 

 

Without looking, I think it will be similar to an example I just posted working with balloons, see this link:

https://forums.autodesk.com/t5/inventor-programming-ilogic/open-drawing-from-balloon/td-p/12760438

 

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

Message 3 of 4
WCrihfield
in reply to: Raider_71

Hi @Raider_71.  This can be a complicated subject to describe.  First of all, we have the DrawingDimension, which is the base type of all dimensions on a drawing, no matter what type or shape they are.  Then there are the other, more specific types of dimensions that are 'derived' from that base type, and one of those is the GeneralDimension.  Then that type also has some other even more specific dimension types that are 'derived' from that, and one of those is the LinearGeneralDimension (as an example, for discussion).  Each level deeper you get in these 'types', there are more properties and/or methods (Subs & Functions) available for them, for the more specific type they represent.  Well, at the LinearGeneralDimension level, we now have some properties that we can use towards your goal.  (But different types may have different properties.)  Some 'Links' to the online help documentation for some of those properties for this type are listed below:

DrawingDimension 

GeneralDimension 

LinearGeneralDimension 

LinearGeneralDimension.IntentOne 

LinearGeneralDimension.IntentTwo 

LinearGeneralDimension.IntentThree 

Those last 3 give us a GeometryIntent object, as their value.  This is like an object that defines the 'connection' between the dimension and something it is supposed to be attached to.  We can 'sometimes' use this object, by inspecting its properties further, to find out what it is attached to (but not always).  If the GeometryIntent.IntentType property's value is 'kGeometryIntent' (a variation of the IntentTypeEnum), then we will be able to get a value from its GeometryIntent.Geometry property.  The default type of value we get from that is simply 'Object', because it can be many different types of objects.  However, sometimes it is a DrawingCurve object (a single piece of 2D geometry on the sheet, within a DrawingView).  If that is what you wanted to find, then were done, but if not, then you probably want to know what part of the actual model (in 3D model space) the DrawingCurve is associated with...and if so, read on.

 

If we get a DrawingCurve, and want to know what it is associated with in 'the model', then we can use its DrawingCurve.ModelGeometry property.  Another one that just returns an 'Object', because it could be many different types of objects.  Then more code may be needed to dig even deeper into identifying what type of object it is, and once we know that, we can extract further information from it.

Whew...😅

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 4
Raider_71
in reply to: WCrihfield

Hi @WCrihfield ,

 

Thanks for your detailed explanation! It pointed me in the right direction. I was not able to get an "AngularGeneralDimensions" collection object under "GeneralDimensions" but I managed to check the type of each "GeneralDimension" inside "GeneralDimensions" and then if it was type of "kAngularGeneralDimensionObject" then I converted the type to "AngularGeneralDimension" and worked from there. Below is my code just for reference. Feel free to tell me if there is a better way to do it.

 

        Dim GenDims As GeneralDimensions = oSheet.DrawingDimensions.GeneralDimensions

        Dim oAngDim As AngularGeneralDimension

        For Each oDim As GeneralDimension In GenDims

            If oDim.Attached Then

                If oDim.Type = ObjectTypeEnum.kAngularGeneralDimensionObject Then

                    oAngDim = CType(oDim, AngularGeneralDimension)

                    If oAngDim.IntentThree Is Nothing Then
                        MessageBox.Show("yes")
                    End If

                End If

            End If

        Next

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

Post to forums  

Autodesk Design & Make Report