Display full version of the post: How to remove prompt and specify block name

kameron1967
14.03.2011, 15:55
I'm looking to replace the selection option to it automatically selecting "BlockA".  How would you change this, please.
Code:
(setq ss (nth 3  (vlax-invoke    (vlax-ename->vla-object (car (entsel "\nSelect Block: ")))    'GetAttributes)))

CarlB
14.03.2011, 20:55
One way:
 
Instead of
(car (entsel "\nSelect Block: "))
use
 
(ssname (ssget "_X" '((0 . "INSERT")(2 . "BlockA"))) 0)

kameron1967
14.03.2011, 21:49
Carl - does it replace the code above?  If not, I wonder how I would put that information in there so that it reads the block name, instead of asking for it.  Thanks!

CarlB
14.03.2011, 23:10
This is the complete code after substitution:
 
(setq ss (nth 3  (vlax-invoke    (vlax-ename->vla-object        (ssname (ssget "_X" '((0 . "INSERT")(2 . "BlockA"))) 0))    'GetAttributes)))

kameron1967
14.03.2011, 23:26
Excellent.  Thanks, CarlB!