CAD Forum ► EN ► AutoCAD ► How to remove prompt and specify block name
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)))
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!
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!