本帖最后由 尘缘一生 于 2025-1-5 20:51 编辑
三领是这么作的,至于那个方向,实际不用开发的,难道谁画图,方向不定吗?任何方向,角度的都必须一定!不留后患!
这个玩意,对于我这搞建筑设计的,有时候钢构用一下子,早做好了,20年前就存在。
- ;;SLdesign 三领设计 V3.0 by 尘缘一生 QQ:15290049
- ;;椭圆孔-------------
- (defun c:slot (/ osmo w d ang p1 p2 cp1 cp2 cp3 cp4 cp5 cp6 str p0)
- (setq osmo (getvar "OSMODE"))
- (setvar "OSMODE" 16383) ;;捕捉全部打开
- (setq p0 (getpoint (slmsg "\n 输入长圆孔中心点:" "\n 块蛾ふいみ翴:" "\n Enter center point of the oblong hole:")))
- (setvar "OSMODE" osmo)
- (setq ang (4dire p0))
- (setq d (/ (* 0.5 (atof (inputbox-1
- (slmsg "长圆孔长轴距离" "蛾ふ禸禯瞒" "Long axis distance of elongated hole")
- (slmsg "距离=" "禯瞒=" "Distance=") "50" "15"
- )
- )
- ) (getvar "DIMLFAC")
- )
- )
- (setq p1 (polar p0 (+ ang pi) d) p2 (polar p0 ang d))
- (setq w (/ (* 0.5 (atof (inputbox-1
- (slmsg "长圆孔短轴距离" "蛾ふ祏禸禯瞒" "Distance between long circular hole and short axis")
- (slmsg "距离=" "禯瞒=" "Distance=") "30" "15"
- )
- )
- ) (getvar "DIMLFAC")
- )
- )
- (cykong p1 p2 w)
- ;(setq w (/ (* 5. w) 3.))
- ;(setq cp1 (polar p1 (+ ang pi2) w)
- ; cp2 (polar p1 (+ ang 3pi2) w)
- ; cp3 (polar p2 (+ ang pi2) w)
- ; cp4 (polar p2 (+ ang 3pi2) w)
- ; cp5 (polar p1 (+ ang pi) w)
- ; cp6 (polar p2 ang w)
- ; str (slmsg "中心线" "いみ絬" "Centerline")
- ;);求得长圆孔中心轴线的六个关键点
- ;;绘制长圆孔中心线------
- ;(fy_lineformat (makeline cp1 cp2) str "CENTER" 0.4 6)
- ;(fy_lineformat (makeline cp3 cp4) str "CENTER" 0.4 6)
- ;(fy_lineformat (makeline cp5 cp6) str "CENTER" 0.4 6)
- )
- ;;画长圆孔---(一级)------
- ;bp1,长轴短点1,长轴短点2 W 半个短轴
- (defun cykong (bp1 bp2 w / ang p1 p2 p3 p4)
- (setq
- ang (angle bp1 bp2)
- p1 (polar bp1 (+ ang pi2) w)
- p2 (polar bp1 (+ ang 3pi2) w)
- p3 (polar bp2 (+ ang pi2) w)
- p4 (polar bp2 (+ ang 3pi2) w)
- )
- (entmake
- (list
- (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 90 5) (cons 70 1)
- (cons 10 p2) (cons 42 0.0)
- (cons 10 p4) (cons 42 1.0)
- (cons 10 p3) (cons 42 0.0)
- (cons 10 p1) (cons 42 1.0)
- (cons 10 p2) (cons 42 1.0)
- )
- )
- )
不要看代码不运行的部分,只看原理,我在本坛,从来不取代码,因为,任何流出来的代码,也不是我想要的结果,你自己得加工最好的那一个。
所以,三领的内码,你休想是原装的能入三领进来,绝不可能!
|