TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: velasquez on July 03, 2009, 03:57:07 PM

Title: SafeArray Helps
Post by: velasquez on July 03, 2009, 03:57:07 PM

I am not getting to work with the syntax for  (mapcar ´vla-put-layer ...
with Safearray and  SafeArray value 
Does anybody can me to help?

Thanks
Title: Re: SafeArray Helps
Post by: CAB on July 03, 2009, 04:01:55 PM
Post what you have tried so far.
Title: Re: SafeArray Helps
Post by: velasquez on July 03, 2009, 04:28:47 PM
(if (ssArray
      (= (type ssArray) 'safeArray)
;;;is the safeArray made of vlax-object's
      (= (vlax-safeArray-type ssArray) 9)
    ) ;_ fim de and
  (mapcar 'vla-put-layer
     (car (safeArray-value ssArray))
     "TestLayer"
  ) ;_ fim de mapcar
) ;_ fim de if
Title: Re: SafeArray Helps
Post by: CAB on July 03, 2009, 04:43:54 PM
Would you mind explaining the bigger picture?
Most of the time a safearray is not needed, only a list.
Title: Re: SafeArray Helps
Post by: velasquez on July 03, 2009, 05:06:58 PM
HI CAB 
I got to work with vla-put-layer using SSGET. 
But I need to learn more on Safearray.   
Does the function below use ' vla-delete how to work with vla-put-layer or vla-put-color?

 
Code: [Select]
;;;delete objects
  (if (and flag
   ssArray
   (= (type ssArray) 'safeArray)
;;;is the safeArray made of vlax-object's
   (= (vlax-safeArray-type ssArray) 9)
      ) ;_ fim de and
    (mapcar 'vla-delete (safeArray-value ssArray))
  ) ;_ fim de if

Thank you.