Posts: 5
Registered: ‎03-20-2013
Message 1 of 3 (163 Views)

Selection Set from model space BTR

163 Views, 2 Replies
07-11-2013 05:17 AM

Im trying to get a selection of certain objects from the modelspace btr of a dwg im opening in code (not in the active autocad window) but failing horribly.


Can anyone point me in the right direction?


Heres a cut down version of code showing where im at until I get to the selection part.


Dim objDB As New Database(False, True)
objDB.ReadDwgFile(filePath, FileShare.Read, False, "")

Using trans As Transaction = objDB.TransactionManager.StartTransaction
   Dim bt As BlockTable = trans.GetObject(objDB.BlockTableId, OpenMode.ForRead, False)
   Dim btr As BlockTableRecord = trans.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForRead)          

End Using

 I've tried a few different things past this point but nothing seems to work.  Any advise/code snippets would be appreciated.


Posts: 1,417
Registered: ‎04-09-2008
Message 2 of 3 (155 Views)

Re: Selection Set from model space BTR

07-11-2013 06:27 AM in reply to: RobJG

Selection Set makes sense only with dwg-file opened in AutoCAD editor.

Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Posts: 5
Registered: ‎03-20-2013
Message 3 of 3 (150 Views)

Re: Selection Set from model space BTR

07-11-2013 07:02 AM in reply to: Alexander.Rivilis

Yeah, this has just occured to me too.


Currently working with the objectIDs in the btr now to see if I can do what I want.



Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.