VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get All Inserted Blocks

0 REPLIES 0
Reply
Message 1 of 1
meck
306 Views, 0 Replies

Get All Inserted Blocks

We have drawigs that many blocks references in them. All I need to do is know which blocks have been inserted in the drawing. I'm using VB.net 2010 and AutoCAD 2013. Here is my code...

 

Dim BlockSet AsAcadSelectionSet

Try

BlockSet = oAcadApp.ActiveDocument.SelectionSets.Add("InsertedBlocks")

Catch ex AsException

BlockSet = oAcadApp.ActiveDocument.SelectionSets.Item("InsertedBlocks")

BlockSet.Clear()

EndTry

Dim FilterType(0) AsInt16

Dim FilterData(0) AsObject

 

FilterType(0) = 0

FilterData(0) = "INSERT"

Dim FilterTypeObject AsObject

Dim FilterDataObject AsObject

FilterTypeObject = FilterType

FilterDataObject = FilterData

BlockSet.Select(AcSelect.acSelectionSetAll, , , FilterTypeObject, FilterDataObject)

MsgBox(BlockSet.Count)

 

 

I believe my lack of knowledge on the filtering is my biggest problem. In there a reference to all the types of filters that can be used?

I haven't been doing a lot of AutoCAD programming. Is there a help file like there is with Inventor?

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost