0 Members and 1 Guest are viewing this topic.
(defun foo (name) (vlax-map-collection (vla-get-plotconfigurations (vla-get-activedocument (vlax-get-acad-object))) '(lambda (x) (vla-put-configname x name)) ))(foo "xxx.pc3")
(defun c:fixprinterserverlocation (/ _stripath _getnetworkprinters name printers) (defun _stripath (path / n ) (if (setq n (vl-string-position (ascii "\\") path 0 t)) (strcase (substr path (+ 2 n))) path ) ) (defun _getnetworkprinters (/ i name out p ws) (if (and (setq ws (vlax-get-or-create-object "WScript.Network")) (setq p (vlax-invoke ws 'enumprinterconnections)) (setq i (vlax-invoke p 'count)) ) (repeat i (if (wcmatch (setq name (vla-item p (setq i (1- i)))) "\\\\*") (setq out (cons (cons (_stripath name) name) out)) ) ) ) out ) (_getnetworkprinters) (if (setq printers (_getnetworkprinters)) (vlax-for x (vla-get-plotconfigurations (vla-get-activedocument (vlax-get-acad-object))) (if (setq name (cdr (assoc (_stripath (vla-get-configname x)) printers))) (vla-put-configname x name) ) ) ) (princ))(c:fixprinterserverlocation)
it is wanderful!