63
242
181
后起之秀
使用道具 举报
10
8258
8335
初来乍到
15
335
322
初露锋芒
26
1495
20
;=======================================================================; JPline.Lsp May 30, 2007; Joins Any 2 ECS LINEs, ARCs, Or POLYLINEs That Have A; Common End Point Into New WCS 3DPOLY;================== Start Program ======================================(princ "\nCopyright (C) 2007, Fabricated Designs, Inc.")(princ "\nLoading JPline v1.5 ");;;1.5 LWPolyLines & zerop Thickness(setq jp_ nil lsp_file "JPline");==== For Automated Calling From Another Program =======================(defun jp_auto (ar1 ar2) ;;;Provide enames Of (jp_make ar1 ar2)) ;;;2 Entities To Join;================== Macros =============================================(defun PDot ()(princ "."))(defun Beep (/ f)(and (wcmatch (getvar "PLATFORM") "*DOS*") (setq f (open "con" "w")) (write-char '7 f) (close f)))(defun Err (e) (beep) (princ (strcat "\nError: ** " e " ** ")) (quit))(PDot);++++++++++++ Set Modes & Error ++++++++++++++++++++++++++++++++++(defun jp_smd ()(SetUndo)(setq oldlay (getvar "CLAYER") olderr *error* *error* (lambda (e) (while (> (getvar "CMDACTIVE") 0) (command)) (and (/= e "quit / exit abort") (princ (strcat "\nError: *** " e " *** "))) (command "_.UNDO" "_END" "_.U") (jp_rmd)) jp_var '( ("CMDECHO" . 0) ("MENUECHO" . 0) ("MENUCTL" . 0) ("MACROTRACE" . 0) ("OSMODE" . 0) ("SORTENTS" . 119) ("REGENMODE" . 1) ("MODEMACRO" . ".") ("BLIPMODE" . 0) ("EXPERT" . 0) ("SNAPMODE" . 1) ("PLINEWID" . 0.0) ("ORTHOMODE" . 1) ("GRIDMODE" . 0) ("ELEVATION" . 0) ("THICKNESS" . 0) ("UCSICON" . 0) ("HIGHLIGHT" . 1) ("COORDS" . 2) ("DRAGMODE" . 2) ("CECOLOR" . "BYLAYER") ("CELTYPE" . "BYLAYER")))(foreach v jp_var (setq m_v (cons (getvar (car v)) m_v) m_n (cons (car v) m_n)) (setvar (car v) (cdr v))) (if (not (entnext)) (err "There Are No Entities To Work With!"))(princ (strcat (getvar "PLATFORM") " Release " (substr (ver) 18 2) " - Join LINES, ARCS, & PLINES ....\n"))(princ))(PDot);++++++++++++ Return Modes & Error +++++++++++++++++++++++++++++++(defun jp_rmd () (SetLayer oldlay) (setq *error* olderr) (mapcar 'setvar m_n m_v) (command "_.UNDO" "_END") (prin1))(PDot);++++++++++++ Set And Start An Undo Group ++++++++++++++++++++++++(defun SetUndo ()(and (zerop (getvar "UNDOCTL")) (command "_.UNDO" "_ALL"))(and (= (logand (getvar "UNDOCTL") 2) 2) (command "_.UNDO" "_CONTROL" "_ALL"))(and (= (logand (getvar "UNDOCTL") 8) (command "_.UNDO" "_END"))(command "_.UNDO" "_GROUP"))(PDot);++++++++++++ Make Layer Current +++++++++++++++++++++++++++++++++(defun SetLayer (lay_name / lay_list lay_flag) (if (not (tblsearch "LAYER" lay_name)) (command "_.LAYER" "_MAKE" lay_name "") (progn (setq lay_list (tblsearch "LAYER" lay_name) lay_flag (cdr (assoc 70 lay_list))) (if (= (logand lay_flag 1) 1) (command "_.LAYER" "_THAW" lay_name "")) (if (minusp (cdr (assoc 62 lay_list))) (command "_.LAYER" "_ON" lay_name "")) (if (= (logand lay_flag 4) 4) (command "_.LAYER" "_UNLOCK" lay_name "")) (and (= (logand lay_flag 16) 16) (princ "\nCannot Set To XRef Dependent Layer") (quit)) (command "_.LAYER" "_SET" lay_name ""))))(PDot);++++++++++++ Convert LINE To 3DPOLY +++++++++++++++++++++++++++++(defun ledit (ln / ld lay pt1 pt2 lty thk clr hf vf) (and (= (type ln) 'ENAME) (setq ld (entget ln)) (= (cdr (assoc 0 ld)) "LINE") (setq lay (cdr (assoc 8 ld)) pt1 (cdr (assoc 10 ld)) pt2 (cdr (assoc 11 ld)) lty (if (assoc 6 ld) (cdr (assoc 6 ld)) "BYLAYER") thk (if (assoc 39 ld) (cdr (assoc 39 ld)) 0.0) clr (if (assoc 62 ld) (cdr (assoc 62 ld)) 256))) (if (and pt1 pt2) (progn (if (equal (caddr pt1) (caddr pt2) 0.0001) (setq hf 0 vf 0) (setq hf 8 vf 32 thk 0.0 lty "BYLAYER")) (entdel ln) (entmake (list (cons 0 "POLYLINE")(cons 8 lay)(cons 66 1) (cons 10 (list 0.0 0.0 0.0))(cons 70 hf) (cons 40 0.0)(cons 41 0.0)(cons 210 (list 0.0 0.0 1.0)) (cons 71 0)(cons 72 0)(cons 73 0)(cons 74 0)(cons 75 0)