Block Insertion Lisp/ Palette command - - HELP!
I'm trying to create what should be a very simple lisp routine, or maybe something that can just be put into the pallet as a macro command. Either way; I'm happy as long as it works.
I need to insert a block named grdot into the drawings, but there are variables. I need it to match the annotation scale, plus a user input prompt for either sheet size B, or D.
If it's D size, then the block needs to be inserted at twice the annotation scale, for B size, it would just need to be scaled at the annotation scale.
I'm not having any luck figuring it out and and I'm relatively new at lisp.
1 Attachment(s)
Re: Block Insertion Lisp/ Palette command - - HELP!
Please upload a sample.dwg
Re: Block Insertion Lisp/ Palette command - - HELP!
You could write it all in one line or what would be better would be to use a lisp that you pass the block name.
not tested
Code:
macro
^c^c^p(if (not insblk)(load "insblk"))(insblk "grdot"))
lisp file
(defun insblk (bname / sheet sz )
(setq sheet (strcase (getstring "Enter sheet size B or D")))
(cond
((= sheet "B")(setq sz 2.0))
((= sheet "D")(setq sz 1.0))
)
(command "-insert" (getpoint) bname sz 0.0)
)