Differentiate between dimension type

Differentiate between dimension type

Lalchetaketan022
Contributor Contributor
273 Views
1 Reply
Message 1 of 2

Differentiate between dimension type

Lalchetaketan022
Contributor
Contributor

Hi

 

I just could collect all the dimensions from a drawing file using API. Could anyone please let me know how to differentiate according to type of dimension? In other words, I just need to have dimensions of type radial, angular and diametrical dimensions only.

0 Likes
Accepted solutions (1)
274 Views
1 Reply
Reply (1)
Message 2 of 2

Michael.Navara
Advisor
Advisor
Accepted solution

According to this help article, you can check Type property of the dimension object.

If dimensionObj.Type = ObjectTypeEnum.kAngularGeneralDimensionObject Then

   'do something with angular dimension
Eend If

 

Or if you want to do some specific task with dimension (depending on its type) you can cast the dimension to one of the derived type (specific type of dimension)

AngularGeneralDimensionDiameterGeneralDimensionLinearGeneralDimensionRadiusGeneralDimension

 

Dim dimensionObj As GeneralDimension = ThisDrawing.Document.SelectSet(1)

Dim angularDim As AngularGeneralDimension = TryCast(dimensionObj, AngularGeneralDimension) 

 

The angular dim should be valid AngularGeneralDimension or Nothing

0 Likes