Jump to content

Create List for multiple Dynamic Block Selection


MMS

Recommended Posts

I have problem with my code especially for create list multiple selection. I choose more than one object but the result still have one list.

_$ 

GETDYNPROPS 

<Selection set: 1b> 
0 
nil 
4 
_$ 

Could someone give explanation where's wrong with my code.

 

;mencari data 
(defun getdynprops (obj / v)
 (vl-remove-if 'null
   (mapcar '(lambda (x)
             (if (setq v (vlax-variant-value (vla-get-value x))) 
             (cons (vla-get-propertyname x) v)))
   (vlax-safearray->list
     (vlax-variant-value
       (vla-getdynamicblockproperties obj)))))
)
;--------------
(vl-load-com)
(setq ss (ssget ))
(setq i 0)
;(setq ssd (ssadd))
(setq LiSS '())
(repeat (sslength ss)
 (setq i i)
 (setq ename (ssname ss i))
 (setq vevo (vlax-ename->vla-object ename))
 (setq LVevo (cdr(car(getdynprops vevo))))
 (setq LiVevo (cons LVevo LiSS))
 (setq i (1+ i))
 );repeat

Link to comment
Share on other sites

Change:

 

(setq LiVevo (cons LVevo LiSS))

To:

 

(setq LiSS (cons LVevo LiSS))

 

Then check the value of the 'LiSS' variable.

 

Make sure you localise your variables though!!

Link to comment
Share on other sites

Change:

 

(setq LiVevo (cons LVevo LiSS))

To:

 

(setq LiSS (cons LVevo LiSS))

 

Then check the value of the 'LiSS' variable.

 

Make sure you localise your variables though!!

 

Hi Lee,

 

Thanks for your explanation. Done :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...