Reading Textual Properties of a Linear Dimension

Discussion in 'AutoCAD' started by tommyo, Dec 7, 2006.

  1. tommyo

    tommyo Guest

    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
     
    tommyo, Dec 7, 2006
    #1
  2. tommyo

    tommyo Guest

    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
     
    tommyo, Dec 7, 2006
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.