Jump to content

Lisp to Plot All Layouts Malfunctioning


mwade93

Recommended Posts

That means that you have unbalanced parentheses. Please post how you have modified the code - it will be better for you to understand where the issue is.

Link to comment
Share on other sites

  • Replies 30
  • Created
  • Last Reply

Top Posters In This Topic

  • tmelancon

    10

  • MSasu

    9

  • mwade93

    5

  • Snownut

    3

I think my confusion is the lay variable. I am uncertain of how to use it and where it goes, the code remains the same I had accidentally removed one of the paren, my fault. I appreciate you for working with me as I am eager to figure this out.

Link to comment
Share on other sites

try this;

(defun c:DPA ( )
(foreach lay (layoutlist) ;lay = each item in the layoutlist
  (setvar 'CTab lay)
  (COMMAND  "_.plot" "n" "" "" "Brother HL-5370DW series"  "n" "n" "y" )
  ); end of foreach function
 (command "_QSAVE" "_CLOSE")
) 

You could call the "lay" variable anything you like, on simple foreach operations like this one I usually just use "x". The foreach loops through all items in the list "layoutlist" and performs the actions within the foreach, in this case the "setvar" and "_.plot" operations. For nested foreach functions you may want to get a bit more discriptive with the variable names.

 

Untested but should work fine

Edited by Snownut
Link to comment
Share on other sites

Thanks Snow I appreciate your input. It runs flawlessly I just added two additional commands that I needed in there which were the Change Tab, Model (then save and close).

 

One of the guys in my office here prints to our printer through my computer over network so the name of the printer is different on his autocad plot dialog box (i.e. \\COMPUTER1\Brother HL-5370DW series)

 

So I changed the code on his lisp file to read

 

(defun c:DPA ( )
(foreach lay (layoutlist) ;lay = each item in the layoutlist
  (setvar 'CTab lay)
  (COMMAND  "-plot" "n" "" "" "\\Computer1\Brother HL-5370DW series"  "n" "n" "y" )
  ); end of foreach function
 (command "CTAB" "MODEL" "_QSAVE" "_CLOSE")
)

For some reason it is stopping on the Enter an Output Device Name [?] and not proceeding. I really do appreciate all of your hard work and input. God bless.

 

\\Computer1\ is my computer name that he goes through to access this printer but its not working with the lisp routine.

Link to comment
Share on other sites

I would go to his computer and type the "_.plot" command then write down each key stroke you need to use/enter, then make sure the command line reflects exactly what it took to plot from his machine. (each enter stroke is reflected by "" in the command line)

 

Also seems you would need \\ between computer1 & Brother not just a single \.

 

Just as a preference I like to use (setvar 'ctab "model") instead of using it in a command line.

Link to comment
Share on other sites

I did that and the only thing different is the printer name. All other keystrokes are identical. This is why i figured just the printer name would need to change in the routine. However, I am getting this message...

 

Regenerating Model.

Regenerating Layout.

Regenerating Model.

nil

 

GRrrrr I was so happy when it worked for me and then my buddy said houston we have a problem.. I hope we can figure it out

Link to comment
Share on other sites

Unfortunately I am not real familiar with working over networks, there seems to be something I/We are missing regarding the printer name, maybe someone else will chirp in.

 

Just a thought, can you create a new printer in Windows - Control Panel, and configure it so there is no need to tell ACAD it is on a different computer.

Link to comment
Share on other sites

We use network printers it may be known as design laser but it uses the network name \\\\PROD\\level5-laser note the \\ are required in this case our network name is the PROD.

 

Chase your It guys for name if they dont exist there will be a NET USE command to give name of printers

Link to comment
Share on other sites

Hey bigAL thanks for chiming in. Could you possibly create a 6 page drawing and run a test for me? Just emter your network printer name where it shall apply in the routine. If it gives you the same error then it must be the name of the printer with the backward slashes. The code wprks flawlessly on my pc and ive been using it all day. Super super useful. Lmk

Link to comment
Share on other sites

  • 7 months later...
thanks mostafa realy realy great lisp in that link you shared, you can even made one for PDF & One for Printer

 

you're welcome, glad to hear that.

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