Macro to move in axis

Macro to move in axis

joao_csp
Explorer Explorer
469 Views
3 Replies
Message 1 of 4

Macro to move in axis

joao_csp
Explorer
Explorer

Hello

 

I'm trying to create a macro to move an object in one axis only, using move .x

The goal is for the user just to have three interactions, pick object and both points.

 

I'm using the following:

^C^C_move^M\^M\.x^M\@^M

 

move ------------------   ^C^C_move
enter---------------------  ^M
(pick object)------------  \
enter--------------------   ^M
(pick base point)-------  \
.x-------------------------  .x
enter--------------------   ^M
(pick second point)-----  \
@Anonymous--------------------   @
enter--------------------   ^M

 

 

But after picking the second point I always have to manually type the '@' to end the command.

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

ВeekeeCZ
Consultant
Consultant

Not sure if this is what you want but I like it.

^C^C_move;\;\.y;@;

0 Likes
Message 3 of 4

Kent1Cooper
Consultant
Consultant
Accepted solution

I think the problem is that the one backslash for User input is expected to be one base point input, but with the coordinate filter, the input for that one backslash encompasses both the .x input and the YZ part that it then asks for.  The @ doesn't get fed in until after those two pieces of one input are supplied, which is why it gives an unknown-command message for the "@", because by that point it's past the end of the Move command.

 

Some AutoLisp functions can be used in macros.  This seems to work, if I understand correctly what you're trying to do [very minimally tested]:

^C^C_.move;\;(setq p1 (getpoint)) \(list (car (getpoint)) (cadr p1) (caddr p1))

Kent Cooper, AIA
0 Likes
Message 4 of 4

Sea-Haven
Mentor
Mentor

I have a autoloaded lisp which has 2 defuns CHX, CHY as name implies, mine asks for distance but it would be easier to have all the "move" coding in a defun (defun C:CHX, so menu becomes ^c^cCHX, the autoload lisp has like 30 defuns in it.

0 Likes