Author Topic: Psetup in (Plotconfigs)  (Read 8652 times)

0 Members and 1 Guest are viewing this topic.

ML

  • Guest
Psetup in (Plotconfigs)
« on: March 17, 2008, 02:23:19 PM »
Does anyone know how to get a Page setup into your current layout from another drawing?
In ACAD, it is Psetupin; I am trying to do that via code.
It looks like the method I need is CopyFrom but I am getting a key not found error when setting the Configs.
Once I get that, I will then set the nec layout to the respective page setup (plotconfig)
Any ideas?

Thanks!
Mark

Code: [Select]
Sub Psetupsin()

Dim PltConfig as PlotConfiguration

Set KPltConfigs = ThisDrawing.PlotConfigurations.Item ("I:\Path\Path\Path\Filename-CTB.dwt\K-22x34")
Set HPltConfigs = ThisDrawing.PlotConfigurations.Item ("I:\Path\Path\Path\Filename-CTB.dwt\H-22x34")

  For Each PltConfig In ThisDrawing.PlotConfigurations
   If PltConfig.Name = "K-22x34" Then
    Debug.Print "K"
   Else
    PltConfig.CopyFrom KPltConfigs
   End If
   If PltConfig.Name = "H-22x34" Then
    Debug.Print "H"
   Else
     PltConfig.CopyFrom HPltConfigs
   End If
  Next

End Sub

Guest

  • Guest
Re: Psetup in (Plotconfigs)
« Reply #1 on: March 17, 2008, 02:52:18 PM »
I've got something.... Give me a few minutes to fetch it!

Guest

  • Guest
Re: Psetup in (Plotconfigs)
« Reply #2 on: March 17, 2008, 02:57:11 PM »
Alright.... It uses the CopyObjects of DBX to copy from one file to another.  I use a dialog box, but you can tweak to not use the dialog box.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Psetup in (Plotconfigs)
« Reply #3 on: March 17, 2008, 03:31:07 PM »
Matt, very cool, I will have to look at more in detail later.

ML- Im curious why you would pull one from another dwg when you could just assign what you want from where you are?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

ML

  • Guest
Re: Psetup in (Plotconfigs)
« Reply #4 on: March 17, 2008, 05:00:03 PM »

Hey Matt

I downloaded the file but I have not yet had a chance to look at it.
I will definitely look at it tomorrow...thank you

CM,
If you create a drawing called Plotconfigs, you can set up all your pagesetups in that drawing, then in your current drawing (in Paper space) type psetupin,
that will prompt you for a drawing, select your Plotconfigs drawing (or template .dwt) and it will expose all of your pagesetups in that drawing. You can also right click on your layout tab and use The Pagesetup Manager as well to achieve this. Command line is psetupin.

I can give you several reasons why you would do this.

Do you want to set up a plot configuration in every single drawing, or would you rather have one created and import it when needed? In some of my customizations, I will do -layout;
That will give you your options, then you can insert a layout from your Plotconfigs drawing (or .dwt), followed by Psetupin which will allow you to bring in your Plot config as well.

If you do this; you will have all of your plotter configs setup in advance.
So, for instance, say you want to create a new layout; bring in the layout, then the pagesetup (plotconfig) and you are rolling.

Make sense?

Mark

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Psetup in (Plotconfigs)
« Reply #5 on: March 17, 2008, 05:15:21 PM »
yes, but it seems like a lot of extra work.  I do not have any page setups at all.  I setup on the fly thru code, and can save or not save the dwg as I go.  I guess its easier to maintain 1 dvb file on the network than trying to keep up with my users template files.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Bob Wahr

  • Guest
Re: Psetup in (Plotconfigs)
« Reply #6 on: March 17, 2008, 06:27:43 PM »
I did this a while back.  I decided at the time that I didn't want to do it through ObjectDBX.  Then I decided it was easier not to.  Importing from a plotconfig drawing, I would pick through the list of pagestups.  Okay, I want the 11x17, 15x21, 30x42, and 30x42 for PDFs.  So that's four I need to pick from a really long list that we have.  Programtically, I pick the sheet size on a form and it makes the page setups that I want/need.

ML

  • Guest
Re: Psetup in (Plotconfigs)
« Reply #7 on: March 17, 2008, 06:36:30 PM »

CM

Quite the opposite!!!

To me it is a total waste of time to set up your Plotter configs each time.

Listen, try importing  a page setup from a previous drawing next time you are about to do all your settings, then tell me what you think is faster.

Also, what happens when you have more then one plotter or perhaps you are using CTB and STB?

Perhaps for a particular drawing (as Bob eluded to) you only want to use a particular .pc3 file and not all of them?

Well, may be we spoil the users but our routines bring in the pagesetup, then the layout, then every thing else after that.

This also assures that each user has the right settings per plotter and it allows them to do what they are suppose to; that is engineering, not setting up plot config.

To each his own :)

Mark

Bob Wahr

  • Guest
Re: Psetup in (Plotconfigs)
« Reply #8 on: March 17, 2008, 06:39:18 PM »
Mark, I think you're misunderstanding Duh.  He's not saying that you should set them up manually in each drawing that you start.  If you are writing a program which will in part import page setups from another drawing, why not just get your program to create the page setups instead.

ML

  • Guest
Re: Psetup in (Plotconfigs)
« Reply #9 on: March 17, 2008, 06:45:36 PM »

Oh I see his point.
I could certainly do that but if I have a drawing that already contains them then why not just grab them?
Otherwise, I will have a mountain of code for each Plotconfig, it doesn't make much more sense.
Not to mention that "if" the routine is not available, I would like to be able to say to the user
"OK, type psetupin, hit enter and browse to your file, then choose your pagesetup"
I have to think as a  user sometimes

Anyhow, this is all irrelevant. I just want the answer! :) LOL

Mark

Bob Wahr

  • Guest
Re: Psetup in (Plotconfigs)
« Reply #10 on: March 17, 2008, 06:46:47 PM »
Then I'll just shut up since you have it.

ML

  • Guest
Re: Psetup in (Plotconfigs)
« Reply #11 on: March 17, 2008, 06:48:25 PM »

LOL
OK



ML

  • Guest
Re: Psetup in (Plotconfigs)
« Reply #12 on: March 17, 2008, 06:50:14 PM »

Didn't it make sense what I am saying Bob?

Bob, as you know, I always respect your opinion.

It just really doesn't seem to need to be debated, it is fairly cut and dry.

Have a good one!

Mark

Bob Wahr

  • Guest
Re: Psetup in (Plotconfigs)
« Reply #13 on: March 17, 2008, 06:53:51 PM »
Different ways of skinning kittens and all.  My preference is to avoid using external liberries when I can so I would rather have my code make the pagesetups than have it be dependant on DBX to do it.  They'll both get the job done.

ML

  • Guest
Re: Psetup in (Plotconfigs)
« Reply #14 on: March 17, 2008, 06:56:04 PM »

That would be cool if I were doing something on the fly but I want the users to still be able to make changes manually when necessary as well. In this case

Mark