Please help me VBA code.
How can I to get all Object's name in a dwg?
etc: TEXT, MTEXT, DIMENSION, LINE, CIRCLE....
Thanks.
Please help me VBA code.
How can I to get all Object's name in a dwg?
etc: TEXT, MTEXT, DIMENSION, LINE, CIRCLE....
Thanks.
[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]
Ok, Thank you very much.