Move Z axis lisp

Move Z axis lisp

andreas7ZYXQ
Advocate Advocate
1,642 Views
3 Replies
Message 1 of 4

Move Z axis lisp

andreas7ZYXQ
Advocate
Advocate

Im currently working on a lisp that will move my object to a specified absolute cordinate in z axis. But it would be great if it could move it ex 300units.

 

So.

 

User starts first command
Prompt for "specified Z cordinate" > it moves

 

Start second command

Promt for "how much to move" > it moves

Any ideas?

0 Likes
1,643 Views
3 Replies
Replies (3)
Message 2 of 4

ВeekeeCZ
Consultant
Consultant

The second is simple:

 

(defun c:movez ( / ss dz)
  (if (and (setq ss (ssget ":L"))
	   (setq dz (getdist "\nDelta z: ")))
    (command "_.MOVE" ss "" "_none" '(0 0 0) "_none" (list 0 0 dz)))
  (princ)
)

The first... what kind of objects are we talking about? What if an one part of object has different z value than an other?

Message 3 of 4

andreas7ZYXQ
Advocate
Advocate

Great ! it does just what i want.

 

Hm , there is a bunch of different blocks and lines i want to move in my drawing. It would be great if i could have something to move all items on a floor plan to a specified height.

0 Likes
Message 4 of 4

devitg
Advisor
Advisor

Use

(setq selection (SSGET  "_x" '( ( 0 . "line,insert"))))
 

 

0 Likes