designerstuart Posted October 13, 2011 Share Posted October 13, 2011 (edited) 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 October 13, 2011 by designerstuart Quote Link to comment Share on other sites More sharing options...
designerstuart Posted October 13, 2011 Author Share Posted October 13, 2011 (edited) 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 October 13, 2011 by designerstuart Quote Link to comment Share on other sites More sharing options...
pBe Posted October 13, 2011 Share Posted October 13, 2011 perhaps _fileopen ? Quote Link to comment Share on other sites More sharing options...
designerstuart Posted October 13, 2011 Author Share Posted October 13, 2011 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. Quote Link to comment Share on other sites More sharing options...
designerstuart Posted October 13, 2011 Author Share Posted October 13, 2011 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.... Quote Link to comment Share on other sites More sharing options...
designerstuart Posted October 13, 2011 Author Share Posted October 13, 2011 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? Quote Link to comment Share on other sites More sharing options...
designerstuart Posted October 13, 2011 Author Share Posted October 13, 2011 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? Quote Link to comment Share on other sites More sharing options...
SLW210 Posted October 13, 2011 Share Posted October 13, 2011 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. Moved to the proper forum. Quote Link to comment Share on other sites More sharing options...
designerstuart Posted October 13, 2011 Author Share Posted October 13, 2011 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! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 14, 2011 Share Posted October 14, 2011 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. Quote Link to comment Share on other sites More sharing options...
JGA Posted October 14, 2011 Share Posted October 14, 2011 Try -open, which forces ACAD to use the command line version of the tool Quote Link to comment Share on other sites More sharing options...
designerstuart Posted October 17, 2011 Author Share Posted October 17, 2011 ^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? ;-) Quote Link to comment Share on other sites More sharing options...
designerstuart Posted October 17, 2011 Author Share Posted October 17, 2011 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! Quote Link to comment Share on other sites More sharing options...
designerstuart Posted October 17, 2011 Author Share Posted October 17, 2011 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? thanks Quote Link to comment Share on other sites More sharing options...
designerstuart Posted October 17, 2011 Author Share Posted October 17, 2011 okay scratch that everything is working fine again...... time for a break perhaps. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.