Author Topic: Delete a plotter from a page setup?  (Read 7254 times)

0 Members and 1 Guest are viewing this topic.

KewlToyZ

  • Guest
Delete a plotter from a page setup?
« on: September 14, 2006, 12:13:46 PM »
I'm running into some issues with the 2007 publish utility.
Something I never really tried and now I can't seem to find out how:
Delete a plotter from a page setup?

Can this be done with lisp or is it somewhere in the interface I do not see?

Greg B

  • Seagull
  • Posts: 12340
  • Tell me a Joke!
Re: Delete a plotter from a page setup?
« Reply #1 on: September 14, 2006, 12:15:33 PM »
Is the plotter used at all?

KewlToyZ

  • Guest
Re: Delete a plotter from a page setup?
« Reply #2 on: September 14, 2006, 12:25:50 PM »
Well I found the way to delete it as a right click in the pagesetup dialog.
Here is the issue, Publish searches for every plotter configured in every page setup of every drawing it is asked to open even seems to repeat the search after it finds it. Also it does this when you already have these multiple files opened in the interface. Dramatically slower to publish than 2004 was. I'm going through the routines and the templates finding all have multiple entries for every office. I figured one way to clean up the lag time of this is removing the plotters from the page setup and templates to just leave one solitary entry for plot to file. When drawings are opened in the publish utility I can import the plotter configuration I need for that current moment and not all of them.

Of course this adds a step to batch plot/publish but it removes the network search from the startup everytime for every drawing.

KewlToyZ

  • Guest
Re: Delete a plotter from a page setup?
« Reply #3 on: September 14, 2006, 01:45:14 PM »
I'm looking at my options to optimize my projects for publishing more easily.

I'm curious what methods you guru's employ for handling as a standard in page setup for plotters?

I am running into too many configuration considerations to test in a timely fashion.
I wondered if many of you have tried alternate formats and what pro's and cons you find with them?

I came to this company where they use psetupin to set the plotter configurations as well as setting them in the templates.
Since implementing 2007 the process is bogging down with some bugs I can't quite pinpoint.
We use Technisys for handling Plotter managment and plot accounting.
We use publish to batch plot.
The usual approach is selecting multiple files in explorer and right click to select open then click the publish button once all files are open.
I found it works a bit faster if make the selection from just opening cad then clicking publish and adding the files in the publish dialog.
But the wait time is considerable due to the amount of plotter configurations in the page setup of each drawing.
Is this the current format you utilize?


T.Willey

  • Needs a day job
  • Posts: 5218
Re: Delete a plotter from a page setup?
« Reply #4 on: September 14, 2006, 01:55:47 PM »
I'm looking at my options to optimize my projects for publishing more easily.

I'm curious what methods you guru's employ for handling as a standard in page setup for plotters?

I am running into too many configuration considerations to test in a timely fashion.
I wondered if many of you have tried alternate formats and what pro's and cons you find with them?

I came to this company where they use psetupin to set the plotter configurations as well as setting them in the templates.
Since implementing 2007 the process is bogging down with some bugs I can't quite pinpoint.
We use Technisys for handling Plotter managment and plot accounting.
We use publish to batch plot.
The usual approach is selecting multiple files in explorer and right click to select open then click the publish button once all files are open.
I found it works a bit faster if make the selection from just opening cad then clicking publish and adding the files in the publish dialog.
But the wait time is considerable due to the amount of plotter configurations in the page setup of each drawing.
Is this the current format you utilize?


I wrote my own batch plot routine.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

KewlToyZ

  • Guest
Re: Delete a plotter from a page setup?
« Reply #5 on: September 14, 2006, 02:27:12 PM »
Hi T!
How many issues have you ran into with each version of CAD changing?
Did you do any project accounting with it?
Do you run into file issues switching between MS & PS or stb & ctb?
I had thought of embarking on the writing of the utility but I'm not very good with conditional formatting yet.
It would be a fairly long task for me to complete and one very likely I could not complete on my own.

Did you write any of it on the forums?

KewlToyZ

  • Guest
Re: Delete a plotter from a page setup?
« Reply #6 on: September 14, 2006, 02:28:44 PM »
Better yet is it a utility for sale? lol

T.Willey

  • Needs a day job
  • Posts: 5218
Re: Delete a plotter from a page setup?
« Reply #7 on: September 14, 2006, 02:45:15 PM »
I am the only one at my site.  I write for myself, and people who are looking for help.  I only work with ctb files, so that is all I use it for.  I did write it with help from people here, trying to figure out how the use it without any commands, but that didn't work.  I get all the information I need, and then issue the plot command from the the command line.  I'm sure you could program the other stuff in it you need, but for me, it is not in there.

Better yet is it a utility for sale? lol
I'm not good enough to get paid for code I write, but if you want to see it I can post it, no problem.  :wink:
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

AndyM

  • Newt
  • Posts: 136
Re: Delete a plotter from a page setup?
« Reply #8 on: September 14, 2006, 03:12:36 PM »
I wrote a routine to plot all the tabs in my current drawing.  The drawing needs to be open for it to work.  It involves importing a plotter configuration, writing a "DSD" file, sending it to the plotter or in my case a printer, and then deleting the plotter configuration.  It can be done and it was a real challenge.

KewlToyZ

  • Guest
Re: Delete a plotter from a page setup?
« Reply #9 on: September 14, 2006, 03:22:05 PM »
I would love to see it T!
I only plot with ctb files and only the layout tabs so that would be fine for my uses.
I am considering re-writing my sheetsetup routine to include choices of which plotter I wish to use in the page setups.
But again depending on the history and lifecycle this may prove an arduous route to take.
This is why the page setups reside in the drawing in the first place.
I take it you use a vba application or or a combination of vba, script, and lisp?

I'm curious psuchewinner, are you using the windows printer driver for spooling the files then?
« Last Edit: September 14, 2006, 03:23:43 PM by KewlToyZ »

T.Willey

  • Needs a day job
  • Posts: 5218
Re: Delete a plotter from a page setup?
« Reply #10 on: September 14, 2006, 03:31:55 PM »
I only have one layout to print per drawing, so if you have more, then you will need to change the code.  Right now it just prints whatever layout it opens up into.  It is written in lisp, and uses a dcl.  Let me know if it doesn't work, I think it should just fine though.

Right now it will close the last drawing, and leave it blank if you has sdi = 0, but if you don't then it will try to open up a drawing from my hd, so you will have to change the last portion of the code.  I think this is the only thing you should have to change.
Code: [Select]
(if DidPlot
 (if (equal oldSdi 0)
  (command "_.vbastmt" (strcat "documents.item \(\"" (getvar "dwgname") "\"\).close(False)"))
  (progn
   (command "_.vbastmt" "AcadApplication.ActiveDocument.New \(\"c:/custom/drawings/3m-pics-start.dwg\"\)")
   (command "_Yes")
  )
 )
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

whdjr

  • Guest
Re: Delete a plotter from a page setup?
« Reply #11 on: September 14, 2006, 04:18:14 PM »
This doesn't answer your original question but this is what I use:

This deletes all page setups from a drawing.
Code: [Select]
(defun C:delete_page_setups ()
 (vlax-map-collection
  (vla-get-PlotConfigurations
   (vla-get-activedocument (vlax-get-acad-object))
  )
  'vla-delete
 )
 (princ)
)


This one gives you alist of page setups in a file after you select one it makes that page setup the current setup in each layout tab.  This has a lisp file and a dcl file.
Code: [Select]
(defun c:change_page_setups (/ adoc      page_setups
     dcl_id userclick   selection
     plotcfg
    )
;;;
 (defun get_page_setup (doc func / lst)
  (vlax-map-collection
   (vla-get-plotconfigurations doc)
   '(lambda (x) (setq lst (cons ((eval func) x) lst)))
  )
  (reverse lst)
 )
;;;
 (defun getSelectedItems (tilename AllItemsList / indexes)
  (if (setq indexes (get_tile tilename))
   (setq indexes (read (strcat "(" indexes ")"))
indexes (mapcar '(lambda (n) (nth n AllItemsList))
indexes
)
   )
  )
  indexes
 )
;;;
 (vl-load-com)
 (defun on_list_pick ()
  (if (= (get_tile "page_setup_names") "")
   (mode_tile "select" 1)
   (mode_tile "select" 0)
  )
 )
 (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
 (and
  (setq page_setups (get_page_setup adoc 'vla-get-name))
  (setq dcl_id (load_dialog "page_setups.dcl"))
  (new_dialog "page_setup" dcl_id)
  (start_list "page_setup_names")
  (mapcar 'add_list page_setups)
  (not (end_list))
  (action_tile "cancel" "(done_dialog 0)")
  (action_tile
   "select"
   (strcat
    "(setq selection (getSelectedItems \"page_setup_names\" page_setups))"
    "(done_dialog 1)"
   )
  )
  (action_tile "page_setup_names" "(on_list_pick)")
  (not (mode_tile "select" 1))
  (setq userclick (start_dialog))
 )
 (if dcl_id
  (unload_dialog dcl_id)
 )
 (if (and userclick selection)
  (and
   (setq plotcfg (vla-item (vla-get-plotconfigurations adoc)
   (car selection)
)
   )
   (vlax-map-collection
    (vla-get-layouts adoc)
    '(lambda (x)
      (if (eq (vla-get-modeltype x) :vlax-false)
       (vla-copyfrom x plotcfg)
      )
     )
   )
  )
 )
 (princ)
)
Code: [Select]
page_setup : dialog {
  label = "Page Setup Names";
  : boxed_column {
    label = "Select Page Setup to be Current";
    : list_box {
      key = "page_setup_names";
      height = 12;
      multiple_select = false;
      }
   }
   : row {
     : spacer_0{
     }
    : button {
      label = "&Select...";
      key = "select";
      fixed_width = true;
      alignment = centered;
      }
    : button {
      label = "&Cancel";
      is_cancel = true;
      key = "cancel";
      fixed_width = true;
      alignment = centered;
      }
    : spacer_0{
     }
  }
}

KewlToyZ

  • Guest
Re: Delete a plotter from a page setup?
« Reply #12 on: September 14, 2006, 04:21:48 PM »
I only have one layout to print per drawing, so if you have more, then you will need to change the code.  Right now it just prints whatever layout it opens up into.  It is written in lisp, and uses a dcl.  Let me know if it doesn't work, I think it should just fine though.

Hey Tim :)
Will this run without MYERRORCHECK if I remove it?
I don't know where to define its function?
2 references without a definition so I figured it was another routine.
« Last Edit: September 14, 2006, 04:36:26 PM by KewlToyZ »

KewlToyZ

  • Guest
Re: Delete a plotter from a page setup?
« Reply #13 on: September 14, 2006, 04:23:23 PM »
This doesn't answer your original question but this is what I use:

This deletes all page setups from a drawing.

This one gives you alist of page setups in a file after you select one it makes that page setup the current setup in each layout tab.  This has a lisp file and a dcl file.

Thanks whdjr! I'll look this over soon. Much appreciated.

T.Willey

  • Needs a day job
  • Posts: 5218
Re: Delete a plotter from a page setup?
« Reply #14 on: September 14, 2006, 04:56:06 PM »
I only have one layout to print per drawing, so if you have more, then you will need to change the code.  Right now it just prints whatever layout it opens up into.  It is written in lisp, and uses a dcl.  Let me know if it doesn't work, I think it should just fine though.

Hey Tim :)
Will this run without MYERRORCHECK if I remove it?
I don't know where to define its function?
2 references without a definition so I figured it was another routine.
There is always something.  Here you go.
Code: [Select]
(defun MyErrorCheck (Function Listof / ErrChk)
; Use just like (vl-catch-all-apply....
; Returns nil if an error

(setq ErrChk (vl-catch-all-apply Function Listof))
(if (vl-catch-all-error-p ErrChk)
 (setq ErrChk nil)
 ErrChk
)
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.