Consulting

Results 1 to 3 of 3

Thread: How to get All Object's name in dwg?

  1. #1

    How to get All Object's name in dwg?

    Please help me VBA code.
    How can I to get all Object's name in a dwg?
    etc: TEXT, MTEXT, DIMENSION, LINE, CIRCLE....
    Thanks.

  2. #2
    VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,168
    Location
    [VBA]Function Aset(iSSetName As String) As AcadSelectionSet
    Dim ssetA As AcadSelectionSet
    On Error Resume Next
    Set ssetA = ThisDrawing.SelectionSets.Add(iSSetName)
    If Err.Number <> 0 Then
    Set ssetA = ThisDrawing.SelectionSets(iSSetName)
    ssetA.Delete
    Set ssetA = ThisDrawing.SelectionSets.Add(iSSetName)
    Err.Clear
    End If
    On Error GoTo 0
    Set Aset = ssetA
    End Function
    Sub GetEntities()
    Dim Sm As AcadEntity
    Dim Alss As AcadSelectionSet
    Set Alss = Aset("AllOfThem")
    Alss.Select acSelectionSetAll
    For Each Sm In Alss
    MsgBox Sm.ObjectName
    Next
    End Sub[/VBA]

  3. #3
    Ok, Thank you very much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •