TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: kruuger on March 22, 2017, 11:10:48 AM

Title: Add dictionary with DBX
Post by: kruuger on March 22, 2017, 11:10:48 AM
hello
is it possible to add dictionary with dbx?
like:
Code: [Select]
(cd:DCT_AddDict (namedobjdict) "ADS_SETTINGS")thanks
Title: Re: Add dictionary with DBX
Post by: dgorsman on March 22, 2017, 11:41:20 AM
As in, using ObjectDBX to side-load a file?  Yes, it is.  If that's an "AutoCAD owned" dictionary ("ADS" rings a bell) you're responsible for getting everything right.
Title: Re: Add dictionary with DBX
Post by: roy_043 on March 22, 2017, 11:57:14 AM
As in, using ObjectDBX to side-load a file?  Yes, it is.
You are right but you have to use VL functions to do so. Using entmake is not possible in this case.
Title: Re: Add dictionary with DBX
Post by: Lee Mac on March 22, 2017, 02:41:56 PM
Essentially use the following process applied to an ObjectDBX Document object:
Title: Re: Add dictionary with DBX
Post by: kruuger on March 23, 2017, 04:42:39 PM
Essentially use the following process applied to an ObjectDBX Document object:
  • vla-get-dictionaries applied to ObjectDBX Document object to obtain Dictionaries Collection
  • vl-catch-all-apply 'vla-item on Dictionaries Collection to check if target dictionary already exists
  • If dictionary doesn't exist, vla-add to Dictionaries Collection with dictionary name to create it
  • vl-catch-all-apply 'vla-getobject on Dictionary object to check if target xrecord already exists
  • If xrecord doesn't exist, vla-addxrecord to Dictionary object with xrecord name to create it
  • vla-getxrecorddata to obtain existing xrecord data
  • vla-setxrecorddata to set xrecord data
hi Lee, thanks for the list. will see if i can handle this.
kruuger