TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: JimmyDev on July 22, 2022, 05:46:28 AM

Title: Lisp Autocad move block to specific coordinates
Post by: JimmyDev on July 22, 2022, 05:46:28 AM
Hello,

I would like to move a specific block to specific coordinates. In the example below I can select te block "CART_LV02" and I'm able to move it 0.5 to the right. But how how can I move it for example at coordinates x=200 and y=300?

(command "MOVE" (ssget "_X" '((0 . "INSERT") (2 . "CART_LV02"))) "" "" '(0.5 0 0))

Many thanks
Title: Re: Lisp Autocad move block to specific coordinates
Post by: MatGrebe on July 22, 2022, 09:22:35 AM
Just look at the command prompt when using move. Something like
(command "MOVE" (ssget "_X" '((0 . "INSERT") (2 . "CART_LV02"))) "" "#200,100")
should work.
Mathias
Title: Re: Lisp Autocad move block to specific coordinates
Post by: Tharwat on July 22, 2022, 12:46:02 PM
It is a better practice to check if the selection set is valid before feeding it up to any command or a function.  :wink: