Author Topic: Help with vlax-safeArray-fill  (Read 1736 times)

0 Members and 1 Guest are viewing this topic.

velasquez

  • Newt
  • Posts: 195
Help with vlax-safeArray-fill
« on: August 13, 2009, 07:35:35 PM »
Hi
I need help with vlax-safeArray-fill
 
1 - I created a selection group called MySS with ssget. 
2 - I worked this selection group with ssadd and ssdel. 
3 - some entities were modified with the command Trim and the command Extend. 

My problem is: 
How to update the entities of the selection group MySS to create a vlax-safeArray-fill? 

I will work with MySS in -> (vla-add (vla-get-blocks JoyDoc) (vlax-3d-point pt) BlkName)

Thanks

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Help with vlax-safeArray-fill
« Reply #1 on: August 13, 2009, 09:43:26 PM »
Do you really need a safe array?

Could you explain what you are trying to do with the selection set?
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.

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Help with vlax-safeArray-fill
« Reply #2 on: August 14, 2009, 05:17:01 AM »
If you are trying to add the objects to the block definition in VL, I would recommend the vla-copyobjects method, to copy the objects to the block space.

See here:

http://www.theswamp.org/index.php?topic=29637.msg351646#msg351646

velasquez

  • Newt
  • Posts: 195
Re: Help with vlax-safeArray-fill
« Reply #3 on: August 14, 2009, 08:26:41 AM »
The selection group MySS was modified. 
If I try to create a block with VisualLisp -> (JoyAddBlock "TEST1" pt1 MySS T)

I receive the error message below.
; error: lisp value has no coercion to VARIANT with this type:  nil

Code: [Select]
(defun JoyAddBlock (name pt ss flag / JoyDoc ssArray vla_block)
;;;Pega o documento ativo
  (setq JoyDoc (vla-get-activedocument (vlax-get-acad-object)))
  (vla-copyObjects
    JoyDoc
    (setq ssArray (JoySelectionSet->Array ss)) ;_ converte o conjunto de selecao
    (vla-add (vla-get-blocks JoyDoc) (vlax-3d-point pt) name)
  ) ;_ fim de vla-copyObjects
;;;Se o flag for T 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
;;;Descarta o objeto
  (vlax-Release-Object JoyDoc)
) ;_ fim de defun