bsimpson 发表于 2022-7-6 15:13:30

宽度的Lisp例程

你好
 
在新的一年里,看看你能否尝试一下。
 
沿多段线以间距x绘制的多条线的宽度,该多段线与沿同一方向运行的另一条线相关。
 
从相关线段的垂直捕捉到多段线到另一条线的交点的距离必须与累积间距增量一起放置在ascii文件中。
 
谢谢
B辛普森。

Lee Mac 发表于 2022-7-6 15:25:05

这纯粹是二维问题吗?

Lee Mac 发表于 2022-7-6 15:28:11

也许是这个?
 
;两条直线/多段线之间的增量测量;作者:Lee McDonnell,2009年1月17日;[假设多段线只有两个顶点](defun c:mspc(/oFile cCurve dCurve dCurvel mspc sPt ePt cAng nlist dis pdis pt wpt wDis)(vl load com)(如果(setq of ile)(open)(getfield“Create a Text File”“c:\\”txt“9”w))(progn(如果(和(setq cCurve(car(entsel“\nSelect First Curve>”))))))(成员(cdr(assoc 0(setq cCurvel(entget cCurve)(entget cCurve))))))))(“lwrine”)(“Lwline”))(setq dCurve(car(entsel“\nSelect Curve to Measure to>”)(member(cdr(assoc 0(setq dCurvel(entget cCurve)))'(“LINE”“LWPOLYLINE”))(progn(initget 7)(setq mSpc(getreal”\n指定测量增量:)(cond((=“LINE”(cdr(assoc 0 cCurvel)))(setq sPt(cdr(assoc 10 cCurvel))ePt(cdr(assoc 11 cCurvel))cAng(角度sPt ePt))(=“LWPOLYLINE”(cdr(assoc 0 cCurvel)))(foreach x cCurvel(if(eq 10(car x))(setq nlist(cons(cdr x)nlist))(setq nlist(cons(cdr x)nlist))(setq nlist(reverse nlist)sPt(nth 0 nlist)ePt(nth 0 nlist)ePt(nth 1 nlist)cAng(角度sPt ePt))))(setq dis(距离sPt ePt)i 0 pdis 0)(而(</p>

bsimpson 发表于 2022-7-6 15:36:08

谢谢李,
 
这是一个2D场景。
 
编写的lisp例程在我的计算机上出现了一个错误,错误是*cancel*
 
我认为这是AutoCAD的版本。我使用的版本是AutoCAD 14。
 
希望可以将例程编辑成套件。
 
当做
bsimpson公司

Lee Mac 发表于 2022-7-6 15:42:02

啊,可怕的R14。。。不允许VL命令
 
这太可惜了,有了VL,常规训练会容易得多。
 
我看看我能做什么。

Lee Mac 发表于 2022-7-6 15:52:01

这很烦人,因为我只使用了一个VL函数:vlax curve getClosestPointTo。。
我想不出通用LISP中的等效方法。。

bsimpson 发表于 2022-7-6 15:58:18

谢谢李的努力,
 
有什么建议可以帮我吗?
 
bSimpson公司

Lee Mac 发表于 2022-7-6 16:03:42

可能有一种不使用VL命令的解决方法,但很明显,当您可以使用VL命令时,我从未真正选择过通用LISP方法。
 
我使用了Vlax Curve GetClosestPointTo,因为在具有两条直线的2D问题中,最近的点始终是与其中一条直线垂直的点,但要在公共LISP中实现这一点有些困难。

iztok13 发表于 2022-7-6 16:07:59

thx信息

Lee Mac 发表于 2022-7-6 16:13:40

 
欢迎光临。
页: [1]
查看完整版本: 宽度的Lisp例程