烟盒迷唇
发表于 2019-6-10 16:24:22
打印出来不是按顺序生成的
注册
发表于 2019-9-2 08:33:11
(vl-load-com)(setq mspace (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
(setvar "cmdecho" 0)
(defun c:y1( / plotdeviceminp maxpminpoint maxpoint tkname ourset ilast imyent1orientation)
(setq plotdevice "hp LaserJet 1000")
(print "select keytk" )
(SETQ keytk (car (entsel)))
(while (or (null keytk) (/= (cdr (assoc '0 (entgetkeytk)))"INSERT"))
(SETQ keytk (car (entsel)))
)
(setqtkname (cdr (assoc '2 (entgetkeytk)) ))
(alert (strcat "Do you want to print \" " tkname "\"?" ))
(setq papersize "A4")
(setq plotstyle "A4-TK.ctb")
(command "ucs" "w")
(print "Select what you want to print:")
(SETQ ourset (ssget (list (cons 2 tkname))))
(while (null ourset)
(SETQ ourset (ssget (list (cons 2 tkname))))
)
(setq ilast (sslength ourset))
(setq i 0)(setq iplot 0)
(repeat ilast
(setq my (ssname ourset i))
(setq ent1 (entget my))
(if (= (cdr (assoc '2 ent1) ) tkname)
(progn
(vla-getboundingbox (vlax-ename->vla-object my) 'minpoint 'maxpoint )
(setq minp (vlax-safearray->listminpoint))
(setq maxp (vlax-safearray->listmaxpoint))
(if ( > (- (car maxp)(car minp))(- (cadr maxp)(cadr minp)))(setq orientation "landscape") (setq orientation "portrait"))
(command "-plot" "y" "model" plotdevice papersize "Millimeters" orientation
"no" "w"minpmaxp "fit" "c" "y" plotstyle"y" "n" "n" "n""y")
(setq iplot (1+ iplot))
)
)
(setq i (1+ i))
)
(princ "\nThe total is:")(princ iplot)
(print "over!!!")
(princ)
)
(defun c:y3( / plotdeviceminp maxpminpoint maxpoint tkname ourset ilast imyent1orientation)
;(setq plotdevice "\\王斌\Xerox WorkCentre 415/Pro 420 XL")
(print "select keytk" )
(SETQ keytk (car (entsel)))
(while (or (null keytk) (/= (cdr (assoc '0 (entgetkeytk)))"INSERT"))
(SETQ keytk (car (entsel)))
)
(setqtkname (cdr (assoc '2 (entgetkeytk)) ))
(alert (strcat "Do you want to print \" " tkname "\"?" ))
(setq papersize "")
(setq plotstyle "")
(command "ucs" "w")
(print "Select what you want to print:")
(SETQ ourset (ssget (list (cons 2 tkname))))
(while (null ourset)
(SETQ ourset (ssget (list (cons 2 tkname))))
)
(setq ilast (sslength ourset))
(setq i 0)(setq iplot 0)
(repeat ilast
(setq my (ssname ourset i))
(setq ent1 (entget my))
(if (= (cdr (assoc '2 ent1) ) tkname)
(progn
(vla-getboundingbox (vlax-ename->vla-object my) 'minpoint 'maxpoint )
(setq minp (vlax-safearray->listminpoint))
(setq maxp (vlax-safearray->listmaxpoint))
(if ( > (- (car maxp)(car minp))(- (cadr maxp)(cadr minp)))(setq orientation "landscape") (setq orientation "portrait"))
(command "-plot" "y" "model" "" "" "Millimeters" orientation
"no" "w"minpmaxp "fit" "c" "y" """y" "n" "n" "n""y")
(setq iplot (1+ iplot))
)
)
(setq i (1+ i))
)
(princ "\nThe total is:")(princ iplot)
(print "over!!!")
(princ)
)
tfanghui
发表于 2022-7-18 09:16:18
大神这个可以按顺序,左右,上下打印吗?
mokson
发表于 2022-7-18 10:10:02
要认真学习一下。
boboxiake
发表于 2022-12-9 09:57:56
不错,谢谢分享,下来学习一下
chenhl1998
发表于 2022-12-18 16:54:40
谢谢分享~~~~~~~
Noangler
发表于 2023-3-20 16:31:37
都说不能用吗?
shirker
发表于 2024-2-27 21:21:57
希望好用,感谢分享
sjl_fyl
发表于 2024-6-7 11:16:15
{:1_1:}谢谢分享
kuseok
发表于 2024-6-26 00:56:10
试过了,很好用,就是不能识别多线段。