Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
.NET
»
Topic:
Named Object Dictonary
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Named Object Dictonary (Read 1333 times)
0 Members and 1 Guest are viewing this topic.
poncelet
Guest
Named Object Dictonary
«
on:
March 09, 2012, 09:56:25 AM »
Hello,
Can we create a new dictionary under Named Object Dictonary (NOD) and put there our xrecords?
Logged
poncelet
Guest
Re: Named Object Dictonary
«
Reply #1 on:
March 09, 2012, 11:11:30 AM »
Found it:
Code - vb.net:
[Select]
Dim
ed
As
Editor
=
Application
.
DocumentManager
.
MdiActiveDocument
.
Editor
Dim
dLock
As
DocumentLock
=
Application
.
DocumentManager
.
MdiActiveDocument
.
LockDocument
Using
trans
As
Transaction
=
ed
.
Document
.
Database
.
TransactionManager
.
StartTransaction
Try
Dim
nod
As
DBDictionary
=
trans
.
GetObject
(
ed
.
Document
.
Database
.
NamedObjectsDictionaryId
, OpenMode
.
ForRead
)
If
Not
nod
.
Contains
(
"i love to hate .net"
)
Then
nod
.
UpgradeOpen
(
)
Dim
Dict
As
New
DBDictionary
nod
.
SetAt
(
"i love to hate .net"
, Dict
)
trans
.
AddNewlyCreatedDBObject
(
Dict,
True
)
End
If
Catch
ex
As
System
.
Exception
ed
.
WriteMessage
(
vbCr
&
"Dictionary creation failed"
)
End
Try
trans
.
Commit
(
)
dLock
.
Dispose
(
)
End
Using
If you use VBA try this:
Code - vb.net:
[Select]
ThisDrawing
.
Dictionaries
.
Add
(
"i love to hate .net"
)
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
.NET
»
Topic:
Named Object Dictonary