cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Arrange Dimensions to centre

Arrange Dimensions to centre

Using "Arrange" dimensions in Annotate never center's the dimensions that are updated. It does shift them to pre-determined offsets but seems to not try and get them in the centre at all. This has been a problem for a long time and I took me too long to post this problem. 

 

 

MarcellW_0-1706982138395.png MarcellW_1-1706982279615.png

 

 

 

4 Comments
m.verbunt
Advocate

We use some iLogic code to do this.

 

Dim oDoc As DrawingDocument
oDoc = ThisDoc.Document

' Set a reference to the active sheet
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet

Dim oDrawingDim As DrawingDimension
Dim oDrawingDims As DrawingDimensions
Dim oDimsToBeArranged As ObjectCollection

' Iterate over all dimensions in the drawing and
' center them if they are linear or angular.
' Add them to the ObjectCollection to be arranged

oDrawingDimensions = oSheet.DrawingDimensions

oDimsToBeArranged = ThisApplication.TransientObjects.CreateObjectCollection

question = MessageBox.Show("Would you like to center all dimensions?", "Arrange",MessageBoxButtons.YesNo,MessageBoxIcon.Question)

          'set condition based on answer
            If question = vbYes Then
				
For Each oDrawingDim In oDrawingDimensions
	       oDrawingDim.CenterText
    If TypeOf oDrawingDim Is LinearGeneralDimension Then
'       oDrawingDim.CenterText
       oDimsToBeArranged.Add(oDrawingDim)
    End If
	Next

			Else If question = vbNo Then
				
For Each oDrawingDim In oDrawingDimensions
    If TypeOf oDrawingDim Is LinearGeneralDimension Then
'       oDrawingDim.CenterText
       oDimsToBeArranged.Add(oDrawingDim)
    End If
	Next
			End If


If oDimsToBeArranged.Count > 0 Then		
	oDrawingDimensions.Arrange(oDimsToBeArranged)
End If 
MarcellW
Contributor

Hi m.Verbunt

 

This is quite a work-around! 

 

Thank you kindly! 

s_klausR9UFR
Contributor

Hi,

You can solve the problem directly in your template:

Unfortunately, my Inventor is set to German, but I hope you can find the setting via the screenshot.

s_klausR9UFR_1-1710423591897.png

Best regards

MarcellW
Contributor

Hi Klaus

 

Thank you for this! I managed to change it accordingly. I will test it going forward 

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

Submit Idea