Author Topic: control PLOTTER NAME list  (Read 4705 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: control PLOTTER NAME list
« Reply #15 on: January 14, 2010, 02:46:56 PM »
Careful - registry involved:

Code: [Select]
;; DvcNme  =  Device Name [STR]

(defun PutDefPlotDevice (DvcNme)
  (vl-load-com)
  ;; Lee Mac  ~  14.01.10

  (if (vl-position (strcase DvcNme)
        (mapcar (function strcase)
                (vlax-safearray->list
                  (vlax-variant-value
                    (vla-getPlotDeviceNames
                      (vla-get-ActiveLayout
                        (vla-get-ActiveDocument
                          (vlax-get-acad-object))))))))

    (vl-registry-write
      (strcat "HKEY_CURRENT_USER\\" (vlax-product-key)
              "\\Profiles\\" (getvar "CPROFILE") "\\General")

      "DefaultConfig" DvcNme)))

aicr317

  • Guest
Re: control PLOTTER NAME list
« Reply #16 on: January 14, 2010, 03:03:01 PM »
Careful - registry involved:

Code: [Select]
;; DvcNme  =  Device Name [STR]

(defun PutDefPlotDevice (DvcNme)
  (vl-load-com)
  ;; Lee Mac  ~  14.01.10

  (if (vl-position (strcase DvcNme)
        (mapcar (function strcase)
                (vlax-safearray->list
                  (vlax-variant-value
                    (vla-getPlotDeviceNames
                      (vla-get-ActiveLayout
                        (vla-get-ActiveDocument
                          (vlax-get-acad-object))))))))

    (vl-registry-write
      (strcat "HKEY_CURRENT_USER\\" (vlax-product-key)
              "\\Profiles\\" (getvar "CPROFILE") "\\General")

      "DefaultConfig" DvcNme)))


in this work ,it seems only edit the registry,not work in cad,

T.Willey

  • Needs a day job
  • Posts: 5251
Re: control PLOTTER NAME list
« Reply #17 on: January 14, 2010, 03:18:56 PM »
Sometimes when you edit the registry it will only show up after you close and reopen Acad.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

ronjonp

  • Needs a day job
  • Posts: 7527
Re: control PLOTTER NAME list
« Reply #18 on: January 14, 2010, 03:24:04 PM »
Can't this be used instead of writing to reg?

Code: [Select]
;; DvcNme  =  Device Name [STR]

(defun putdefplotdevice (dvcnme)
  (vl-load-com)
  ;; Lee Mac  ~  14.01.10 ... RJP edit
  (if (vl-position
(strcase dvcnme)
(mapcar (function strcase)
(vlax-invoke
  (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object)))
  'getplotdevicenames
)
)
      )
    (vla-put-defaultoutputdevice
      (vla-get-output (vla-get-preferences (vlax-get-acad-object)))
      dvcnme
    )
  )
)
« Last Edit: January 14, 2010, 03:30:53 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: control PLOTTER NAME list
« Reply #19 on: January 14, 2010, 03:35:20 PM »
Nice one Ron - I really need to investigate that side of the object model a bit more  :wink:

ronjonp

  • Needs a day job
  • Posts: 7527
Re: control PLOTTER NAME list
« Reply #20 on: January 14, 2010, 03:47:55 PM »
Nice one Ron - I really need to investigate that side of the object model a bit more  :wink:

 8-)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: control PLOTTER NAME list
« Reply #21 on: January 14, 2010, 04:18:31 PM »
Speaking of using your own dialog:
http://www.theswamp.org/index.php?topic=1916.0
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.