Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

insert block lisp

1 REPLY 1
SOLVED
Reply
Message 1 of 2
a.tawkXHKN6
171 Views, 1 Reply

insert block lisp

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)
)

1 REPLY 1
Message 2 of 2
Kent1Cooper
in reply to: a.tawkXHKN6

[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)

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost