arrange dimension of linear dimension and if it was assigned to layer.

arrange dimension of linear dimension and if it was assigned to layer.

khadeerkruthi
Contributor Contributor
159 Views
1 Reply
Message 1 of 2

arrange dimension of linear dimension and if it was assigned to layer.

khadeerkruthi
Contributor
Contributor

I have assigned the layer to linear dimension but arranging dimension has to happen only for the particular layer using the ilogic.

0 Likes
160 Views
1 Reply
Reply (1)
Message 2 of 2

tfrohe_LSI
Advocate
Advocate

The DrawingDimension object has a Layer property. You can access DrawingDimension.Layer.Name and test that against the layer name you want to arrange dimensions for. If it matches, add the dimension to a SelectSet then run the arrange dimensions command on the selected dimensions. Here is an example of how this could look.

 

 

'Get a reference to the docuemnt and sheet
Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oActiveSheet As Sheet = oDoc.ActiveSheet

'Get a reference to the SelectSet and clear it
Dim oSelectSet As SelectSet = oDoc.SelectSet
oSelectSet.Clear

'Loop through the dimensions and select only ones that match the layer(s) we want
For Each oDim As DrawingDimension In oActiveSheet.DrawingDimensions
	If oDim.Layer.Name.Contains("Dimensions") Then oSelectSet.Select(oDim)
Next

' Get the CommandManager object.
Dim oCommandMgr As CommandManager
oCommandMgr = ThisApplication.CommandManager

' Get control definition for the arrange dimensions command.
Dim oControlDef As ControlDefinition = oCommandMgr.ControlDefinitions.Item("DrawingArrangeDimensionsCmd")

' Execute the command.
Call oControlDef.Execute

 

I hope this helps you.

 

0 Likes