Author Topic: vlax-dump-object->List  (Read 1058 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2303
vlax-dump-object->List
« on: December 15, 2016, 03:40:58 pm »
Hi all,.

I'm looking to get a list of dump object..

something like:
Code: [Select]
(("Application (RO) =" #<VLA-OBJECT IAcadApplication 00007ff796ce44f8>)
  ("Area =" 4807.45)
  ("Center =" (2831.45 1200.59 0.0))
  ("Circumference =" 245.789)
  ("Diameter =" 78.2371)
  ....
  ....
  )

or even Text can be useful..
something like
Code: [Select]
(vl-princ-to-string (vlax-dump-object (vlax-ename->vla-object (car (entsel))) t))

Maybe anything simple to do that I don't know ? or any suggestion ?
Thank you
Keep smile...

Lee Mac

  • Seagull
  • Posts: 11732
  • AutoCAD 2015 Windows 7 London, England
Re: vlax-dump-object->List
« Reply #1 on: December 15, 2016, 03:57:47 pm »
The following is built on code I developed in conjunction with MP during a conversation a few years ago, it may prove useful:

Code: [Select]
(defun vlax-dump-object->list ( obj mth )
    (append
        (list
            (mapcar
                (function
                    (lambda ( prp )
                        (list prp (vlax-get obj prp))
                    )
                )
                (_GetObjectProperties obj)
            )
        )
        (if mth (list (_GetObjectMethods obj)))
    )
)

(defun _GetObjectProperties ( obj )
    (vl-remove-if-not
        (function
            (lambda ( prp )
                (vlax-property-available-p obj prp)
            )
        )
        (_GetVlaProperties)
    )
)

(defun _GetObjectMethods ( obj )
    (vl-remove-if-not
        (function
            (lambda ( mth )
                (vlax-method-applicable-p obj mth)
            )
        )
        (_GetVlaMethods)
    )
)

(defun _GetVlaAtoms ( )
    (eval
        (list 'defun '_GetVlaAtoms '( )
            (list 'quote
                (vl-sort
                    (vl-remove-if-not
                        (function
                            (lambda ( sym )
                                (wcmatch (vl-symbol-name sym) "vla`-*")
                            )
                        )
                        (atoms-family 0)
                    )
                    (function
                        (lambda ( a b )
                            (<
                                (vl-symbol-name a)
                                (vl-symbol-name b)
                            )
                        )
                    )
                )
            )
        )
    )
    (_GetVlaAtoms)
)

(defun _GetVlaProperties ( )
    (eval
        (list 'defun '_GetVlaProperties '( )
            (list 'quote
                (mapcar
                    (function
                        (lambda ( sym )
                            (substr (vl-symbol-name sym) 9)
                        )
                    )
                    (vl-remove-if-not
                        (function
                            (lambda ( sym )
                                (wcmatch (strcase (vl-symbol-name sym)) "VLA`-GET`-*")
                            )
                        )
                        (_GetVlaAtoms)
                    )
                )
            )
        )
    )
    (_GetVlaProperties)
)

(defun _GetVlaMethods ( )
    (eval
        (list 'defun '_GetVlaMethods '( )
            (list 'quote
                (mapcar
                    (function
                        (lambda ( sym )
                            (substr (vl-symbol-name sym) 5)
                        )
                    )
                    (vl-remove-if
                        (function
                            (lambda ( sym )
                                (wcmatch (strcase (vl-symbol-name sym)) "VLA`-GET`-*,VLA`-PUT`-*")
                            )
                        )
                        (_GetVlaAtoms)
                    )
                )
            )
        )
    )
    (_GetVlaMethods)
)

(vl-load-com) (princ)

Andrea

  • Water Moccasin
  • Posts: 2303
Re: vlax-dump-object->List
« Reply #2 on: December 15, 2016, 04:36:11 pm »
Wow !....amazing...  :smitten:

Thank you very much Lee..
I was thinking differently..

I'm on my way to create a quick tool helping me to have fast information when selecting an object .... :)

Keep smile...

MP

  • Seagull
  • Posts: 16940
  • brevity != aggression
Re: vlax-dump-object->List
« Reply #3 on: December 15, 2016, 04:37:54 pm »
Here's the original code posted about 11 years ago: link.
\|// Set goal. Experiment tirelessly until
|oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

Grrr1337

  • Bull Frog
  • Posts: 338
Re: vlax-dump-object->List
« Reply #4 on: December 15, 2016, 04:38:05 pm »
From my stash (studied from hmsilva):
Heres the original thread
Code: [Select]
(defun C:test ( / e o StrMark opn row LstRows rest n itm str LstDump newf newopn a )

(while (not (setq e (car (entsel "\nSelect object to dump to file: ")))) e)
(if (setq o (vlax-ename->vla-object e))
(progn
(SetVarP SysVars2 'cmdecho 0)
(setq StrMark (rtos (rem (getvar 'date) 1) 2 10))
(setvar 'LOGFILEMODE 1)
(princ (strcat "\n" StrMark "\n"))
(princ)
(foreach x (entget e) (print x)(princ "\n"))
(princ "\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n")
(princ)
(vlax-dump-object o T)
(princ)
(setvar 'LOGFILEMODE 0)

(if (setq opn (open (getvar 'LOGFILENAME) "r"))
(progn (while (setq row (read-line opn)) (if (> (strlen row) 0) (setq LstRows (cons row LstRows)))) (close opn))
      )
(if LstRows (progn (setq LstRows (reverse LstRows)) (setq LstRows (cdr (member StrMark LstRows)))))
(ListAlertEach LstRows)

(if
        (and
          LstRows
          (setq newf (getfiled "Create New TXT File" "" "txt" 1))
          (setq newopn (open newf "w"))
        )
        (progn
          (foreach x LstRows (write-line x newopn))
          (close newopn)
          (or a (setq a "Yes")) (initget "Yes No Y N")
          (setq a (cond ((getkword (strcat "\nDo you want to open the TXT file? [Yes/No] <" a ">: "))) ( a )))
          (if (member (strcase a) '("Y" "YES")) (startapp "explorer" newf))
        ); progn
      ); if

    ); progn
  ); if o

(princ)
);| defun |; (vl-load-com) (princ)

(defun SetVarP ( SysVarLst VarName Val ); <- UNTESTED !
(and
(= 'LIST (type SysVarLst))
(if (not (zerop (length SysVarLst))) (apply 'and (mapcar '(lambda (x) (= (length x) 3)) SysVarLst)))
(member VarName (mapcar 'car SysVarLst))
(not (vl-catch-all-error-p (vl-catch-all-apply 'setvar (list VarName Val))))
  )
);| defun SetVarP |; (vl-load-com) (princ)

(defun ListPrintEach ( Lst ) (if (listp Lst) (foreach x Lst (princ "\n") (print x))) (princ))
(defun ListAlertEach ( Lst ) (if (listp Lst) (alert (apply 'strcat (mapcar '(lambda (x) (strcat "\n" (vl-princ-to-string x))) Lst)))) (princ))
Entget, and Dump with option to save as TXT file, the only problem is that the List is contained entirely of strings.
Figured out to put the StrMark variable, so everytime the log file can be re-readen 8)

Andrea

  • Water Moccasin
  • Posts: 2303
Re: vlax-dump-object->List
« Reply #5 on: December 15, 2016, 04:43:51 pm »
Thank you Guys..  8-)
Keep smile...

Grrr1337

  • Bull Frog
  • Posts: 338
Re: vlax-dump-object->List
« Reply #6 on: December 15, 2016, 04:53:26 pm »
Thanks for sharing this, Lee!
Its not very friendly to LWpolylines:
Code: [Select]
_$ (vlax-dump-object->list (vlax-ename->vla-object (car (entsel))) nil)
Error: Invalid number of parameters
_1$

Here's the original code posted about 11 years ago: link.
WTH MP?!
 That thread is insane!!!  :uglystupid2:  :uglystupid2:  :angel:
After seeing this, now I'm subscribed to T.Willey's ideas!  :idea:

MP

  • Seagull
  • Posts: 16940
  • brevity != aggression
Re: vlax-dump-object->List
« Reply #7 on: December 15, 2016, 04:58:48 pm »
Tim is an awesome programmer and artist.
\|// Set goal. Experiment tirelessly until
|oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

Grrr1337

  • Bull Frog
  • Posts: 338
Re: vlax-dump-object->List
« Reply #8 on: December 15, 2016, 05:24:23 pm »
By the way Andrea, I had a similar idea. However I'm a "hobby programmer" so wrote only this (BrowseThruDictionaries - starting from the namedobjdict):

I used LM:ListBox to achieve this, but its actually unfinished, because wanted to include "back" button.
One day I might get it done  :cry2:

MP

  • Seagull
  • Posts: 16940
  • brevity != aggression
Re: vlax-dump-object->List
« Reply #9 on: December 15, 2016, 05:33:40 pm »
In before the deluge.

Wrote this back in 2010, first incarnation originated about 6 years prior.
\|// Set goal. Experiment tirelessly until
|oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

MP

  • Seagull
  • Posts: 16940
  • brevity != aggression
Re: vlax-dump-object->List
« Reply #10 on: December 15, 2016, 05:38:30 pm »
Also does the dxf data and yes -- everything is live linked -- can dance about the object model at will (sorry, no vid available):
\|// Set goal. Experiment tirelessly until
|oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

Grrr1337

  • Bull Frog
  • Posts: 338
Re: vlax-dump-object->List
« Reply #11 on: December 15, 2016, 05:43:58 pm »
In before the deluge.

Wrote this back in 2010, first incarnation originated about 6 years prior.

The conclusion is that this applies to you also mr.Puckett !   :grinwink:
Tim is an awesome programmer and artist.

MP

  • Seagull
  • Posts: 16940
  • brevity != aggression
Re: vlax-dump-object->List
« Reply #12 on: December 15, 2016, 05:54:34 pm »
Don't know about awesome but I'm stubborn and determined. The original was actually a dll I wrote using Visual Studio 6 enterprise. Mid 90's. It was slick and very graphical (icons for each data type) using a listview widget and was good for a couple versions, then knackered by Autodesk. Rewrote it in lisp exploiting a std type library dll. Worked for years then knackered again. Rewrote again in 2010 pure lisp. Fingers crossed its not knackered for awhile.
\|// Set goal. Experiment tirelessly until
|oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

kdub

  • SuperMod
  • Swamp Rat
  • Posts: 933
  • class keyThumper<T>:ILazy<T>
Re: vlax-dump-object->List
« Reply #13 on: December 15, 2016, 06:06:19 pm »
< ... >  (sorry, no vid available):

I remember a time when a whiff of a hint was appreciated.

don't get me started ....
called Kerry in my other life

Sometimes the question is more important than the answer.

Andrea

  • Water Moccasin
  • Posts: 2303
Re: vlax-dump-object->List
« Reply #14 on: December 15, 2016, 06:08:05 pm »
I knew that you guru did something like that...
awesome ! :)

but to be honest...I was thinking creating something like that since 2001,..:)
never had time.. haha :oops:

...you did very nice tools guys...congrats. :)
Keep smile...

Grrr1337

  • Bull Frog
  • Posts: 338
Re: vlax-dump-object->List
« Reply #15 on: December 15, 2016, 06:12:22 pm »
Don't know about awesome but I'm stubborn and determined.
IMO Thats a part from the definition of being awesome programmer.
The original was actually a dll I wrote using Visual Studio 6 enterprise. Mid 90's. It was slick and very graphical (icons for each data type) using a listview widget and was good for a couple versions, then knackered by Autodesk. Rewrote it in lisp exploiting a std type library dll. Worked for years then knackered again. Rewrote again in 2010 pure lisp. Fingers crossed its not knackered for awhile.
So you were rolling with a few languages, I thought once you started with one language you continue(d) with it.

Sounds interesting (for me - a person that never opened ACAD till 2010's)
I'm not gonna reveal when I was born to make you feel old, so Lets just say you are very experienced (append valuable).  :-o

MP

  • Seagull
  • Posts: 16940
  • brevity != aggression
Re: vlax-dump-object->List
« Reply #16 on: December 15, 2016, 06:50:13 pm »
Thanks for the complimentary thoughts. LISP was technically my fourth language if I get to count ladder logic. As for feeling old, worry not, the snow on the roof and sidewalk is a constant reminder. :cry:
\|// Set goal. Experiment tirelessly until
|oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

MP

  • Seagull
  • Posts: 16940
  • brevity != aggression
Re: vlax-dump-object->List
« Reply #17 on: December 16, 2016, 01:52:36 am »
I remember a time when a whiff of a hint was appreciated.

don't get me started ....

The internet has become a demanding mistress?
\|// Set goal. Experiment tirelessly until
|oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

kdub

  • SuperMod
  • Swamp Rat
  • Posts: 933
  • class keyThumper<T>:ILazy<T>
Re: vlax-dump-object->List
« Reply #18 on: December 16, 2016, 02:09:09 am »
I remember a time when a whiff of a hint was appreciated.

don't get me started ....

The internet has become a demanding mistress?

Essentially yes .. which is incredible since it is an object without volition.
called Kerry in my other life

Sometimes the question is more important than the answer.

Andrea

  • Water Moccasin
  • Posts: 2303
Re: vlax-dump-object->List
« Reply #19 on: December 16, 2016, 01:21:58 pm »
just showing where i'm going with this...
not finished yet,..to much idea on table..
:)



Keep smile...

MP

  • Seagull
  • Posts: 16940
  • brevity != aggression
Re: vlax-dump-object->List
« Reply #20 on: December 16, 2016, 01:24:41 pm »
Nicely done. Reminds me of my old dll version. But nicer.
\|// Set goal. Experiment tirelessly until
|oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

MP

  • Seagull
  • Posts: 16940
  • brevity != aggression
Re: vlax-dump-object->List
« Reply #21 on: December 16, 2016, 01:28:06 pm »
Make sure it will also make a hard copy, I find it very useful:

================================================================================

<Dwg: OMG.dwg> <Object: AcDbPolyline "2BC9">

====================================== PROPERTIES ==============================

Application®                           <Object: IAcadApplication>
Area®                                  447.23669466
Closed                                 :vlax-false
Color                                  256
ConstantWidth                          1.0
Coordinate                             
Coordinates                            (438.02349191 103.48063257 438.02349191 ... 171.07034114)
Database®                              <Object: IAcadDatabase>
Document®                              <Object: IAcadDocument>
Elevation                              0.0
EntityTransparency                     "ByLayer"
Handle®                                "2BC9"
HasExtensionDictionary®                :vlax-false
Hyperlinks®                            <Object: IAcadHyperlinks>
Layer                                  "HIDDEN"
Length®                                84.48966663
Linetype                               "BYLAYER"
LinetypeGeneration                     :vlax-true
LinetypeScale                          1.0
LineWeight                             -1
Material                               "ByLayer"
Normal                                 (0.0 0.0 1.0)
ObjectID®                              49
ObjectID32®                            49
ObjectName®                            "AcDbPolyline"
OwnerID®                               48
OwnerID32®                             48
PlotStyleName                          "ByLayer"
Thickness                              0.0
TrueColor                              <Object: IAcadAcCmColor>
Visible                                :vlax-true
                                       
====================================== DXF DATA ================================

  -1                                   <Ename: LWPOLYLINE "2BC9">
   0                                   "LWPOLYLINE"
 330                                   <Ename: BLOCK_RECORD "86">
   5                                   "2BC9"
 100                                   "AcDbEntity"
  67                                   1
 410                                   "Layout1"
   8                                   "HIDDEN"
 100                                   "AcDbPolyline"
  90                                   6
  70                                   128
  43                                   1.0
  38                                   0.0
  39                                   0.0
  10                                   (438.02349191 103.48063257)
  40                                   1.0
  41                                   1.0
  42                                   0.0
  91                                   0
  10                                   (438.02349191 103.48063257)
  40                                   1.0
  41                                   1.0
  42                                   0.41421356
  91                                   0
  10                                   (443.02349191 108.48063257)
  40                                   1.0
  41                                   1.0
  42                                   0.0
  91                                   0
  10                                   (443.02349191 166.07034114)
  40                                   1.0
  41                                   1.0
  42                                   -0.41421356
  91                                   0
  10                                   (448.02349191 171.07034114)
  40                                   1.0
  41                                   1.0
  42                                   0.0
  91                                   0
  10                                   (459.2154867 171.07034114)
  40                                   1.0
  41                                   1.0
  42                                   0.0
  91                                   0
 210                                   (0.0 0.0 1.0)
                                       
====================================== METHODS =================================

AddRef                                 
AddVertex                              
ArrayPolar                             
ArrayRectangular                       
Copy                                   
Delete                                 
Erase                                  
Explode                                
GetBoundingBox                         
GetBulge                               
GetExtensionDictionary                 
GetIDsOfNames                          
GetTypeInfo                            
GetTypeInfoCount                       
GetWidth                               
GetXData                               
Highlight                              
IntersectWith                          
Invoke                                 
Mirror                                 
Mirror3D                               
Move                                   
Offset                                 
QueryInterface                         
Release                                
Rotate                                 
Rotate3D                               
ScaleEntity                            
SetBulge                               
SetWidth                               
SetXData                               
TransformBy                            
Update
                                 
\|// Set goal. Experiment tirelessly until
|oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

Andrea

  • Water Moccasin
  • Posts: 2303
Re: vlax-dump-object->List
« Reply #22 on: December 16, 2016, 02:09:12 pm »
Yes,...Thank you..is on the list..

if you notice,...when I clic on some #<Variant.... I use functions to get result..
so,..I'll do same thing for many other selection, like showing directly some info in AutoCAD.
I want to add also to allow to modify few value.. :)
Keep smile...

MP

  • Seagull
  • Posts: 16940
  • brevity != aggression
Re: vlax-dump-object->List
« Reply #23 on: December 16, 2016, 03:00:13 pm »
Thanks, did notice the mouse gesturing :) and best of luck with editing properties -- it can become a rabbit hole of validation.
\|// Set goal. Experiment tirelessly until
|oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

Grrr1337

  • Bull Frog
  • Posts: 338
Re: vlax-dump-object->List
« Reply #24 on: January 08, 2017, 06:06:30 am »
I really liked LM's suggestion, but was annoyed that it crashes on LWPOLYLINES / SPLINES, because of a properties with values of "...Indexed contents not shown...", so I performed the following modification (the hammer approach):

Code - Auto/Visual Lisp: [Select]
  1. (if (eq 'VLA-OBJECT (type obj))
  2.  (append
  3.    (list
  4.      (mapcar
  5.        (function
  6.          (lambda ( prp / prpval )
  7.            (if (not (vl-catch-all-error-p (setq prpval (vl-catch-all-apply 'vlax-get (list obj prp)))))
  8.              (list prp prpval)
  9.              (list prp nil)
  10.            )
  11.          )
  12.        )
  13.        (_GetObjectProperties obj)
  14.      )
  15.    )
  16.    (if mth (list (_GetObjectMethods obj)))
  17.  )
  18. )
  19.  

Soo for example when you have such property:
Code: [Select]
;   Coordinate = ...Indexed contents not shown...The list will turn it to:
Code: [Select]
("Coordinate" nil)
HTH, sorry for bumping this thread.

mailmaverick

  • Bull Frog
  • Posts: 350
Re: vlax-dump-object->List
« Reply #25 on: January 08, 2017, 10:24:16 am »
Courtesy Forum Members, my Code :

Code: [Select]
(defun c:LM_DumpObject (/ prop&methods)
  ;; Dumps Selected Object in a DCL Box having two List Boxes, one containing Object Properties and second containing Object Methods
  ;; Courtesy Lee Mac
  ;; Source : https://www.theswamp.org/index.php?topic=52409.0
  (vl-load-com)
  ;| -------------------------------------------------------------------------
------------------------------------------------------------------------------
          FUNCTION DEFINITIONS       
------------------------------------------------------------------------------
------------------------------------------------------------------------------
  |;
  ;;
  (defun vlax-dump-object->list (obj mth)
    (if (eq 'VLA-OBJECT (type obj))
      (append (list
                (mapcar (function
                          (lambda (prp / prpval)
                            (if (not (vl-catch-all-error-p (setq prpval (vl-catch-all-apply 'vlax-get (list obj prp)))))
                              (list prp prpval)
                              (list prp nil)
                            )
                          )
                        )
                        (_GetObjectProperties obj)
                )
              )
              (if mth
                (list (_GetObjectMethods obj))
              )
      )
    )
  )
  ;;
  (defun _GetObjectProperties (obj)
    (vl-remove-if-not (function (lambda (prp) (vlax-property-available-p obj prp))) (_GetVlaProperties))
  )
  ;;
  (defun _GetObjectMethods (obj)
    (vl-remove-if-not (function (lambda (mth) (vlax-method-applicable-p obj mth))) (_GetVlaMethods))
  )
  ;;
  (defun _GetVlaAtoms ()
    (eval (list 'defun
                '_GetVlaAtoms
                '()
                (list 'quote
                      (vl-sort (vl-remove-if-not
                                 (function (lambda (sym) (wcmatch (vl-symbol-name sym) "vla`-*")))
                                 (atoms-family 0)
                               )
                               (function (lambda (a b) (< (vl-symbol-name a) (vl-symbol-name b))))
                      )
                )
          )
    )
    (_GetVlaAtoms)
  )
  ;;
  (defun _GetVlaProperties ()
    (eval
      (list 'defun
            '_GetVlaProperties
            '()
            (list 'quote
                  (mapcar (function (lambda (sym) (substr (vl-symbol-name sym) 9)))
                          (vl-remove-if-not
                            (function (lambda (sym) (wcmatch (strcase (vl-symbol-name sym)) "VLA`-GET`-*")))
                            (_GetVlaAtoms)
                          )
                  )
            )
      )
    )
    (_GetVlaProperties)
  )
  ;;
  (defun _GetVlaMethods ()
    (eval
      (list 'defun
            '_GetVlaMethods
            '()
            (list 'quote
                  (mapcar (function (lambda (sym) (substr (vl-symbol-name sym) 5)))
                          (vl-remove-if
                            (function (lambda (sym) (wcmatch (strcase (vl-symbol-name sym)) "VLA`-GET`-*,VLA`-PUT`-*")))
                            (_GetVlaAtoms)
                          )
                  )
            )
      )
    )
    (_GetVlaMethods)
  )
  ;;
  (defun LM:ListBox2 (lis1 lis2 / DCH DCL DES)
    ;; Makes two List Boxes, each filled with supplied lists
    ;; lis1 : List1 to be appended in Left List Box
    ;; lis2 : List2 to be appended in Right List Box
    (defun *error* (msg)
      (if (and (= 'int (type dch)) (< 0 dch))
        (unload_dialog dch)
      )
      (if (= 'file (type des))
        (close des)
      )
      (if (and (= 'str (type dcl)) (setq dcl (findfile dcl)))
        (vl-file-delete dcl)
      )
      (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")))
        (princ (strcat "\nError: " msg))
      )
      (princ)
    )
    (if
      (and
        (setq dcl (vl-filename-mktemp "tmp.dcl"))
        (setq des (open dcl "w"))
        (write-line
          (strcat
            "listbox : list_box { }
          example : dialog { label = \"Dump Object\"; spacer; : row {
          : listbox { key = \"ls1\"; label =  \"Properties\"; width = 50; height = 20; fixed_width = false; fixed_height = false; multiple_select = false ; }
          : column {}
          : listbox { key = \"ls2\"; label =  \"Methods\"; width = 30; height = 20; fixed_width = false; fixed_height = false; multiple_select = false ; }}
          ok_only;}"
          )
          des
        )
        (not (setq des (close des)))
        (< 0 (setq dch (load_dialog dcl)))
        (new_dialog "example" dch)
      )
       (progn (if lis1
                (progn (start_list "ls1")
                       (foreach itm lis1
                         (add_list (strcat (vl-princ-to-string (car itm)) " = " (vl-princ-to-string (cadr itm))))
                       )
                       (end_list)
                )
              )
              (if lis2
                (progn (start_list "ls2") (foreach itm lis2 (add_list itm)) (end_list))
              )
              (start_dialog)
       )
    )
    (if (< 0 dch)
      (unload_dialog dch)
    )
    (if (setq dcl (findfile dcl))
      (vl-file-delete dcl)
    )
    (princ)
  )
  ;;
  ;| -------------------------------------------------------------------------
------------------------------------------------------------------------------
         ACTUAL PROGRAM STARTED       
------------------------------------------------------------------------------
------------------------------------------------------------------------------
  |;
  (setq prop&methods (vlax-dump-object->list (vlax-ename->vla-object (car (entsel))) T))
  (LM:ListBox2 (car prop&methods) (cadr prop&methods))
  (princ)
)

Run by typing LM_DumpObject in command prompt.

T.Willey

  • Needs a day job
  • Posts: 5184
Re: vlax-dump-object->List
« Reply #26 on: January 10, 2017, 09:19:35 am »
By the way Andrea, I had a similar idea. However I'm a "hobby programmer" so wrote only this (BrowseThruDictionaries - starting from the namedobjdict):
<snip>
You may be interested in this post then, as it is an entity walker program (not a full as MP's though): https://www.theswamp.org/index.php?topic=51751.0
Once the code is loaded, you can look through the NamedObjDict like
(ChaseEntData (NamedObjDict))

Tim is an awesome programmer and artist.
Thanks MP (for the compliment and all the help along the way).
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.