LSA 发表于 2022-7-5 17:13:51

请求Lisp绘制风管

如果有人愿意分享他们创建风管弯头(圆形和矩形)的lisp,我将不胜感激。
 
对于那些不在暖通空调领域的人。。。我想要一个lisp,可以绘制:
 
http://img430.imageshack.us/img430/5060/roundelbow2sd8gp.jpg
 
 
对不起,这张照片太大了。我没有机会调整它的大小。
 
因此lisp将提示输入起点。(最好是中扣)
提示输入直径。
提示输入半径。(如果半径为1,则内径等于直径,外径等于内径+直径。如果半径为1.5,则内径为直径的1.5倍,依此类推。)
 
 
提前谢谢。
 
LSA公司

fuccaro 发表于 2022-7-5 17:20:14

你用什么软件?很可能是多恩和一个动态方块。

LSA 发表于 2022-7-5 17:22:26

我使用ACAD 2006。你能解释一下如何用动态块实现这一点吗?
 
我的印象是,动态块只是可以编辑而不分解的块。你指的是使用工具托盘吗?

Adesu 发表于 2022-7-5 17:25:26

 
嗨,LSA,
这里是我的代码,我只是为您创建了一个特殊的,并进行了测试

(defun c:test (/ loc rad p1 p2 el1 dia p3 el2 p4 el3 el4)
(setq loc (getpoint "\nClick any location for object<0,0,0>: "))
(if (= loc nil)(setq loc '(0 0 0)))
(setq rad (getdist "\nEnter radius for duct<1>: "))
(if (= rad nil)(setq rad 1))
(setq p1 (polar loc 0 rad))
(setq p2 (polar loc (* pi 0.5) rad))
(command "_arc" "c" loc p1 p2 "")
(setq el1 (entlast))
(setq dia (getdist "\nEnter diameter for duct<2>: "))
(if (= dia nil)(setq dia 2))
(setq p3 (polar p1 0 dia))
(command "_offset" dia el1 p3 "")
(setq el2 (entlast))
(setq p4 (polar p2 (* pi 0.5) dia))
(command "_line" p1 p3 "")
(setq el3 (entlast))
(command "_line" p2 p4 "")
(setq el4 (entlast))
(command "_region" el1 el2 el3 el4 "")
(princ)
)

fixo 发表于 2022-7-5 17:28:50

我在2005年的工作:
 

(defun C:duct (/ bpt cpt dia pt rad tpt ulp urp x y)
(setvar "cmdecho" 0)
(setvar "osmode" 0)

(setq    dia (getreal "\nEnter diameter :\n")
   rad (getreal "\nEnter duct radius as diameter fraction : \n")
)

(setq pt (getpoint "\nEnter insertion point of duct \n"))
(setq    x   (car pt)
   y   (cadr pt)
   bpt (list x (- y (/ dia 2)))
   tpt (list x (+ y (/ dia 2)))
   cpt (list x (+ y (+ (* dia 0.5) (* dia rad))))
   ulp (list (+ x (* dia rad)) (+ y (* dia 0.5) (* dia rad)))
   urp (list (+ x dia (* dia rad)) (+ y (* dia 0.5) (* dia rad)))
)

(command "arc""C"   cpt    tpt    ulp    "arc""C"    cpt
      bpt      urp   "line"    tpt    bpt    ""   "line" urp
      ulp      ""
   )
(setvar "osmode" 703)
(setvar "cmdecho" 1)
(princ)
)
;Test : (C:duct)
~(J)~

LSA 发表于 2022-7-5 17:32:45

谢谢大家。两者都很好。我会稍微调整一下以满足我的需要。

hyposmurf 发表于 2022-7-5 17:34:47

这里有一个很酷的,将绘制带角的管道路线。我理解为管道绘制转角有多麻烦,相当耗时,而且我们的区块库对它来说有点无用。我想我的电脑上还有一些其他的管道系统口吃。
 
刚才看到你在画双线。很高兴认识在同一暖通空调行业使用CAD的其他人。

LSA 发表于 2022-7-5 17:39:04

HSmurf。。。。Lisp程序。非常感谢。

fuccaro 发表于 2022-7-5 17:41:31

如果你自己有任何想分享的HVAC口吃,那就太酷了。我试图在这里开始一个关于暖通空调Lisp程序的线程,但没有得到太多的回应。

hyposmurf 发表于 2022-7-5 17:43:33

发布的lisp代码的格式是否已更改?你能把lisp文件发给我吗?
页: [1] 2
查看完整版本: 请求Lisp绘制风管