TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: taner on July 12, 2009, 09:10:09 PM
-
Hi,
vlax-dump-object can list the object's properties. Similarly, I need a function can gather the object's properties
so that the propertiy's name can buildup a list.
Say test is the function, (test circleobj)can get a list of the circle object's properties name,just lick("Area" "Center" "Circumference" "Layer" "Linetype" " Lineweight" " Material "Normal"
" PlotStyleName" "Radius" "Thickness" and other property).
Any one can help me?
Thanks in advance.
-
Perhaps make a list of ALL available properties for ALL objects
Then when you select your object, test vlax-property-available-p with each property, if it returns true get the property value and save the property name and value into an association list.
... but really, the method depends on what you want to use the resulting data for ..
regards
Kerry
-
I used an idea along the same lines here:
http://www.theswamp.org/index.php?topic=29276.0 (http://www.theswamp.org/index.php?topic=29276.0)
And a similar thing here:
http://www.theswamp.org/index.php?topic=28710.0 (http://www.theswamp.org/index.php?topic=28710.0)
Lee
-
a very nice method is here
http://www.theswamp.org/index.php?topic=19890.0
-
(defun C:VDOT (/ OBJ)
(vl-load-com)
(vlax-dump-object
(setq OBJ (vlax-ename->vla-object
(car (entsel "\n* Select object to examine Methods and Properties *"))
)
)
T
)
(textscr)
(prin1)
)
-
Hi,
vlax-dump-object can list the object's properties. Similarly, I need a function can gather the object's properties
so that the propertiy's name can buildup a list.
Say test is the function, (test circleobj)can get a list of the circle object's properties name,just lick("Area" "Center" "Circumference" "Layer" "Linetype" " Lineweight" " Material "Normal"
" PlotStyleName" "Radius" "Thickness" and other property).
Any one can help me?
Thanks in advance.
It is not mine.
;;*//*/*/*/*/*/*/*/*/*/*/*/*/**/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
;;
;; -- DEFUN ax-get-properties
;;RETIREVE listed property values from an object
;; Recupera los valores de las propiedades especificadas de un objeto.
;; Copyright: en AutoCAD - ©2005 scaner, Spain."
;; ... / ...
;; Arguments [Type]:
;; Obj = ActiveX object [VLA-object]
;; lst = props-list [LIST]
;; lst = Lista de propiedades [LIST]
;; Retorna [Type]:
;; dotted pairs list
;; lst = Lista de pares punteados '(("Pro1" . "Val1")...) [LIST]
;; car -> Prop (symbol) [SYM]
;; cdr -> propie value [REAL/INT/STR/variant ]
;; Notas:
;; it check if prop is available
;; Comprueba si las propiedades están disponibles para el objeto.
;;
(defun ax-get-properties (Obj lst / lstPro)
(foreach x lst
(if (vlax-property-available-p Obj x)
(setq lstPro (cons (cons x (vlax-get-property Obj x)) lstPro))
)
)
(reverse lstPro)
)
;;