ActiveX help

Discussion in 'AutoCAD' started by Rodney Estep, Aug 23, 2004.

  1. Rodney Estep

    Rodney Estep Guest

    Dear all,
    I ran across this code a while back and this does 1/2 of what I need.
    This gives me a list of all of the plot devices available to autocad but I
    need to know the sheet names available to each printer.

    (defun GetPlotDevices (ad)
    (vla-RefreshPlotDeviceInfo
    (vla-get-activelayout
    ad))
    (vlax-safearray->list
    (vlax-variant-value
    (vla-getplotdevicenames
    (vla-item (vla-get-layouts ad) "Model"))))
    )
    (setq dp_plotters (GetPlotDevices (vla-get-activedocument
    (vlax-get-acad-object))) cntr 0 dP_plotter_con (list))

    (repeat (length dp_plotters)
    (setq dp_plotter (nth cntr dp_plotters))
    ;***this is where I need help***
    (setq sheet_list (vl?????
    ;***
    (setq dp_plotter_con (append (list (cons dp_plotter sheet_list))
    dp_plotter_con )
    cntr (1+ cntr)
    )
    )
    ;;;;; I SHOULD USE FOREACH FOR THIS BUT OLD HABITS ARE HARD TO BREAK :)

    Thanks
    Rodney
     
    Rodney Estep, Aug 23, 2004
    #1
  2. Rodney Estep

    zeha Guest

    Rodney,

    Maybe this

    (repeat (length dp_plotters)
    (setq dp_plotter (nth cntr dp_plotters))
    ;***this is where I need help***
    (vla-put-configname al pd)

    (setq sheet_list
    (vla-GetLocaleMediaName
    (vla-item (vla-get-layouts ad) "Model")
    (vlax-safearray->list
    (vlax-variant-value
    (vla-GetCanonicalMediaNames
    (vla-item (vla-get-layouts ad) "Model"))))))
    (setq dp_plotter_con (append (list (cons dp_plotter sheet_list))
    dp_plotter_con )
    cntr (1+ cntr)
    )
    )

    Not tested

    Cheers

    Harrie
     
    zeha, Aug 23, 2004
    #2
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.