Hello all,
I am really just looking to simplify my program.
This program justs inserts a block at a selected point and uses the selected point as a layer setting.
I am sure there is a better way.
Edit: I do desire to preview the block as I insert it.
Thanks all in advance
Code:
;bn = block name
;bs = block scale
;rl = referenced layer
(defun C:xxx (/ sp1 bn bs rlay)
(setq bn "XXX")
(setq bs (getvar "Dimscale"))
(command "undo" "mark")
(command "-insert" bn "s" bs "r" 0 pause)
(setq sp1 (getvar "lastpoint"))
(command "undo" "back")
(command "laymcur" sp1)
(setq rl (getvar "clayer"))
(command "-insert" bn "s" bs "r" 0 "non" sp1)
(command "Change" (entlast) "" "P" "LA" rl "")
(princ))