AutoCAD Electrical
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Block Name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
How to Get Block Name from Current drawing using vb.net?
Dim objEditor As Editor = Autodesk.AutoCAD.ApplicationServices.Application.D
Dim objDocument As Document = Autodesk.AutoCAD.ApplicationServices.Application.D
Dim objDatabase As Database = objEditor.Document.Database
Dim symbolNames As String
Using objTransaction As Transaction = objDatabase.TransactionManager.StartTransaction()
Dim objBlockTable As BlockTable
objBlockTable = TryCast(objTransaction.GetObject(objDatabase.Block
Dim objBlockTableRecord As BlockTableRecord
objBlockTableRecord = TryCast(objTransaction.GetObject(objBlockTable(Blo
For Each acObjId As ObjectId In objBlockTableRecord
symbolNames = acObjId.ObjectClass.DxfName
Next
End Using
when Iam using the above code,I get all object name...but i did not get block name,instead of that i got "INSERT" as a Block name...I want to get Block name correctly...How to get it?
Re: Block Name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Using this code, you are asking for the DXFNAME og the object class, wich is INSERT (i.e. a Block Reference).
You will have to check the Name-property of this block refrence for what you are looking for.
THL
Please select "Accept As Solution" if this post answers your question. Kudos don't hurt either. ;-)
