Author Topic: request Dictionary with DCL-listbox  (Read 2244 times)

0 Members and 1 Guest are viewing this topic.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
request Dictionary with DCL-listbox
« on: February 27, 2013, 06:14:59 AM »
Hello!

I have an idea, to set and request dictionaries from Autocad.database = forexample define a dictionary that haves project specify types. Have anybody an example to can write an dictionary which include a list ((0 . "projectname") (1 . "date") (2 . "props..")). I don´t know which Lispfunction would be intressting to do this. I think I need a read- and write function. How does it look like ?
« Last Edit: February 27, 2013, 07:47:57 AM by cadplayer »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: request Dictionary with DCL-listbox
« Reply #1 on: February 27, 2013, 08:07:45 AM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: request Dictionary with DCL-listbox
« Reply #2 on: February 27, 2013, 08:26:26 AM »
I think different, it would be nice if I could save standard textblocks in dictionaries which I always use in my drawings and request them if I need...

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: request Dictionary with DCL-listbox
« Reply #3 on: February 27, 2013, 08:34:14 AM »
For the rest why not use a Drawing Property? E.g. http://www.theswamp.org/index.php?topic=21308.0

Else if you're dead set on using dictionaries, then the base for dictionaries linked to the DWG as a whole is the ename returned by NamedObjDict. So you'd basically create a Dictionary (using entmake) to add it to that "overall" dictionary using DictAdd. Then for each of your values you'd create an XRecord and DictAdd those to the custom dictionary you created.

IMO the dictionary idea seems a lot more complex than simply working with custom dwg properties. And you don't get any benefit between the 2. Actually you can have attributes / text link to properties, but not to dictionaries. That would make your "standard" blocks a lot simpler too.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: request Dictionary with DCL-listbox
« Reply #5 on: February 27, 2013, 10:49:46 AM »
Fantastic ! I understand now how read and write dictionaries, but what is about if I have saved a own dictionary in a drawing and want to be change something...
(dictremove (namedobjdict) "DWGPROPS") ; erase only my dictionary
(dictadd (namedobjdict) "DWGPROPS" (entmakex xlist)) ; redifine my dictionary

Have I missed something?


kruuger

  • Swamp Rat
  • Posts: 637
Re: request Dictionary with DCL-listbox
« Reply #7 on: February 27, 2013, 12:19:49 PM »
Fantastic ! I understand now how read and write dictionaries, but what is about if I have saved a own dictionary in a drawing and want to be change something...
(dictremove (namedobjdict) "DWGPROPS") ; erase only my dictionary
(dictadd (namedobjdict) "DWGPROPS" (entmakex xlist)) ; redifine my dictionary

Have I missed something?
http://cad.pl/ftp/Pack/v1/CADPL-Pack-v1.lsp
go to DCT section. collection of dictionary function with sample.
k.
« Last Edit: February 27, 2013, 12:23:30 PM by kruuger »

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: request Dictionary with DCL-listbox
« Reply #8 on: February 27, 2013, 01:33:40 PM »
Thanks for all great stuff, thats was exactly what I want have. Enough to read now :wink:

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: request Dictionary with DCL-listbox
« Reply #9 on: February 27, 2013, 03:52:07 PM »
Homework  :-)
< .. >

I bet you'd make a great librarian Alan !!
Just wanted to acknowledge your excellent continuing contribution.

Regards,
Kerry
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: request Dictionary with DCL-listbox
« Reply #10 on: February 27, 2013, 04:05:02 PM »
Well thank you Sir, kind of you to say.  :-D


I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.