- 积分
- 7560
- 明经币
- 个
- 注册时间
- 2022-2-9
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 sandyvs 于 2024-7-7 11:24 编辑
2024.7.6更新,我的解决办法:如果想打任意尺寸,用一个PDFfactory.pc3,如果不行,恢复这个pc3的默认值,重新设置就好了。如果打特定尺寸,就用pdffactory或者用其他的pc3,不要跟任意尺寸的用一个。我这测试没问题。
陈伟大佬已找到解决办法,这下不用重新定义pc3,pmp文件就可以打任意尺寸了。
PDFfactory可以通过写入注册表添加自定义尺寸,@陈伟的帖子有提及,http://bbs.mjtd.com/thread-188520-1-1.html
问题是是需要重启cad后才能使用,但偶然发现不重启CAD也能刷新,就是用其他pc3打印机打印一下就可以了。
或者在特性那恢复下默认值也可以。
不知道有没有人研究过,是什么原因,或是更新了什么才导致PDFfactory打印尺寸列表更新的?
(defun ppsize (tufuAA Height Width / i pdfD pdfF reg-path reg-path1 reg-path2 reg-path3 tufuAA);陈伟
(setq reg-path "HKEY_CURRENT_USER\\Software\\FinePrint Software\\")
(setq reg-path2 "\\CustomPapers\\")
(setq i 1)
(repeat 15 ;重复15次,最高支持pdfFactory15
(setq reg-path1 (strcat "pdfFactory" (itoa i))) ;pdfFactory版本号
(setq pdfD (vl-registry-read (strcat reg-path reg-path1) "Version"))
;(setq reg-path3 "chenwei-A2+5/2")
(setq pdfF (vl-registry-read (strcat reg-path reg-path1 reg-path2 reg-path3 ) "Width"))
(if (and (not pdfF) pdfD)
(progn
(vl-registry-write (strcat reg-path reg-path1 reg-path2 tufuAA) "Height" Height)
(vl-registry-write (strcat reg-path reg-path1 reg-path2 tufuAA) "Width" Width)
)
)
(setq i (1+ i))
)
tufuAA
)
;;http://bbs.mjtd.com/forum.php?mo ... 8087&fromuid=338795
;;; 获得某打印机纸张类型列表, 返回形如 "过大尺寸:ISO A2 (纵向)" "过大尺寸:ISO A2 (横向)".... 的列表
;;; 例: (setq PaperSizes (GetPaperList1 "HP DesignJet 430 (E/A0) by HP" ))
(defun GetPaperList1 (configName / app canpapersizearr canpapersizelist canpapersizevar app doc index layout papersize)
(vl-load-com)
(setq app (vlax-get-acad-object)
doc (vla-get-activedocument app)
layout (vla-get-activelayout doc)
)
(vla-put-configname layout configName) ;将打印机设为当前打印机
(vla-RefreshPlotDeviceInfo layout)
(setq CanPaperSizeVar (vla-GetCanonicalMediaNames layout)
CanPaperSizeArr (vlax-variant-value CanPaperSizeVar)
CanPaperSizeLIst (vlax-safearray->list CanPaperSizeArr)
PaperSize '()
index 0
)
(repeat (length CanPaperSizeList)
(setq Papersize (cons (vla-GetLocaleMediaName layout (nth index CanPaperSizeList)) Papersize)
index (1+ index)
)
)
(reverse PaperSize)
)
;;; 获得某打印机纸张类型列表, 返回形如 "User620" "User1644".... 的列表
;;; 例: (setq PaperSizes (GetPaperList2 "HP DesignJet 430 (E/A0) by HP" ))
(defun GetPaperList2 (configName / app canpapersizearr canpapersizelist canpapersizevar app doc layout)
(vl-load-com)
(setq app (vlax-get-acad-object)
doc (vla-get-activedocument app)
layout (vla-get-activelayout doc)
)
(vla-put-configname layout configName);将打印机设为当前打印机
(vla-RefreshPlotDeviceInfo layout)
(setq CanPaperSizeVar (vla-GetCanonicalMediaNames (vla-item (vla-get-layouts doc) "Model"))
CanPaperSizeArr (vlax-variant-value CanPaperSizeVar)
CanPaperSizeLIst (vlax-safearray->list CanPaperSizeArr)
)
)
(setq acaddoc (vla-get-activedocument (vlax-get-acad-object)))
(setq plot (vla-get-plot acaddoc))
(setq clayout (vla-get-activelayout acaddoc))
(setq 2pt (list (getpoint)(getpoint)))
(setq llur (list (apply 'mapcar (cons 'min 2pt) ) (apply 'mapcar (cons 'max 2pt))))
(setq ppWidth (abs (- (caar llur) (caadr llur))))
(setq ppHeight (abs (- (cadar llur) (cadadr llur))))
(setq papername "自定义")
(ppsize papername (fix (* 1000 ppWidth)) (fix (* 1000 ppHeight)) )
(chaxundayingshebei)
(setq index (vl-position (strcase papername) (mapcar (function strcase) (GetPaperList1 "pdfFactory Pro.pc3") )));pdfFactory Pro.pc3只能加两个,之后就加不进去了
(vla-put-CanonicalMediaName clayout (nth index (GetPaperList2 "pdfFactory Pro.pc3")))
暂时找到一种方法,但是太慢了。。
;;所有的
;(GetAllMediaNames (vla-get-activedocument (vlax-get-acad-object)))
(defun GetAllMediaNames (ad / al cn pd apmn)
(setq al (vla-get-activelayout ad))
(setq cn (vla-get-configname al))
(foreach pd (GetPlotDevices ad)
(if (/= pd "None")
(progn
(vla-put-configname al pd)
(setq apmn (cons pd apmn))
(setq apmn (cons (GetCanonicalMediaNames ad) apmn))
)
)
)
(if (/= cn "None") (vla-put-configname al cn))
(reverse apmn)
)
; (AllLocalMediaNames (vla-get-activedocument (vlax-get-acad-object)))
(defun AllLocalMediaNames(ad / al cn pd apmn)
(setq al (vla-get-activelayout ad))
(setq cn (vla-get-configname al))
(foreach pd (GetPlotDevices ad)
(if (/= pd "None")
(progn
(vla-put-configname al pd)
(setq apmn (cons pd apmn))
(setq apmn (cons (GetLocaleMediaNames ad) apmn))
)))
(if (/= cn "None") (vla-put-configname al cn))
(reverse apmn)
)
;;"图纸尺寸"定义的本地名称
(defun GetLocaleMediaNames (ad / mn mnl)
(setq la (vla-item (vla-get-layouts ad) "Model"))
(foreach mn (GetCanonicalMediaNames ad)
(setq mnl (cons (vla-GetLocaleMediaName la mn) mnl))
)
(reverse mnl)
)
;;所有的打印机设置.(设置,不是名称!)
;;(GetPlotDevices (vla-get-activedocument (vlax-get-acad-object)))
(defun GetPlotDevices (ad)
(vla-RefreshPlotDeviceInfo (vla-get-activelayout ad))
(vlax-safearray->list (vlax-variant-value (vla-getplotdevicenames
(vla-item (vla-get-layouts ad) "Model"))))
)
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|