Author Topic: Delete a plotter from a page setup?  (Read 13477 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: 12417
  • 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: 5251
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: 5251
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.

psuchewinner

  • Guest
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: 5251
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: 5251
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.

KewlToyZ

  • Guest
Re: Delete a plotter from a page setup?
« Reply #15 on: September 15, 2006, 10:09:21 AM »
Playing around with a few functions and altering the plotting process I am wondering;
Deleting a layout doesn't seem to remove the plotters?
I am finding it is more efficient to import a plotter from a drawing that just contains one plot configuration than assigning all plotters to a drawing.
.plot is designed much more efficiently than publish when it comes to managing page setups and plotters.

I can delete a plotter with a right click in the page setup manager but I'm not finding the command line approach to it?
In other words deleting the pagesetup doesn't remove the previous configurations when replaced by a new one?

I removed all old references in the dwt file and the routines that created the previous configurations but they still remain after replacing the page setup.
« Last Edit: September 15, 2006, 10:37:38 AM by KewlToyZ »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Delete a plotter from a page setup?
« Reply #16 on: September 15, 2006, 10:48:22 AM »
Perhaps I missed something but why don't you create your own plot lisp to use the DSD file
and plot what is found there? You would still use the PUBLISH to manage the DSD file.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KewlToyZ

  • Guest
Re: Delete a plotter from a page setup?
« Reply #17 on: September 15, 2006, 10:52:18 AM »
Here is just the base of what I am converting over to.
More or less since everything is networked I'm trying to phase out as much network traffic in the process as possible.
Old page setups causes a ton of network traffic. I decided to start removing them from new projects and try to setup the routines to strip the layout and replace it with one only containing the sheet size and plot to file references.
Any plots or publishes use an import from centralized dwg files named according to the page setups additionally required for that plot type.

If you use this approach the advantages of .plot vs. publish become much more apparent.
Mainly because if you use .plot; you get to select the exact page setup you wish to import.
In publish it shotguns everything in forcing me to consider making individual dwg files for each page setup type.


KewlToyZ

  • Guest
Re: Delete a plotter from a page setup?
« Reply #18 on: September 15, 2006, 10:56:34 AM »
Good morning CAB :)

I just glanced over the dsd file usage yesterday while I was testing my other approach.
I don't know enough about the dsd to make any judgement of how it would work with overall performance in project lifecycles and network traffic in the office?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Delete a plotter from a page setup?
« Reply #19 on: September 15, 2006, 11:05:07 AM »
OK, I just re-read the entire thread and it appears that the main problem is the slow operation of PUBLISH when
adding the files to be printed. And this is due to the many page setups found in the files.

Did i get that correct?

Another approach is a lisp to pick the files to be printed, write a DSD file & see if that DSD file is slow to load.

Once loaded it will use DEFAULT as the plot setup or you can force an external page setup.
Do you need to go back & change all of these page setups.

As for the life cycle of the DSD, if it easy to create then just delete it when done.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Delete a plotter from a page setup?
« Reply #20 on: September 15, 2006, 11:15:23 AM »
Just think aloud here.

My Pseudo code
User picks to Create a plot list
List is used to create the DSD file, note, this is nothing more than a text file & you can go off on your own here.
The Setup can be your single or from a pick list.
Lisp to plot each file in the text file.

You can create a DCL to simulate the PUBLISH if using it to manipulate the text file is too slow.



Note: I live in a single CPU environment so I am not aware of the network problems you face.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KewlToyZ

  • Guest
Re: Delete a plotter from a page setup?
« Reply #21 on: September 15, 2006, 11:25:09 AM »
Correct sir!

I thought it would be in the best interest to strip them all.
We use 6 seperate national offices with multiple plotter configurations in each one plus full and half sheet sizes.
One office does not need the other 5's configurations bloating their project cycle times.
It is quite simply production downtime in the process to leave the current state of operations.
So i went through the process workflow and what our current automation forces into it.

I guess the main goal was to remove extra system time being introduced by sloppy configuration while minimizing the amount of customizations required.
I found my error in the lisp routine i used to do the page setups in the last few lines and not cqalling it in the proper locations.
<---------- sloppy  :-P

Code: [Select]
(defun delOldPageSetups ()
  (vl-load-com)
  (vlax-for ps (vla-get-plotconfigurations
  (vla-get-activedocument
  (vlax-get-acad-object)))
  (vla-delete ps)
)
)

KewlToyZ

  • Guest
Re: Delete a plotter from a page setup?
« Reply #22 on: September 15, 2006, 11:29:02 AM »
Just think aloud here.

My Pseudo code
User picks to Create a plot list
List is used to create the DSD file, note, this is nothing more than a text file & you can go off on your own here.
The Setup can be your single or from a pick list.
Lisp to plot each file in the text file.

You can create a DCL to simulate the PUBLISH if using it to manipulate the text file is too slow.

I will have to play with that concept. It may prove less subject to change with any feature changes of AutoCad's utilities.

Quote

Note: I live in a single CPU environment so I am not aware of the network problems you face.

I had done the same for many years. How happy I should have been for the simplicity lol!
Considerably better for development environments. I'm always hanging in the wind of a production environment.
« Last Edit: September 15, 2006, 11:30:54 AM by KewlToyZ »