自动扶梯安装图自动绘制原程序
www.dimcax.com
自动扶梯安装图自动绘制原程序
(defun c:gad()
(setq os (getvar "osmode"))
(setvar "osmode" os)
(setq p10 (getpoint "\n请输入基点<退出>:")) ;gad开始画点
(setq s1 (getreal "\n下段长度:")) ;s1下段长度
(setq s2 (getreal "\n上段长度:")) ;s2上段长度
(setq at (getreal "\n倾斜角度:")) ;at上段长度
(setq sh (getreal "\n提升高度:")) ;sh提升高度
(setq s4 (+ s1 200))
(setq p20 (list (+ (car p10) s4) (cadr p10))) ;算出p20点的坐标
(setq atp (/ (* at 3.1416) 180)) ;将角度转为弧度
(setq p30x (+ (car p20) (/ sh (/ (sin atp) (cos atp))))) ;计算出p30点的x值
(setq p30y (+ (cadr p10) sh)) ;计算出p30点的y值
(setq p30 (list p30x p30y)) ;计算出p30点的坐标
(setq s4 (+ s2 200))
(setq p40 (list (+ (car p30) s4) (cadr p30))) ;算出位置p40点的坐标
(command "layer" "n" "1z" "c" "7" "1z" "")
(command "layer" "s" "1z" "")
(setq p11 (list (car p10) (- (cadr p10) 140))) ;获得p11点的坐标
(setq p12 (list (+ (car p10) 240) (- (cadr p10) 140))) ;获得p12点的坐标
(setq p13 (list (+ (car p10) 240) (- (cadr p10) 1050))) ;获得p13点的坐标
(setq atp2 (/ (* (/ (- 180 at) 2) 3.1416) 180)) ;求下边线余角
(setq ytt (/ (* 940 (cos atp2)) (sin atp2))) ;求参数ytt
(setq ytt2 (- ytt (/ (* 110 (cos atp)) (sin atp)))) ;求ytt2
(setq p14x (+ (car p10) (+ s1 ytt2))) ;求p14点的x坐标
(setq p14 (list p14x (- (cadr p10) 1050))) ;得到p14点坐标
(command "line" p10 p11 "")
(command "line" p11 p12 "")
(command "line" p12 p13 "")
(command "line" p13 p14 "")
(setq p31 (polar p14 atp (/ sh (sin atp)))) ;获得p31点的位置
(setq p41 (polar p40 -1.5708 140)) ;获得p41点位置
(setq p42 (polar p41 pi 240)) ;获得p42的坐标
(setq p43 (polar p42 -1.5708 910)) ;获得p43的坐标
(command "line" p14 p31 "")
(command "line" p31 p43 "")
(command "line" p43 p42 "")
(command "line" p42 p41 "")
(command "line" p41 p40 "")
;this program express the layer of shelf
(setq xl ( * 1600 (sin(* (/ at 2) (/ pi 180)))))
( setq p51 (polar p10 0 1269)) ;获得p51点的坐标
( setq p52 (polar p51 (/ pi 2) 250)) ;获得p52点的坐标
( setq p100 (list (car p20) (cadr p52))) ;获得p100点的坐标
( setq p53 (polar p100 pi xl)) ;获得p53点的坐标
( setq p54 (polar p100 (* at (/ pi 180)) xl)) ;获得p54点的坐标
( setq p200 (polar p100 (* (+ (/ (- 180 at) 2) at) (/ pi 180)) 1600)) ;获得p200点的坐标
( setq p101 (list(car p30) (+ (cadr p30) 250))) ;获得p101点的坐标
( setq p55 (polar p101 (* (+ 180 at ) (/ pi 180)) xl)) ;获得p55点的坐标
( setq p56 (polar p101 0 xl)) ;获得p56点的坐标
( setq p201 (polar p101 (* (- 360 (/ (- 180 at) 2)) (/ pi 180)) 1600)) ;获得p201点的坐标
( setq p57 (polar p101 0 (- s2 1070))) ;获得p57点的坐标
( setq p58 (polar p57 (* 3 (/ pi 2)) 250)) ;获得p58点的坐标
(command "line" p51 p52 "")
(command "line" p52 p53 "")
(command "line" p54 p55 "")
(command "line" p56 p57 "")
(command "line" p57 p58 "")
(command "arc" "c" p200 p53 p54 )
(command "arc" "c" p201 p56 p55 )
;this program express the frist layer
( setq p62 (list (car p51) (+ (cadr p51) 1000))) ;获得p62点的坐标
( setq p102 (list (car p20) (cadr p62))) ;获得p102点的坐标
( setq p63 (polar p102 pi xl)) ;获得p63点的坐标
( setq p64 (polar p102 (* at (/ pi 180)) xl)) ;获得p64点的坐标
( setq p202 (polar p102 (* (+ (/ (- 180 at) 2) at) (/ pi 180)) 1600)) ;获得p202点的坐标
( setq p103 (list (car p30) (+ (cadr p30) 1000))) ;获得p103点的坐标
( setq p65 (polar p103 (* (+ 180 at ) (/ pi 180)) xl)) ;获得p65点的坐标
( setq p66 (polar p103 0 xl)) ;获得p66点的坐标
( setq p203 (polar p103 (* (- 360 (/ (- 180 at) 2)) (/ pi 180)) 1600)) ;获得p203点的坐标
( setq p67 (polar p103 0 (- s2 1020))) ;获得p67点的坐标
(command "line" p62 p63 "")
(command "line" p64 p65 "")
(command "line" p66 p67 "")
(command "arc" "c" p202 p63 p64)
(command "arc" "c" p203 p66 p65 )
;this program express the points of last layer
( setq p72 (polar p62 (* 3 (/ pi 2)) 98)) ;获得p72点的坐标
( setq p104 (list (car p20) (cadr p72))) ;获得p104点的坐标
( setq p73 (polar p104 pi xl)) ;获得p73点的坐标
( setq p74 (polar p104 (* at (/ pi 180)) xl)) ;获得p74点的坐标
( setq p204 (polar p104 (* (+ (/ (- 180 at) 2) at) (/ pi 180)) 1600)) ;获得p204点的坐标
( setq p105 (polar p103 (* 3 (/ pi 2)) 98)) ;获得p105点的坐标
( setq p75 (polar p105 (* (+ 180 at ) (/ pi 180)) xl)) ;获得p75点的坐标
( setq p76 (polar p105 0 xl)) ;获得p76点的坐标
( setq p205 (polar p105 (* (- 360 (/ (- 180 at) 2)) (/ pi 180)) 1600)) ;获得p205点的坐标
( setq p77 (polar p105 0 (- s2 1020))) ;获得p77点的坐标
;this program express the points second layer
( setq p702 (polar p62 (* 3 (/ pi 2)) 13)) ;获得p702点的坐标
( setq p504 (list (car p20) (cadr p702))) ;获得p504点的坐标
( setq p703 (polar p504 pi xl)) ;获得p703点的坐标
( setq p704 (polar p504 (* at (/ pi 180)) xl)) ;获得p704点的坐标
( setq p2004 (polar p504 (* (+ (/ (- 180 at) 2) at) (/ pi 180)) 1600)) ;获得p2004点的坐标
( setq p505 (polar p103 (* 3 (/ pi 2)) 13)) ;获得p505点的坐标
( setq p705 (polar p505 (* (+ 180 at ) (/ pi 180)) xl)) ;获得p705点的坐标
( setq p706 (polar p505 0 xl)) ;获得p706点的坐标
( setq p2005 (polar p505 (* (- 360 (/ (- 180 at) 2)) (/ pi 180)) 1600)) ;获得p2005点的坐标
( setq p707 (polar p505 0 (- s2 1020))) ;获得p707点的坐标
;this program express the third layer
( setq p802 (polar p62 (* 3 (/ pi 2)) 26)) ;获得p802点的坐标
( setq p604 (list (car p20) (cadr p802))) ;获得p604点的坐标
( setq p803 (polar p604 pi xl)) ;获得p803点的坐标
( setq p804 (polar p604 (* at (/ pi 180)) xl)) ;获得p804点的坐标
( setq p2006 (polar p604 (* (+ (/ (- 180 at) 2) at) (/ pi 180)) 1600)) ;获得p2006点的坐标
( setq p605 (polar p103 (* 3 (/ pi 2)) 26)) ;获得p605点的坐标
( setq p805 (polar p605 (* (+ 180 at ) (/ pi 180)) xl)) ;获得p805点的坐标
( setq p806 (polar p605 0 xl)) ;获得p806点的坐标
( setq p2007 (polar p605 (* (- 360 (/ (- 180 at) 2)) (/ pi 180)) 1600)) ;获得p2007点的坐标
( setq p807 (polar p605 0 (- s2 1020))) ;获得p807点的坐标
(command "line" p802 p803 "")
(command "line" p804 p805 "")
(command "line" p806 p807 "")
(command "arc" "c" p2006 p803 p804 )
(command "arc" "c" p2007 p806 p805 )
;this program express the centre of circes
( setq p300 (polar p62 (* 3 (/ pi 2)) 440)) ;获得p300点的坐标
( setq p301 (polar p67 (* 3 (/ pi 2)) 440)) ;获得p301点的坐标
;this program express the junction of arces
( setq p81 (polar p51 (* 101 (/ pi 180)) 223)) ;获得p81点的坐标
( setq p82 (polar p58 (* 79 (/ pi 180)) 223)) ;获得p82点的坐标
( setq p83 (polar p51 (* 116 (/ pi 180)) 135)) ;获得p83点的坐标
( setq p84 (polar p58 (* 64 (/ pi 180)) 135)) ;获得p84点的坐标
( setq p85 (polar p51 (* 113 (/ pi 180)) 146)) ;获得p85点的坐标
( setq p86 (polar p58 (* 67 (/ pi 180)) 146)) ;获得p86点的坐标
( setq p87 (polar p51 (* 111 (/ pi 180)) 158)) ;获得p87点的坐标
( setq p88 (polar p58 (* 69 (/ pi 180)) 158)) ;获得p88点的坐标
;this program express passsageway
( setq p120 (polar p52 pi 9)) ;获得p120点的坐标
( setq p110 (polar p51 pi 49)) ;获得p110点的坐标
( setq p90 (polar p51 (* 99 (/ pi 180)) 233)) ;获得p90点的坐标
( setq p91 (polar p58 (* 81 (/ pi 180)) 233)) ;获得p91点的坐标
( setq p121 (polar p57 0 9)) ;获得p121点的坐标
( setq p111 (polar p58 0 49)) ;获得p111点的坐标
( setq p400 (polar p51 (* 92 (/ pi 180)) 220)) ;获得p400点的坐标
( setq p401 (polar p51 (* 15 (/ pi 180)) 369)) ;获得p401点的坐标
( setq p402 (polar p58 (* 88 (/ pi 180)) 220)) ;获得p402点的坐标
( setq p403 (polar p58 (* 165 (/ pi 180)) 369)) ;获得p403点的坐标
(command "line" p52 p120 "")
(command "line" p57 p121 "")
(command "arc" "c" p400 p120 p90 )
(command "arc" "c" p401 p90 p110 )
(command "arc" "c" p402 p91 p121 )
(command "arc" "c" p403 p111 p91 )
;this program express the arces of handrail belt
(command "arc" "c" p300 p62 p83 )
(command "arc" "c" p301 p84 p67 )
(command "arc" "c" p300 p802 p87 )
(command "arc" "c" p301 p88 p807 )
;this program express the line of shelf
(command "line" p10 p51 "")
(command "line" p58 p40 "")
(command "layer""n""cen""c""3""cen""l""center""cen""")
(command "layer""s""cen""")
(command "line" p51 p20 "")
(command "line" p20 p30 "")
(command "line" p30 p58 "")
;this program express the line of last layer
(command "layer" "n" "gre" "c" "3" "gre" "")
(command "layer" "s" "gre" "")
(command "line" p72 p73 "")
(command "line" p74 p75 "")
(command "line" p76 p77 "")
(command "arc" "c" p204 p73 p74 )
(command "arc" "c" p205 p76 p75 )
(command "arc" "c" p300 p72 p81 )
(command "arc" "c" p301 p82 p77 )
;this program express the line of second layer
(command "layer" "n" "zs" "c" "5" "zs" "")
(command "layer" "s" "zs" "")
(command "line" p702 p703 "")
(command "line" p704 p705 "")
(command "line" p706 p707 "")
(command "arc" "c" p2004 p703 p704 )
(command "arc" "c" p2005 p706 p705 )
(command "arc" "c" p300 p702 p85 )
(command "arc" "c" p301 p86 p707 )
(setvar "osmode" os)
(princ)
)
*********************************************************************
版权所有,本程序作者黄新宇,莫介文
原创,居然没有人回复,伤心呀
我看了你的程序应该作的不错,如把它画成三维就更好.
gbg
谢谢顾老夸奖,我下一步的工作是将我公司的扶梯相关参数写进程序,使程序能带出我们公司相关产品的重量支撑力什么的参数,
很不错的东西,个人正在学习中.支持楼主.
看不懂啊
我顶!!!
走在路上
很不错的东西
赞赏 哪个公司的