TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Peter2 on January 07, 2021, 06:22:46 AM

Title: Tool for displaying / handling dictionaries?
Post by: Peter2 on January 07, 2021, 06:22:46 AM
Is there a tool for a simple display (or handling?) dictionaries? Like the name, the size, the content? The "ArxDbg Utility" covers a part of this functions, but shows mainly the "database background" and not the user-side ...
Title: Re: Tool for displaying / handling dictionaries?
Post by: BIGAL on January 07, 2021, 06:06:19 PM
Your question is a bit vague what is it your trying to do, look inside  a dictionary.

This shows how to look for a dictionary name. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/listing-dictionaries/td-p/1522830
a example
Code: [Select]
(defun GetKVPairs (e / return xD esriD att key val)
;Get Key/Value Pairs
(setq return '())
(if (and (setq xD (cdr (assoc 360 (entget e))))
(setq esriD (cdr (assoc -1 (dictsearch xD "ESRI_ATTRIBUTES")))))
  (progn
    (setq att (entget esriD))
    (while (setq att (member (assoc 3 att) att))
      (setq key (cdr (car att))
    val (cdr (assoc 1 (entget (cdr (car (setq att (cdr att))))))))
      (setq return (cons (cons key val) return))
    );while
    (setq return (reverse return))
  );progn
;else
  (setq return nil)
);if
return
);defun
Title: Re: Tool for displaying / handling dictionaries?
Post by: Peter2 on January 10, 2021, 12:53:24 PM
@BIGAL
thanks, works fine for me.
Title: Re: Tool for displaying / handling dictionaries?
Post by: dgorsman on January 12, 2021, 01:51:08 PM
I've normally used the VLIDE, through the watch window.  Sometimes dumping results to the log.  A bit primitive maybe, but gets the info I need.