- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Forum,
I have a block used several times on an Autocad sheet and I want to get each instance as well as all of its attributes. The name of the block is called "MASS INTERMEDIATE DYNAMIC". I can't seem to get the count of the amount of instances used on the drawing and get the attributes. The code below only returns one instance of the block but I know it's used 20 times on my autocad sheet.
Dim acad1 As AcadApplication
acad1 = Marshal.GetActiveObject("Autocad.Application")
Dim oDoc As AcadDocument = acad1.ActiveDocument
Dim oblocks As AcadBlocks = oDoc.Blocks
Dim sblock As String = "MASS INTERMEDIATE DYNAMIC"
Dim blockname As String
For Each oblock As AcadBlock In oblocks
blockname = oblock.Name
If Not InStr(1, blockname, sblock) > 0 Then Continue For
Debug.Print(blockname)
Next
Thanks,
Felix
Solved! Go to Solution.