Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Attribute VB_Name = "Module1"
- Sub zad2()
- Dim ModelSpace As AcadModelSpace
- Set ModelSpace = ActiveDocument.ModelSpace
- Dim sset As AcadSelectionSet
- Dim tempSet As AcadSelectionSet
- Dim blockref As AcadBlockReference
- Dim atr As Variant
- Dim tagstr As String
- Dim txtstr As String
- Dim fType(0) As Integer
- Dim fData(0) As Variant
- For Each tempSet In ThisDrawing.SelectionSets
- If tempSet.Name = "SS1" Then
- Set sset = ThisDrawing.SelectionSets("SS1")
- Else
- Set sset = ThisDrawing.SelectionSets.Add("SS1")
- End If
- Next
- sset.Clear
- sset.SelectOnScreen
- Set blockref = sset.Item(0)
- atr = blockref.GetAttributes
- tagstr = atr(0).TagString
- txtstr = atr(0).TextString
- fType(0) = 2 'filtr DXF, który wskazuje na bloki
- fData(0) = tagstr ' jaki blok nas interesuje (po nazwie)
- sset.Select acSelectionSetAll, , , fType, fData ' zaznacz wszystkie obiekty, które są blokiem o danej nazwie
- sset.Highlight (True)
- Application.Update
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement