- UID
- 10061
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-9-16
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
;* 图幅坐标初始化,插入图幅和图形比例
;
(DEFUN C:BEGIN(/ ST SCALE TU CR1 E oldh)
(SETQ ST (getvar "textstyle"))
(COMMAND "STYLE" "HZ" "" "" "" "" "" "" ""
"layer" "s" "0" ""
);command
(SETQ SCALE (GETSTRING "\nPlease input the scale of graph请输入图形比例<1:10>: "))
(IF (= SCALE "") (SETQ SCALE "1:10"))
(INITGET 1 "A0 A1 A2 A3 A4")
(SETQ TU (STRCASE (GETKWORD "\nSelect the frame选择图框<A0,A1,A2,A3,A4>: ")))
(SETQ SCA (ATOF (SUBSTR SCALE 3)))
;
(IF (= TU "A0")
(SETQ B 841 L 1189 A 25 C 10
CR1 (LIST (* (- L C 6) SCA) (* 29.25 SCA))
TU "C:\\BYQ94\\BYQ\\A0"
);SETQ
);IF
;
(IF (= TU "A1")
(SETQ B 594 L 841 A 25 C 10
CR1 (LIST (* (- L C 6) SCA) (* 29.25 SCA))
TU "C:\\BYQ94\\BYQ\\A1"
);SETQ
);IF
;
(IF (= TU "A2")
(SETQ B 420 L 594 A 25 C 10
CR1 (LIST (* (- L C 6) SCA) (* 29.25 SCA))
TU "C:\\BYQ94\\BYQ\\A2"
);SETQ
);IF
;
(IF (= TU "A3")
(SETQ B 297 L 420 A 25 C 5
CR1 (LIST (* (- L C 6) SCA) (* 24.25 SCA))
TU "C:\\BYQ94\\BYQ\\A3"
);SETQ
);IF
(IF (= TU "A4")
(SETQ B 210 L 297 A 25 C 5
CR1 (LIST (* sca (- B C 6)) (* sca 24.25))
TU "C:\\BYQ94\\BYQ\\A4"
);SETQ
);IF
;
(SETQ E (tblsearch "style" (getvar "textstyle"))
oldh (* sca (CDR (ASSOC 40 E)))
);SETQ
;
(COMMAND "INSERT" TU (LIST 0 0) sca "" ""
"STYLE" "HZ" "" (* sca 3.5) "" "" "" "" "" ""
"TEXT" "J" "M" CR1 "" SCALE ;插入图比例
"STYLE" ST "" oldh "" "" "" "" "" ""
"ZOOM" "A"
"dim" "dimsoxd" "off"
"dimtih" "off"
"dimtoh" "off"
"dimtad" "on"
"dimtix" "on"
"dimdli" (* sca 7)
"dimexe" (* sca 3)
"dimexo" 0
"dimasz" (* sca 2.5)
"dimtxt" (* sca 4)
"exit"
"scale" "c" '(0 0) (list (* sca L) (* sca B)) "" '(0 0) (/ 1.0 sca)
"zoom" "e"
"units" 2 1 1 0 0 "N"
);COMMAND
);DEFUN
;
(defun start() ; xhcase rl gy dy is public argument
(prompt "\n")
(if (setq fname1 (open "c:\\byq94\\txt\\fname.txt" "r"))
(progn
(setq XinHaoMing (read-line fname1)
xinhaoming (read xinhaoming)
xhcase (cdr (nth 0 XinHaoMing))
rl (cdr (nth 1 XinHaoMing))
gy (cdr (nth 2 XinHaoMing))
dy (cdr (nth 3 XinHaoMing))
);setq
;系列号
(if (= xhcase 7) (setq xh "S7"))
(if (= xhcase 9) (setq xh "S9"))
(setq
rlst (itoa rl)
gyst (itoa gy)
dyst (rtos dy 2 1)
xhst (strcat xh "--" rlst "/" gyst "/" dyst) ;xhst是型号名
TiShi (strcat "当前作图型号为: " xhst )
);setq
(prompt TiSHi)
(initget 1 "Y N")
(setq fnayes (getkword " 是否就此型号作图?<Y/N>: "))
(setq fnayes (strcase fnayes));setq
);progn
(setq fnayes "N")
);if
;
(if (= fnayes "N")
(progn
(initget 1 "S7 S9")
(setq xh (getkword "请输入型号<:S7 .S9..> : "))
(setq rl (getint "请输入容量<例:100> :"))
(initget 1 "6000 6300 10000 35000")
(setq gy (getkword "请输入高压<10000,35000,6000,6300(单位V)> :") )
(initget 1 "400 6300 10000")
(setq dy (getkword "请输入低压<400,6300,10000> :"))
(setq fna "f"
gy (atoi gy)
dy (atof dy)
);setq
);progn
);if
(setq xh (strcase xh)
rlst (itoa rl)
gyst (itoa gy)
dyst (rtos dy 2 1)
;xhst是型号名
gyst2 (itoa (/ gy 1000))
dyst2 (rtos (/ dy 1000) 2 1)
xhst (strcat xh "--" rlst "/" gyst2 "/" dyst2)
);setq
;
(if (= xh "S7") (setq xhcase "7"))
(if (= xh "S9") (setq xhcase "9"))
;
(if (= fna "f")
(progn
(setq XinHaoMing (strcat "((xl . " xhcase ")(rl . " rlst ")(gy . " gyst ")(dy . " dyst "))")
fname2 (open "c:\\byq94\\txt\\fname.txt" "w")
);setq
(write-line XinHaoMing fname2)
);progn
);if
);defun
|
|