(setq a (entsel))
(setq b (car a))
(setq d (entget b))
(setq i_l (getint "\n L:")
i_h (getint "\n H:")
i_t (getint "\n T:")
)
(setq p1 (getpoint "\nStart Pt:"))
(setq p2 (polar p1 (* (/ pi 2) 4) i_l)
p3 (polar p2 (* (/ pi 2) 1) i_t)
p4 (polar p3 (* (/ pi 2) 2) (- i_l i_t))
p5 (polar p4 (* (/ pi 2) 1) (- i_h i_t))
p6 (polar p5 (* (/ pi 2) 2) i_t)
)
(command "line" p1 p2 p3 p4 p5 p6 "c")
//
(setq i_l (getint "\n L:")
i_h (getint "\n H:")
i_t (getint "\n T:")
)
(setq p1 (getpoint "\nStart Pt:")
p1_ang (getpoint p1 "\nStart Pt:")
)
(setq ang1 (angle p1 p1_ang))
(setq p2 (polar p1 (+ (* (/ pi 2) 4) ang1) i_l)
p3 (polar p2 (+ (* (/ pi 2) 1) ang1) i_t)
p4 (polar p3 (+ (* (/ pi 2) 2) ang1) (- i_l i_t))
p5 (polar p4 (+ (* (/ pi 2) 1) ang1) (- i_h i_t))
p6 (polar p5 (+ (* (/ pi 2) 2) ang1) i_t)
)
(command "line" p1 p2 p3 p4 p5 p6 "c")
//
(defun c:r_txt()
(setq path "d:/work/txt/")
(setq f_name "aa.txt")
(setq P_fp (strcat path f_name))
(setq fp (open p_fp "r"))
(while (setq tx_line (read-line fp))
(print tx_line)
)
(princ)
(close fp)
(setq fp (open p_fp "a"))
(print "aaaa" fp)
(close fp)
)
//
(defun c:r_txt()
(setq path "d:/work/txt/")
(setq f_name "aa.txt")
(setq P_fp (strcat path f_name))
(setq fp (open p_fp "r"))
(while (setq tx_line (read-line fp))
(cond
((= "H" tx_line) (setq n_H (atof (read-line fp))))
((= "B" tx_line) (setq n_B (atof (read-line fp))))
((= "T" tx_line) (setq n_T (atof (read-line fp))))
)
)
(princ)
(close fp)
)
//
(defun c:dch(i_l i_h i_t / p1 p1_ang
p2 p3 p4 p5 p6
)
;;;(setq i_l (getint "\n L:")
;;; i_h (getint "\n H:")
;;; i_t (getint "\n T:")
;;; )
(setq p1 (getpoint "\nStart Pt:")
p1_ang (getpoint p1 "\nStart Pt:")
)
(setq ang1 (angle p1 p1_ang))
(setq p2 (polar p1 (+ (* (/ pi 2) 4) ang1) i_l)
p3 (polar p2 (+ (* (/ pi 2) 1) ang1) i_t)
p4 (polar p3 (+ (* (/ pi 2) 2) ang1) (- i_l i_t))
p5 (polar p4 (+ (* (/ pi 2) 1) ang1) (- i_h i_t))
p6 (polar p5 (+ (* (/ pi 2) 2) ang1) i_t)
)
(command "pline" p1 p2 p3 p4 p5 p6 "c")
)
//
(setq p1 (getpoint "\mPick p1:")
p2 (getpoint p1 "\mPick p2:")
)
(setq d1 (getreal "\nEnter Length:"))
(setq d (DISTANCE p1 p2)
a (ANGLE p1 p2)
d2 (/ d 2)
a2 (+ a (/ pi 2))
a3 (+ a2 (/ pi 2))
)
(setq p3 (POLAR p1 a d2)
p4 (POLAR p3 a2 d1)
p5 (POLAR p4 a3 d2)
p6 (POLAR p4 a d2)
)
(command "line" p1 p2 "" "line" p3 p4 "" "line" p5 p6 "")
///
(defun c:aaa()
(setq p1 (getpoint "\n pick point:"))
(setq p2 (getpoint p1 "\n pick point2:"))
(setq d1 (getreal "\n°Å¸® :"))
(of_po p1 p2 (angle p1 p2) d1 T)
(setq p3 n_p1)
(setq p4 n_p2)
(of_po p1 p2 (angle p1 p2) d1 nil)
(setq p5 n_p1)
(setq p6 n_p2)
(command "line" p3 p4 "" "line" p5 p6 "")
)
(defun of_po(p1 p2 ang d1 flag)
(if (= flag T)
(progn
(setq n_p1 (polar p1 (+ ang (/ pi 2)) d1))
(setq n_p2 (polar p2 (+ ang (/ pi 2)) d1))
)
(progn
(setq n_p1 (polar p1 (- ang (/ pi 2)) d1))
(setq n_p2 (polar p2 (- ang (/ pi 2)) d1))
)
)
)
///
(setq p1 (getpoint "")
p2 (GETCORNER p1 "")
)
(setq ss_get (ssget "c" p1 p2))
(setq cnt (sslength ss_get))
(setq cnt1 0)
(repeat cnt
(setq ss_get1 (entget (ssname ss_get cnt1)))
(foreach aa ss_get1 (print (cdr aa)))
(setq cnt1 (+ 1 cnt1))
)
///
(setq jum "123456-234567")
"123456-234567"
(setq g (substr jum 1 2))
"12"
(setq y_i (strcat "19" g))
"1912"
(setq hh (- 2007 (atoi y_i)))
95
(strcat (itoa hh) "ȓ")
"95ȓ"
//(defun c:rrr()
(setq bb (sub1 2 3))
(princ bb)
)
(defun sub1(a b / plus_v div_v)
(setq div_v (/ a b))
(setq plus_v (+ a b))
)
//
(setq dd (entget (car (entsel))))
(setq cnt (length dd))
(setq cnt2 0)
(repeat cnt
(princ "\n")
(princ (nth cnt2 dd) )
(setq cnt2 (+ 1 cnt2))
)
(princ)
///
(setq p1 (getpoint "\nPick Point"))
(setq p2 (GETCORNER p1 "\nCorner Pt:"))
(setq ss_1 (ssget "w" p1 p2))
(setq cnt (sslength ss_1))
(setq cnt2 0)
(repeat cnt
(ssname ss_1 cnt2)
(setq cnt2 (+ 1 cnt2))
)
//
(setq p1 (getpoint "\nPick Point"))
(setq p2 (GETCORNER p1 "\nCorner Pt:"))
(setq ff (list (cons 8 "cen")))
(setq ss_1 (ssget "c" p1 p2 ff))
(setq cnt (sslength ss_1))
(setq ct (itoa cnt))
(setq msg (strcat "\n[ " ct " ] °³¼ö°¡ ¹ß°ß µÇ¾ú½À´Ï´Ù."))
(alert msg)
(setq cnt2 0)
(repeat cnt
(setq aa (entget (ssname ss_1 cnt2)))
(setq cnt2 (+ 1 cnt2))
(princ aa)
)
//
(mapcar '(lambda (x y z) (* x (- y z))) '(5 6) '(20 30) '(14 5.0))
//
(mapcar '(lambda (x) (+ x 4)) '(1 2 3))
//
(setq p2 (getpoint p1 "\nPick Pt2:"))
(setq p3 (div p1 p2 2 3))
(command "line" p1 p2 "" "line" p3)
(defun div(pt1 pt2 m n)
(setq n_p1
(mapcar
'(lambda(a b c d)
(/ (+ (* c a) (* d b))(+ c d))
)
pt1 pt2 (list m m m) (list n n n)
)
)
)
//
(setq dcl_id (LOAD_DIALOG "use_dia1.dcl"))
(NEW_DIALOG "use_dia" dcl_id)
(action_tile "can" "(setq dn 1) (done_dialog)")
(lambda ($KEY $VALUE $DATA $REASON $X $Y)
(setq dn 2)
)
(action_tile "acc" "(setq dn 2) (done_dialog)")
(start_dialog)
(unload_dialog dcl_id)
(if (= dn 1) (princ "can"))
(if (= dn 2) (princ "acc"))
//
(setq msg_v '("³Êºñ" "³ôÀÌ" "µÎ²²"))
(setq cnt 0)
(setq a_list '())
(repeat (length msg_v)
(setq msg_in (strcat "\n[ " (nth cnt msg_v) " ]ÀÔ·ÂÇϼ¼¿ä:"))
(setq n_v (list (getint msg_in )))
(setq a_list (append n_v a_list))
(setq cnt (+ 1 cnt))
)
(foreach x a_list (princ x))
//(setq msg_v '("³Êºñ" "³ôÀÌ" "µÎ²²"))
(setq msg_v1 '("³Êºñ" "³ôÀÌ" "µÎ²²1" "µÎ²²2"))
(setq v1 (fds msg_v))
(princ "\n")(foreach x a_list (princ x))
(setq v2 (fds msg_v1))
(princ "\n")(foreach x a_list (princ x))
(princ)
(defun fds(msg_v)
(setq cnt 0)
(setq a_list '())
(repeat (length msg_v)
(setq msg_in (strcat "\n[ " (nth cnt msg_v) " ]ÀÔ·ÂÇϼ¼¿ä:"))
(setq n_v (list (getint msg_in )))
(setq a_list (append n_v a_list))
(setq cnt (+ 1 cnt))
)
a_list ;Return Value
)
///
;;;(setq e1 (entlast))
(setq dp1 (getpoint "\nSt point:")
dp2 (getpoint dp1 "\nClick direct:")
)
(setq e_d1_li '())
(while (setq d1 (getint "\nEnter dist:"))
(setq e_d1_li (append (list d1) e_d1_li))
)
(setq cnt1 (length e_d1_li))
(repeat (length e_d1_li)
(setq cnt1 (- cnt1 1))
(setq e1 (entlast))
(setq e_list1 (entget e1))
(setq ep1 (cdr (assoc 10 e_list1)))
(setq ep2 (cdr (assoc 11 e_list1)))
(setq ang1 (ANGLE ep1 ep2))
;;; (if (and (>=ang1 0) (<ang1 pi))
;;; )
(setq d1 (nth cnt1 e_d1_li))
(setq ang2 (ANGLE dp1 dp2))
(setq np1 (POLAR ep1 ang2 d1)
np2 (POLAR ep2 ang2 d1)
)
(command "line" np1 np2 "")
)
//
(defun c:cc()
(setq aa (car (entsel)))
(command "copy" aa "" "m")
)
//
(setq s1 (list (cons 0 "LINE") (cons 62 5)))
(setq p1 (getpoint "\nPick point:")
p2 (GETCORNER p1 "\nOther point:")
)
(setq ss1 (ssget "w" p1 p2 s1))
//
(setq s1 (list (cons 0 "CIRCLE") (cons 8 "0")))
(setq p1 (getpoint "\nPick point:")
p2 (GETCORNER p1 "\nOther point:")
)
(setq ss1 (ssget "w" p1 p2 s1))
(if (/= ss1 nil)
(progn
(sub_fun1 ss1)
)
(progn
(alert "\Not Found Entity")
)
)
(defun sub_fun1(ss1)
(setq slen (sslength ss1))
(setq p1 (GETPOINT "\p1:"))
(setq p2 (GETPOINT p1 "\np2:"))
(command "move" ss1 "" p1 p2)
)
//
(if (= d2 nil)
(setq d2 (getint "\Offset Dist:"))
(progn
(setq d3 d2)
(setq d2 (getint (strcat "\Offset Dist:<" (itoa d2) ">" )))
)
)
(if (= d2 nil)
(setq d2 d3)
(setq d2 d2)
)
(princ d2)
//
(setq ss_V (ssadd))
(while (setq ent_name (car (entsel)))
(setq ss_v (ssadd ent_name ss_v))
)
(setq cnt 0)
(repeat (sslength ss_v)
(setq ent_name (ssname ss_v cnt))
(setq cnt (+ 1 cnt))
(princ ent_name)
(princ)
)
//
(setq path "d:/work/txt/")
(setq f_name "aa.txt")
(setq P_fp (strcat path f_name))
(setq fp (open p_fp "r"))
(setq a_list (list))
(setq a_list2 (list))
(while (setq tx_line (read-line fp))
(cond
((= "H" tx_line) (setq n_H (atof (read-line fp))))
((= "B" tx_line) (setq n_B (atof (read-line fp))))
((= "T" tx_line) (setq n_T (atof (read-line fp))))
)
(if (= "T" tx_line)
(progn
(setq a_list2 (list n_h n_b n_t))
(setq a_list (append (list a_list2) a_list))
)
)
(print tx_line)
)
(princ)
(close fp)
|