Macro Printer Change

Hello

I have a problem when changing the Background. The layout does not change and remains on the settings of the 1st basemap.

To "correct" this "default" I created a small macro that changes the basemap and then the layout according to the basemap. My problem is that depending on the size of the background plan we change printers which puts my macro at default.

How do I include a printer change in a macro???

 

Or how to include this layout change when manually changing the baseline???

Hello

 

If I understood correctly, you print a4 on an "A" printer, and a3 on a "B" printer?

 

Why not set the a3 basemap directly to print on the "B" printer and the a4 on the "A"?

 

Then when you launch your macro, (I did the same one, it's really practical), since your basemaps have their own printing parameters, everything works.

 

Keep us informed;)

3 Likes

That's exactly what I wanted to do but I must have missed something when making the background plan because when changing the background plan the printer doesn't change.

1 Like

I'm not at work, so I can't test.... I don't have a printer installed here

 

But if it doesn't work, don't hesitate ;)

When you create/edit your drwdot file (so not the basemap but the MEP template), you need to adjust your layout (file/layout).

On the other hand, if you change the size along the way and therefore change the background plan (slddrt), I don't think the layout comes with it.

2 Likes

Well I did some tests again by redoing my basemaps and the printer is not kept in the baseplane...

 

How I create my basemaps: I create my DRWDOT or I fill in the printer, the layout and then in the explorer I make a copy that I rename to . SLDDRT

 

Edit: @stefbeno I confirm that the layout doesn't change hence the macro I'm trying to do... On the other hand, there is the problem of choosing the printer that I can't implement in my macro...

1 Like

Have you tried to do a macro in manu and see what happens?

 

By that, I mean, record a macro, do the manipulation and then edit the macro to see how it works (it doesn't always work, but you never know. It helps sometimes)

2 Likes

I confirm that this is not possible, even by going through a macro

 

See this link http://help.solidworks.com/2015/English/api/swconst/filepagesetup.htm

 

Basically: "Defined by the operating system or by a specific printer device; there is no SOLIDWORKS API enumeration for these values"

3 Likes

Arf, you're hard Bart in the morning like that.

 

That said, for the original problem, I don't really understand why it doesn't follow. In general it follows on its own. And if you need to scale on writing, there's a message that pops up asking you the question. Maybe you checked "by default" the fact of not doing it? (Tools, System Option, Advanced)

1 Like

Here, he just wants to be able to have a layout that matches the format of the drawing, so that he doesn't have to choose a printer and paper size.

 

So I confirm that this is not possible with Soldiworks 2014

Thank you Bart I didn't know the API help site of solid...

So the same fight for the choice of printer: http://help.solidworks.com/2015/English/api/swconst/fileprint.htm  => Not currently available in SOLIDWORKS API

I had built my macro on the basis of a manual macro recording without finding the printer change, I understand why now.... :'(

1 Like

In fact, it is possible, but only in certain cases.

 

Some printers can be configured under windows to automatically print according to the desired format.

 

But I've never encountered this case...

Hello

A priori it is possible to choose the default printer for a drawing (be careful with the min update case):  

Gets or sets the default printer for this document.

.NET Syntax

Visual Basic (Declaration) 
Property Printer As System.String
Visual Basic (Usage) 
IModelDoc2
Dim value As System.String
 
instance. Printer = value
 
value = instance. Printer

Spring

http://help.solidworks.com/2015/english/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.imodeldoc2~printer.html

You can even start printing directly afterwards:

http://help.solidworks.com/2015/english/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.imodeldoc2~printdirect.html

 

And as a bonus, a macro where a priori he changes the layout:

https://forum.solidworks.com/thread/60953

Hello to tous.je come here to testify that you are attempting an impossible mission. Personally, I have not yet found a solution to this problem but as soon as I find a lead, I will come back to you to inform you.