;Membuat garis sejajar dengan hanya memberi jaraknya saja
(defun c:SW (/ A FAN DI KU SU MA rr)
(setq rr *error* *error* merr)(command "ucs" "W")
(IF(NULL MYG)(SETQ MYG 3.0))
(setq FAN (ENTsel " OFFSET by New Base Line\nSelect line to Offset : ") )
(if FAN(progn
(setq KU 0.0 DI (getdist (osnap(cadr FAN)"endp")
(STRCAT"\n Enter distance <"(RTOS MYG 2 2)"> : ") ))
(if DI (setq MYG DI) (setq DI MYG))
(setq SU(list DI))
;(command "ucs" "e" FAN)
(while DI
(if(/= DI "Undo")(progn
(setq SU(append(list DI)SU))
(setq KU (+ KU DI))
(command "offset" KU FAN"NON"(cadr(grread t))"")
) )
(initget "eXit Undo .")
(setq DI(getreal(strcat"\n eXit/Undo/Enter distance <"(rtos MYG)"> : ")) )
(if DI(IF(NUMBERP DI)(setq MYG DI))(setq DI MYG))
(if(or(="."DI)(="eXit"DI))(setq DI nil))
(if (= DI "Undo")
(if(cdr SU)(progn
(entdel(entlast))
(setq KU(- KU (car SU)))
(setq SU(cdr SU))
)(princ"Nothing to undo"))
) ) ))
(setq *error* rr)(princ))
;(defun c:wa(/ P LAY)(SETQ LAY(GETVAR"CLAYER"))(COMMAND"LAYER""M""ARBANG""")(WHILE(SETQ P(GETPOINT"\n Insertion point: "))(COMMAND"INSERT""D:/PROJECT/LIBRARY/WATUS.DWG""non"P""""""))(SETVAR"CLAYER"LAY)'°)
;(defun c:aw(/ P)(SETQ P(GETPOINT"\n Insertion point: "))(COMMAND"INSERT""*D:/PROJECT/LIBRARY/aalir.DWG""non"P"")'°)
;(defun c:AS(/ P)(SETQ P(GETPOINT"\n Insertion point: "))(COMMAND"INSERT""*D:/PROJECT/LIBRARY/ARSIR.DWG""non"P"""")'°)
(DEFUN C:Tr(/ osm rr pt1 pt2 pt3 pt4 se)(setq rr *error* *error* merr)
(setq osm(getvar"osmode"))(setvar"osmode"0)
(setq pt1 (getpoint "\nFirst corner: ")
pt2 (getcorner pt1 "\nOther corner: ")
pt3 (list(car pt1)(cadr pt2))
pt4 (list(car pt2)(cadr pt1))
se (ssget"c"pt1 pt2))
(command"trim"se"""f"pt3 pt1 pt4"""f"pt3 pt2 pt4"")
(setvar"osmode"osm)(setq *error* rr)(princ))
(defun c:bc(/ ct x y t en)
(setq ct (getpoint" BOCK\n Pick point to intersection/
x (getreal"\n Enter two distance <20>: ")
y (getreal"\n second distance <20>: "))
(initget "Non")
(setq t (getreal"\n Non / Enter thickness <3>: "))
(if(not ct)(setq ct(getvar"viewctr")) )
(if(not x)(setq x 20))(if(not y)(setq y 20))(if(not t)(setq t 3))
(command"pline""NON"ct"NON"(list(+(car ct)x)(cadr ct))
"NON"(list(+(car ct)x)(+(cadr ct)y))"NON"(list(car ct)(+(cadr ct)y))"c")
(setq en(entlast))
(if(="Non"t)(command"explode"en)(progn
(command"offset"t(list en ct)"non"(list(+(car ct)(/ x 2))(+(cadr ct)(/ y 2)))"")
(command"explode"(entlast)"explode"en)))
(princ))
(defun c:SW2 (/ A FAN DI KU SU MA rr)
(setq rr *error* *error* merr)(command "ucs" "W")
(IF(NULL MYG)(SETQ MYG 3.0))
(setq FAN (ENTsel " OFFSET by New Base Line 1:2 \nSelect line to Offset : ") )
(if FAN(progn
(setq KU 0.0 DI (getdist (osnap(cadr FAN)"endp")
(STRCAT"\n Enter distance <"(RTOS MYG 2 2)"> : ") ))
(if DI (setq MYG DI) (setq DI MYG))
(setq SU(list DI))
(while DI
(if(/= DI "Undo")(progn
(setq SU(append(list DI)SU))
(setq KU (+ KU DI))
(command "offset"(* 0.5 KU) FAN"NON"(cadr(grread t))"")
) )
(initget "eXit Undo .")
(setq DI(getreal(strcat"\n eXit/Undo/Enter distance <"(rtos MYG)"> : ")) )
(if DI(IF(NUMBERP DI)(setq MYG DI))(setq DI MYG))
(if(or(="."DI)(="eXit"DI))(setq DI nil))
(if (= DI "Undo")
(if(cdr SU)(progn
(entdel(entlast))
(setq KU(- KU (car SU)))
(setq SU(cdr SU))
)(princ"Nothing to undo"))
) ) ))
(setq *error* rr)(princ))
(defun c:ws (/ A FAN DI KU SU MA rr)
(setq rr *error* *error* merr)(command "ucs" "W")
(IF(NULL MA)(SETQ MA 3.0))
(setq FAN (ENTsel " OFFSET by ONE Base Line\nSelect line to Offset : ") )
(if FAN(progn
(setq KU 0.0 DI (getdist (osnap(cadr FAN)"endp")
(STRCAT"\n Enter distance <"(RTOS MA 2 2)"> : ") ))
(if DI (setq MA DI) (setq DI MA))
(command "ucs" "e" FAN)
(while DI
(if(/= DI "Undo")(command "offset" di FAN"NON"(list 0 KU)"") )
(initget "eXit Undo .")
(setq DI(getreal(strcat"\n eXit/Undo/Enter distance <"(rtos MA)"> : ")) )
(if DI(IF(NUMBERP DI)(setq MA DI))(setq DI MA))
(if(or(="."DI)(="eXit"DI))(setq DI nil))
(if (= DI "Undo")(entdel(entlast)) )
) ) )
(command "ucs" "W")(setq *error* rr)(princ))
(defun c:ga (/ a ar pt sc pt1)
(setq pt1 (getpoint "Select point inside area to be calculated: "))
(command "-boundary" pt1 "")
(setq A (ssget "L"))
(setq unts (getvar "lunits"))
(setvar "lunits" 2)
(command "area" "e" a )
(setq ar (getvar "area"))
(setvar "lunits" unts)
(setq pt (getpoint "select location for area note: "))
(command "text" pt"""" ar)
)
;Array vertikal
(defun c:vr (/ A FAN DI KU SU MA rr)
(setq rr *error* *error* merr)(command "ucs" "W")
(Princ" Vertical Array ")
(setq A (ssget ))
(setq FAN (ssname A 0)
DI(cdr(assoc 10(entget FAN)))
KU(getint " Enter the number of rows (---): <10> ")
SU (getdist DI " Specify the distance between rows: ")
)(IF(NULL KU)(SETQ KU 10))
(command"-array" A "" "_R" KU "1" SU)
(setq *error* rr)(princ))
;Array horizontal
(defun c:hr (/ A FAN DI KU SU MA rr)
(setq rr *error* *error* merr)(command "ucs" "W")
(Princ" Vertical Array ")
(setq A (ssget ))
(setq FAN (ssname A 0)
DI(cdr(assoc 10(entget FAN)))
KU(getint " Enter the number of columns (|||): <10> ")
SU (getdist DI " Specify the distance between columns: ")
)(IF(NULL KU)(SETQ KU 10))
(command"-array" A "" "_R" "1" KU SU)
(setq *error* rr)(princ))
________________________________________________________
0 Komentar::
Posting Komentar
Pesan Anda: