Page 1 of 1

Counting Dimensions??

Posted: Mon Jun 22, 2009 6:30 am
by ja2984
Hi all,

Does anyone know of a way to count how many dimensions are in a drawing?

Thanks,

John

Posted: Mon Jun 22, 2009 9:24 am
by JCAMPOS
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.

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
Regards,
JCAMPOS

Posted: Tue Jun 23, 2009 2:50 am
by ja2984
Thanks for the quick reply, Shall give it a go tomorrow.

Thanks again.