Quick Plot

Discussion in 'AutoCAD' started by jblazek, Oct 8, 2004.

  1. jblazek

    jblazek Guest

    I wrote this lisp a long time ago... before layouts existed. the layouts are stumping me. I want this routine to make the plot file to a specific file (which it does) w/ the name of the dwg AND the layout name as well.

    what's missing?? any help???
     
    jblazek, Oct 8, 2004
    #1
  2. jblazek

    jblazek Guest

    oh yeah...

    here's the lisp:

    (defun pltname()
    (command "cmddia" "0")
    (command "filedia" "0")
    (setq CE (getvar "CMDECHO")) (setvar "CMDECHO" 0)
    (setq PATH (getvar "DWGPREFIX"))
    (setq DWGNAM (getvar "DWGNAME"))
    (setq NAME (-(strlen DWGNAM)4))
    (setq PLTNAM (substr DWGNAM 1 NAME))
    (setq PLT "plot\\")
    (setq FLENAM (strcat PATH PLT PLTNAM ".plt"))
    (command "-view" "r" "24x36 plot")
    (command "-plot" "n" "" "1050 D Full Size Cover" "" "y" FLENAM "n" "y")
    (command "zoom" "e" "zoom" ".95x")
    (command "qsave")
    (command "cmddia" "1")
    (command "filedia" "1")
     
    jblazek, Oct 8, 2004
    #2
  3. jblazek

    Douglas Barr Guest

    JB -
    I got it to work just fine after changing the specifics on plotter etc to my
    own. I also changed it to plot Display, since I didn't have a view by that
    name.

    The only other thing I had to do was to create a subdirectory below the
    drawing's location, or it dies when it can't put the plt file anyplace. Also
    had to close out the code you sent with a

    (princ)
    )

    -doug


    (command "cmddia" "0")
    (command "filedia" "0")
    (setq CE (getvar "CMDECHO")) (setvar "CMDECHO" 0)
    (setq PATH (getvar "DWGPREFIX"))
    (setq DWGNAM (getvar "DWGNAME"))
    (setq NAME (-(strlen DWGNAM)4))
    (setq PLTNAM (substr DWGNAM 1 NAME))
    (setq PLT "plot\\")
    (setq FLENAM (strcat PATH PLT PLTNAM ".plt"))
    ; (command "-view" "r" "24x36 plot")
    ; (command "-plot" "N" "" "1050 D Full Size Cover" "" "y" FLENAM "n" "y")

    (command "-plot" "Y" "layout1" "auto hp laserjet 4v on server1" "Letter"
    "Inches" "Landscape" "No"
    "D" "F" "C" "Y" "monochrome.ctb" "Y" "Y" "N"
    "N" "Y" FLENAM "Y" "Y")

    (command "zoom" "e" "zoom" ".95x")
    (command "qsave")
    (command "cmddia" "1")
    (command "filedia" "1")
    (princ)
    )
     
    Douglas Barr, Oct 8, 2004
    #3
  4. jblazek

    Rick Keller Guest

    Try creating a plot folder on your computer and send all of the plot files
    to the same one, then you will not forget to make the folder in the current
    directory.

    Rick
     
    Rick Keller, Oct 8, 2004
    #4
  5. jblazek

    jblazek Guest

    doug-

    Yeah it works fine for me. and yes you need to create a folder called plot before running the lisp. oh yeah... i don't know what happened when i copy/clipped the text to the discussion group but my original routine does include
    (princ)
    )

    But anyway, it does work fine but i want to put the plot file in the plot directory with the name of the current drawing; which it does, AND i want it to also include the tab or layout name (ex. A101-plans). reason being, some of our projects are all done on one drawing but have multiple layouts tabs. so i need the current layout tab's name to be included with the name of the drawing or the plt file will keep replacing itself and we will not have record of the previous plot. and i know ctab returns the layout name but i just can't get the routine to run when i add the variable "CTAB".
     
    jblazek, Oct 11, 2004
    #5
  6. jblazek

    Jason Wilder Guest

    Look up (layoutlist). It returns a list of strings of what your current
    layout tabs are. You could create a For loop to go through them.

    plot before running the lisp. oh yeah... i don't know what happened when i
    copy/clipped the text to the discussion group but my original routine does
    include
    directory with the name of the current drawing; which it does, AND i want it
    to also include the tab or layout name (ex. A101-plans). reason being,
    some of our projects are all done on one drawing but have multiple layouts
    tabs. so i need the current layout tab's name to be included with the name
    of the drawing or the plt file will keep replacing itself and we will not
    have record of the previous plot. and i know ctab returns the layout name
    but i just can't get the routine to run when i add the variable "CTAB".
     
    Jason Wilder, Oct 11, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.