Author Topic: SafeArray Helps  (Read 2376 times)

0 Members and 1 Guest are viewing this topic.

velasquez

  • Newt
  • Posts: 195
SafeArray Helps
« 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

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: SafeArray Helps
« Reply #1 on: July 03, 2009, 04:01:55 PM »
Post what you have tried so far.
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.

velasquez

  • Newt
  • Posts: 195
Re: SafeArray Helps
« Reply #2 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

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: SafeArray Helps
« Reply #3 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.
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.

velasquez

  • Newt
  • Posts: 195
Re: SafeArray Helps
« Reply #4 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.