Macro: Modifying an ".X" Filter not Succesfull

Macro: Modifying an ".X" Filter not Succesfull

Nik4_99
Enthusiast Enthusiast
531 Views
5 Replies
Message 1 of 6

Macro: Modifying an ".X" Filter not Succesfull

Nik4_99
Enthusiast
Enthusiast

Hi all.

 

I am trying to make a basic customization to a ".X" (and .Y and .Z) command:

 

 

 

^C^C_.Z;\0;

 

 

 

I want to take the X coordinate of the next-selected-point and automatically keep the YZ coordinates of the basic point, so "stretch" (or any other command) would take just the "X" coordinate of the selected point.


However - I select the point to stretch, execute the command, select the point-to-acquire-X-coordinate-from, and I get the still active command with the

of (need YZ):

open prompt at the command line.

It does not accept the selecting of the next point (what I think the "\" should do) and continue with executing the macro.

If I enter manually "0" and then "Enter" - the needed coordinate is obtained, but I get the rest of my Macro command afterwards:

Command: 0
Unknown command "0". Press F1 for help.


Any help on why the ";" is not accepted to execute "Enter" after selecting the point-to-acquire-X-coordinate-from, and finishing the command?

If I replace the ";" with " " does not make any difference.


Thanks in advance,

Cheers

N

 

0 Likes
Accepted solutions (1)
532 Views
5 Replies
Replies (5)
Message 2 of 6

cadffm
Consultant
Consultant
Accepted solution

Hi,

 

^C^C_.Z;\0;

Please try it by hand,

start Stretch command, select the stretch area and objects, select the basepoint and PRESS [ESC]

cancel..

doesn't make sense, or? also 2x ESC isn't good in this situation. Get rid of your "^C^C" part:

 

_.Z;\0;

Start again:

start Stretch command, select the stretch area and objects, select the basepoint and

type in _.Z<enter><select a point??>type in 0<enter>....

 

Can not work this way and BTW: You want to keep YZ, and not Z only

 

 - - -
>>I want to take the X coordinate of the next-selected-point
.X;\

 

>and automatically keep the YZ coordinates of the basic point
.YZ;@;


But if used .YZ filter, the next is for .X only, so you need .YZ only
.YZ;@;\

 

 

BTW: for my personla use, ORTHO mode is good enough for often,

[F8] or as temporary switch of current ortho state: Pressing [Shift] while point selection

Sebastian

Message 3 of 6

Nik4_99
Enthusiast
Enthusiast

Hi Sebastian,

thanks for taking a look.

I had problems posting this topic yesterday at the end of the work, I copy-pasted a few times and eventually I gave up. This morning I got no errors posting, but I made one by myself...

 

I was experimenting with all coordinates, and I posted here "Z" instead of "X" in my posted macro (despite the "X" mentioned in the Subject) - so there was your correct reply

"BTW: You want to keep YZ, and not Z only"

 

Here (in this iteration that I posted for help), the code should have looked like this:

 

 

^C^C_.X;\0;

 

 

I used this method to select the point of a line, then look for a donor for (in this case) X coordinate,  and then enter "0" for next prompt (YZ). This method works manually. With this approach - Double Esc is not a problem (I also tried without it before - no difference).

 

Anyhow - your approach is working, so thank you very much for your time and help.

 

Just out of curiosity - if you have time - why is my code (.X;\0;) not working in macro, but it works manually?

 

Cheers,

Nika

 

p.s. - ORTHO mode is not working as desired in 3D, especially when I need a closer coordinate (X, for example), as the ortho switches to further one (Y). If we add the Z factor - it rarely acts as I want...

0 Likes
Message 4 of 6

cadffm
Consultant
Consultant

Hi Nika,

 

>> ^C^C_.X;\0;


>>I used this method to select the point of a line, then look for a donor for (in this case) X coordinate,

>>and then enter "0" for next prompt (YZ). This method works manually.

I can not believe that this is working

- not as macro because of ESC (2x) plus _.X is not an legit input

- and not by typing by hand

I don't know what I could misunderstand, I read your words clearly, but that can't be work.

?? What is wrong in my (or your) side?

 

>>"With this approach - Double Esc is not a problem (I also tried without it before - no difference)."

No difference doesn't meant that there is no problem with.

 

>>"Anyhow - your approach is working, so thank you very much for your time and help."

Good to hear.

 

>>"Just out of curiosity - if you have time - why is my code (.X;\0;) not working in macro, but it works manually?"

Now you wrote .X;\0;

before you wrote ^C^C_.X;\0;

That is not the same! Less 2x ESC and the command name is .X instead the unknown _.X


Let us imagine you really test the user keyboard input as macro:

.X;\0

It works by hand and looks good, what is the problem?

In automation AutoCAD doesn't accept 0 as a real 3D-coordinate (what is correct, wether 2D nor 3D), that's the problem.

By hand, autocad autocomplete a 0 to 0,0,0 but not in a macro inside the .X command.

 

HTH

 
 

 

 

Sebastian

0 Likes
Message 5 of 6

Nik4_99
Enthusiast
Enthusiast

Thank you again for your time and help, Sebastian.

Cheers

Nika

0 Likes
Message 6 of 6

cadffm
Consultant
Consultant

Glad to help,

so your macro .X;\0; would working if you change it to .X;\0,0,0; or .X;\0,0,0

but .X;@ is the better one if you like to use the X-Position of the lastpoint (for stretch it is the basepoint, you selected before the target point.

Sebastian