Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone, I have a little problem with this rule.
the rule itself works well to align and center the dimensions.
I did some tweaking to get the result but I have very little coding knowledge.
I would like to implement an InputRadioBox that allows me to choose between:
- Center
-Align
-Center and align.
I managed to do all of this by splitting into 3 different rules.
Thank you
'ZOOM IN
ThisApplication.CommandManager.ControlDefinitions.Item("AppZoomallCmd").Execute
'--------------------------------------------------------------------------------------------------------------------
'Center Dimension Code
'--------------------------------------------------------------------------------------------------------------------
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
' a reference to the active sheet & dimension
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
Dim oDrawingDim As DrawingDimension
' Iterate over all dimensions in the drawing and center them if they are linear or angular.
For Each oDrawingDim In oSheet.DrawingDimensions
If TypeOf oDrawingDim Is LinearGeneralDimension Or TypeOf oDrawingDim Is AngularGeneralDimension Then
Call oDrawingDim.CenterText 'x1
Call oDrawingDim.CenterText 'x2
End If
Next
'--------------------------------------------------------------------------------------------------------------------
'Arrange Dimension Code
'--------------------------------------------------------------------------------------------------------------------
'Get the active document, assuming it Is a drawing.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
' Get the collection of dimensions on the active sheet.
Dim oDimensions As DrawingDimensions
oDimensions = oDrawDoc.ActiveSheet.DrawingDimensions
' Get a reference to the select set and clear it.
Dim oSelectSet As SelectSet
oSelectSet = oDrawDoc.SelectSet
oSelectSet.Clear
' Add each dimension to the select set to select them.
Dim oDrawDim As DrawingDimension
For Each oDrawDim In oDimensions
oSelectSet.Select(oDrawDim)
Next
Call ThisApplication.CommandManager.ControlDefinitions.Item("DrawingArrangeDimensionsCmd").Execute
Solved! Go to Solution.