Using Macro Parameter that Contains Space

Using Macro Parameter that Contains Space

Nik4_99
Enthusiast Enthusiast
448 Views
6 Replies
Message 1 of 7

Using Macro Parameter that Contains Space

Nik4_99
Enthusiast
Enthusiast

Hi,

there is a simmilar toppic "Using macro parameter contains space (changing layer color from command line)", but it is 10+ years old and it is a layer color specific.

 

I have 200+ drawings with no layouts and with wrong printer predefined. Also, the Paper size, Plot Style, Plot Transparency and Plot area (window) is not set right.

I assume that I will have to select the Window (what to plot from Model space) manualy, but I was thinking to "automate" Plot setup for other plot settings.

In mentioned toppic I find an idea to use something like

C^C^C^_-plot;n;;"previous plot";"dwg to pdf.pc3";n;y;n;

 

but it stops:

Command: C^C^C^_-plot;n;;"previous Unknown command "C^C^C^_-PLOT;N;;"PREVIOUS".  Press F1 for help.
Command: plot";"dwg Unknown command "PLOT";"DWG".  Press F1 for help.
Command: to TOOLBAR
Command: pdf.pc3";n;y;n;*Cancel*

 

Looking at the command prompt - it looks like AC treats space as "enter" (although I put quotes "" that solved the problem for OP in mentioned post).

 

Any help is appreciated.

Cheers,

N

 

 

 

 

 

 

 

 

0 Likes
449 Views
6 Replies
Replies (6)
Message 2 of 7

Kent1Cooper
Consultant
Consultant

Start by either removing the C at the beginning [two ^C cancels are typical, and enough to get out of most commands if one is running at the time], or include the caret ^ before it like the others, if you really want three cancels.

 

Then run it again, to see whether the space is really the problem.

 

If you would only ever run this at the Command: prompt with no other command running, you don't even need the ^C^C [or ^C^C^C] at all.

Kent Cooper, AIA
0 Likes
Message 3 of 7

Nik4_99
Enthusiast
Enthusiast

Hi Kent,

thanks for your reply, and for all your makros you wrote, they make my life a bit easier.

This 3 Cs are from mentioned post where OP commented that it is working for him. so I didn't want to change anything at first. Then I deleted the third C, but it still gives me the same message.

I already tried the imput from the command line (actually - the "error" attached im my previous post is from the comand run from the command line. So, again: when I start from command line

-plot;n;;"previous plot";"dwg to pdf.pc3";n;y;n;

I get CUI window opened, and when I cancel and look at the Command line, I see:

 

-plot;n;;"previous Unknown command "-PLOT;N;;"PREVIOUS". Press F1 for help.
Command: plot";"dwg Unknown command "PLOT";"DWG". Press F1 for help.
Command: to TOOLBAR

(and

pdf.pc3";n;y;n;

still active - not sent - in command line).

 

If I run

C^C^_-plot;n;;

I get to the point "enter setup name", where I can mannualy "previous plot", and AC goes to "Enter output device name", where I can mannualy write "DWG to PDF", and I get the "Create plot file" window.

So, mannualy I can enter the imput containig space.

 

 

 

0 Likes
Message 4 of 7

Kent1Cooper
Consultant
Consultant

You should not have deleted the third C, but the first one.  The carets come before the C's.  Macros typically start with:

^C^C

Kent Cooper, AIA
0 Likes
Message 5 of 7

Sea-Haven
Mentor
Mentor

We had plot lsp that had all plot parameters set we just picked correct menu option

 

^c^c(load "plota3")

 

There are plenty of plot lisp examples out.

 

Using phone so no example code.

0 Likes
Message 6 of 7

Nik4_99
Enthusiast
Enthusiast

@Kent1Cooper 

Thank you - what an amateur mistake I made. However - this is not a main problem. I was entering the command directly from Command line

-plot;n;;"previous plot";"dwg to pdf.pc3";n;y;n;

and AC didn't undesrtand that I enter a 2 word parameter. It interpreted space as the enter.

It still do.

............

Edit - Irelevant

.............

 

@Sea-Haven 

I have no problem entering a single word parameters as your example. There is a problem when AC interpates space between 2 words as enter...

 

 

 

0 Likes
Message 7 of 7

Nik4_99
Enthusiast
Enthusiast

Ok.

Playing and experimenting a little bit more - I found that

 

^C^C_-plot;n;;previous plot;dwg to pdf.pc3;

 

is working.

Now - if you take a look at Zoltan's

Zoltan's (10+ years old) post

you will see that

 

^C^C_-la;c;1;"Verdeckt (ISO)";c;6;"Bemaßung (ISO)";l;dashed;"Verdeckt (ISO)";;ltscale;20;re;

 

Worked for him. So I got misled that I need to use quotations when making a makro.

On the other hand, I was under impresion that I can copy paste the code (without ^C^C) and try it from Command line to see if it will work... It looks like it is not possible. Macro does not interpet space as Enter, while command line do (and it is stil unclear if one can enter a parameter with space from command line...?)

So- for Zoltan - it worked with quotation marks. For me - it works without.

Thanks all for your time. I did search for a solution before asking for help, but it mislead me...

Cheers

 

 

 

0 Likes