ALIGN & Centralize Dimensions for All Drawing Sheets

ALIGN & Centralize Dimensions for All Drawing Sheets

cad
Advocate Advocate
676 Views
2 Replies
Message 1 of 3

ALIGN & Centralize Dimensions for All Drawing Sheets

cad
Advocate
Advocate

Hi

 

I got the iLOGIC rule within the Forum to align Dimensions.

 

But it works only in Current Sheet.

 

Is that possible to Align Dimensions for All the sheets at a time ?

 

Thanks.

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

frederic.vandenplas
Collaborator
Collaborator
Accepted solution

Hi,

 

I don't want to be rude, but it's easier for everyone if you provide what you already do have.

We can't see how your variables are declared, so to give a fully working example that works in your case without error is quite difficult.

Anyway, i'm glad to help you out if there should be any problems building your code Smiley Wink

 

You can use this piece of ilogic, just place your code where the line is commented

Dim oDrawDoc as drawingdocument = ThisDrawing.Document
Dim oSheet As sheet 
For Each oSheet In oDrawDoc.sheets
'Place your code to align dimensions here
'maybe this line is also needed, did not test it
ActiveSheet = ThisDrawing.Sheet(osheet.Name)
Next osheet

  

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
Message 3 of 3

cad
Advocate
Advocate

Agreed !!! 

 

I should have provided what I got.

(That people say "Rude" but I call it the "Truth")

 

Some how I missed to post, what I already had.

 

As a NewB (nearly zero) in iLogic, I always struggle to get what I want.

 

but Finally, got here within Forum that works great for all the sheets. to align all dimensions.

 

SyntaxEditor Code Snippet

Dim doc As Inventor.DrawingDocument = ThisDoc.Document
For Each sheet As Sheet In doc.Sheets
'sheet.Activate
Dim dimensions As Inventor.ObjectCollection = ThisServer.TransientObjects.CreateObjectCollection
Dim drawDim As Inventor.DrawingDimension
  For Each drawDim In sheet.DrawingDimensions
    If Not TypeOf drawDim Is Inventor.OrdinateDimensionSet _
      And Not TypeOf drawDim Is Inventor.BaselineDimensionSet _
      And Not TypeOf drawDim Is Inventor.ChainDimensionSet Then
     dimensions.Add(drawDim)
    End If
  Next
  sheet.DrawingDimensions.Arrange(dimensions)
Next

 

 

0 Likes