.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set DB Dictionary-Autocad.Net

3 REPLIES 3
Reply
Message 1 of 4
rajee_arch
1462 Views, 3 Replies

Set DB Dictionary-Autocad.Net

Anybody can help in coding or book reference for Set DBDictionary using VB.NET

Regards,
Raji
3 REPLIES 3
Message 2 of 4

could you be more specific, as to what you would like to do with the DBDictionary??????????

for example, here is some code one of my program uses to load layerstates into a form's listbox:

Dim db As Database = HostApplicationServices.WorkingDatabase
Dim LayState As DictionaryEntry
Dim oLSM As LayerStateManager
Dim oLSMDict As DBDictionary

Using trans As Transaction = db.TransactionManager.StartTransaction
Try
oLSM = db.LayerStateManager
oLSMDict = trans.GetObject(db.LayerStateManager.LayerStatesDictionaryId(True), OpenMode.ForRead)
Catch ex As Exception
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
ed.WriteMessage("*Error Ocurred in Loading Layer States*")
End Try
trans.Commit()
End Using
Form_LSM.tb_Name.Text = ""
Form_LSM.lb_LayStates.Items.Clear()

For Each LayState In oLSMDict
myForm.lb_LayStates.Items.Add(LayState.Key.ToString)
Next
Message 3 of 4

  • Can you create you own DBDictionary that is not attached to an entity?
Message 4 of 4
_gile
in reply to: gsbalajadia

Hi,

Yes you can add named dictionary to the NamedObjectsDictionary (see this topic).



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost