AutoLISP矩形与多个内切圆
AutoLISP矩形与多个内切圆,代码如下。
(defun c:test()
(setvar "cmdecho" 0)
(setq oldlay (getvar "clayer"))
(setq oldosmode (getvar "osmode"))
(setvar "osmode" 0)
(setq w (getreal "输入底部宽度<100>:"))
(setq n (getint "n几排垂直圆<2>:"))
(setq rp1 (getpoint "n输入左下角点:"))
(if (null w) (setq w 100))
(if (null n) (setq n 2))
(setq r (/ w 2 (1+ (* (sqrt 3) (1- n)))))
(setq cp1 (polar rp1 (/ pi 4) (* r (sqrt 2))))
(setq cp2 (polar cp1 (/ pi 6) (* r 2)))
(setq rp2 (polar rp1 0 w))
(setq rp3 (polar rp2 (/ pi 2) (* 4 r)))
(setq gap (* 2 (sqrt 3) r))
(command "-layer" "m" "str" "c" 4 "" "")
(command "rectang" rp1 rp3)
(command "circle" cp1 r)
(command "array" (entlast) "" "r" 2 n (* r 2) gap)
(command "circle" cp2 r)
(if (> n 2) (command "array" (entlast) "" "r" 1 (1- n) gap))
(command "-layer" "m" "dim" "c" 1 "" "")
(command "dim1" "hor" rp1 rp2 (polar rp1 (* pi 1.5) 10) "")
(setvar "somode" oldosmode)
(setvar "clayer" oldlay)
)
代码完。
相关文章
- 2021-09-08BIM技术丛书Revit软件应用系列Autodesk Revit族详解 [
- 2021-08-11中文版3ds Max 2010+VRay从入门到精通 点智文化PDF下
- 2021-08-11中文版3ds Max 2010完全学习手册 段海朋等PDF下载
- 2021-08-11中文版3ds Max 2012完全自学教程 瞿颖健PDF下载
- 2021-08-03Autodesk 数字化工厂布局设计实战教程2014 [白雪松 著
- 2021-08-03Autodesk Revit机电应用入门篇 [王君峰 编著] 2013年P
- 2021-08-03Autodesk RevitStructure实例详解 [黄亚斌,徐钦 主编]
- 2021-08-03Autodesk RevitStructure2012应用宝典 [欧特克软件(中
- 2021-08-03Autodesk RevitMEP2014管线综合设计应用全彩 [柏慕进
- 2021-08-02Autodesk RevitMEP2012应用宝典 [欧特克软件(中国)有限