Select all model space dimensions

Select all model space dimensions

Anonymous
Not applicable
560 Views
3 Replies
Message 1 of 4

Select all model space dimensions

Anonymous
Not applicable
Is there code for selecting all the dimensions in model space?

I want to essentially replicate what happens when I use qselect and grab all of the dimensions. Once I have the dimensions selected I want to:

(1) change their layer to my "DIMENSION" layer and (2) change their dimension style to my "ModelSpaceDimensionStyle"
0 Likes
561 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Sure, use a filtered selection set. Entity type is specified by code 0 and
the entity is "DIMENSION", then for Model/Paperspace the code is 67 and
modelspace value is 0.


wrote in message news:5255221@discussion.autodesk.com...
Is there code for selecting all the dimensions in model space?

I want to essentially replicate what happens when I use qselect and grab all
of the dimensions. Once I have the dimensions selected I want to:

(1) change their layer to my "DIMENSION" layer and (2) change their
dimension style to my "ModelSpaceDimensionStyle"
0 Likes
Message 3 of 4

Anonymous
Not applicable
Sub SelectDim()

Dim Selection As AcadSelectionSet
Dim Dimension As AcadDimension
Dim FilterType(1) As Integer
Dim FilterData(1) As Variant


On Error Resume Next
Set Selection = ThisDrawing.SelectionSets.Item("ssDim")
If Err Then
Set Selection = ThisDrawing.SelectionSets.Add("ssDim")
Err.Clear
Else
Selection.Clear
End If

FilterType(0) = 0
FilterData(0) = "DIMENSION"
FilterType(1) = 67
FilterData(1) = "0"

Selection.Select acSelectionSetAll, , , FilterType, FilterData
'Selection.SelectOnScreen FilterType, FilterData

For Each Dimension In Selection

Dimension.Layer = "DIMENSION"
Dimension.StyleName = "ModelSpaceDimensionStyle"

Next Dimension



End Sub
0 Likes
Message 4 of 4

Anonymous
Not applicable
This works great. I actually added a line:

Dimension.TextColor = acWhite

Is there a way to change the dimension line and extension line colors also?
0 Likes