chelsea1307 发表于 2022-7-6 14:27:06

双线软风管

我在不同的网站上找到了很多lisp,但不符合我们办公室的标准,也不符合他们喜欢的外观(是的,他们很挑剔),现在我正在努力学习lisp,我想我会尝试得到一个他们将使用的lisp。
 
(defun c:dflex (/ A B C)
(setq A(getint "\n Duct Length?: "))
(setq B(ssget "\n Select duct: "))
(setq C(); want it to allow user to pick start point dont know if i need a variable or not
(command "_.circle" C (/ A 2.0)")
 
这就是我目前所拥有的。我用变量C表示多段线/直线的端点,该端点将作为软风管的起点。在端点上创建第一个圆后,我想沿着选定的多段线/直线从中心复制一个距离为a+1的圆,我不知道该怎么做。任何在正确方向上的帮助都将是巨大的(我再次尝试写这篇文章,但不希望有人为我写它),也愿意接受关于另一种方式的建议。附件是一张我希望决赛看起来像什么的图片

David Bethel 发表于 2022-7-6 14:44:29

你的表现真的很难。
 
可以使用“测量”复制圆。通过偏移路径样条线进行修剪可能是一种解决方案,但这将很棘手-大卫

tzframpton 发表于 2022-7-6 14:49:36

这将是一个艰难的Lisp程序。祝你好运眨眼:

chelsea1307 发表于 2022-7-6 15:02:57

是的,在你的回答之后,我可能会推迟一点,直到我深入了解它

BIGAL 发表于 2022-7-6 15:08:10

一个答案是,在多段线中,可以创建一条具有多条弧的多段线。我从另一个未经测试的程序中剪切了这个,但它被设置为绘制90mm的圆弧。
 

(setq insul_ht (getint "\nEnter Insulation ht mm :<90> "))
(if (= insul_ht nil)
(setq insul_ht 90)
)

(setq p1 (getpoint "\n1st point: "))
(setq p9 (getpoint P1 "\nend point : "))
(setq ang1 (angle p1 p9))
(setq p1 (polar p1 ang1 45))   
; routine to set N as number of pline segments as a factor of 90 mm.
; 90 mm 25 arc's with straights

(setq N (fix (/ (distance p1 p9) 90.0)))
(setq d1 (- insul_ht 25.0))
(setq d2 25.0)
(setq d3 (- d1 25))
(setq d4 40.0)

(setq p2 (polar p1 (+ 1.5708 ang1)d1))
(command "pLINE"p2 "w" 0.0 0.0)
(setq m 0)
(while (< m N)
(setq p3 (polar p2 ang1 d2))
(setq p4 (polar p3 ang1 d2))
(setq p5 (polar (polar p3 ang1 20)(+ ang1 4.71239) d3))
(setq p6 (polar p5 ang1 d2 ))
(setq p7 (polar p6 ang1 d2))
(setq p8 (polar p4ang1 d4))
; now put pts 3,4,5,6
(command "a" "ce" p3 "a" "-180" "l" p5 "a" "ce" p6 p7 "l" p8)
; parallel lines now drawn
(setq m (+ 1 m))
(setq p2 p8)
)

(command "")   
; ends pline
         


BIGAL 发表于 2022-7-6 15:22:43

好的,第二步,lisp代码有5种不同的模式
 
(setq N(固定(/(距离p1 p9)(*90.0(/绝缘ht 90.0)))(setq d1(/绝缘ht 2.0))(setq p2(极性p1(+1.5708 ang1)d1))(命令“pLINE”p2“w”0.0 0“a”)(setq m 1)(而(

chelsea1307 发表于 2022-7-6 15:27:27

谢谢大艾,我会看看这些,看看我是否能弄清楚发生了什么,以及如何修改以满足我的需要
页: [1]
查看完整版本: 双线软风管