LISP-求剖面直線角度穩定
2 posters
AutoCAD顧問 :: 技術(發言等級:一般會員) :: :: 進階討論
第1頁(共1頁)
LISP-求剖面直線角度穩定
各位前輩好~
小蝦向知道為何自己的剖線始終無法斜角直線= =....一直抓不出來角度問題點,想請前輩們給予指教>"<~
(DEFUN C:CAS0719()
(setq cir 12
cir2 (* cir 0.5)
bc (getpoint "\n START line 1 point:")
bp1 (getpoint bc "\n END line 2 point:")
Bp2 (getpoint BP1"\n direction:")
)
(setq p1 (cal "Bc+nor(bP1,bp2)*cir2")
p2 (cal "rot(p1,bc,-45)")
p3 (cal "P2+nor(bc,P2)*cir2")
PR (inters BC p1 p2 p3 nil)
h (distance BC PR )
)
(setq A (cal "ang(BC,BP1,BP2)"));;ang (apex,p1,p2),ang(BP2,BC,BP1)
(if (> A 5 45 90 180 )
(setq way +1 )
(setq way -1 )
)
(setq AA (cal "ang(BC,BL1,BL2)"))
(IF (> AA 5 90 180)
(setq way1 +1 )
(setq way1 -1 )
)
(SETQ BL1 (CAL "PLD(BP1,BC,CIR2)")
BL2 (CAL "BP1+NOR(BL1,BP1)*H*WAY1")
)
(COMMAND "circle" Bc (* CIR2))
(setq p4 (cal "PLD(BC,BP1,H)")
p5 (cal "rot(p2,bc,-45)")
p6 (cal "rot(p5,bc,-45)")
P61 (cal "rot(p3,bc,-90)")
P3 (cal "P6-nor(bc,P6)*cir2*WAY")
P7 (cal "rot(p6,bc,-45)")
P8 (cal "rot(p7,bc,-45)")
P9 (cal "rot(p8,bc,-45)")
P10 (cal "rot(p9,bc,-45)")
P11 (cal "rot(p10,bc,-45)")
P12 (CAL "PLD (P7,P11,1/2)")
)
(COMMAND "PLINE" P3 p7 "A" "S" P5 P11 "L" PR P61 "C" "" )
(command "LAYER" "M" "MARK" "C" "2" "MARK" "")
(setvar "CECOLOR" "2")
(setq p (entlast) )
(command "hatch" "P" "solid" "s" P "")
(COMMAND "Line" p11 p7 "")
(setq
V1 (CAL "PLD(BP1,BC,CIR2*0.4)");V1 (CAL "BP1+NOR(P12,BP1)*H")
V2 (CAL "PLD(BC,BP1,H)");;V2 (CAL "PLD(PR,BP1,H*2)")
V3 (CAL "PLD(V2,BP1,CIR)")
V4 (CAL "PLD(V3,BP1,-CIR2)")
V5 (CAL "PLT(V4,V3,1/3)")
V6 (CAL "PLT(V5,V2,1/2)")
V7 (CAL "PLD(BP1,V1,CIR2)")
V8 (CAL "PLD(V7,V1,-CIR2)")
V9 (CAL "PLT(V8,V7,1/3)")
V10 (CAL "PLT(V9,V7,1/2)")
)
(COMMAND "PLINE" BP1 BL2 V1 "C" )
(COMMAND "LINE" V2 V6 "" "LINE" V4 V5 "" "LINE" V9 V10 "" "LINE" V7 V1 "" "PLINE" BP1 BL2 V1 "C" )
(command "LAYER" "M" "MARK" "C" "2" "MARK" "")
(setvar "CECOLOR" "2")
(setq O (entlast))
(command "hatch" "P" "solid" "s" O "")
小蝦向知道為何自己的剖線始終無法斜角直線= =....一直抓不出來角度問題點,想請前輩們給予指教>"<~
(DEFUN C:CAS0719()
(setq cir 12
cir2 (* cir 0.5)
bc (getpoint "\n START line 1 point:")
bp1 (getpoint bc "\n END line 2 point:")
Bp2 (getpoint BP1"\n direction:")
)
(setq p1 (cal "Bc+nor(bP1,bp2)*cir2")
p2 (cal "rot(p1,bc,-45)")
p3 (cal "P2+nor(bc,P2)*cir2")
PR (inters BC p1 p2 p3 nil)
h (distance BC PR )
)
(setq A (cal "ang(BC,BP1,BP2)"));;ang (apex,p1,p2),ang(BP2,BC,BP1)
(if (> A 5 45 90 180 )
(setq way +1 )
(setq way -1 )
)
(setq AA (cal "ang(BC,BL1,BL2)"))
(IF (> AA 5 90 180)
(setq way1 +1 )
(setq way1 -1 )
)
(SETQ BL1 (CAL "PLD(BP1,BC,CIR2)")
BL2 (CAL "BP1+NOR(BL1,BP1)*H*WAY1")
)
(COMMAND "circle" Bc (* CIR2))
(setq p4 (cal "PLD(BC,BP1,H)")
p5 (cal "rot(p2,bc,-45)")
p6 (cal "rot(p5,bc,-45)")
P61 (cal "rot(p3,bc,-90)")
P3 (cal "P6-nor(bc,P6)*cir2*WAY")
P7 (cal "rot(p6,bc,-45)")
P8 (cal "rot(p7,bc,-45)")
P9 (cal "rot(p8,bc,-45)")
P10 (cal "rot(p9,bc,-45)")
P11 (cal "rot(p10,bc,-45)")
P12 (CAL "PLD (P7,P11,1/2)")
)
(COMMAND "PLINE" P3 p7 "A" "S" P5 P11 "L" PR P61 "C" "" )
(command "LAYER" "M" "MARK" "C" "2" "MARK" "")
(setvar "CECOLOR" "2")
(setq p (entlast) )
(command "hatch" "P" "solid" "s" P "")
(COMMAND "Line" p11 p7 "")
(setq
V1 (CAL "PLD(BP1,BC,CIR2*0.4)");V1 (CAL "BP1+NOR(P12,BP1)*H")
V2 (CAL "PLD(BC,BP1,H)");;V2 (CAL "PLD(PR,BP1,H*2)")
V3 (CAL "PLD(V2,BP1,CIR)")
V4 (CAL "PLD(V3,BP1,-CIR2)")
V5 (CAL "PLT(V4,V3,1/3)")
V6 (CAL "PLT(V5,V2,1/2)")
V7 (CAL "PLD(BP1,V1,CIR2)")
V8 (CAL "PLD(V7,V1,-CIR2)")
V9 (CAL "PLT(V8,V7,1/3)")
V10 (CAL "PLT(V9,V7,1/2)")
)
(COMMAND "PLINE" BP1 BL2 V1 "C" )
(COMMAND "LINE" V2 V6 "" "LINE" V4 V5 "" "LINE" V9 V10 "" "LINE" V7 V1 "" "PLINE" BP1 BL2 V1 "C" )
(command "LAYER" "M" "MARK" "C" "2" "MARK" "")
(setvar "CECOLOR" "2")
(setq O (entlast))
(command "hatch" "P" "solid" "s" O "")
Grace.Hsu- 一般會員
- 文章總數 : 6
年齡 : 34
來自 : 高雄市
職業 : 工程設計
愛好 : 運動
個性 : 直爽
使用年資 : 1
使用版本 : 2015
經驗值 : 944
威望值 : 0
注冊日期 : 2022-05-26
回復: LISP-求剖面直線角度穩定
____________________________________________________________________________________
👉快速比例設定與出圖技巧-線上課程(點我)👈
AutoCAD顧問 :: 技術(發言等級:一般會員) :: :: 進階討論
第1頁(共1頁)
這個論壇的權限:
您 無法 在這個版面回復文章