Moving objects a distance based on dimscale

Moving objects a distance based on dimscale

scottPBYAJ
Observer Observer
342 Views
3 Replies
Message 1 of 4

Moving objects a distance based on dimscale

scottPBYAJ
Observer
Observer

Hello to you wonderful people. I have been dabbling with LISP and would like to know what is the correct routine for the following,

 

I want to simple move the previously selected objects direct up a distance equal to dimscale x8 

 

(defun c:MJ () (COMMAND "MOVE" "P" "" 0,0  0,(* 8 (getvar "dimscale"))) (princ) ;suppresses nil return )

 

The problem is it stops the command after getvar.

 

Your help is greatly appreciated

0 Likes
Accepted solutions (1)
343 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant
Accepted solution

You're mixing AutoLisp list format and keyboard-entry format.  Comma-separated coordinates are keyboard entry format, and can't include an AutoLisp expression directly.  Try this:

 

(defun c:MJ () (COMMAND "MOVE" "P" "" '(0 0) (list 0 (* 8 (getvar "dimscale"))))

 

No comma between the coordinates in a list, including between the bold-italic zero and AutoLisp function.  You could also use "0,0" [with the comma but in quotes, as a text string as you would type in] for the start point.

Kent Cooper, AIA
0 Likes
Message 3 of 4

scottPBYAJ
Observer
Observer
Thank you Kent works as intended. I'll need to do some more research on the '
0 Likes
Message 4 of 4

Kent1Cooper
Consultant
Consultant

@scottPBYAJ wrote:
.... I'll need to do some more research on the '

On that subject, you should read in the AutoLisp Reference about both the (list) and (quote) functions, which are kind of inter-related in relation to that.

Kent Cooper, AIA
0 Likes