inventor drawing Dimension align to center using ilogic gives error

inventor drawing Dimension align to center using ilogic gives error

Anonymous
Not applicable
1,138 Views
3 Replies
Message 1 of 4

inventor drawing Dimension align to center using ilogic gives error

Anonymous
Not applicable

Hello,

 

I was trying to align the drawing dimensions to center but it gives error.

 

can any one help me out to resolve the error.

 

My code is mentioned below:

    Dim oDrawDoc As DrawingDocument
    Dim oSheet As Sheet
    oDrawDoc = ThisApplication.ActiveDocument
    oSheet = oDrawDoc.Sheets.Item(1)
    Dim oDimension As DrawingDimension
    oDimension.CenterText
0 Likes
Accepted solutions (1)
1,139 Views
3 Replies
Replies (3)
Message 2 of 4

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

Hi, try this code, center the linear and angular dimensions

Dim oDoc As DrawingDocument = ThisDoc.Document
Dim oSheet As Sheet = oDoc.ActiveSheet
' Iterate over all dimensions in the drawing and center them if they are linear or angular.
For Each oDimension As DrawingDimension In oSheet.DrawingDimensions
    If TypeOf oDimension Is LinearGeneralDimension Or _
       TypeOf oDimension Is AngularGeneralDimension Then
        Call oDimension.CenterText
    End If
Next

 I hope this helps, greetings!


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 3 of 4

Anonymous
Not applicable

Thanks its working.

0 Likes
Message 4 of 4

blandb
Mentor
Mentor

Any idea as to why I have to run this rule twice before it will center them?

Autodesk Certified Professional
0 Likes