Author Topic: Using the new command from the command line  (Read 3402 times)

0 Members and 1 Guest are viewing this topic.

ML

  • Guest
Using the new command from the command line
« on: April 06, 2005, 02:36:14 PM »
I am trying to start a new drawing by using a drawing template via the command line. I had to set filedia to 0 to suppress the dialog box (-new does not work) but I just can't seem to get to work

Anyone see what might be wrong?

Also, is it possible to set filedia back to 1 in the same macro?

Thank you

Mark


^C^Cfiledia;0;new;("K:\Path\to\Template\templatefile.dwt");

PDJ

  • Guest
Using the new command from the command line
« Reply #1 on: April 06, 2005, 03:01:38 PM »
Try _new instead of -new..

Can't help ya with the macro, I'd write it in lisp myself..

dubb

  • Swamp Rat
  • Posts: 1105
Using the new command from the command line
« Reply #2 on: April 06, 2005, 03:05:43 PM »
CTRL + N

CREATES A NEW DRAWING...USING THE HOT KEY

ML

  • Guest
Using the new command from the command line
« Reply #3 on: April 06, 2005, 03:11:28 PM »
I did try _new and it was still no go.
I agree with you on The LISP part except I used a vbastmt command instead.

The problem is I may need to share these macro with LT users and it is not VBA or LISP enabled

Mark

MikePerry

  • Guest
Using the new command from the command line
« Reply #4 on: April 06, 2005, 05:17:07 PM »
Hi

Try removing the opening and closing brackets from the Path ie.

^C^CFileDia;0;_.New;"K:\Path\to\Template\templatefile.dwt";

Have a good one, Mike

ML

  • Guest
Using the new command from the command line
« Reply #5 on: April 07, 2005, 10:58:55 AM »
Mike,

That is not working either
It seems like after new is entered, the macro stops. If you type new at the command line (with Filedia set to 0), then you can type in your template file but it is not working in a macro so far.

Mark

VerticalMojo

  • Guest
Using the new command from the command line
« Reply #6 on: April 07, 2005, 11:44:53 AM »
Try this...

^C^C_fileopen;K:\Path\to\Template\templatefile.dwt;

ML

  • Guest
Using the new command from the command line
« Reply #7 on: April 07, 2005, 12:04:37 PM »
It looks like that will only open a .dwg file, I am trying to start a new drawing using a .dwt file

Mark

VerticalMojo

  • Guest
Using the new command from the command line
« Reply #8 on: April 07, 2005, 12:27:51 PM »
I dont think that you can start a macro and have it finish in another drawing, that being said you wont be able to restore the filedia after opening the template becuase it only works in "Single drawing compatibility mode".

Here is a snip from Autodesk - Discussion Groups

>snip<

Reply From:  Klasson, Conny
Date: Aug/21/01 - 04:40 (GMT)

Don't think its your system, I have the same thing here.
Seems like the "New" command has trouble with reading "Enter"
from the macro. Have not seen this before. Maybe it's a new
"feature" of LT 2000i?
I let you know if I can get a solution to this.

This macro works, and it should be the same for New:
^C^C_fileopen;acltiso.dwt;

Note the trick to turn of Filedia and then put it
back on in transparent mode while opening the file.
If I put the filedia;1; at the end of the macro
it's ignored (don't know why).

However, after som trial & error I found that the new
command works in a macro in "Single drawing compatibility mode".
Maybe it's the MDI that makes the macro get lost when the
macro is launched in one dwg and supposed to land in another??

Conny

--------------------------------------------------

Reply From: D'Arcy, Gary
Date: Aug/21/01 - 04:56 (GMT)
   
Dear Conny,

You are correct regarding SDI v's MDI.
This is the same for lisp and ARX also.

Once the NEW command with MDI enabled communication with the current
session ceases.
A new stack is created for each new drawing and all of the starup
initialization
has to be carried out including loading up the *.fas files etc.

In most it is the intention to set say a system variable in the current
drawing but by the time the new command has been issued you are no
longer in that drawing.

Regards Gary.


>snip<

Sitra

  • Guest
Using the new command from the command line
« Reply #9 on: April 07, 2005, 12:39:52 PM »
Maybe a script might work....

VerticalMojo

  • Guest
Using the new command from the command line
« Reply #10 on: April 07, 2005, 12:54:11 PM »
Conrad is right.....

First create a script file "Template" with this

Code: [Select]
filedia
0
_new
K:/Path/to/Template/templatefile.dwt
filedia
1


then a macro....

^C^Cexpert;5;scr;Template.scr;

ML

  • Guest
Using the new command from the command line
« Reply #11 on: April 09, 2005, 11:03:03 PM »
That's an intesesting idea, but I am not sure it could be launched from the menu macro.

Vertico, thank you for the informative post, I now know that I am not going crazy  :D

Every thing that was happening to me is confirmed in your post.

I found that using a VBA expression does the trick.
Here is how it works if anyone is interested:

Note:If you have a support path to your template files, you only need to put the template file name, not the entire path

^C^Cvbastmt;Application.Documents.add ("K:\Path to template file")

After you run the macro, you will notice that a new drawing (.dwg) is created just as it would be with going to File-New-template file

Mark

ML

  • Guest
Using the new command from the command line
« Reply #12 on: April 09, 2005, 11:05:55 PM »
I'm, sorry Vertical, I didn't see your macro. That is a real cool idea.
I will remember that idea if I need to see the menu to a none VBAenabled user

Mark