the below routine insert a block from a drawing called My-Library.dwg that included many blocks. it works fine when the inserted block is scaled uniformly. but for the blocks that are not the routine doesn't work. it should be fixed so that it works on both block types that are uniform and non-uniform scaled.
(defun c:test ()
(setq lay (getvar "CLAYER"))
(command "_.layer" "_M" "LAYERNAME" "_c" "1" "" "")
(command "_.insert" "My-Library") (command)
(setq pt1 (getpoint "select base point: "))
(command "_.insert" "blockname" pt1 "" PAUSE "")
(command "setvar" "clayer" lay)
(princ)
)
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
[If that's the one that works for Blocks defined for uniform scaling, and the PAUSE is for the rotation, you have an extraneous Enter "" at the end.]
Use the Scale option within the INSERT command, before the insertion point, and it will take one scale regardless, and not need to ask for one for some Blocks but two for others:
(command "_.insert" "blockname" "_scale" 1 pt1 PAUSE)