kevinp Posted February 6, 2009 Share Posted February 6, 2009 Im trying to make a macro button to auto-plot an 11x17 print. On every single drawing we plot to 11x17, all our settings are exactly the same, with the exception of the layout name. This is my current macro: ^C^C-PLOT;YES;LAYOUT1;RICOH Copier.pc3;11" x 17";INCHES;LANDSCAPE;NO;EXTENTS;FIT;CENTER;YES;ACT.CTB;YES;yes;NO;NO;NO;NO;YES Now not every layout we have is named layout1. Most of them are simply the drawing title (ex. 600SQ FT RM CONDUIT RISER), because it helps identify the drawing in the sheet set. How can I go about making it plot the current layout, and not prompt for it? If it matters, we have a page setup in *some* of our drawings labeled 11x17. Quote Link to comment Share on other sites More sharing options...
uddfl Posted February 6, 2009 Share Posted February 6, 2009 ^C^C-PLOT;YES;(getvar "ctab");RICOH Copier.pc3;11" x 17";INCHES;LANDSCAPE;NO;EXTENTS;FIT;CENTER;YES;ACT.CTB;YES;yes;NO;NO;NO;NO;YES Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 6, 2009 Share Posted February 6, 2009 Haha, you just beat me to it... I was just going to suggest this... (defun c:plt (/ oldcmd tab) (setq oldcmd (getvar "cmdecho")) (setvar "cmdecho" 0) (if (not (eq "Model" (setq tab (getvar "CTAB")))) (progn (command "-plot" "YES" tab "RICOH Copier.pc3" "11\" x 17\"" "INCHES" "LANDSCAPE" "NO" "EXTENTS" "FIT" "CENTER" "YES" "ACT.CTB" "YES" "YES" "NO" "NO" "NO" "NO" "YES")) (princ "\nCurrent Tab is Model")) (setvar "cmdecho" oldcmd) (princ)) But obviously the Kevin would probably want to keep it in macro form. Quote Link to comment Share on other sites More sharing options...
kevinp Posted February 6, 2009 Author Share Posted February 6, 2009 Thanks alot guys, works great now. Ill also have to save that code just incase I need it for anything down the road Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 6, 2009 Share Posted February 6, 2009 No worries Kev, glad you got it working. I only used LISP because I don't like to combine the LISP with the macro (like the (getvar "ctab") in the posted macro. I would rather keep things separate - but that is just my preference Quote Link to comment Share on other sites More sharing options...
kevinp Posted February 6, 2009 Author Share Posted February 6, 2009 So does that mean you can use any lisp command/function within a macro? Sorry if this is a dumb question, Im just not very familiar with lisp. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 6, 2009 Share Posted February 6, 2009 Hmmm... that is a good question - never thought about the restrictions of using LISP within a macro (mostly because of my previous post). My gut instinct would say "yes", but I would think that the macro would become so cluttered that it would be much more feasible to use a proper LISP program. But there is a huge possibly that I may be wrong - just going by my gut Quote Link to comment Share on other sites More sharing options...
uddfl Posted February 6, 2009 Share Posted February 6, 2009 So does that mean you can use any lisp command/function within a macro? Sorry if this is a dumb question, Im just not very familiar with lisp.Yes, just as you can invoke LISP functions directly from the command line. Quote Link to comment Share on other sites More sharing options...
kevinp Posted February 6, 2009 Author Share Posted February 6, 2009 Very cool...guess Ill have to start learning it! Quote Link to comment Share on other sites More sharing options...
uddfl Posted February 6, 2009 Share Posted February 6, 2009 I would think that the macro would become so cluttered that it would be much more feasible to use a proper LISP program.I do agree with this. If the lisp function needed is more than a couple of lines, I'd recommend to save it as a lisp file and then invoke the main lisp function from the macro. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 6, 2009 Share Posted February 6, 2009 Yes, just as you can invoke LISP functions directly from the command line. Ahh, of course - thanks for clarifying that Uddfl 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.