• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

macro for editing print style to hundreds of layouts

  • Thread starter Thread starter brizzo1982
  • Start date Start date

brizzo1982

Guest
Good morning, everyone.
devo (ahimè) edit to some files (used as models) the preset print style.
These files, necessary for the realization of electrical schematics, have within hundreds of layouts.
each layout has default set the print parameters, then as a printer "laser b/n.pc3", as sheet size "a4", scale "suitable size", and printing style "schemi.ctb", etc..

is there a mode to create a macro (a field unknown to me) or something like that, to be able to automatically change in all default layouts, for example, the printer in "colors.pc3" and print style in "schemi_colori.ctb"? ?

Thank you very much.. :finger:
 
Good morning, everyone.

No idea about that? :confused:

..the problem is that I don't have enough autolisp knowledge and practically nothing vba..so I don't even know which tool to create this automatism.
thanks anyway for the attention. :smile:
 
if you are looking for the forum there is a discussion (or more) that speaks of an excel file to create scripts, and it is usable for printing, conversion etc. try to see how to solve

the file is called createfilescript created by rrpor66
 
@shape
Thank you for your concern. I had already tried to use it in the past without great results.
the problem is that I don’t know which commands to insert to change the required print settings, and especially how to slip to the next layout! !

@tir
Thank you for your concern. Unfortunately this lisp changes all settings of all layouts with the settings of the selected layout. so doing I lose even the "window" print selections, different in all layouts.
I just need to change the printer.pc3 and .ctb, keeping all other options unchanged.
 
save this code by name cambia_stampante_layout.lsp in a folder read from the autocad path:
Code:
(fun c:csl)
(foreach l (layoutlist )
(command "._layout" "_set" l)
(command "_-plot"
"_y"
l
"name_stampante"
""
""
""
""
""
""
""
""
"nome.ctb"
""
""
""
""
""
"_y"
"_n"
)
)
)
with createfilescript select the files that interest you, will be inserted in column a.

in column c insert these instructions, one per line:_
file
(load "cambia_stampante_layout")
csl
_qsave
_close
button creates script file

in autocad, in a new design, script command and select what you created.


notes:
- do before testing with a few test dwg
- replace name_printing strings and name_ctb with those you need to use
- the code replicates the answers to all _-plot command request messages, each "" (double quotes) corresponds to a sending, i.e. confirms the proposed data, if you want to change other settings try the command in autocad and see the sequence of requests.
 
thanks endless gp. for the work you did!
Unfortunately, I have some problem in making the lisp work.
the part of createscript I happen, even if for duty of record I correct you on the fact that the commands must be written in column d (and not c).
the file uploaded by script or manually, replies:

"
HTML:
command:
command: change_printer_layout.lsp loaded.


command:
command:
command: specify opposite angle:
command: csl
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "y". press f1 for the guide.
unknown command "n". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "y". press f1 for the guide.
unknown command "n". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "y". press f1 for the guide.
unknown command "n". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "y". press f1 for the guide.
unknown command "n". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "y". press f1 for the guide.
unknown command "n". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "y". press f1 for the guide.
unknown command "n". press f1 for the guide.
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide.
; error: function canceled

command: *nullato*

command: *nullato*

command: <passaggio 1_14="" a:="">regeneration of current layout.
regeneration model in progress.

command: _.pagesetup </passaggio>
"


to which if you left it would turn all the layouts contained in the file, but without changing anything.
I am sure that I have entered the fields name_printer and name.ctb the name of my new printer.pc3 and the name of the correct ctb....but it does not work.

the trouble is, that started from the model of new virgin file, the two layouts created by default by autocad edit them correctly! ! !

Where could the hippo be with my files? ?
 
...the commands must be written in column d (and not c).
e' vero... :tongue:


view that is dry:
command:
command:
command: specify opposite angle:command: csl
unknown command "csl". press f1 for the guide.
unknown command "csl". press f1 for the guide
... .... .
... .... .
... .... .
You have to wonder where that request comes from.
Since the lisp works if launched by the single dwg obviously the problem is in the script, are you sure you don't have spaces before or after each single command in the line?

try to create the script with the attached xls.
 

Attachments

I don't know if the problem can be that but scripts are not coordinated with the vba if you open many designs can be that opening the file happens before the lisp has finished working which causes casino... already tested on other macros !!!
 
I'm running, I can't try the script.
Consider that the error gave it to me even by starting the lisp in the design.. so I don't think it's a script but file problem.

the opposite corner maybe it can be a window print selection? ?

to make you understand my situation I attach one of the files (so I have dozens to edit).
try to throw the lisp and you will see (law of murphy apart :biggrin:), the error you give.

Thank you, we feel again Monday!! :finger:

good work and w-e
 

Attachments

I noticed that they answered me on the American autodesk website.
I'm not at work. I'll try Monday.
Curious and never practice this mode of editing through text editor.. opens me a world! !
Thank you and good day!
 
I confirm what is reported by tir.
saving in dxf, renamed in txt, you can at one stroke only change the required settings.

Thank you all!
 
save this code by name cambia_stampante_layout.lsp in a folder read from the autocad path:
Code:
(fun c:csl)
(foreach l (layoutlist )
(command "._layout" "_set" l)
(command "_-plot"
"_y"
l
"name_stampante"
""
""
""
""
""
""
""
""
"nome.ctb"
""
""
""
""
""
"_y"
"_n"
)
)
)
with createfilescript select the files that interest you, will be inserted in column a.

in column c insert these instructions, one per line:_
file
(load "cambia_stampante_layout")
csl
_qsave
_close
button creates script file

in autocad, in a new design, script command and select what you created.


notes:
- do before testing with a few test dwg
- replace name_printing strings and name_ctb with those you need to use
- the code replicates the answers to all _-plot command request messages, each "" (double quotes) corresponds to a sending, i.e. confirms the proposed data, if you want to change other settings try the command in autocad and see the sequence of requests.
Hi.
the lisp you created works in part or better... only works on the first layout of the file, why doesn't everyone do it? the command set l to what corresponds?
I have the autocad in Italian and maybe not all the layouts begin for l but are numbered.
Thank you.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top