I'm attempting to read the Measurement property of a linear dimension via VBA code. I'm successfully selecting the dimension via a SelectionSet, but cannot determine how to read the text properties. How do I convert/cast and Entity object to a ACADDimAligned? Do I need to incorporate a ACADText or ACADMText object somehow? (the line will be the only object on the "LENGTH" layer, and BuildFilter is a custom filter function - the selection IS working correctly) '***** code start *****' Dim intData() As Integer Dim varData() As Variant Dim objSel As AcadSelectionSet Dim intEntityCount As Integer Dim objEnt As ACADEntity Set objSel = ThisDrawing.SelectionSets.Add("LENGTH") BuildFilter intData, varData, 8, "LENGTH" objSel.Select acSelectionSetAll, , , intData, varData intEntityCount = objSel.Count If intEntityCount = 1 Then Set objEnt = objSel(0) '-- WHAT NOW?? --' End If '***** code end *****' Assistance greatly appreciated! Thanks, Tom Oakes
The answer, of course, is so much easier than it would have seemed. Dim objDim As Variant Dim strMeasure As String If objEnt.ObjectName = "AcDbRotatedDimension" Then Set objDim = objEnt strMeasure = objDim.Measurement End If