Lisp - Insert block and match scale to another block

Lisp - Insert block and match scale to another block

Anonymous
Not applicable
897 Views
1 Reply
Message 1 of 2

Lisp - Insert block and match scale to another block

Anonymous
Not applicable

Hi there,

 

Need a little help,

I require a LISP that will insert a new block and that new blocks scale matches the x,y,z scale of a block that will already be in the drawing.

A little help will be greatly appreciated.

 

Thanks You

Matt 

0 Likes
Accepted solutions (1)
898 Views
1 Reply
Reply (1)
Message 2 of 2

Ajilal.Vijayan
Advisor
Advisor
Accepted solution

Hi Matt,

Welcome to this forum.

 

Try with this one

(defun c:mtchblk (/ mblk mx my mz);command name MTCHBLK
(setq mblk (entget (car (entsel "Select the Block to match :"))))
(setq
mx (cdr (assoc 41 mblk))
my (cdr (assoc 42 mblk))
mz (cdr (assoc 43 mblk))
);setq
(command "-insert" "myblock" "x" mx "y" my "z" mz PAUSE 0)
(princ)
);defun