solid nut head အတြက္ ...

အခ်ိန္သိပ္မရလိုက္လို့ ျဖစ္ကတတ္ဆန္းျဖစ္သြားပါတယ္..
အမွားကိုသိတဲ့သူေတြ ျပင္ေပးမယ္ဆိုရင္လည္း လက္ခံပါတယ္..
ဒီlsp file ေလးမွာ error ေတြရိွပါတယ္ ..
ေနာက္ျပီး ခ်န္းခ်န္း ကာ..ကာဒါ..ကာဒစ္ဒါ ေတြမသံုးထားပါ၀ူး
List ကိုလညး္ လ်စ္လူရႈထားပါတယ္...
အလြယ္လမ္းလိုက္ထားတယ္ဆိုပါေတာ့..
ဖိုင္အသစ္ဖြင့္ျပီးပဲစမ္းေစခ်င္ပါတယ္....
ဘာလိုု့လဲဆိုေတာ့ ခ်န္းခ်န္းက အင္တာဆက္ရွင္ကို select all နဲ့ အလြယ္လုပ္ထားလို့ေလ....
ေအာက္က code ေလးကို notepad မွာပဲျဖစ္ျဖစ္ကူးျပီး nuth.lsp နာမည္နဲ့သိမ္းျပီး run ၾကည့္ပါ...

ဒါက ခ်န္းခ်န္းေရးတဲ့ မျပည့္စံုတဲ့ အႏုပညာဆိုပါေတာ့..

(defun C:nuth()
(setvar "cmdecho" 0)
(setq r (getdist "\nEnter Nut Radius: "))
(setq h (getdist "\Enter Nut Height: "))
(command "polygon" "6" "0,0,0" "c" r)
(command "extrude" "l" "" h "")
(command "circle" "0,0,0" r "")
(command "extrude" "l" "" "t""-45" h "")
(command "intersect" "all" "")
(command "-view" "_swiso" "")
(setvar "cmdecho" 1)
(princ)
)

ဒါကေတာ့ ကိုဖိုးဆန္းျပန္ေရးေပးထားတဲ့ ျပည့္ျပည့္စံုစံု Program ပါ...
(defun C:mynuth()
(setq cmdecho (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq osmode (getvar "osmode"))
(setvar "osmode" 0)
(setq Radius (getreal "Enter Radius of Nut: "))
(setq Height (getreal "Enter Height of Nut: "))
(setq HoleDiameter (getreal "Enter Diameter of hole of the Nut:"))
(setq Sides (getint "Enter the number of sides of the nut:"))
(setq NutCenter (getpoint "\nPick the center point of the Nut:"))
(setq Z_NutCenter (caddr NutCenter))
(setq CenterPointUpperCircle (list (car NutCenter) (cadr NutCenter) (+ Z_NutCenter Height)))

(command "_.Polygon" Sides NutCenter "C" Radius)
(setq Polygon (entlast))
(command "_.circle" NutCenter Radius)
(setq CircleLower (entlast))
(command "copy" CircleLower "" NutCenter CenterPointUpperCircle "")
(setq CircleUpper (entlast))
(command "_.extrude" Polygon "" Height)
(setq Polygon (entlast))
(command "_.extrude" CircleLower "" "t" -45 Height)
(setq CircleLower (entlast))
(command "_.extrude" CircleUpper "" "t" -45 (* Height -1))
(setq CircleUpper (entlast))
(command "_.intersect" Polygon CircleLower CircleUpper "")
(setq FilledNut (entlast))
(command "_.circle" NutCenter "d" HoleDiameter)
(setq Hole (entlast))
(command "_.extrude" Hole "" Height)
(setq Hole (entlast))
(command "_.subtract" FilledNut "" Hole "")

(setvar "cmdecho" cmdecho)
(setvar "osmode" osmode)
;(command "_.zoom" "extent")


)

ခင္မင္ေလးစားလ်က္
ခ်န္းခ်န္း

Please Share This Post

Share on Facebook Plus on Google+