.NET

.NET

Reply
New Member
jae_irc
Posts: 2
Registered: ‎09-25-2006
Message 1 of 3 (226 Views)

CreateExtensionDictionary to blockreference

226 Views, 2 Replies
09-25-2006 12:54 PM
I'm trying to create an extension dictionary for a blockreference but autocad tall me eNoDatabase

here is the code

Dim db As Database = HostApplicationServices.WorkingDatabase
Dim trans As Transaction = db.TransactionManager.StartTransaction()
Dim bt As BlockTable = trans.GetObject(db.BlockTableId, OpenMode.ForWrite)
Dim btr As BlockTableRecord = trans.GetObject(bt.Item(BlockTableRecord.ModelSpace), OpenMode.ForWrite)
Dim newBtrId As ObjectId = CreateEmployeeDefinition()
Dim br As BlockReference = New BlockReference(New Point3d(10, 10, 0), newBtrId)
Dim brExtDict As DBDictionary

Dim name As Xrecord = New Xrecord
Dim salary As Xrecord = New Xrecord
Dim division As Xrecord = New Xrecord

name.Data = New ResultBuffer(New TypedValue(DxfCode.Text, "Earnest Shackleton"))
salary.Data = New ResultBuffer(New TypedValue(DxfCode.Real, 7200))
division.Data = New ResultBuffer(New TypedValue(DxfCode.Text, "Sales"))

' Se cae al tratar de crear el diccionario para el blockreference

br.CreateExtensionDictionary()

the last line is where crash the code,
any help it's good recived
Distinguished Contributor
Alexander Rivilis
Posts: 303
Registered: ‎09-26-2004
Message 2 of 3 (226 Views)

Re: CreateExtensionDictionary to blockreference

09-25-2006 03:04 PM in reply to: jae_irc
I've not tested but think that you must add br to btr before br.CreateExtensionDictionary()
New Member
jae_irc
Posts: 2
Registered: ‎09-25-2006
Message 3 of 3 (226 Views)

Re: CreateExtensionDictionary to blockreference

09-26-2006 06:32 AM in reply to: jae_irc
Thanks a lot i thonk the same during the night :smileyhappy:
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.