Paper size in Autoplot routine.

Discussion in 'AutoCAD' started by Andrew McDonald, Feb 2, 2004.

  1. 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
     
    Andrew McDonald, Feb 2, 2004
    #1
  2. Andrew McDonald

    dean_bourke Guest

    Try including the quotation marks by using:

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

    Dean
     
    dean_bourke, Feb 2, 2004
    #2
  3. I think i need to remove the quotation marks...not include them.

    Regards
    Andrew McDonald
     
    Andrew McDonald, Feb 2, 2004
    #3
  4. Andrew McDonald

    dean_bourke Guest

    By putting in "ISO A1 594 x 840 mm.", you are already not including them.
     
    dean_bourke, Feb 3, 2004
    #4
  5. Sorry Dean, won't accept it either.
     
    Andrew McDonald, Feb 3, 2004
    #5
  6. 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)

    --
    Ken Alexander
    Acad2004
    Windows2000 Prof.

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein
     
    Ken Alexander, Feb 3, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.