ActiveX Plotting Script

Discussion in 'AutoCAD' started by Eric Schneider, Dec 20, 2004.

  1. Hello group. Its been a while since I've checked in here.

    Would someone please help me out here. I've been staring at this one too
    long and can no longer see (what I am sure is) the profoundly obvious.

    I've been banging my head against the monitor over this one. I wrote an
    ActiveX plot routine and it don't work. The idea is to feed it the plot
    setup and it returns the current settings so they can be restored when the
    plot is finished.

    Thanks in advance.

    Regards,
    Eric Schneider

    Change the variable 'sheet' to a 'Paper size' you know you have on the
    current 'Printer/plotter' or change the "Printer/plotter' to 'None'.

    (setq alay (vla-get-ActiveLayout (adoc))
    sht "Legal_(8.50_x_14.0_Inches)";valid on 'Printer/plotter' 'None'
    scl 36
    )

    (setq dat
    (plotset
    (list
    (list 'vla-RefreshPlotDeviceInfo alay)
    (list 'vla-put-CanonicalMediaName alay sht)
    (list 'vla-SetCustomScale alay 1 scl)
    )
    )
    )

    (defun plotset (lst / ret)
    (mapcar
    '(lambda (x / den fun get num obj str)
    (setq fun (car x)
    obj (cadr x)
    str (vl-prin1-to-string fun)
    )
    (cond
    ( (wcmatch-p str "vla-put-*")
    (setq get (eval (list (read (vl-string-subst "-get-" "-put-" str))
    obj))
    ret (cons (list fun obj get) ret)
    )
    )
    ( (wcmatch-p str "vla-SetC*")
    (eval (list (read (vl-string-subst "-GetC" "-SetC" str)) obj 'num
    'den))
    (setq ret (cons (cons fun (cons obj (list num den))) ret))
    )
    ( T (setq ret (cons x ret)))
    )
    (eval x)
    )
    lst
    )
    (reverse ret)
    )
     
    Eric Schneider, Dec 20, 2004
    #1
  2. Eric,

    It is good to hear from you again.

    Your quotes weren't making it to the eval:

    (list (read (vl-string-subst "-GetC" "-SetC" str)) obj '(quote num) '(quote
    den))


    --
    R. Robert Bell


    Hello group. Its been a while since I've checked in here.

    Would someone please help me out here. I've been staring at this one too
    long and can no longer see (what I am sure is) the profoundly obvious.

    I've been banging my head against the monitor over this one. I wrote an
    ActiveX plot routine and it don't work. The idea is to feed it the plot
    setup and it returns the current settings so they can be restored when the
    plot is finished.

    Thanks in advance.

    Regards,
    Eric Schneider

    Change the variable 'sheet' to a 'Paper size' you know you have on the
    current 'Printer/plotter' or change the "Printer/plotter' to 'None'.

    (setq alay (vla-get-ActiveLayout (adoc))
    sht "Legal_(8.50_x_14.0_Inches)";valid on 'Printer/plotter' 'None'
    scl 36
    )

    (setq dat
    (plotset
    (list
    (list 'vla-RefreshPlotDeviceInfo alay)
    (list 'vla-put-CanonicalMediaName alay sht)
    (list 'vla-SetCustomScale alay 1 scl)
    )
    )
    )

    (defun plotset (lst / ret)
    (mapcar
    '(lambda (x / den fun get num obj str)
    (setq fun (car x)
    obj (cadr x)
    str (vl-prin1-to-string fun)
    )
    (cond
    ( (wcmatch-p str "vla-put-*")
    (setq get (eval (list (read (vl-string-subst "-get-" "-put-" str))
    obj))
    ret (cons (list fun obj get) ret)
    )
    )
    ( (wcmatch-p str "vla-SetC*")
    (eval (list (read (vl-string-subst "-GetC" "-SetC" str)) obj 'num
    'den))
    (setq ret (cons (cons fun (cons obj (list num den))) ret))
    )
    ( T (setq ret (cons x ret)))
    )
    (eval x)
    )
    lst
    )
    (reverse ret)
    )
     
    R. Robert Bell, Dec 23, 2004
    #2
  3. Doh! I'm out of practice.

    Thanks Robert.

    P.S. I've been doing allot of different stuff. My job description has
    widened out quite a bit, I've moved and had a couple more kids! Busy busy
    busy! If you get bored, here a bunch of images of personal junk to take in
    (if the link works, on some connections it works, no some it doesn't)

    http://eswebs.com/gallery/Digital-Pictures-of-Everything
     
    Eric Schneider, Dec 27, 2004
    #3
  4. Servers in a wash room?!

    So that's what you look like. Nice looking family.

    --
    R. Robert Bell


    Doh! I'm out of practice.

    Thanks Robert.

    P.S. I've been doing allot of different stuff. My job description has
    widened out quite a bit, I've moved and had a couple more kids! Busy busy
    busy! If you get bored, here a bunch of images of personal junk to take in
    (if the link works, on some connections it works, no some it doesn't)

    http://eswebs.com/gallery/Digital-Pictures-of-Everything
     
    R. Robert Bell, Dec 27, 2004
    #4
  5. Yup. Wash room! Yup, that's me. Thanks 'bout the family. Kirsten is 4,
    Carson is 1.5, and Kaitlyn is 3 weeks and Cherie is old enough to have 3
    kids. ;^) That's a peek into my life.

    Regards,
    Eric S.
     
    Eric Schneider, Dec 27, 2004
    #5
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.