whs51601
发表于 2022-6-16 20:10:09
xyp1964 发表于 2014-8-5 21:04
院子,我花币买了你这个程序,买了不能用,怎么办?
song宋_74729
发表于 2022-6-21 15:39:00
(defun c:tt(/ os ss pl p1 p2)
(setq os (getvar 'osmode))
(setvar 'osmode 0)
(setq ss (ssget '((0 . "insert"))))
(if ss
(progn
(setq pl (GXL-GETSSBOX ss)
p1 (car pl)
p2 (cadr pl)
ss (GXL-SEL-SS->LIST ss)
)
;;;此处画一个圆,图块投影到园上排序
(command "_pline" p1 "a" "s" (list (car p1) (cadr p2)) p2 "s" (list (car p2) (cadr p1)) p1 "")
(setq en (entlast))
(setq ss (vl-sort ss '(lambda (a b)
(< (vlax-curve-getParamAtPoint en (vlax-curve-getclosestpointto en (gxl-dxf a 10)))
(vlax-curve-getParamAtPoint en (vlax-curve-getclosestpointto en (gxl-dxf b 10)))
)
)
)
)
(command "_pline")
(mapcar 'command (mapcar '(lambda (X) (gxl-dxf x 10)) ss))
(command "")
(entdel en)
)
)
(setvar 'osmode os)
(princ)
)
;; gxl-GetssBox 取得选择集的实体外矩形框
(defun gxl-GetssBox (ss / maxpt maxptlst minpt minptlst obj x ss1)
(setq ss1 (gxl-Sel-SS->List ss))
(foreach x ss1
(setq obj (vlax-ename->vla-object x))
;(setq minPt (vlax-make-safearray vlax-vbdouble '(0 . 2)))
;(setq maxPt (vlax-make-safearray vlax-vbdouble '(0 . 2)))
(vla-GetBoundingBox Obj 'minpt 'maxpt) ; 得到包围框
(setq minPt (vlax-safearray->list minPt))
(setq maxPt (vlax-safearray->list maxPt))
(setq minPtlst (append minPtlst (list minPt)))
(setq maxPtlst (append maxPtlst (list maxPt)))
) ;_ 结束foreach
(setq minPt (list (apply 'min (mapcar 'car minPtlst))
(apply 'min (mapcar 'cadr minPtlst))
0
) ;_ 结束list
) ;_ 结束setq
(setq maxPt (list (apply 'max (mapcar 'car maxPtlst))
(apply 'max (mapcar 'cadr maxPtlst))
0
) ;_ 结束list
) ;_ 结束setq
;(command "rectang" minPt maxPt)
(list minPt maxPt)
) ;_ 结束defun
(defun gxl-Sel-SS->List (ss / i s )
(if ss
(repeat (setq i (sslength ss))
(setq s (cons (ssname ss (setq i (1- i))) s))
)
)
)
;;;==================================================================
;;;(gxl-dxf ent i )取出像素索引i对应的值
;;;==================================================================
(defun gxl-dxf (ent i)
(cond ((= (type ent) 'ename)
(cdr (assoc i (entget ent)))
)
((= (type ent) 'list)
(cdr (assoc i ent))
)
) ;_ if
)
试试这看看
忘记是哪位大师做的,取之明经cad,用之明经
孙海波
发表于 2024-3-10 11:01:23
xyp1964 发表于 2014-8-5 21:04
no function definition: XYP-CMDLA0,垃圾
chixun99
发表于 2024-4-8 08:27:58
song宋_74729 发表于 2022-6-21 15:39
(defun c:tt(/ os ss pl p1 p2)
(setq os (getvar 'osmode))
(setvar 'osmode 0)
贱人里也有这个,原创哪位就不清楚了。
开心无惧
发表于 2024-9-2 21:59:33
ZZXXQQ 发表于 2014-8-5 08:54
你好 可以帮忙修改一下吗
改成:在被选择的一个块或多个块和指定指定点之间连线
我想找某个块的基点
非常感谢
儒门小客
发表于 2024-9-19 00:04:27
wowan1314 发表于 2014-8-6 10:46
特制程序! 非通用!
楼主的意思是这样?
这个插件,售卖吗?如何购买