Jump to content

Macro command for current layout?


kevinp

Recommended Posts

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.

Link to comment
Share on other sites

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. :thumbsup:

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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 :P

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
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...