a++programs

4
L.D.COLLEGE OF ENGINEERING. AHMEDABAD M.E.(C.A.S.A.D.)-I SEM SUB:- COMPUTER APPLICATION AND DESING ;Program for Plane Frame with input file (defun c:frame() (command "erase" "w" "0.0" "50,50" "") ;;; (setq f1 (open "D:\Inframe.lsp" "r")) (setq f1 (open "d:\\Inframe.lsp" "r")) ;;;#<file "c:\\myinfo.dat"> ;;;;;;#<file "D:\Inframe.lsp"> ;;; (setq fname (getstring "\n D:\\inframe.lsp")) ;;; r"")) ;;; (setq f1 (open fname "r")) (setq nm (read-line f1)) (repeat (atoi nm) (setq l (read-line f1)) (setq mn (atoi (substr l 1 4))) (setq j (atoi (substr l 5 4))) (setq k (atoi (substr l 9 4))) (setq x1 (atof (substr l 13 6))) (setq y1 (atof (substr l 19 6))) (setq x2 (atof (substr l 25 6))) (setq y2 (atof (substr l 31 6))) (setq pt1(list x1 y1)) (setq pt2(list x2 y2)) (command "color" "5" "") (command "osnap" "") (command "line" pt1 pt2 "") (command "color" "red" "") (setq x 0.25) (setq p1 (list (-(car pt1) x)(-(cadr pt1) x))) (setq p2 (list (-(car pt2) x)(-(cadr pt2) x))) (command "text" "j" "m" p1 "0.25" "" (itoa j) "") (command "text" "j" "m" p2 "0.25" "" (itoa k) "") (command "color" "green" "") (command "circle" p1 "0.5" "") (command "circle" p2 "0.5" "") (command "osnap" "mid" "") (command "color" "blue" "") (setq p3 (list (/(+(car pt1)(car pt2))2)(/(+ (cadr pt1) (cadr pt2))2))) (setq p3 (list (+(car p3) x )(+(cadr p3) x))) 1

Upload: anonymous-hj7hmihh

Post on 13-Jul-2016

212 views

Category:

Documents


0 download

DESCRIPTION

cpp

TRANSCRIPT

Page 1: a++Programs

L.D.COLLEGE OF ENGINEERING. AHMEDABADM.E.(C.A.S.A.D.)-I SEM

SUB:- COMPUTER APPLICATION AND DESING;Program for Plane Frame with input file(defun c:frame()(command "erase" "w" "0.0" "50,50" "");;; (setq f1 (open "D:\Inframe.lsp" "r")) (setq f1 (open "d:\\Inframe.lsp" "r")) ;;;#<file "c:\\myinfo.dat"> ;;;;;;#<file "D:\Inframe.lsp">;;; (setq fname (getstring "\n D:\\inframe.lsp"));;; r""));;; (setq f1 (open fname "r")) (setq nm (read-line f1)) (repeat (atoi nm) (setq l (read-line f1)) (setq mn (atoi (substr l 1 4))) (setq j (atoi (substr l 5 4))) (setq k (atoi (substr l 9 4))) (setq x1 (atof (substr l 13 6))) (setq y1 (atof (substr l 19 6))) (setq x2 (atof (substr l 25 6))) (setq y2 (atof (substr l 31 6))) (setq pt1(list x1 y1)) (setq pt2(list x2 y2)) (command "color" "5" "") (command "osnap" "") (command "line" pt1 pt2 "") (command "color" "red" "") (setq x 0.25) (setq p1 (list (-(car pt1) x)(-(cadr pt1) x))) (setq p2 (list (-(car pt2) x)(-(cadr pt2) x))) (command "text" "j" "m" p1 "0.25" "" (itoa j) "") (command "text" "j" "m" p2 "0.25" "" (itoa k) "") (command "color" "green" "") (command "circle" p1 "0.5" "") (command "circle" p2 "0.5" "") (command "osnap" "mid" "") (command "color" "blue" "") (setq p3 (list (/(+(car pt1)(car pt2))2)(/(+ (cadr pt1)(cadr pt2))2))) (setq p3 (list (+(car p3) x )(+(cadr p3) x))) (command "text" "j" "m" p3 "0.5" "" mn "") (command "color" "5" "") (command "circle" p3 "0.5" "") (setq j (+ j 1)) (setq k (+ k 1)) ) ;(command "redraw" "") (command "zoom" "all") )

1

Page 2: a++Programs

L.D.COLLEGE OF ENGINEERING. AHMEDABADM.E.(C.A.S.A.D.)-I SEM

SUB:- COMPUTER APPLICATION AND DESING

191 1 2 1.0 1.0 1.0 5.02 2 3 1.0 5.0 1.0 9.03 3 4 1.0 9.0 1.0 13.04 5 6 4.5 1.0 4.5 5.05 6 7 4.5 9.0 4.5 9.06 7 8 4.5 9.0 4.5 13.07 8 9 4.5 13.0 4.5 16.08 15 14 8.5 1.0 8.5 5.09 14 13 8.5 5.0 8.5 9.010 13 12 8.5 9.0 8.5 13.011 12 11 8.5 13.0 8.5 16.012 2 6 1.0 5.0 4.5 5.013 3 7 1.0 9.0 4.5 9.014 4 8 1.0 13.0 4.5 13.015 6 14 4.5 5.0 8.5 9.016 7 13 4.5 9.0 8.5 9.017 8 12 4.5 13.0 8.5 13.018 9 10 4.5 16.0 6.5 18.019 10 11 6.5 18.0 8.5 16.0

2

Page 3: a++Programs

L.D.COLLEGE OF ENGINEERING. AHMEDABADM.E.(C.A.S.A.D.)-I SEM

SUB:- COMPUTER APPLICATION AND DESING

( defun c:conrec() ( setq p1 (getpoint"\nGive the first corner of Rectangle")) ( setq p2 (getpoint"\nGive the second corner of Rectangle")) ( command "rectangle" p1 p2) ( setq od (getreal "\nGive the offset distance")) ( setq os (getpoint"\nGive the offset side")) ( setq so (ssget)) ( command "offset" od so os "") ( setq n(getint"\nGive the No. of Rectangle")) ( setq n(+ 1 n)) ( setq op(/ od n)) ( setq onew od) ( repeat n

( setq onew(- onew op)) (command "offset" onew so os "") ))

3