Inventor Customization

Inventor Customization

Reply
Contributor
RPdAnjou
Posts: 33
Registered: ‎06-06-2011
Message 1 of 4 (432 Views)
Accepted Solution

VB.Net - How do I find 3d Linear Dimensions on a drawing

432 Views, 3 Replies
08-09-2012 01:35 AM

Hi,

 

I would like to know how I can find a dimension that's created with the command (with the internal command name) "Create3DLinearDimension".

This command is used to create a linear dimension on a view that has the default dimension type set to "True".

 

Thanks.

Hi,

 

Drawings are 2d and I do not see a command with internal name "Create3DLinearDimension" when iterating through the collection of all available commands, so I don't know which object you are talking about.

 

You can access a drawing existing dimensions from the "Sheet.DrawingDimensions.GeneralDimensions" property, then check the exact type of each dimension entity.

 

Regards,

Philippe.

ADN Support Specialist
philippe.leefsma
Posts: 674
Registered: ‎06-02-2009
Message 2 of 4 (416 Views)

Re: VB.Net - How do I find 3d Linear Dimensions on a drawing

08-16-2012 01:15 AM in reply to: RPdAnjou

Hi,

 

Drawings are 2d and I do not see a command with internal name "Create3DLinearDimension" when iterating through the collection of all available commands, so I don't know which object you are talking about.

 

You can access a drawing existing dimensions from the "Sheet.DrawingDimensions.GeneralDimensions" property, then check the exact type of each dimension entity.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Contributor
RPdAnjou
Posts: 33
Registered: ‎06-06-2011
Message 3 of 4 (411 Views)

Re: VB.Net - How do I find 3d Linear Dimensions on a drawing

08-16-2012 01:54 AM in reply to: philippe.leefsma

Well, as I said, I do get this name when creating a linear dimension on a view with the default dimension type set to "True" in stead of the general "Projected". This happens when a View is placed as "Isometric".

 

Thanks for the tip, i will try to loop trough the "Sheet.DrawingDimensions.GeneralDimensions" properties.

Contributor
RPdAnjou
Posts: 33
Registered: ‎06-06-2011
Message 4 of 4 (403 Views)

Re: VB.Net - How do I find 3d Linear Dimensions on a drawing

08-16-2012 03:53 AM in reply to: philippe.leefsma

Okey, I used the following code to list the dimensions that were created as "True".

 

            Dim sViews As String = ""
            Dim bFirst As Boolean = True
            For Each oSheet As Sheet In oDoc.Sheets

                If oSheet.DrawingDimensions.GeneralDimensions.Count < 1 Then Continue For

                bFirst = True
                For Each oDim As GeneralDimension In oSheet.DrawingDimensions.GeneralDimensions
                    If oDim.GeneralDimensionType = GeneralDimensionTypeEnum.kTrueGeneralDimension Then
                        If bFirst = True Then 'Add sheet name for first dim
                            sViews += vbCrLf & vbCrLf & "Sheet: " & oSheet.Name
                            bFirst = False
                        End If
                        sViews += vbCrLf & "Dimension: " & oDim.Text.Text
                    End If
                Next
            Next

This works as aspected.

I get a list with the dimensions I created as "True".

 

Thanks for the solution.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.