dfuehrer
2008-02-27, 09:11 PM
Hello everyone,
I am faced with a challenge (to me anyway). Here are my job I have reciently changed locations, and thus my networked printers have changed. Here's the problem. We have literally hundreds and hundreds of drawing files that I use on a regular basis that are now mapped to the wrong printer because they are set that way in the Pagesetup Manager.
I have been attempting to write some code that I can at least run on a drawing by drawing basis, to change this setup. So far, no luck. There are a couple of other considerations here too. There may be portrait or landscape layouts, as well as multiple layout tabs within the same drawing.
I received some help a while ago here, on another routine that used visual basic to search the individual drawing for a named layout tab that *might* be named this, or that. I have attemped to use this as a basis for what I am writing now, but no joy. When I run what I have, I get: ; error: no function definition: VLAX-GET-ACAD-OBJECT. here is my code for the vertical (portrait) orientation.
(defun c:cpv ()
(command "cmdecho" "0")
(setq ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(vlax-for lo (vla-get-Layouts ActDoc)
(setq LoName (vla-get-Name lo))
(if
(and
(vl-string-search "11" LoName)
(vl-string-search "17" LoName)
(vl-string-search "Vertical" LoName)
)
(vla-put-ActiveLayout ActDoc lo)
)
)
(command "-plot" "Y" "11x17 Vertical" "\\PRNSRV13\LN1016826" "Ansi B 11 x 17 in" "inches" "portrait"
"no" "layout" "1:1" "0.00,0.00" "no" "" "yes" "no" "no" "no" "yes" "no")
(command "cmdecho" "1")
(princ)
)
Anyone have any ideas?? I'm in over my head...
Thank you in advance!
Don
Moderator Note:
How to use [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code)
I am faced with a challenge (to me anyway). Here are my job I have reciently changed locations, and thus my networked printers have changed. Here's the problem. We have literally hundreds and hundreds of drawing files that I use on a regular basis that are now mapped to the wrong printer because they are set that way in the Pagesetup Manager.
I have been attempting to write some code that I can at least run on a drawing by drawing basis, to change this setup. So far, no luck. There are a couple of other considerations here too. There may be portrait or landscape layouts, as well as multiple layout tabs within the same drawing.
I received some help a while ago here, on another routine that used visual basic to search the individual drawing for a named layout tab that *might* be named this, or that. I have attemped to use this as a basis for what I am writing now, but no joy. When I run what I have, I get: ; error: no function definition: VLAX-GET-ACAD-OBJECT. here is my code for the vertical (portrait) orientation.
(defun c:cpv ()
(command "cmdecho" "0")
(setq ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(vlax-for lo (vla-get-Layouts ActDoc)
(setq LoName (vla-get-Name lo))
(if
(and
(vl-string-search "11" LoName)
(vl-string-search "17" LoName)
(vl-string-search "Vertical" LoName)
)
(vla-put-ActiveLayout ActDoc lo)
)
)
(command "-plot" "Y" "11x17 Vertical" "\\PRNSRV13\LN1016826" "Ansi B 11 x 17 in" "inches" "portrait"
"no" "layout" "1:1" "0.00,0.00" "no" "" "yes" "no" "no" "no" "yes" "no")
(command "cmdecho" "1")
(princ)
)
Anyone have any ideas?? I'm in over my head...
Thank you in advance!
Don
Moderator Note:
How to use [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code)