Jump to content

macro to open from specific template


designerstuart

Recommended Posts

hi guys i'm trying to make a macro which opens a .dwt file and enters command PUBLISH (it has all my publish setups in).

here's what i have:

 

^C^C_open;"C:\Users\xxx\Desktop\plot_template.dwt";publish;

the main problem i face is getting the OPEN part to work. i've read this and have a few questions:

when i run it as a script it works, but doesn't as a macro. why does the open dialog box pop up as macro but not script?

do i need to change filedia to 0 then 1 either side of my macro?

 

thanks people

Edited by designerstuart
Link to comment
Share on other sites

and when i use the filedia version

 

^C^C_filedia;0;open;"C:\Users\xxx\Desktop\plot_template.dwt";filedia;1;publish;

it stops, so the command line is asking "enter name of drawing to open". but the name is the next line in my macro. puzzled.

Edited by designerstuart
Link to comment
Share on other sites

thanks.

 

so it has to be a more complex case than i thought? using this, i presume SDI means i must only have one dwg open.

just tried this

 

^C^C_filedia;0;fileopen;"C:\Users\xxx\Desktop\plot_template.dwt";filedia;1;publish;

 

but same problem. i still get asked for the file name.

Link to comment
Share on other sites

dbroada implies here that this basic format ^C^C-filedia;0;open;"H:\Drawings\Library\123.dwg" should work with forward slashes instead of backslashes - what's wrong with what i'm doing? i tried the following but still no joy. :(

 

^C^C_filedia;0;open;"C:/Users/xxx/Desktop/plot_template.dwt";filedia;1;publish;

thanks in advance....

Link to comment
Share on other sites

so i'm kind of talking to myself here, but this works now:

 

^C^C_setvar;filedia;0;_fileopen;C:/Users/xxx/Desktop/plot_template.dwt;_setvar;filedia;1;

 

i found it here. but i would really like to be able to do this with multiple drawings open - is this possible?

Link to comment
Share on other sites

so with further reading, it seems that autocad has 2 modes - SDI and MDI, Single and Multiple Document Interface. for whatever reason the OPEN or NEW commands can only be used in a macro if autocad is in SDI, and it can only be in SDI if you have exactly one drawing open.

 

so it looks like i cannot have some buttons on a toolbar for opening a drawing from template1 or template2 or whatever. which is a shame. anyone got anything to add before i give up on this?

Link to comment
Share on other sites

You may need to be open to more suggestions on how to publish. Usually statements like that reduce the actual amount of help you get. That is just a suggestion. :thumbsup:

 

Moved to the proper forum. :thumbsup:

Link to comment
Share on other sites

okay thanks SLW. it's just i know there are lots of other ways to do what i want, and so many of the threads i have read on this topic are full of helpful suggestions to do it another way. it seems that making a button to open from a template file is not a simple matter!

Link to comment
Share on other sites

Your on the mark once you open the second dwg it takes control and it has nothing to do, if you load a script it will continue in the 2nd 3rd 4th dwg using the first dgw's script till finished.

 

^C^Cscript mypublish

put all the stuff in the script file and it should work

setvar;filedia;0;_fileopen;C:/Users/xxx/Desktop/plot_template.dwt;_setvar;filedia;1;

 

I use space rather than ; except maybe the last one. Warning if you have a space in the directory name will not work also.

Link to comment
Share on other sites

^C^Cscript mypublish

put all the stuff in the script file and it should work

setvar;filedia;0;_fileopen;C:/Users/xxx/Desktop/plot_template.dwt;_setvar;filedia;1;

 

cool thanks bigal - let me get this straight - you use a macro to call up a script, and in the script you have all the stuff i was trying to put in my macro? if i understand you right you're a genius workarounder..... i'll try it today. thanks

 

JGA - i tried the -OPEN command right at the beginning - did you? ;-)

Link to comment
Share on other sites

success! thanks bigal i've done what you recommended:

 

a macro which calls the script:

^C^C_script;"C:/AUTOCAD FILES/publish.scr";

 

then a script which does the job:

filedia
0
open
C:\Users\xxx\Desktop\plot_template.dwt
filedia
1
publish

 

simples!

Link to comment
Share on other sites

okay so after doing this i notice my open dialog box is missing

but it's not a simple case of FILEDIA as it it set to 1.

 

if it helps with troubleshooting - no SAVEAS box, no OPEN box, but there is a box for NEW

what variable have i messed with? :oops:

thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...