Paper size in Autoplot routine.

Andrew McDonald

Usenet Archive
Joined
Jul 9, 2003
Messages
27
Reaction score
0
I have a routine which needs to accept the following paper size : ISO A1 594 x 840 mm. (with the period [.] at the end) I can use the following code to retrieve this name :

(DEFUN getlocalemedianames (adoc / la cmn lmn)
(SETQ la (VLA-ITEM (VLA-GET-LAYOUTS adoc) "Model"))
(FOREACH cmn (getcanonicalmedianames adoc)
(SETQ lmn (CONS (VLA-GETLOCALEMEDIANAME la cmn) lmn))
)
(REVERSE lmn)
)
(getlocalemedianames (vla-get-activedocument (vlax-get-acad-object)))

The name is returned in the form of : "ISO A1 594 x 840 mm."

This name when used in the line below won't be accepted by the routine (command "-PLOT" "y" "" "\\\\GCSERVER\\Cadjet 2" "ISO A1 594 x 840 mm." "m" "l" "n" "v" "a1" "1=1" "c" "y" "tvs.ctb" "y" "n")

However, if you type in the above manually, you can type in ISO A1 594 x 840 mm. (without the quotes) and it will be accepted.

My question is how do you get the (command "-plot" .....) line of code to accept this paper size.

Any replies greatly appreciated.

Regards
Andrew McDonald
 
Try including the quotation marks by using:

(strcat "\"" "ISO A1 594 x 840 mm." "\"")

Dean
 
I think i need to remove the quotation marks...not include them.

Regards
Andrew McDonald
 
By putting in "ISO A1 594 x 840 mm.", you are already not including them.
 
I'm not sure if this is the direction you need to go, but take a look at this. I modified your defun a bit and added a comparison check between localemedia and canonicalmedia names. Maybe this will help you.

(DEFUN getlocalemedianames (adoc / la cmn lmn)
(vla-RefreshPlotDeviceInfo (VLA-ITEM (VLA-GET-LAYOUTS adoc) "Model")) (SETQ la (VLA-ITEM (VLA-GET-LAYOUTS adoc) "Model")) (FOREACH cmn (setq user-list (safearray-value (variant-value (vla-getcanonicalmedianames la)))) (SETQ lmn (CONS (VLA-GETLOCALEMEDIANAME la cmn) lmn)) ) (setq lmn (REVERSE lmn))
)

(getlocalemedianames (vla-get-activedocument
(vlax-get-acad-object)))

(setq pos (vl-position "ANSI E - 34 x 44 in." lmn))
(setq user-name (nth pos user-list))
(vla-put-canonicalmedianame la user-name)
 

Latest threads

Back
Top