nkmjg 发表于 2024-3-18 19:20:11

cad批量页码lisp

本帖最后由 nkmjg 于 2024-5-26 08:44 编辑

   (defun c:mypt ()

(setq ss (ssget '((0 . "LWPOLYLINE")(62 . 5))))

(setq ss-list (WJM采用SS2LST ss))

(setq AcadObject (vlax-get-acad-object)

AcadDocument (vla-get-ActiveDocument AcadObject)

mSpace (vla-get-ModelSpace AcadDocument)

)

(setq preferenceSel (vla-get-Preferences AcadObject))

(setq fileSel (vla-get-Files preferenceSel))

(setq filedir(vla-get-PrinterConfigPath fileSel));采用打印机.

(setq plots (vl-directory-files filedir "*.pc3"))

(setq style (myp:get采用properties plots))

(setq style (substr style 1 (- (strlen style) 4)))

(setq filedir(vla-get-PrinterStyleSheetPath fileSel));采用打印样式.

(setq plot-styles (vl-directory-files filedir "*.ctb"))

(setq plot (myp:get采用properties plot-styles))

(setq plot (substr plot 1 (- (strlen plot) 4)))

(foreach en ss-list

(progn

(setq obj (vlax-ename->vla-object en))

(vla-getboundingbox obj 'll 'ur)

(setq pt1 (vlax-safearray->list ll))

(setq pt2 (vlax-safearray->list ur))

(command "采用.PLOT"

"Y";采用是否需要详细打印配置?[是(Y)/否(N)] : y

"";采用输入布局名或 [?] :

plot;采用输入输出设备的名称或 [?] :

"A3";采用输入图纸尺寸或 [?] :

"m";采用输入图纸单位 [英寸(I)/毫米(M] :

"L";采用输入图形方向 [纵向(P)/横向(L)] :

"N";采用是否反向打印?[是(Y)/否(N)] :

"W";采用输入打印区域 [显示(D)/范围(E)/图形界限(L)/视图(V)/窗口(W)] : w

pt1;采用输入窗口的左下角 <0.000000,0.000000>: 输入窗口的右上角 <0.000000,0.000000>:

pt2;采用输入窗口的右上角 <0.000000,0.000000>:

"f";采用输入打印比例 (打印的 毫米=图形单位) 或 [布满(F)] : fit

"c";采用输入打印偏移 (x,y) 或 [居中打印(C)] <0.00,0.00>: c

"Y";采用是否按样式打印?[是(Y)/否(N)] :

style;采用输入打印样式表名称或 [?] (输入 . 表示无) :

"Y";采用是否打印线宽?[是(Y)/否(N)] :

"N";采用是否删除隐藏线?[是(Y)/否(N)] :

"N" ;采用是否打印到文件 [是(Y)/否(N)] : y

"Y";采用是否保存模型选项卡的修改 .

"Y";采用是否继续打印 .

)

(princ "n*********************n")

)

)

)
页: [1]
查看完整版本: cad批量页码lisp