Counting Dimensions??

The VBA forum deals with IntelliCAD 2000 VBA (Visual Basic for Applications) issues.

Moderator: CMS Inc

Post Reply
ja2984
Contributor
Posts: 12
Joined: Thu Jun 11, 2009 2:09 am

Counting Dimensions??

Post by ja2984 » Mon Jun 22, 2009 6:30 am

Hi all,

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

Thanks,

John
JCAMPOS

Post by JCAMPOS » Mon Jun 22, 2009 9:24 am

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
ja2984
Contributor
Posts: 12
Joined: Thu Jun 11, 2009 2:09 am

Post by ja2984 » Tue Jun 23, 2009 2:50 am

Thanks for the quick reply, Shall give it a go tomorrow.

Thanks again.
Post Reply