Jump to content

Recommended Posts

Posted

Hi there all,

I need a lisp which can move selected objects on specified distance. I want to move selected object or objects 1000 units on right side which is -X axis. Please make it this way so that after this Lisp command I select the objects which I need to be moved on 1000 units right and then after hitting enter or space bar all selected objects should move 1000 units right. Hope you will understand.

 

If someone can help, I'll be thankful.

Posted
(defun c:Test (/ ss )
 (if (setq ss (ssget "_:L" ))
   (vl-cmdf "_.move" ss "" "_non" '(0. 0. 0.) "_non"  '(1000. 0. 0.))
   )
 (princ)
 )

Posted
(defun c:Test (/ ss )
 (if (setq ss (ssget "_:L" ))
   (vl-cmdf "_.move" ss "" "_non" '(0. 0. 0.) "_non"  '(1000. 0. 0.))
   )
 (princ)
 )

Hi Tharwat,

This is exactly what I needed, thank you for understanding my need and making this Lisp for me. Have good time.

 

Thanks again.

Posted
Hi Tharwat,

This is exactly what I needed, thank you for understanding my need and making this Lisp for me. Have good time.

 

Thanks again.

 

You're welcome anytime .

Posted

An old question why not CHX CHY CHZ and ask for space rather than hard code.

(defun c:CHX (/ ss )
(setq diff (Getreal "\nEnter distance required"  ))
(if (setq ss (ssget "_:L" ))
   (vl-cmdf "_.move" ss "" "_non" '(0. 0. 0.) "_non"  '(diff 0. 0.))
   )
 (princ)

CHY '(0. diff 0.)
 )

 

Version 2, 1 spacing per session
(if (= diff nil)
(setq diff (Getreal "\nEnter distance required"  ))
)
(if (setq ss (ssget "_:L" ))
   (vl-cmdf "_.move" ss "" "_non" '(0. 0. 0.) "_non"  '(diff 0. 0.))
   )

 

Like the selection set my old version was pick pick pick

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...