Author Topic: Page Setup problems  (Read 533 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7022
Re: Page Setup problems
« Reply #15 on: August 06, 2019, 04:03:27 PM »
ronjonp,

The last version of FOO that you posted crashes in Model Space with the following error:

-psetupin Enter file name: Server3.dwt Enter user defined page setup(s) to import or [?]: *
Command: Regenerating model - caching viewports.
; error: Too many actual parameters
Ooops .. had a typo. Revised code in original post.

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

baglover

  • Mosquito
  • Posts: 12
Re: Page Setup problems
« Reply #16 on: August 06, 2019, 04:27:27 PM »
ronjonp,

Reassigning, or stripping, the server info out and replacing it was my first thought, but I wasn't able to figure out how to do it.

Unfortunately your routine returned an error:

; error: Automation Error. Invalid input


ronjonp

  • Needs a day job
  • Posts: 7022
Re: Page Setup problems
« Reply #17 on: August 06, 2019, 04:35:45 PM »
Can you post a sample drawing so I have something to test on? Just been coding blind :)

From the help file:
Quote
Remarks
This property does not take a fully qualified path, only the file name for the configuration file. Use the PrinterConfigPath property to specify the path for printer configuration files.

Use the RefreshPlotDeviceInfo method before trying to change the ConfigName property.

Do not assign the ConfigName property a value of "None." Attempting to do so results in unexpected behavior.

That being said just try refreshing the plot device info:

Code - Auto/Visual Lisp: [Select]

*face meet palm*

« Last Edit: August 06, 2019, 04:51:03 PM by ronjonp »

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

baglover

  • Mosquito
  • Posts: 12
Re: Page Setup problems
« Reply #18 on: August 06, 2019, 05:33:15 PM »
ronjonp

Attached is a sample 8 1/2" x 11" Portrait drawing and the Server3 template file where the updated page setups are stored.

Thanks again for looking at this.


57gmc

  • Newt
  • Posts: 86
Re: Page Setup problems
« Reply #19 on: August 06, 2019, 06:07:35 PM »
That being said just try refreshing the plot device info:

Hey Ron, if you used the CopyFrom method on the ActiveLayout, it should fix the problem, setting it to a named page setup.

ronjonp

  • Needs a day job
  • Posts: 7022
Re: Page Setup problems
« Reply #20 on: August 06, 2019, 06:21:44 PM »
ronjonp

Attached is a sample 8 1/2" x 11" Portrait drawing and the Server3 template file where the updated page setups are stored.

Thanks again for looking at this.
Your printer names are NOT the same:
Old server: "\\rrj-sbs2011\CAD Copier BW KM C364"
New server: "\\rrj-s3\Willowbrook CAD Copier Color KM C364"


Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

baglover

  • Mosquito
  • Posts: 12
Re: Page Setup problems
« Reply #21 on: August 07, 2019, 09:53:11 AM »
I understand that the printers were renamed (something I recommended against) but the names of the Page Setups are the same.

I guess this isn't as simple as substituting "Old Current Page Setup Name" with "New Page Setup Name".

At this point I am able to globally delete the old page setups and import the new page setups. 

If what I need is a LISP routine that will need to update both the "Device Name" as well as "Where" it pulls the driver from, then this goes beyond asking for assistance.

Thanks everyone for your suggestions and your effort.

ronjonp

  • Needs a day job
  • Posts: 7022
Re: Page Setup problems
« Reply #22 on: August 07, 2019, 12:19:55 PM »
The issue is finding what pagesetup name is tied to what tab. I could not find a way to do that.
If that part of the problem gets solved, then the copyfrom method should work as mentioned.

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

baglover

  • Mosquito
  • Posts: 12
Re: Page Setup problems
« Reply #23 on: August 07, 2019, 12:48:09 PM »
ronjonp

I appreciate all you have done so far.

The only way that I know of to get the page setup name for each tab is the Field PageSetupName (%<\AcVar PageSetupName>%) but I've not been able to work that back into the routine.


57gmc

  • Newt
  • Posts: 86
Re: Page Setup problems
« Reply #24 on: August 07, 2019, 01:13:58 PM »
The layout doesn't store the name of the page setup used to set the current settings. The CopyFrom method doesn't copy the name of the page setup to the Layout. It only copies the settings to the layout. You just have to choose a page setup to make current. If you are going to batch the files, choosing a page setup for all the files shouldn't be a problem.

ronjonp

  • Needs a day job
  • Posts: 7022
Re: Page Setup problems
« Reply #25 on: August 07, 2019, 02:05:29 PM »
The layout doesn't store the name of the page setup used to set the current settings. The CopyFrom method doesn't copy the name of the page setup to the Layout. It only copies the settings to the layout. You just have to choose a page setup to make current. If you are going to batch the files, choosing a page setup for all the files shouldn't be a problem.
Ageed. The idea was to see what was used last and match it. Picking a default would be much easier :)
I guess I could compare a list of properties using vl-every for the tabs and the imported pagesetups to get a 'match'.

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

57gmc

  • Newt
  • Posts: 86
Re: Page Setup problems
« Reply #26 on: August 07, 2019, 02:56:12 PM »
The layout doesn't store the name of the page setup used to set the current settings. The CopyFrom method doesn't copy the name of the page setup to the Layout. It only copies the settings to the layout. You just have to choose a page setup to make current. If you are going to batch the files, choosing a page setup for all the files shouldn't be a problem.
Ageed. The idea was to see what was used last and match it. Picking a default would be much easier :)
I guess I could compare a list of properties using vl-every for the tabs and the imported pagesetups to get a 'match'.
That could work. However, I was responding more to the OP. If you can get him to agree, your job would be simpler. Personally, in my office, I don't worry about updating existing dwgs. I have a routine that performs the update to a standard via one click. So its not a loss of productivity to have users do the update as needed.

baglover

  • Mosquito
  • Posts: 12
Re: Page Setup problems
« Reply #27 on: August 07, 2019, 03:17:45 PM »
Resetting the Current Page Setup to one "Default" page setup would work. 

That was the thinking behind creating the BLANK page setup in the template file. 

Its not as efficient as updating the Current Page Setup to the proper setting, but most of these drawings are legacy drawings which will never be opened/plotted again.  I just can't tell you which ones those are. 

So I can update the drawings right now, because I can delete the old page setups, and import the new update ones.  Though I'll probably wait and do it over the weekend just to be sure I'm not trying to update a drawing someone is using.

I was just thinking if the final hurtle could be cleared, my users wouldn't have to do anything when they plot an older drawing.