函数ACET-。。。
大家好。有人能用这个密码拦住我吗
defun getfencesel (en flt / fe ss)
(vl-cmdf "_ZOOM" "_E")
(setq ss (ssadd en))
(setq fe (acet-list-remove-adjacent-dups (acet-geom-object-point-list en 0.05))
ss (ssget "_F" fe flt)
)
(vl-cmdf "_ZOOM" "_P")
ss
)
也许有人知道它是如何重写为普通Autolisp或Vlisp的?? 以下是我的尝试:
; (sssetfirst nil (GetFenceSel (car (entsel)) '((0 . "*TEXT")) 3))
; (sssetfirst nil (GetFenceSel (car (entsel)) nil 3))
(defun GetFenceSel ( e flt prec / DivideCurveAtInc Trap pL ll ur SS )
(defun DivideCurveAtInc ( i c / TotLen d PtLst )
(if
(and
(numberp i) (not (or (zerop i) (minusp i)))
(not (vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getEndParam (list c))))
(<= i (setq TotLen (vlax-curve-getDistAtParam c (vlax-curve-getEndParam c))))
)
(progn
(setq d 0.0)
(while (<= d TotLen)
(setq PtLst (cons (vlax-curve-getPointAtDist c d) PtLst))
(setq d (+ d i))
); while
(setq PtLst (reverse PtLst))
); progn
); if
PtLst
); defun DivideCurveAtInc
(defun Trap ( f L / r err ) (if (setq err (not (vl-catch-all-error-p (setq r (vl-catch-all-apply f L))))) (if r r err)) )
(cond
( (not (setq e (Trap 'vlax-ename->vla-object (list e))))
(princ "\nNo object provided.")
)
( (not (Trap 'vla-GetBoundingBox (list e 'll 'ur)))
(princ "\nInvalid object.")
)
(
(or
(and
(Trap 'vlax-curve-getEndParam (list e))
(setq pL (mapcar '(lambda (x) (reverse (cdr (reverse x)))) (DivideCurveAtInc prec e)))
)
(setq pL
(
(lambda ( x / p1 p2 ) (setq p1 (car x)) (setq p2 (cadr x)) (list p1 (list (car p1) (cadr p2)) p2 (list (car p2) (cadr p1))) )
(mapcar '(lambda (x) (reverse (cdr (reverse (safearray-value x))))) (list ll ur))
)
)
); or
(vla-ZoomWindow (vlax-get-acad-object) ll ur)
(and
(setq SS (ssget "_F" pL flt))
(ssadd (vlax-vla-object->ename e) SS)
)
(vla-ZoomPrevious (vlax-get-acad-object))
)
); cond
SS
); defun GetFenceSel
(vl-load-com) (princ)
所有lisp都在这里:
https://www.theswamp.org/index.php?topic=9042.465
文件:TriangV0.6.7。ymg的LSP
因为我的CAD没有Acad Express工具,所以我必须更改TriangV0.6.7。LSP。
我用功能更改了部件:
布拉格马
vl时间
acet ui进度
..adne command TIN正在工作,但教授仍然没有。
我将grrr代码改为带有错误的片段,但它不起作用。我对这件事的了解已经结束了。
我还在用COMAND
我将感谢你的帮助。
波西克 请阅读代码发布指南,并编辑代码以包含在代码标签中。
(defun getfencesel (en flt / fe ss)
(acet-ss-zoom-extents (setq ss (ssadd en)))
(setq fe (acet-list-remove-adjacent-dups (acet-geom-object-point-list en 0.05))
ss (ssget "_F" fe flt)
)
(vl-cmdf "_ZOOM" "_P")
ss
)
=
Your Code Here 我现在可以换帖子了吗?如果没有,我会尝试在未来做正确的。我的英语没有我想要的那么好,这就是为什么我会错过它。
波西克 李:你的代码正在运行,非常感谢。
太好了-不客气!
Excellent - you're welcome!
页:
[1]