Home Drawing sample
Learn command, AutoLISP, Problem AutoCAD, การใช้งาน AutoCAD หลากหลายความรู้หลากหลายปัญหา ร่วมแก้ไขแบ่งปันปัญหาแห่ง CAD การรวมกันคิด สามารถทำให้ผ่านพ้นไปได้ และหาแนวทางแก้ปัญหาได้เกือบทุกปัญหา ลุงธี57
Begin with Command "BOX"
เป็นคำสั่งในชุดแรกๆเริ่มจากการเขียนตามหนังสือ
แล้วมาต่อยอดภายหลังครับ
(defun getinfo ()
(setq pt1 (getpoint "pick first corner:"))
(setq pt3 (getcorner pt1 "pick opposite corner:"))
)
(defun procinfo ()
(setq pt2 (list (car pt3) (cadr pt1)))
(setq pt4 (list (car pt1) (cadr pt3)))
)
(defun output()
(command "pline" pt1 pt2 pt3 pt4 "c")
)
(defun C:BOX1 (/ pt1 pt2 pt3 pt4)
(getinfo)
(procinfo)
(output)
)
(defun C:3DBOX (/ pt1 pt2 pt3 pt4 h)
(getinfo)
(setq h (getreal "Enter height of box: "))
(procinfo)
(output)
(command "change" "L" "" "P" "thickness" h ""
"3dface" pt1 pt2 pt3 pt4 ""
"3dface" ".xy" pt1 h ".xy" pt2 h
".xy" pt3 h ".xy" pt4 h ""
)
)
(defun C:3DWEDGE (/ pt1 pt2 pt3 pt4 h)
(getinfo)
(setq h (getreal "Enter height of wedge: "))
(procinfo)
(output)
(command "3dface" pt1 pt4 ".xy" pt4 h ".xy" pt1 h pt2 pt3 ""
"3dface" pt1 pt2 ".xy" pt1 h pt1 ""
"copy" "L" "" pt1 pt4
)
)
แล้วมาต่อยอดภายหลังครับ
(defun getinfo ()
(setq pt1 (getpoint "pick first corner:"))
(setq pt3 (getcorner pt1 "pick opposite corner:"))
)
(defun procinfo ()
(setq pt2 (list (car pt3) (cadr pt1)))
(setq pt4 (list (car pt1) (cadr pt3)))
)
(defun output()
(command "pline" pt1 pt2 pt3 pt4 "c")
)
(defun C:BOX1 (/ pt1 pt2 pt3 pt4)
(getinfo)
(procinfo)
(output)
)
(defun C:3DBOX (/ pt1 pt2 pt3 pt4 h)
(getinfo)
(setq h (getreal "Enter height of box: "))
(procinfo)
(output)
(command "change" "L" "" "P" "thickness" h ""
"3dface" pt1 pt2 pt3 pt4 ""
"3dface" ".xy" pt1 h ".xy" pt2 h
".xy" pt3 h ".xy" pt4 h ""
)
)
(defun C:3DWEDGE (/ pt1 pt2 pt3 pt4 h)
(getinfo)
(setq h (getreal "Enter height of wedge: "))
(procinfo)
(output)
(command "3dface" pt1 pt4 ".xy" pt4 h ".xy" pt1 h pt2 pt3 ""
"3dface" pt1 pt2 ".xy" pt1 h pt1 ""
"copy" "L" "" pt1 pt4
)
)
คำสั่งเสริม AutoLISP ช่วยเขียนลูกศร
คำสั่งเสริม AutoLISP ช่วยเขียนลูกศร
(defun C:ARROW ()
(setvar "osmode" 0)(setq oldcolor (getvar "cecolor"))
(setq AR1 (getpoint "\nClick on Start point of arrow line: ")
AR2 (getpoint ar1 "\nClick on Next point of arrow line: ")
AR3 (getpoint ar2 "\nClick on Next point of arrow line: ")
)
(setq ang (angle ar1 ar2) angl (+ ang (/ pi 2.)) angr (+ ang (* 3 (/ pi 2.)))
r (polar ar1 angr 0.15) l (polar ar1 angl 0.15) ur (polar r ang 0.26)
ul (polar l ang 0.26)
)
(command "color" "5" "pline" ar1 "w" "0" "" ur ul ar1 ar2 ar3 "")
(command "color" oldcolor)
)
(defun C:ARROW-R ()
(setvar "osmode" 0)(setq oldcolor (getvar "cecolor"))
(setq AR1 (getpoint "\nClick on Start point of arrow line: ")
AR2 (getpoint ar1 "\nClick on End point of arrow line: ")
)
(setq ang (angle ar2 ar1) angl (+ ang (/ pi 2.)) angr (+ ang (* 3 (/ pi 2.)))
r (polar ar2 angr 0.15) l (polar ar2 angl 0.15) ur (polar r ang 0.26)
ul (polar l ang 0.26)
)
(command "color" "5" "pline" ar1 "w" "0" "" ar2 ur ul ar2 "")
(command "color" oldcolor)
)
(defun C:ARROW ()
(setvar "osmode" 0)(setq oldcolor (getvar "cecolor"))
(setq AR1 (getpoint "\nClick on Start point of arrow line: ")
AR2 (getpoint ar1 "\nClick on Next point of arrow line: ")
AR3 (getpoint ar2 "\nClick on Next point of arrow line: ")
)
(setq ang (angle ar1 ar2) angl (+ ang (/ pi 2.)) angr (+ ang (* 3 (/ pi 2.)))
r (polar ar1 angr 0.15) l (polar ar1 angl 0.15) ur (polar r ang 0.26)
ul (polar l ang 0.26)
)
(command "color" "5" "pline" ar1 "w" "0" "" ur ul ar1 ar2 ar3 "")
(command "color" oldcolor)
)
(defun C:ARROW-R ()
(setvar "osmode" 0)(setq oldcolor (getvar "cecolor"))
(setq AR1 (getpoint "\nClick on Start point of arrow line: ")
AR2 (getpoint ar1 "\nClick on End point of arrow line: ")
)
(setq ang (angle ar2 ar1) angl (+ ang (/ pi 2.)) angr (+ ang (* 3 (/ pi 2.)))
r (polar ar2 angr 0.15) l (polar ar2 angl 0.15) ur (polar r ang 0.26)
ul (polar l ang 0.26)
)
(command "color" "5" "pline" ar1 "w" "0" "" ar2 ur ul ar2 "")
(command "color" oldcolor)
)
สมัครสมาชิก:
บทความ (Atom)
คลังบทความของบล็อก
ป้ายกำกับ
ของหาย
คำสั่งย่อ
คำสั่ง AutoCAD ที่ควรรู้
คีย์ลัด ใน AutoCAD
ณ ที่แห่งนี้
ฟอนท์ภาษาไทย
โลโก้โปรแกรม AutoCAD
วัดความยาวเส้น
ac$
acad.fas
acad.lsp
acad.pgp
acad.vlx
Alias
annotation scale
Attibute
AutoCAD
AutoCAD Command
AutoCAD error
AutoLISP
Autosave
Backup
Block
Block AutoCAD
CAD error
cad.fas
Can not OPEN FILE
close wcs icon
Command
Command autocad
Commandline
CUI
DBLCLKEDIT
Dimension
Dimspace
Draft Setting
DTEXTED
edit text
External Referances
FATAL ERROR
File autocad
Find text
Fix F8
font autocad
FS
Function Key
Game
HATCH
Hatch error
Isomatric
Key
LISP
logo AutoCAD
LSP
Menubar
Missing
Modelspace
Navvcube
Object Snap
Option
Ortho Key
Osnap
Osnap error
overkill
page setup
panels
Paperspace
perpendicular
PRODUCED BY AN AUTODESK EDUCATION PRODUCT
Recovery
Release
Ribbon
Rtext
Scale
Seclect Mode
Select Command
Setvar
Shortcut Key
System Variables
Thai Font for AutoCAD
Tip & Trick
Toolbar หาย
Turn off Start Tab
Unisolate
Variable
Version
Viewport
Virus
Virus AutoLISP
Wblock
XREF
Xref AutoCAD