Hi all,
Does anyone know of a way to count how many dimensions are in a drawing?
Thanks,
John
#2
Hi John,
All you have to do is collect all the dimension objects in the drawing to one SelectionSet object. Then, call the "Count" method of the SelectionSet object to know how many dimension objects you have.
Regards,
JCAMPOS
All you have to do is collect all the dimension objects in the drawing to one SelectionSet object. Then, call the "Count" method of the SelectionSet object to know how many dimension objects you have.
Code: Select all
Public Sub TotalNumberOfDimensions()
'Initialize a SelectionSet object:
Dim sset As IntelliCAD.SelectionSet
'Specify the SelectionSet filters (to search for "DIMENSION" objects):
Dim filterTypes(0) As Integer
Dim filterData(0) As Variant
filterTypes(0) = 0: filterData(0) = "DIMENSION"
'Add the SelectionSet object to the SelectionSets collection:
Set sset = IntelliCAD.ActiveDocument.SelectionSets.Add("MyDimensions")
'Select objects in the drawing using the SelectionSet filters:
Call sset.Select(IntelliCAD.SelectionSetType.vicSelectionSetAll, , , filterTypes, filterData)
'Display the total number of dimension objects in the active drawing:
MsgBox sset.Count
End Sub
JCAMPOS