Jump to content

ssget to get a block by name


MiGo

Recommended Posts

  • 11 years later...
 On 9/16/2009 at 10:25 AM, Lee Mac said:

 


(ssget "_X" '((0 . "INSERT") (2 . "ISO_A1_Title_Block")))

 

 

Could you use this with a variable?

 

(setq BlkName (vla-get-effectivename (vlax-ename->vla-object (car (entsel "\nSelect block: "))))
(ssget "_X" '((0 . "INSERT") (2 . BlkName ))) ;SELECT BLOCK BY NAME

This doesn't seem to work.

Link to comment
Share on other sites

3 hours ago, mhupp said:

 

Could you use this with a variable?

 


(setq BlkName (vla-get-effectivename (vlax-ename->vla-object (car (entsel "\nSelect block: "))))
(ssget "_X" '((0 . "INSERT") (2 . BlkName ))) ;SELECT BLOCK BY NAME

This doesn't seem to work.

See if this sheds any light. You cannot use ' to quote a variable, LIST and CONS need to be used.

(setq blkname "Test")
(print '((0 . "INSERT") (2 . blkname)))
;;;((0 . "INSERT") (2 . BLKNAME))
(print (list '(0 . "INSERT") (cons 2 blkname)))
;;;((0 . "INSERT") (2 . "Test"))

 

  • Like 1
Link to comment
Share on other sites

Thank you rlx and ronjonp. used this to make a quick little lisp to draw a line to all the blocks of a given name from 0,0.

rlx been meaning to contact you about that lisp + dcl you help me with a few months back. Rather than using the lisp + DCL file went the route of using getfiled.

Edited by mhupp
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...