|
|
Upload
| >> Mô tả tóm tắt nội dung file: |
Bộ AutoLISP chiến đấu Do kts. Trần Ngọc Thắng TỰ BIÊN SOẠN + SƯU TẦM dùng được cho AutoCAD Version Hight : Bổn CỐC CHỦ TUYỆT TÌNH CỐC : Ngưỡng mộ Long Cô Nương phái Cổ MỘ : Chờ Chết Sắp Sẵn Quan Tài Trong Mộ ĐÓ _-_-_ ^ _-_-_ Dại Gì Mà Chuyển Nhỡ Mai Này Tôi Chết Còn Có Cái Mà Dùng . . . Năm Nay Tôi Gặp Tuổi Hạn 49 tuổi . Các Cụ Nói 49 chưa qua 53 đã tới . . . Bó Tay Các Bác Luôn . . . Mà Xem Sách Các Thầy PHÁN TÔI RẰNG tôi thọ chỉ có 68 tuổi là tôi chết . . . còn những 19 năm nữa tôi mới đến số tuổi chết . . . Cũng Lâu Đấy Chứ các Bác ./. Chuyện Mã Lương vẽ giỏi đẹp . . . Được ông Bụt hay ông Tiên tặng cho cây Bút Thần : ông Dặn Mã Lương hãy vẽ Giúp Người Nghèo . . . LỆNH VẼ KHUNG TÊN ~ Tiêu Diệt Lệnh : Lệnh Xé Xác thằng Bé Ra Làm 100 Mảnh : Uống Máu - Ăn Gan : Mới Hả Giận |
| >> Tác giả: |
kiến trúc sư . Trần Ngọc Thắng [ đổi đường dẫn đến thư mục chứa LISP ngắn đi nếu dài quá không đọc được ] |
| >> Loại file: |
word Ảnh (jpg, png..) Khác (Nếu file nén thì hãy cho biết loại file gốc trước khi được nén.) |
| >> Link Files trên web khác (nếu có): |
https://www.cadviet.com/forum/topic |
- <a href="https://www.mediafire.com/file/czicu7v2hdd904k/Library_2008_TnT_For_AutoCAD.zip/file">Library 2008 TnT For AutoCAD</a><a href="https://www.mediafire.com/file/czicu7v2hdd904k/Library_2008_TnT_For_AutoCAD.zip/file">! a) m" K- H5 C7 ~+ H; r" f s
Sao chép mã ********************************************************************************) v4 d$ M2 o. A8 M
* ACADLISP FOR AUTOCAD R.14 -> AUTOCAD R.2012 *; Q% x6 k7 t/ w* b0 T
* Tran Ngoc Thang DHXD-HaNoi41 from years 1999 -> 2015 *
7 J* s0 {0 j c I5 m; s; R* Suu tam & Soan *
7 T' I, S, ~& {/ g! l( i********************************************************************************
/ U: E, J" C/ h S5 P
! n- t% J7 G, Y4 ~5 P; Next available MSG number is 104# V: z; i# I4 a" o) D3 X
; MODULE_ID ACAD2000doc_LSP_
% B; q+ F3 M8 D! F( a;;; ACAD2000DOC.LSP Version 1.0 for AutoCAD 2000
! i% w' w+ x- | a1 e/ V;;;
' a' A( s! w" b8 X4 g8 E. q;;; Copyright (C) 1994 - 1999 by Autodesk, Inc.
& e- y g ?) Y: b, y9 c;;;1 m8 p8 \7 b R
;;; Permission to use, copy, modify, and distribute this software
! o/ V3 L; i5 c& [) ]0 @$ f* y" R;;; for any purpose and without fee is hereby granted, provided
3 R/ f6 P% c c;;; that the above copyright notice appears in all copies and
P( I# W( ^% ]) @; I/ k8 };;; that both that copyright notice and the limited warranty and
: ?5 u8 C+ M( T; r;;; restricted rights notice below appear in all supporting
( y5 H) k5 ]3 w- l6 O) o$ ^;;; documentation.
- c( j3 v1 C% @) r# l;;;
l3 L" \0 s r: \# G% x;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.' v# w1 A+ D, Q/ f G8 s
;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
1 C, }/ } n$ X- w, G;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
. i) X* q& ]# e: j;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE, n% H% o/ @! R1 Z* P/ l9 O: ]/ W
;;; UNINTERRUPTED OR ERROR FREE.4 A' N3 g6 r( I% r, P' J3 k" T
;;;
. j6 [* o3 ~. N& K" W6 A2 e* k;;; Use, duplication, or disclosure by the U.S. Government is subject to
" w I$ L- E- R7 p6 ];;; restrictions set forth in FAR 52.227-19 (Commercial Computer& B7 j$ n" p! j6 N# Z! h5 y$ ~
;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
: r ?6 q6 o+ F5 m, x0 q;;; (Rights in Technical Data and Computer Software), as applicable.0 v' u: |3 z5 ^/ C) g7 _
;;;
/ r4 W& K& R$ [7 U6 };;;.( I) _; D& [7 Q4 {
;;;
) L/ O3 O" G" Z( k( V; V;;; Note:
' }) R" S( q( }* V7 ?;;; This file is loaded automatically by AutoCAD every time : i& n( l5 U& x8 z" u) G3 m4 k0 h) L3 d; X
;;; a drawing is opened. It establishes an autoloader and
+ ]2 ~( P1 H! D! {;;; other utility functions.- P' [ X) v8 c G
;;;
/ \, f! m! ]7 [- A;;; Globalization Note:
) K# L/ A0 ^. D+ t: W3 N;;; We do not support autoloading applications by the native
, \( K# }3 h6 U0 ^;;; language command call (e.g. with the leading underscore, K2 Z: R& c5 C7 o+ z
;;; mechanism.)0 c! ?+ [6 ~7 J( P; Q
! @+ P# T: B3 s/ j9 h
0 e4 J" y* f. f" t% Q/ {+ t& z;;;===== Raster Image Support for Clipboard Paste Special =====8 F/ R# T6 X: }. G: g5 \: L
;;
" V$ R/ ^+ b: Q: n% r" n8 `;; IMAGEFILE
$ t2 V7 F0 l1 q& ];;. E l1 n: P9 q$ t* \5 O( y; r
;; Allow the IMAGE command to accept an image file name without
8 p5 y& m) n, z+ E/ v7 T;; presenting the file dialog, even if filedia is on.$ F. @7 \ v h) Z3 h% C) {, D
;; Example: (imagefile "c:/images/house.bmp")
4 O& p6 f% P( P/ h" E- W3 O4 H;;
# Q1 g8 Y7 W* F" J7 o( A(defun imagefile (filename / filedia-save cmdecho-save)& f+ F! Y, I8 [/ @# U# p0 w
(setq filedia-save (getvar "FILEDIA"))
% Q% \6 F% c2 D" e. F1 r F1 S% F% L3 Z (setq cmdecho-save (getvar "CMDECHO"))* a0 c$ m, \5 ]
(setvar "FILEDIA" 0): Q U( N; v# Q% m$ J9 v2 d
(setvar "CMDECHO" 0)/ T* B' Y4 e" F$ l8 @/ G1 `+ ?
(command "_.-image" "_attach" filename)
/ v+ v8 C1 y$ \) Y4 q ` (setvar "FILEDIA" filedia-save) g7 {2 c4 k9 K' C; J) F$ g: M
(setvar "CMDECHO" cmdecho-save)+ d+ N4 b+ j1 C4 T E
(princ)1 D! K5 v7 X0 n9 ^! x, b
)+ m. Q3 ~/ ?9 E# E
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
* M+ f# F u2 \% k, N; Next available MSG number is 11 / G K; F1 M+ D* S7 Q
; MODULE_ID DDVPOINT_LSP_
" ?5 g, } g5 S3 C3 Z8 y t;;;; S5 x) A5 A6 r R& ^
;;; ddvpoint.lsp7 A) W/ U/ o0 |0 N
;;;
3 s" y# Z) J1 F, R7 g;;; Copyright 1992,1994,1996-1998 by Autodesk, Inc.! W! y* _. E: S
;;;
+ t$ e6 d( f8 [# z0 ]( r;;; Permission to use, copy, modify, and distribute this software" _* o6 G9 d0 A2 B8 S& `6 {
;;; for any purpose and without fee is hereby granted, provided4 m# p( V0 h ^! @0 c2 B% X% p3 y
;;; that the above copyright notice appears in all copies and
7 ~) H2 G" P0 l5 n! f" h;;; that both that copyright notice and the limited warranty and
, U# z9 x" s, D& d' |+ D. j! k;;; restricted rights notice below appear in all supporting6 h+ v: @5 [4 |, j" \6 A; n
;;; documentation.7 a$ w0 {9 D/ I. S/ T7 v$ b6 K4 G/ a
;;;
2 Z7 b. ^7 {' M" Z/ i;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.& B+ f- K q; K
;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
8 O% }+ ~4 o4 e; S8 |- i;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.3 Q6 V" B% N+ G+ [3 i/ O
;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
+ h5 U+ |( \! o8 f* q m$ _;;; UNINTERRUPTED OR ERROR FREE.
0 {! k T/ f; a% B$ Z, };;;' \$ L4 I0 Z( _* z0 o6 z
;;; Use, duplication, or disclosure by the U.S. Government is subject to
0 l( s* @0 C" \, n;;; restrictions set forth in FAR 52.227-19 (Commercial Computer' o8 b! v! [9 O5 y3 ?/ C
;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 7 j8 k8 \. K$ M1 S! v. [5 f% ~, Y" c1 |
;;; (Rights in Technical Data and Computer Software), as applicable.
% m* M4 E5 L r* F;;;
7 D- J( ]9 M: F;;;.. S( _# O U3 X7 U9 U# ^* V; B, G
;;; C DVPOINT - 3D Viewpoint presets dialog.
; V2 D' k5 H% [6 ~% f;;;
, ^( M- i1 } j1 c' V; g' H& O, };;; Uses DDVPOINT.DCL for the dialog definition.
2 E& x" {$ ?2 ]; H;;; The slide image is in ACAD.SLB.
, D. p/ y+ [ V;;;
9 Y+ ]8 E) g+ ~6 d5 }0 Y;;; ===================== load-time error checking ============================3 ` ~' ^. X, S" G4 [. R
;;;
' l. B# H8 V8 v' V1 R J3 B( x, ?9 T' _) C; ~
(defun ai_abort (app msg)
7 i" e; b, }1 w4 ]* ?% l! W( l (defun *error* (s)( G; i; k) x, O; y5 A' z
(if old_error (setq *error* old_error))4 o3 l. h! G7 [# N! `. K8 e
(princ)
- h! k& @: _$ f F# E )7 E" @% y8 R U0 `% G: j" c- h; _( r1 D
(if msg1 X' o7 Y/ O) S0 x/ Y
(alert (strcat " Application error: ". V* v/ Q9 t. K' c& I0 k
app: ]2 k/ L Y; C+ |/ }% H
" \n\n "8 i6 B* C8 ]- Q
msg/ V* z6 j# f6 A( R
" \n"$ j* X4 @! v1 U' D5 I2 U. l
)
! E, b7 L* J2 \2 U' [ )
6 T' p3 c, R) ^+ j+ _ )
! _5 f4 c' N1 `7 |- r5 z! ~ (exit)6 g+ Y, D2 [5 I! m4 Y9 _! [
)
$ l, a, k3 D+ c) D8 T* r7 n. a, u' w% f
;;; Check to see if AI_UTILS is loaded, If not, try to find it,
# d& [& e& N+ u+ o) h;;; and then try to load it.7 W3 v9 l1 ]4 l. {9 z# h
;;;- N4 ~4 l7 M5 d; ?
;;; If it can't be found or it can't be loaded, then abort the
: s. _6 x K+ J K$ m6 ?7 r;;; loading of this file immediately, preserving the (autoload)
3 \( |2 }! i2 K; K' N: Z; F+ [;;; stub function.
6 I* g, p" L2 O) c" K
" ~) J R+ x, q0 E (cond
8 N: W* @7 H! i5 E ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
. t* L2 @( `5 l! \! V: ~
6 R; d% Z) t- [& e ( (not (findfile "ai_utils.lsp")) ; find it3 u9 o. H R! p- B: G
(ai_abort "DDVPOINT"& m. P7 B) S, t0 q1 U
(strcat "Can't locate file AI_UTILS.LSP."" `" n9 c4 `) N9 b
"\n Check support directory.")))
. n. u9 V: v* x+ k! N
" M9 c* m! A: e: \6 m# i ( (eq "failed" (load "ai_utils" "failed")) ; load it
. Q, L; M2 `# H2 S. N5 e (ai_abort "DDVPOINT" "Can't load file AI_UTILS.LSP"))/ j" [2 p' L6 v' ~$ s r" B
)
; l) c7 D! [1 e7 {- b* b- r$ h( T8 N" f2 D, o, D7 `, c* Z
(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP: d6 h3 n. l6 b* j
(ai_abort "DDVPOINT" nil) ; a Nil <msg> supresses" w6 h4 O8 J( |
) ; ai_abort's alert box dialog.5 s( q' W) i) V; k$ Q1 H. o
4 X4 e+ m, U2 [2 V* i;;; ==================== end load-time operations ===========================
# f4 O2 B/ ^# P/ s- X6 q# g" a4 n5 l3 r0 t
(defun ai_ddvp_start ( / image_x image_y image_h slide_x slide_y slide_h program)
1 I+ d; r& K4 a# Z ;; Get program name
: s5 o2 I u b2 A (if (not (setq program (getvar "program")))
+ f' I4 F; J% t" V (setq program "acad")
; _* p2 O. D8 H. [/ i) e# S6 Z+ Q6 m )
* c S7 L4 X9 G" H& r (start_image "ddvp_image"), u2 x3 m+ v/ f: }& @/ D
(slide_image
, R5 \% y) i6 [: m- } 0 0
5 T4 W* S1 R' l0 v (- (setq image_x (dimx_tile "ddvp_image")) 1)
. f$ j5 g. y4 n (- (setq image_y (dimy_tile "ddvp_image")) 1)
2 w# ?* n' S6 }# m( ~! W (strcat program "(ddvp3d)")9 b3 R8 ]. Q R! e( {/ A& T8 Q6 q4 ~6 ^
)$ a% \% }! u1 V& P0 `
(end_image)
) w$ k- U! C5 q" i$ t (setq 9 H6 y8 y+ _- l0 w Z' P
image_x (float image_x)
+ F/ J; f& H) J: E image_y (float image_y)
4 R- E* k( Z% w$ T! D slide_x 12.4265( V7 z( f$ T3 ^' h1 U
slide_y 9.0
3 ~$ P6 Z8 ?: B6 q- O image_h (/ image_x image_y)
. y4 a) z+ ?1 v! q6 d7 \% g slide_h (/ slide_x slide_y)
- z K4 l. {: `/ U+ |7 O x( x )
+ [3 @* N1 x1 F: V: w (if (< slide_h image_h)
7 w& u$ E1 `# `0 r (setq slide_y image_y9 z- w* x" b9 H; L" {% Z7 \8 p
slide_x (* slide_y slide_h)
% `8 a- g$ P% { ). ]; I' C# d+ k4 m4 c: p: A. H
(setq slide_x image_x" V8 P( L4 F# G! f- @: Z- |
slide_y2 (* slide_y (/ image_x 12.4625))
* T8 q0 H4 t9 `! `+ B ^7 T image_y2 (/ image_y slide_y2)* p( z2 k, u) P: C* r% |! m3 [/ }1 @
slide_y (* slide_y2 image_y2)
. F: {5 _( z: h/ |, `% E& Q& P
& z; U* }+ ]5 @) X4 z; {* o$ _ )# ~4 C2 P- U( s! j9 d7 ^% I
)7 _2 w9 y; ~* d7 R7 V2 w
(setq ai_ddvp_bx (fix (* 0.295 slide_x))) n; k) k; x; X* T
ai_ddvp_ax (fix (* 0.65 slide_x))+ }! p. j, [- d' | U! O/ [
ai_ddvp_by (fix (* 0.4875 slide_y)) N5 Y* M8 F+ O# G S: [
)" ~) q/ T* u& g' n7 X/ m& k
)
( s5 D! F1 S; b! [! i( r7 W8 S1 S7 l6 w) R8 v' f H
(defun ai_rtd (arg)
( L% M- B% [* C) w- G. ]. [6 J4 P (/ (* arg 180.0) pi)* }) {- C- k8 C3 Q. p3 ~. X
)
+ f) U' C! Z+ K! O$ K$ [+ M4 ?$ X) @2 [# r2 p4 U
(defun ai_dtr (arg)
6 y* B. G& X7 y! ]" X1 I: M (* pi (/ arg 180.0))( ^# A! `' x$ t, J$ b
) V. U3 w2 G; s N9 _" h9 }
5 S7 g" }* p+ X/ M5 n$ S
(defun ai_ang3dv (v1 v2) K7 v; p2 @, U" K0 W# w6 C* P2 i
(if (not (equal v1 v2 1e-12))- m J- U( m8 j2 x; a) i/ U
(ai_arccos% L+ c% h! L0 A
(/ (ai_dotp v1 v2)
8 y( P* L0 A7 T" u (* (sqrt (ai_dotp v1 v1))
. V$ z c- \, e |: N (sqrt (ai_dotp v2 v2))
* @' i, g w9 \& f" m. N )
( G0 U* H& H1 o; y* b! d# X )
% R& h: |% O* {, t6 V3 S4 L )
5 V: |% y" E0 v9 M (eval '0.0)' a0 Q' l$ }$ e; z; ^+ q# E% b
)
' I, y0 }. m ?( j" ~2 s) M6 T9 K)7 P, w& U& U# j! L7 U) W9 ?3 t
$ A: ?; D, i! b' A0 P, z0 u. W(defun ai_arccos (ang)/ s/ Z0 M/ x; Z* S
(if (not (equal ang 1.0 1e-06))
' N( ~& c1 n" A* Z9 H (if (not (equal ang -1.0 1e-06))! q& L, ~+ u5 F$ {' c
(atan (sqrt (- 1.0 (expt ang 2.0))) ang)6 o/ `! l$ u3 `* K5 L
(eval pi)% y7 S& ^$ c) D0 {
)
2 e" z& G e* U. A; U& N% O7 W& { (eval '0.0): x n( X, I# ~# J1 H
)
8 N- O' f1 Z5 w% C B# M)
1 }# |" K; r8 H( B6 A9 G. @
# U$ z! b8 D" W8 B0 \4 e(defun ai_dotp (v1 v2)1 D; u( r& s# f, J
(+
# X0 y/ a3 W6 h1 u (* (car v1) (car v2))
( _ p9 }; ], X) q (* (cadr v1) (cadr v2)): l: {6 a2 O1 W2 X9 F
(* (caddr v1) (caddr v2))" _$ x( j% F4 D
)
) `* @' E+ T7 W& `: n' h+ W2 f)) X# Q$ E% ?2 e& {" z# {1 p
) t2 P& j; q" ?/ \. e(defun ai_ddvp_do ()7 O$ s( M, O6 E0 G0 U5 o
(if (or (>= ai_ddvp_b_curr 360.0)
7 t. ]/ I0 L6 [- v (< ai_ddvp_b_curr 0.0)* I: i* n4 Y! o5 H% F
(null ai_ddvp_b_curr)' I: |( x% D/ Z7 W F
)8 n: X, O, e! C X8 b; x
(progn" c: Z; c* N9 a$ y. {4 ^
(ai_ddvp_drx ai_ddvp_b_last ai_ddvp_bx 0)
" o2 H9 u3 L! |" c (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 1)9 e: b2 e3 V1 f# J, M% [, S& L
(mode_tile "ddvp_val_x" 2)
9 G/ ]" t W) L+ f (set_tile "error" "Invalid angle from X axis.")" J6 k/ o/ c# Y# b; }
)4 [& k9 m' h% y: Z0 o4 m; w) t+ v
(if (or (> ai_ddvp_a_curr 90.0)
9 o3 A" o/ Q+ p; V2 C (< ai_ddvp_a_curr -90.0)/ }* |9 k3 P- k% F9 M
(null ai_ddvp_a_curr)
3 V7 j% M3 \% h0 C; O# C )
9 Z! }) K/ U4 I3 t$ n (progn
B0 o& _5 A2 R: m* p( J4 S (ai_ddvp_drx ai_ddvp_a_last ai_ddvp_ax 0)* w6 v D! _4 S" u
(ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 1)# x/ f6 G8 W: O: r" ^, }
(mode_tile "ddvp_val_xyp" 2)9 V/ v' x# c6 {( S
(set_tile "error" "Invalid angle from XY plane.")8 ?$ P6 ]4 q Q9 r* x( }% Q9 g2 ]* F( H
)( N8 h) p% ~; g3 O. \% j0 l% Z# u
(done_dialog 1)
" N$ U+ O! I( m" v- o- P )! V& Z0 }4 O% n8 g! v& k
)4 Z( b/ i' A6 [/ H ?. c- V5 P! Y
)
& a* g6 n& K8 u p4 Y0 E- N- p! p! q: H7 w' g
(defun ai_ddvp_set_a (ang)$ M& O) E7 B: n. ~6 F( y" f0 r7 ~ h
(setq ai_ddvp_a_curr ang)8 [' s" R0 }' g
(if (or (> ang 90.0)& ^2 d" G Z2 [( }8 L% Y7 f
(< ang -90.0)0 C# [4 L c" Q8 |# n. @$ H
(null ang)
. M( d- s, l6 q )2 |2 V, g! [, V+ g% s
(progn
' T& d8 v" t* ^ (ai_ddvp_drx ai_ddvp_a_last ai_ddvp_ax 0): K4 J# i4 U) C# w
(ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 1)3 a. G! I4 J0 U* e6 h1 l
(set_tile "error" "Invalid angle from XY plane.")) V. X& ]; `# a2 t' u9 p- Y
)( P/ ~: |( B3 Y% i
(progn
+ \* w( ^) n+ \. h3 z' k (set_tile "error" "")
" i# g- p6 J+ d9 I (ai_ddvp_drx ai_ddvp_a_last ai_ddvp_ax 0)& S$ r( X; c0 A+ l9 O. q5 n
(setq ai_ddvp_a_last ai_ddvp_a_curr ai_ddvp_t T)
$ l, P8 |! w# B- k" [4 C+ C5 ^- n (set_tile "ddvp_val_xyp" (rtos ai_ddvp_a_curr 2 1)) o' X O( |" t' L7 u3 C2 b3 j
(ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 1)
+ [6 [) j$ i. m7 B% T, } (ai_ddvp_drx ai_ddvp_a_curr ai_ddvp_ax 7)- _' s) J) b6 c& l" b$ j( ~/ W1 p9 X
)
$ S$ g- G& M4 Y! C9 f )
! g- V% U' d+ ]+ ?1 v4 R9 z+ J)
4 s: P B- K9 ^3 f/ U% O& |# A5 W4 ^
(defun ai_ddvp_set_b (ang)
4 M9 X. P r) m9 g- V5 ?: g (setq ai_ddvp_b_curr ang)
. T# ?3 j* [: Y" H" s* p* | (if (or (>= ang 360.0)* ]% F' c; M) ^, |
(< ang 0.0)/ o/ b, C# q- x: u5 a
(null ang)
* [9 J' K4 G6 s& Q5 ]: D )9 f) C) [" e0 d, g
(progn
) c% q8 S" c! a( e* ^& ]! |# x (ai_ddvp_drx ai_ddvp_b_last ai_ddvp_bx 0)" p8 c" g; l/ t1 U; j' n5 H
(ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 1)( @ K5 {) {5 L
(set_tile "error" "Invalid angle from X axis.")
( b: ~' c0 e7 q+ l# H )
) B1 p; @3 l1 E/ F* Q9 h (progn% d0 e+ y( D, e" G: }8 s
(set_tile "error" "")1 ^9 X# X5 A* x8 \) {
(ai_ddvp_drx ai_ddvp_b_last ai_ddvp_bx 0)+ q. ^" K4 O$ p+ k3 q4 B
(if (= ang 360.0)
, v! T2 Z- H a* { (setq ai_ddvp_b_curr 0.0 * ^7 d5 y" S: v" O$ b8 ^0 Y+ ^' d( N
ai_ddvp_a_curr 90.0 5 ]) ^6 ?8 l, R, D
ai_ddvp_p T9 ]4 B+ S- F9 R* E
ai_ddvp_b_last ai_ddvp_b_curr
8 r+ r3 ~" P- d8 X1 S )7 F3 m- u6 d8 p' ^- u9 s
(setq ai_ddvp_b_last ai_ddvp_b_curr ai_ddvp_t T)
$ m; T1 V# ^5 Y. C )+ Z; H( J4 m: Y
(set_tile "ddvp_val_x" (rtos ai_ddvp_b_curr 2 1))
5 q. A; X# x4 o5 o/ d# i (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 1)
! R. I" z* ?( q2 l (ai_ddvp_drx ai_ddvp_b_curr ai_ddvp_bx 7)
: `& v* R6 J+ ]& x ). h5 ~. P. t! J5 d5 ~. b. @
)
2 p2 ?) \3 o9 z8 X. V l! ^- g- v)
; e0 b& r; U$ V, y8 ~
; Z O v: n; D, a" Q3 u(defun ai_ddvp_drx (ang x1 col / a x2 y2)& ^$ y( H# h% S! Y6 m0 ~6 J
(setq a (polar (list 0.0 0.0) q2 }3 t# Z3 i( d* k# z V0 }
(- (* 2.0 pi) (ai_dtr ang))
$ h2 Y$ k( y- a3 U/ g 25.0/ A9 m" L& W$ ~) K6 A& G. G
)" I) H( U0 R# o2 W4 l
x2 (+ x1 (fix (car a)))
5 x. u# c5 f( ` y2 (+ ai_ddvp_by (fix (cadr a)))
/ ?4 o V& Q% N; Q )! v6 [& \9 O' F; o! ?6 Z
(start_image "ddvp_image")$ |" _# N& c0 C1 n
(vector_image x1 ai_ddvp_by x2 y2 col)+ w- o( \# `, D8 V# w
(end_image), ?8 e1 m O) C2 @
)3 ?2 p% o- I: v/ Q
" [! l; V" a# z$ x# k(defun ai_ddvp_image (x y / ang1 ang2 list_xy list_axby list_bxby)
0 }$ J5 ?$ G6 d9 G9 R6 b! M (setq list_xy (list x y)9 `. h. u- ^% D6 i# w4 n+ @
list_axby (list ai_ddvp_ax ai_ddvp_by)
S3 U4 ^( Z# A) H5 F7 r2 k list_bxby (list ai_ddvp_bx ai_ddvp_by), Q/ X# S- t, B, T1 r. }* d$ t3 J
)
2 i9 A2 f4 i9 l6 R( ^$ E (if (> x (- ai_ddvp_ax 1))
: m: F1 g/ ?* G* R1 e (progn
# z( J3 d/ q7 Z- q) L- y) w (setq ang1 (ai_rtd (- (* 2.0 pi) (angle list_xy list_axby)))): }; w* C; [- u+ H4 V4 Z o/ C
(if (< 90.0 ang1)6 ~+ w! ?& I* J, J" q2 G/ M
(setq ang1 (- ang1 180.0))! q- n$ T Y9 L- z) o1 T
)
2 b; C4 j8 H8 ]$ a (if (< (distance list_xy list_axby) 40)% P. G" ~1 ^4 t* X$ q! s
(ai_ddvp_set_a ang1)* G. O) D0 ~) p& j9 g4 J
(if (< (distance list_xy list_axby) 84)7 v7 { q, G z4 S+ w5 q
(cond ((= ang1 0.0)
9 o* @. f2 t6 {1 U: h7 J+ { (ai_ddvp_set_a 0.0)
9 a# |6 r& U# X' G- `" D5 Q7 l6 ]1 t )
H" o: t/ K- l Q3 n ((< ang1 -72.0)
* a( y- Z, D" a" T (ai_ddvp_set_a -90.0), x1 {# n; L: S9 @% f
)! b/ i% Q8 z/ F# p+ C; N7 ^
((< ang1 -53.0). K. l3 g2 B, R1 z0 x
(ai_ddvp_set_a -60.0)2 t9 r. L3 L& k3 m( Q9 s
)+ n9 {7 e& I0 \( e" ]9 N7 c
((< ang1 -38.0)
( @: O- v7 E6 L: \" _* k (ai_ddvp_set_a -45.0)2 l( ~1 l1 r% Y- o& k% C+ s
)
0 H4 k$ n3 X% f1 V& s ((< ang1 -20.0)
; Z! O/ v2 l) E! o# `9 v (ai_ddvp_set_a -30.0)
* L3 t$ a* E" ] M/ Z4 c; H )
' c1 H9 ]% |- u6 O! u/ a ((< ang1 -6.0)
v$ i" G9 T/ a. {" I5 a3 ^: _, I (ai_ddvp_set_a -10.0)9 w0 }* p8 @7 H- k) e
)8 ~4 X1 @' r& E" |6 \
((< ang1 6.0)
5 M0 u5 J6 w" j3 K9 M (ai_ddvp_set_a 0.0)
& l4 _& Z+ B5 U/ j: f )/ B! S) {% y: S, O @" E
((< ang1 20.0)
0 s4 }+ z/ T' ]. [ (ai_ddvp_set_a 10.0)
, P2 V9 t7 X2 U )
/ W) N" T. h5 T ((< ang1 38.0)
0 M* y2 c- N0 v, w+ \1 L, f (ai_ddvp_set_a 30.0)
! |- x; H- u; ^ )/ N7 k. n4 U" C$ l7 e; T
((< ang1 53.0)) b5 e$ K3 U/ v+ X5 i+ S
(ai_ddvp_set_a 45.0): O7 A. J6 V! u
)
, }2 R" S$ R9 Y4 Y& U- h ((< ang1 72.0)
+ y$ D2 u# G# D; _$ z0 j (ai_ddvp_set_a 60.0)) U- X+ o% ^; C5 Y- H L& @
)
) L9 g) g* w; V/ ~3 b& F (T5 J0 M- J$ L! z8 O$ q& h
(ai_ddvp_set_a 90.0)4 N& V' |- m( K$ T% W
)
7 A8 f1 V( [4 W6 c3 O )/ I6 K0 o7 L2 G8 ^
)
! g$ m# p& S& m0 G, k5 p )
$ c) g. z. H9 Y# t )) |0 c2 `3 E! Q: i* h4 O" q
(progn: S( R' o/ B" W4 Y0 x, {$ r/ L, w
(setq ang2 (ai_rtd (+ pi (- (* 2.0 pi) (angle list_xy list_bxby)))))/ U4 U5 K# M) N' [$ C$ `
(if (< 360.0 ang2). j/ r$ k( j3 x+ `( q0 M5 A+ F
(setq ang2 (- ang2 360.0))- n" X9 D1 _- L! J: k% d% H# B( E) q
)+ X# s3 n; `. i0 o2 G% h
(if (< (distance list_xy list_bxby) 40)' i' r" m. x1 Y
(ai_ddvp_set_b ang2)3 G$ F2 n' u: i6 r: v: @
(cond ((= ang2 0.0)
2 F$ O2 b/ a: y& ?0 N1 h (ai_ddvp_set_b 0.0)3 g1 D2 e* k3 m& z/ X5 m: K
)6 J. f8 S, L+ ]
((< ang2 22.5): F7 I0 D# y* O8 u: r$ ^0 D3 M1 D
(ai_ddvp_set_b 0.0)3 U, d H- M/ Z: A. u* D
)
+ w# A9 ]. h/ r' L ((< ang2 67.5)/ k7 L1 ?' X. x* T! _7 E7 ^
(ai_ddvp_set_b 45.0)
$ G! i, h3 ~0 T6 |9 I1 w )
/ y: }6 a: Y. C7 `9 q. F- Y ((< ang2 112.5)
& G+ l+ s) T" F' h (ai_ddvp_set_b 90.0)
0 Y. I/ u( Z2 z! V8 g( N: V ). m# B. J, N$ Q% N% t
((< ang2 157.5)5 v, N+ t! ~4 a. Y+ j+ g! h( f$ t
(ai_ddvp_set_b 135.0)
$ j2 ~) v" h) l$ L+ ^; o )' t, B/ A4 q, F H
((< ang2 202.5)
7 M l4 S. U. P (ai_ddvp_set_b 180.0)) e; ?2 m2 L( b/ S) u
)# G6 N# M' g- G f6 M* ^
((< ang2 247.5)
7 h; m/ p$ b2 M! { (ai_ddvp_set_b 225.0)! z* a4 _% \1 J1 q) h
)% x0 @2 f( u) @9 Z3 R% c
((< ang2 292.5)
/ l2 X9 v* \6 z) h1 k5 F3 @ (ai_ddvp_set_b 270.0)
$ q: b) X: }, v8 {4 f# Q )" v9 |" T1 N, z+ V4 X+ `
((< ang2 337.5). B! e1 s& q& ]6 g/ a
(ai_ddvp_set_b 315.0) i- t' B5 f3 i" y) W
)$ ^2 D# i8 [5 p! H) u( ]# M
((< ang2 360.0)
. h* f0 q6 s+ S! m8 d+ P (ai_ddvp_set_b 0.0)
% h t; {" t- u1 a$ V2 d) J )
. `7 Z' A7 |: J% r4 w (T, N' b4 \4 | R7 i, t: F; z
(ai_ddvp_set_b 270.0)7 I, b* m. S" E8 f* Z
)8 R4 {' b) {6 E% g! F3 r
)) n: N% U+ `8 e! Z
)
5 F. e4 W ~2 g6 R )$ \; C! W' f- w" W' P1 v9 o
)4 j* `6 _8 [8 l) y: |
)
0 @) {; P( B- x; _8 k
2 b9 F; ~3 e8 D3 d1 e0 t4 `(defun ai_ddvp_plan ()8 V; b$ q; w' q* z% z
(ai_ddvp_set_a 90.0)8 e) N# g, @# t7 _! d! W1 K- S
(ai_ddvp_set_b 270.0)2 e) D5 F( N/ r! J# f% D: M5 @- c
)' [) C+ k* _6 l! d5 }# e( I
6 C# ?/ @+ R* s- ~# z
(defun ai_ddvp_setvdir (a b)
+ L2 I0 r( E* Q% ^. n. J" y (list (* (sin (ai_dtr (- 90.0 a))) (cos (ai_dtr b)))
% s. n4 ^2 t1 E (* (sin (ai_dtr (- 90.0 a))) (sin (ai_dtr b)))
9 G( z* F8 U# H- i4 G ?- I6 j (cos (ai_dtr (- 90.0 a)))
( t* @. D( I6 q# _9 C" T )
5 b$ z* w( U5 _)# x7 k m) p# G: E' N3 } X
' X8 ? g4 l# ]$ f* J(defun ai_ddvp_set_abs ()5 t9 x9 T; i( Y' t! O* M% ^
(setq ai_ddvp_wv 1)/ `7 j; i% V G. c. ?8 T
(ai_ddvp_drx ai_ddvp_b_curr ai_ddvp_bx 0)1 T% ?9 H. v8 a5 K6 F
(ai_ddvp_drx ai_ddvp_a_curr ai_ddvp_ax 0)
/ H# U0 W0 S& W, G( K$ }" w (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 0)
& a0 x. b- T3 z+ G! A* `! v' P (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 0)
I& n; r" Y; P; Y8 k (setq ai_ddvp_vdir_base (ai_ddvp_fixzero ai_ddvp_vdir_base))
" K5 i) n k! F, \3 F& @ (ai_ddvp_setang (trans ai_ddvp_vdir_base 1 0 T)) [: d) J4 Z2 o6 r n) d+ L
(setq ai_ddvp_a_base ai_ddvp_a$ B( b+ f0 G C* {/ ^ R j
ai_ddvp_b_base ai_ddvp_b
' H% J% N' K; \1 U )4 ~1 g+ q8 _2 y0 W7 h& N% J
+ C0 ]0 {6 T9 k. N (setq ai_ddvp_vdir_curr
- Q# Z2 d8 Z- F1 _ (ai_ddvp_fixzero
. Y; N( y" x6 f* m. j8 x3 @ (trans (ai_ddvp_setvdir ai_ddvp_a_curr ai_ddvp_b_curr) 1 0 T)
5 s0 {9 W8 E+ L )9 n- D6 e+ y$ ^/ E
)
2 O0 T- m& a, A9 N. E# q (ai_ddvp_setang ai_ddvp_vdir_curr)
# O7 \1 T2 R. _" P$ k (setq ai_ddvp_a_curr ai_ddvp_a" i+ d% s$ m# _7 v0 s. C( b4 V( ~
ai_ddvp_b_curr ai_ddvp_b
s( o2 x1 ]7 K7 i: K )
9 ~5 Q% T x# F; j
# `% w/ n$ ^9 f# E (ai_ddvp_set_a ai_ddvp_a_curr); j0 `" R+ D. h$ d: y4 s
(ai_ddvp_set_b ai_ddvp_b_curr), h: [5 w7 ?9 H0 s2 `
)
5 C! |8 X: A; B1 K, G( C+ o8 {$ o2 k% g( p
5 y( V/ y6 r2 `' S. M; P; k(defun ai_ddvp_set_rel ()" b [ O3 @: V$ q
(setq ai_ddvp_wv 0) E, D5 I8 L0 U. S
(ai_ddvp_drx ai_ddvp_b_curr ai_ddvp_bx 0). \8 ?$ L$ B5 r7 X; C
(ai_ddvp_drx ai_ddvp_a_curr ai_ddvp_ax 0)6 l. S$ h; p% U2 t X' u% }- y
(ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 0)
) m4 Y1 e) ^0 n9 i& h (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 0)5 W, k* M7 d8 S1 A. a% [6 p- Q
(setq ai_ddvp_vdir_base (ai_ddvp_fixzero ai_ddvp_vdir_base)), p( |* d$ ^+ ~/ [
(ai_ddvp_setang ai_ddvp_vdir_base)
3 t: K3 n) h' L (setq ai_ddvp_a_base ai_ddvp_a
- X7 C/ ]. Z9 `: E7 z ai_ddvp_b_base ai_ddvp_b
1 T! a+ _- N: k" w) _# D* F+ c )
& D# B3 p- H6 P7 [+ y (setq ai_ddvp_vdir_curr
+ K9 I* w4 H; M( p; \ (ai_ddvp_fixzero / i- o" i" v4 b7 B; C
(trans (ai_ddvp_setvdir ai_ddvp_a_curr ai_ddvp_b_curr) 0 1 T)) U% s' H9 u0 n: F: \
)
, f$ U* V5 s9 R2 _8 U* y" ?* E# w )
2 B0 L/ Z# b% T( [3 k, v$ S (if ai_ddvp_init
% D5 a i9 A7 k: w (setq ai_ddvp_vdir_curr (ai_ddvp_fixzero (trans ai_ddvp_vdir_curr 1 0 T))
6 d/ C0 E7 g; z8 b7 g! w$ J9 a ai_ddvp_init nil
% t4 [3 t1 X3 W8 z6 {6 j4 m )
2 m" a5 M ?! t )5 D8 f5 v4 v( }& n3 H f! r1 s
(ai_ddvp_setang ai_ddvp_vdir_curr)
. T$ S8 ~3 A7 b2 y: T6 T7 q (setq ai_ddvp_a_curr ai_ddvp_a* |' U: M" x9 K. Z* I/ c
ai_ddvp_b_curr ai_ddvp_b; Q4 P) e- V; E" g. x
)$ L9 ]/ J' {9 }& N, F
(ai_ddvp_set_a ai_ddvp_a_curr)
# x. ~0 _- g$ _4 {3 W" b1 h (ai_ddvp_set_b ai_ddvp_b_curr)5 I, R4 k/ W2 C0 S
)6 d% V' p; j; O. \8 ?& z5 ^5 {
' g) y( e a6 Q9 a" ]1 y3 ~(defun ai_ddvp_fixzero (vector / vector_x vector_y vector_z)4 L2 V5 [/ n8 m- M
(setq vector_x (car vector)( \$ z L# N. D4 I
vector_y (cadr vector)
* }9 o& ~5 j/ s% j vector_z (caddr vector)
) _) L6 j4 @. S% x& a, s )1 S* [6 z2 ^3 n
(if (equal vector_x 0.0 1e-06)2 g. b9 d5 J( G/ c
(setq vector_x 0.0)
; V8 d- | p4 V9 R2 Z4 r; w )
9 z( d3 {9 Q( d' z- N (if (equal vector_y 0.0 1e-06) r! s8 z- i5 Q2 ?
(setq vector_y 0.0)
% }# ~0 F1 c+ N7 R )
$ a* t. _, O4 j: f5 B (if (equal vector_z 0.0 1e-06)
- W: X. K2 k- m9 e8 Z( f (setq vector_z 0.0)9 z+ Z5 y, }8 F9 A3 \
)
3 L0 }1 @( r- i; T4 x+ P (list vector_x vector_y vector_z): S) g4 O# t/ ^- ~: e0 m
)
4 p+ a0 S( s0 Z0 K: }: n( E) ~( u6 ]8 N0 b# e- d
(defun ai_ddvp_setang (viewdir / viewdir_x viewdir_y viewdir_z ai_viewdir)
( _. H! w M: ?5 n1 [8 f P; z (setq ai_viewdir (ai_ddvp_fixzero viewdir)( G1 H; j- L! R5 k& {
ai_ddvp_b (ai_rtd (angle ai_viewdir '(0.0 0.0)))% a! }0 `. C& R* ]+ |
)
. c2 J0 N' O6 Q) X- \) D (if (equal (list (car ai_viewdir) (cadr ai_viewdir)) '(0.0 0.0) 1e-06)
+ B: U& L2 N1 l" A6 ]# N (setq ai_ddvp_a 90.0)
* W _5 q; C. L& Q. K( B (setq ai_ddvp_a (ai_rtd (ai_ang3dv - s4 l/ n' y3 p& ~7 E. f4 W
ai_viewdir7 j ^: l# j$ M- ^
(list (car ai_viewdir) (cadr ai_viewdir) 0.0)1 V& `4 b+ e5 g- u
)
! C8 d/ R. ? m; }; P3 @+ t* R- u )) c8 F; v& g: \% N0 X
)
( y0 T2 R) o( |# { )3 h" I7 V7 G$ i4 f1 {5 F+ O
(if (< (caddr ai_viewdir) 0.0)7 b& {% P1 [3 A4 v0 A8 k) G
(setq ai_ddvp_a (- 0.0 ai_ddvp_a))* e* V0 x D+ Y9 X' S! c& q
(setq ai_ddvp_a (abs ai_ddvp_a))6 K* o4 c/ Q: `+ u/ f! @
)
. L' I# }8 e- y! h& S (if (>= ai_ddvp_b 180.0)
* ?6 s9 |' }* r. p# t3 a- x (setq ai_ddvp_b (- ai_ddvp_b 180.0))9 V6 d$ G" h4 C& J! T* A
(setq ai_ddvp_b (+ ai_ddvp_b 180.0))6 G8 K1 Q8 @3 |/ W7 X* l
)
( d0 l4 M2 i4 n" z' @) k6 } (if (or (= ai_ddvp_a 90.0) (= ai_ddvp_a -90.0)); Q( j. W7 n5 f; s- [
(setq ai_ddvp_b 270.0)
) j4 D5 @: @4 O% G+ q# ] )' E3 S: x4 U. k# w |8 y- ]
)' t0 t0 b" w' [! f4 {8 ^* W
, Y; Q- {3 W& i3 M4 }' k" S
(defun ai_ddvp_main ()
4 k; U/ r. x: O4 ]) E8 J4 b (ai_ddvp_start)2 a& o/ @5 ^/ O9 v6 h
(ai_ddvp_setang ai_ddvp_vdir_base)
% M7 E" V" v& |7 t (setq ai_ddvp_a_base ai_ddvp_a8 t1 j- E w. `' j$ j. |* v
ai_ddvp_b_base ai_ddvp_b
* t: t7 L4 |- t! w/ J. F. y# N ai_ddvp_vdir_curr (ai_ddvp_fixzero
% c7 T8 z3 a$ P) w7 l, p- _' ] (ai_ddvp_setvdir ai_ddvp_a_base ai_ddvp_b_base)- U! b6 Q4 Y; N4 T) W
)
' i7 y" R+ F E" { ): m8 E) [: ^; k& J( u; {
(ai_ddvp_setang ai_ddvp_vdir_curr)
7 D8 ?- j4 D# W0 x; H (setq ai_ddvp_a_curr ai_ddvp_a
0 G2 W9 Y' T5 U4 K `: t ai_ddvp_a_last ai_ddvp_a_curr
7 }' B" M- d3 W* ~' ^" ]+ p; R& `! E ai_ddvp_b_curr ai_ddvp_b
" j: k: R& V# C F ai_ddvp_b_last ai_ddvp_b_curr
# P' a5 r( A; Z. T' i2 H" m, g, d )
; b" n+ b1 R' P1 g( X9 j (if (= 0 ai_ddvp_wv)
% c0 ^* i/ |0 a' n6 W (progn. V9 n# t( G* r! P9 z
(ai_ddvp_set_rel)
2 z, j; r1 `0 w& [! `4 g4 W6 h4 d (set_tile "ddvp_rel_ucs" "1")
2 W" |4 C! K( `+ x p& A3 f )! J1 k4 q& [9 _
(ai_ddvp_set_abs)
" t- }$ q6 Z. M0 F0 L" _$ E ): z# `4 m) }$ t5 ?
(setq ai_ddvp_t nil)' W5 v. y7 o2 z1 I& e
(set_tile "ddvp_val_x" (rtos ai_ddvp_b_curr 2 1))# G; I& z/ N+ c4 F
(set_tile "ddvp_val_xyp" (rtos ai_ddvp_a_curr 2 1))
$ r" x( [0 M0 v% m3 y- _7 O3 c' } (action_tile "ddvp_abs_wcs" "(ai_ddvp_set_abs)")
' y: h$ n2 R. Z+ q, X3 k (action_tile "ddvp_rel_ucs" "(ai_ddvp_set_rel)")
8 m: v7 z& W% R (action_tile "ddvp_image" "(ai_ddvp_image $x $y)")
* F' S: n( e4 U h (action_tile "ddvp_val_x" "(ai_ddvp_set_b (distof $value))")
% \4 k/ L' P) I6 G" M% n: N3 l* Q* C (action_tile "ddvp_val_xyp" "(ai_ddvp_set_a (distof $value))")
% H# i. R" K9 S3 [, G0 K (action_tile "ddvp_set_plan" "(ai_ddvp_plan)")2 \8 N% r4 \ [, R5 h- H" Y* ]
(action_tile "accept" "(ai_ddvp_do)")
4 _& G9 o% K1 j4 Z- w# d (action_tile "cancel" "(done_dialog 0)")
' Q4 k& U$ T0 M0 w+ i5 d& v (action_tile "help" "(help \"\" \"viewpoint_presets_dialog\")")
2 @/ k- _& I9 x6 ] (if (= (start_dialog) 1)
0 P: m3 n& q! ^! G (if ai_ddvp_t% V% x9 A/ u* |5 i
(progn
2 Z+ V- x# J; W (command "._WORLDVIEW" ai_ddvp_wv)
8 c' @% \2 l6 P8 s; k& V8 ?/ o (command "._VPOINT" "_R"
. t3 E+ r$ o* Z# i5 S0 O (strcat "<<" (rtos ai_ddvp_b_curr 2)); ]5 E' i# |6 w# {( L' A
(strcat "<<" (rtos ai_ddvp_a_curr 2))5 W! o. z! J8 {3 |
)4 g0 [" Y, k$ d$ e E0 ^( P
)/ g/ [0 ?7 P' E( P
)8 l4 y( E+ Q, b" z" {6 S4 G
)
$ ~$ [1 r" G. {6 z% b0 A)4 [6 |8 _6 r. M1 B; b" | C3 c
4 T- i3 b- ~2 G( V; M* b! v(defun c:VP ( / ai_ddvp_wv ai_ddvp_vdir_base ai_ddvp_vdir_curr
- s* ], Y# a: d: p# v% y6 `4 `! ^# p ai_ddvp_bx ai_ddvp_ax ai_ddvp_by ai_ddvp_a_curr
0 r) c4 k5 ?' ]! t$ p ai_ddvp_b_curr ai_ddvp_a_base ai_ddvp_b_base ai_ddvp_p! R3 ?- W0 D9 x- \
ai_ddvp_t ai_ddvp_init ai_ddvp_a ai_ddvp_b
" ~+ X' P( @' n' z) q ai_ddvp_a_last ai_ddvp_b_last
+ J- L% j) ^7 L8 U# H4 F; C app dcl_id old_cmd undo_init : c4 z7 N7 m; Q% v! A
)1 ~* X& G4 ~6 ^& h+ B/ o+ i; E
8 A g( A" w3 L4 D5 ]! e ;; Set up error function.$ n% p0 u4 |( w2 M/ T& a0 k
(setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho; \: A% O0 h# @/ h4 X, v! j1 ~
old_error *error* ; save current error function U& s; w9 B% R3 b1 B
*error* ai_error ; new error function
: ]* c" T3 A K )
9 ^7 Q$ |9 M( u/ \2 o' F L( B( G7 i3 m
(setvar "cmdecho" 0)
, n4 f% i; } ?1 d9 D3 d( r& }0 ]. @4 H8 t& O
(cond
0 C$ h9 \+ {1 Q) i8 i, d4 i ( (not (ai_notrans))) ; transparent not OK' k: H; w6 k' v$ f, Z0 t
( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?. ]/ w6 _6 D* R2 u, B2 h
( (not (setq dcl_id (ai_dcl "ddvpoint")))) ; is .DCL file loaded?
; l' W% |/ ]. N! G/ F (T (ai_undo_push)
) C+ E0 [. z5 l; y* [ (ddvpoint_main) ; proceed!: k% }5 f% Q8 p' e$ S
(ai_undo_pop). f; S$ g- _6 @8 M0 k
)
0 e3 U% C* P: X, c: \4 Y8 c; t )% v; ?5 M5 N: L
7 K8 r2 e: I! e (setq *error* old_error) # g1 a) |) b% z; w) y
(setvar "cmdecho" old_cmd)
1 q1 u3 L+ y0 Q: p; o5 e (princ)
" F; ]8 D% @) D9 \# v6 n3 e)2 z, j' A9 ~& V; d" d V
9 f N! G( \ t# P(defun ddvpoint_main()
7 \6 t( R( \9 H T/ `1 N+ o
& s2 @9 B6 x$ I# F/ ]+ k( J (if (and (= 0 (getvar "TILEMODE"))# E' M0 ~2 N' B6 h9 d
(= 1 (getvar "CVPORT"))( O- \( ^+ @, e7 x1 c
)
/ e% Z: Q1 `2 _: i (princ "\n** Command not allowed in Paper space **")
, n$ y( G- a1 x8 g( { (progn
9 q3 N$ g# H- E+ T$ F: ` (if (not (new_dialog "ddvpoint" dcl_id))& b8 T0 W$ d$ F* s
(exit)
/ H4 P6 Q' ^; l6 y" Y )
: p# s; Q, m' y; _# T. B (setq ai_ddvp_vdir_base (ai_ddvp_fixzero (getvar "VIEWDIR"))
7 J. g X% o0 W& a ai_ddvp_wv (getvar "WORLDVIEW")
' N+ R/ }# e& v3 L" H* H1 p4 a ai_ddvp_init T
0 z6 y( y1 V2 `* C: b) S )
8 n; O8 g# I, G. E) u% a. k' Q (ai_ddvp_main) C$ g. k" q# ]6 G: G; b
)+ L6 f, n6 e: l" e, B1 s" i2 g1 Q7 W
)# p% A* D5 |) i" U
)
7 i+ L8 \9 K L: d% n1 l. z- n$ b% m
(princ " DDVPOINT loaded. ")
2 j* Y# h1 t$ K5 L/ ^(princ)
4 M& }+ g; z5 j;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; X/ L t" B1 ^% @, ?) Y
;============================= Tran Ngoc Thang =================================. K4 K3 T+ S! m/ b" p
(defun c:zx () (command "zoom" ".5x"))! t! H* b/ C5 E+ v6 m
(defun c:zz () (command "zoom" "p"))
& \ {/ Y, A, t(defun c:za () (command "zoom" "a"))
( J' E ^/ S# j* g(defun c:zd () (command "zoom" "d"))% Q v& {- v% P8 x) w% e7 ?
(defun c:ze () (command "zoom" "e"))$ _" K2 ?# d- {- \& J
(defun c:zr () (command "zoom" "" ""))
( @$ E2 z0 S- W% E(defun c:vv () (command "ucs" "v")); O8 G0 q- X. B) }
(defun c:co () (ssget) (command "copy" "p" "" "m"))
7 J/ v; c& I5 e0 @(defun c:c () (command "circle"))
2 }5 L1 |9 P, C; d0 K8 L; C. Q(defun c:rt () (command "rotate"))" ^$ v; w$ G" v; q, u$ E) G
(defun c:3q () (ssget) (command "_rotate3d" "ANGDIR" "value" pause (princ))), h; X+ e6 o9 f/ H+ P2 \! t
(defun c:30 () (ssget) (command "rotate" "p" "" pause "30"))+ X4 b8 i9 d* @ _7 w
(defun c:-30 () (ssget) (command "rotate" "p" "" pause "-30"))
2 X, u4 n6 m U5 i _* B+ S% j' i(defun c:45 () (ssget) (command "rotate" "p" "" pause "45"))- U! r: |" t: _9 V5 s& t* k8 M
(defun c:r5 () (ssget) (command "rotate" "p" "" pause "5")), S9 x8 B9 T$ S+ [4 E
(defun c:60 () (ssget) (command "rotate" "p" "" pause "60"))
$ r1 W/ [0 q( `; l& R2 Q Q$ B0 \: b(defun c:-60 () (ssget) (command "rotate" "p" "" pause "-60"))
# w' V2 {% L% d& [. N(defun c:90 () (ssget) (command "rotate" "p" "" pause "90")). X: U1 V" L; F2 p; l* X
(defun c:180 () (ssget) (command "rotate" "p" "" pause "180"))* O7 z% t( F7 v ?$ d4 c- O, v% Y
(defun c:-45 () (ssget) (command "rotate" "p" "" pause "-45"))
" N2 C$ V9 M& v: s. S" i(defun c:-90 () (ssget) (command "rotate" "p" "" pause "-90"))
# v2 B4 M0 y3 g; g(defun c:md () (ssget) (command "mirror" "p" "" pause pause "y")), _ _8 N* X4 ]: L- B' F# I
(defun c:fd () (command "find" "p" "" )(princ))(princ)9 |7 c: y1 y9 K. C# O$ E3 n
# \$ Y7 R! }9 U/ }- U: z% T3 }
(defun c:VNI () (command "-style" "VNi-AUCHON" "VNI-vauchon" "225""1""0""n""n""n"))(princ)2 Q' A2 A+ d" ^6 e- h6 _- l4 Y1 i0 u
! q" a; ]3 F' {" t9 E, N+ C
(defun c:romantdim () (command "-style" "ROMANT-DIM" "romant,vnh.shx" "200""1""0""n""n""n"))(princ)
7 w9 J$ P) x. k0 X$ R& p(defun c:romantext () (command "-style" "ROMANT-TEXT" "romant,vnh.shx" "200""1""0""n""n""n"))(princ)
7 u" u" X, y7 I" ]' X; R! U1 d(defun c:vnhelvthuong () (command "-style" "VNHELVLT-Thuong" "vnhelv,vnh.shx" "500""1""0""n""n""n"))(princ)5 E" e! ~' i' Y6 {4 M; A
(defun c:vnhelvhoa () (command "-style" "VNHELVLT-Hoa" "vnhelvh,vnh.shx" "500""1""0""n""n""n"))(princ)
" H5 Q3 e; {5 O+ @(defun c:truc () (command "-style" "TRUC" "impact" "0""1""0""n""n""n"))
0 p) t& i$ ^2 s! M4 {' B(defun c:chu () (command "-style" "CAMBRIA" "Cambria" "200""1""0""n""n"))
- G! n( j0 U- z7 U# L, M# \(defun c:cot () (command "-style" "COTES" "Romand" """1""0""n""n"))3 \) F9 P( a5 j z. L) q7 F
* b7 E* ^1 [3 m9 N7 S" Q' x/ @
(defun c:an () (command "-style" ".AVANT" ".vnavant" "200""1""0""n""n"))
- O4 O; g; Z$ @9 r! c* N: q(defun c:ah () (command "-style" ".AVANTH" ".vnavanth" "200""1""0""n""n"))# I5 w) d8 B# q2 H% h
(defun c:ha () (command "-style" ".ARIALH" ".vnarialh" "200""1""0""n""n")); A3 s) d8 V9 s f( \
(defun c:na () (command "-style" ".ARIALNARROWH" ".vnarial narrowh""1200""1""0""n""n"))
- |( [! W8 _) F3 E" u2 N4 i, F(defun c:vn () (command "-style" ".VNTIME" ".vntime" "200""1""0""n""n"))
3 |0 R; f1 O2 l3 |! z" E& P(defun c:vh () (command "-style" ".VNTIMEH" ".vntimeh" "200""1""0""n""n"))0 I+ d2 w. z. X% Z, k; T9 i7 Y
) L3 N; m/ R- W5 j3 N2 ]) C7 g2 B
(defun c:ps () (command " SOUT" "CorelDraw-import-Photoshop" "W"))(princ);export the current view of a drawing as an EPS file
4 V; x; z/ `- {& o; {. F+ T. f5 D! u
;free lisp by cadviet,cd2k44/ F9 P# \' T% W
;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
; C7 J9 [) u0 T' I* T7 I(defun c:FTEXT (/ ent tstyle )+ N' _+ p6 Y3 r. A
(command "undo" "be")5 v J; ]/ \; R! ^
(setq ent (entsel "\n Pick text :"))- L4 A4 X4 x$ h/ n+ ~
(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))0 d3 b5 `: ^2 \& f& W
(command "STYLE" TSTYLE "romant.shx,vnh.shx" "0" "1" "0" "N" "N" "n")
# N3 c4 d& U1 l(setvar "TEXTSTYLE" Tstyle)5 j8 [6 w% H0 H! y) q& e( H5 e' U
(command "undo" "end")4 f0 o5 r' q8 g: D! |$ s
)
* r/ H/ Z5 r; ], s;Cam on cadviet nhieu 27-11-2023 04h15p36s (thanks cadviet)
; {5 V+ @# E& N# g) M7 K! ?
) T ~; z+ K4 p: U;free lisp by cadviet,cd2k44
( ^* h0 D& `& K* A4 A) b;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
& R: h6 L5 |- Y' D$ Q9 N(defun c:Fvnh (/ ent tstyle )
1 _4 k9 U% h9 _7 q+ W: M(command "undo" "be")0 A, ?5 ^ q7 p9 P
(setq ent (entsel "\n Pick text :"))$ v8 U3 k3 x# p! V$ U
(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))) v0 K' z9 N2 N" {1 G
(command "STYLE" TSTYLE "vnhelvh.shx,vnh.shx" "0" "1" "0" "N" "N" "n")0 {- i1 i M5 m! |. j* v& |
(setvar "TEXTSTYLE" Tstyle)
( b+ D/ H* H2 A$ i8 d$ a(command "undo" "end")# L7 S' W2 p; b. r: x1 Z" p2 j
)6 S8 \" l! P, i% h
5 ^( W. Y1 h3 Z/ x0 \;free lisp by cadviet,cd2k44
- i i1 p: ]$ L' ~0 k;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830: L6 w5 p0 n7 I% N
(defun c:Chbg (/ ent tstyle )& s) y1 D1 t1 r; R/ o) ]* I! V
(command "undo" "be")5 o) k; d8 R9 m5 P; \. o
(setq ent (entsel "\n Pick text :"))
! Z9 ?) e7 ~5 l1 ?(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))/ C! R0 M C4 B H" D
(command "STYLE" TSTYLE "chhbg.shx,vnh.shx" "0" "1" "0" "N" "N" "n")* ?# F6 P1 u. m; b
(setvar "TEXTSTYLE" Tstyle)7 K% W% _ e+ ^- w+ |4 B. s: C
(command "undo" "end")
' o2 k( W" g; @5 t8 G3 Q)
* \6 d- } R. a* o4 X2 E0 p7 `' Z- l- y; @( w
;free lisp by cadviet,cd2k44
8 q7 h$ p8 {$ F" s8 ]" x6 _;link bai viet http://www.cadviet.com/forum/index.php?showtopic=538304 G* T" N4 n# [3 R
(defun c:Chsm (/ ent tstyle )
* l/ l( f: V) A9 K(command "undo" "be")
8 |- r) H0 \, w# z$ t2 A& z+ P(setq ent (entsel "\n Pick text :"))
# s; Z2 Q ^/ m( k6 r% A(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))5 M+ r0 S8 `5 `1 a1 z; R
(command "STYLE" TSTYLE "chhsml.shx,vnh.shx" "0" "1" "0" "N" "N" "n")( W9 z ~' [. X- I
(setvar "TEXTSTYLE" Tstyle)
4 A( h0 _3 I4 N$ T: p0 i(command "undo" "end")
$ [8 o0 ~# M5 t* D* g2 `0 h3 _* E)/ v, I8 w" A$ S+ B
L( b9 P1 _) ?' X8 E! U
;free lisp by cadviet,cd2k44
2 S. k0 z- ~5 ]. Q! H;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
! }1 `* t% l' X' f7 \. v$ G! E(defun c:Fttf (/ ent tstyle )3 e: x1 \& x! c! o+ M8 B' c
(command "undo" "be")
6 R# ]. h( A+ a. U5 }5 _(setq ent (entsel "\n Pick text :"))3 W- Y# ?2 n$ q6 d% \
(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
# z; g: P5 W4 m5 B(command "STYLE" TSTYLE "Cambria.ttf" "0" "1" "0" "N" "N" "n")
, Z$ J% T$ L# m! N) Q(setvar "TEXTSTYLE" Tstyle)
3 Y3 O0 C2 q! X' F0 x(command "undo" "end")3 C5 K# C i# T3 U" P' a3 x, f( Y
)3 l# a: ]3 d& Z0 v* p% m$ s8 U
; H9 J) b: K& f$ D3 E9 p8 ];;; ============================================
/ E* e5 q! u* i5 H) v( a( q;;;" H( e% X' n& ^5 \7 ^
;;; LISP Creater Tao Duong Dan AUTOCAD2000 P l. G {4 ~# |$ T
;;;
2 v1 k8 y$ H" T: `4 B; t;;; ============================================
L" }& Y, `3 w% N* _( i C$ q( ]0 u& r6 s0 c7 b
;;; ============================================
- L: Q/ r; C* N# {+ b, V2 a( q;;;
7 o. [$ I8 w- H9 i2 a;;; CREATING FROM AUTOCAD20007 J: V& F- R7 ], u: A" @
;;; Tran Ngoc Thang - Sinh 03-05-1976% g. c/ I M: d6 C- c
;;; ============================================
# G+ o1 M) o8 C. ?
: Q& G/ e5 n# Z1 [% A, N" d* U(setvar "MEASUREMENT"1);Bien So SCALE Cua BHATCH, a5 J) l: m$ |2 Q# B& o. l% Q
;(setvar "DYNMODE"2);Bien So An Hien COMMAND LINE9 X* g! z. M( s7 S' B) d' Q* ?6 P# u# U
;(setvar "VTENABLE"0);VTOPTIONS Enable Animation for Pan and Zoom2 I# {/ f8 G2 e7 c( z+ n
(setvar "INSUNITS"4)& _* k9 t) {8 j
(setvar "ANGBASE"0)
3 L2 U/ N. g4 V, w9 i- W5 c(setvar "ANGDIR"0)8 l7 o' ^4 b! v6 W3 q$ o3 k9 f
(setvar "AUNITS"0)- L+ [$ c( y- @* ]
(setvar "AUPREC"8)
$ F# q! g8 P" g! @5 u; k$ R6 Y3 n8 Q(setvar "LUNITS"2)
1 z, E. s8 C6 a" B(setvar "LUPREC"8)' g0 t" A/ x: Z) d& T$ q
(setvar "ACADLSPASDOC"1)
1 k3 ^$ q( J. ~" `7 o' L(setvar "pickbox"5)
8 l: y/ P$ v0 C* y) e. @0 v(setvar "blipmode"0)
* h W2 M* o |+ t- k(setvar "mirrtext"0)
]1 k! W. _- P, l; i(setvar "cursorsize"100)
$ e! B* Y( G S(setvar "ZOOMFACTOR"75)3 s5 W1 {6 J* t0 }% H
(setvar "LTSCALE" 10)+ h2 j$ b6 S/ h' }. |
(setvar "lwunits"1)* U9 b3 T$ h4 k% z3 Q+ c* d! J
(setvar "DIMBLK" "Closed")
0 s8 q; D2 W/ y, q) ]0 u9 u(setvar "DIMGAP"0.0693)
, Q9 T/ f' F* w! o(setvar "DIMASZ"0.20)
4 `0 s9 K; R+ w3 T; `1 ^(setvar "DIMCEN"0.2)
& i& N3 }5 w- q& g(setvar "DIMDLI"0.1)! \; w9 }% N' x- @) E2 u
(setvar "DIMEXE"0.0693)
/ J- }- [5 L1 T2 X- a, f7 a# V2 ~(setvar "DIMEXO"0.25)
) @ E1 q& h( I% P(setvar "DIMDEC"0)) |5 a1 J5 T' m, Y7 M1 `2 v
(setvar "DIMTIX" 1)
- A! i* z) }) A: U$ x2 D(setvar "DIMTXT" 0.099)
+ z; }' f5 K! O. E: N( G% a! u(setvar "DIMCLRT" 7)1 C: b5 e+ t5 T6 J2 B. k
(setvar "DIMTVP" 1)
5 N! Z; [8 Z- g' U9 b# I5 @(setvar "DIMJUST" 0)
6 }+ h6 R2 S0 C/ w(setvar "DIMTIH" 0)
% T M5 Q7 A' T& G, a( q(setvar "DIMTOFL" 1)
) g: _3 a% `( T" U6 W(setvar "DIMSCALE" 1111.1111)
7 D) T: t$ @0 l p2 \' n" h. e* ~ o4 S6 ]. E4 @
! n+ `; V' Y2 x4 @. K5 j- H2 F- z* e4 P* I& ?
(defun c:zp () (command "'.zoom" "p"))/ T' M k1 J# V3 ^* S. i# M
(defun c:zz () (command "'.zoom" "p"))
U- }$ d) d5 l+ W2 j' U5 ]/ s(defun c:ze () (command "'.zoom" "e")). t: ]% O x- @- G
(defun c:za () (command "'.zoom" "a"))
- O5 @7 ~' t" n1 {5 E" n4 r(defun c:zd () (command "'.zoom" "d"))
0 _6 W# ~, j6 ^ V" c; e: U(DEFUN C:ZZZ () (COMMAND "ZOOM" ".25X"))" E! V6 c/ M) g6 `* C) B5 _+ C3 N
(DEFUN C:ZX () (COMMAND "ZOOM" "2X"))
! J/ Q3 d3 x: @) ?. }6 L3 g(defun c:de () (command "ddedit")(princ))
* }4 I6 y; g1 T5 J0 U(defun c:dda () (command "Dimaligned"))6 K7 }( R- ], o, C) T
(defun c:ddb () (command "Dimabaseline"))$ w; U$ @* @# W1 O- }8 A
(defun c:ddc () (command "Dimcontinue")): N1 y) i% m* I6 T
(defun c:dde () (command "Dimtedit"))" ^* N# f' C# V" k
(defun c:ddf () (command "Ddattdef"))0 R" t4 B+ D, j$ l6 C% t
(defun c:ddi () (command "Dimdiameter"))
8 U5 ^& D; t `( Y+ w2 k(defun c:ddl () (command "Dimlinear"))
! d5 D* q8 `$ {5 J/ U* d(defun c:ddn () (command "Dimangular"))+ u; `; g$ c* P$ K' P0 e
(defun c:ddo () (command "Dimordinate"))
8 R1 s4 M. U- ]) l1 N# |(defun c:ddr () (command "Dimradius"))
/ r- E4 b7 H( K" m6 d' W; G(defun c:dds () (command "Dimstyle")). C5 A) u( w; z! e
; l* [# A% E' v: V' V( A; w/ N8 i(defun c U () (command "dim1" "up" "select" "exit" pause ))(princ)
9 }. u0 x8 Z* o, h" c(defun c H () (command "Dim1" "home" "select" "exit" pause))(princ)5 c/ n7 F2 w4 P( C, K
(defun c:UU () (command "dim1""update""all"))' q% G# V/ w- D! S$ `- j' V7 D0 M
(defun c:ded() (command "dim1""tedit"))
3 T$ D, d/ t* g5 X7 Z8 i9 P6 O(defun c:da () (command "dim1""ali"))* U1 w& g, g, _; Y3 O) O1 ?
(defun c:dll() (command "dim1""l"))
d% u* Z: u$ p" Y3 J(defun c:dan() (command "dim1""an"))
; L U# E# x Z& b(defun c:d1 () (command "dim1""ra")). i* G- A: i( _2 c4 C; Y) u7 |
(defun c:n () (command "dim1""new"))% O5 L5 G4 J9 u: P* k% N
9 F/ i/ ^9 z* A0 I# A: i9 |
(DEFUN C E () (COMMAND " EDIT"))
( @# g% h4 \. _4 }; T(DEFUN C L () (COMMAND " LINE"))
( m$ Z2 q9 I& y7 t/ U# |: C- _' G6 T(defun c:dd () (command "dist")(princ))
5 ^5 S/ H! V# }1 K1 b(defun c:w () (command "pedit" pause "w" "au")(princ))
1 s" N% b" G. x) v(defun c:pg () (command "polygon" "polygon"))% \6 f5 j6 ?+ k. k7 S
(defun c:el () (command "ellipse")), ~' X* I7 ?0 t3 @. G4 T6 c! C
(defun c:xe () (command "explode"))6 N+ w* w$ @ p. ~2 c8 p
(defun c:eex () (command "extrude"))" C! p$ Z6 O7 ~! S3 ?
(defun c:xg () (command "xline""a"))* {* o7 }, u1 ^6 p5 f9 }
(defun c:xh () (command "xline""h"))
8 B7 H S" L6 }; R7 p# E(defun c:xv () (command "xline""v"))
r8 S7 y! I! c) b( ^
3 v7 Z% ~& R' ~" T5 u(defun c c () (command "osnap""cen"))
8 J, B1 K0 S% E, `2 V8 B& Z(defun c d () (command "osnap""nod"))
/ j: o# }, w% O$ Q; R(defun c e () (command "osnap""end"))
5 r1 z! x8 U6 n; ], D8 ?/ L(defun c i () (command "osnap""int"))
, N* }! U' k9 u0 d, A(defun c r () (command "osnap""per"))+ N( p$ \, X/ B0 N( G% L8 Q
(defun c n () (command "osnap""none"))- B* P: B: x/ E* f1 k
(defun c q () (command "osnap""qua"))
9 g9 |' q; _8 K5 R(defun c m () (command "osnap""mid"))
+ }( O. ]4 [" |: T8 f2 Y1 q(defun c t () (command "osnap""tan")): n X- r3 u0 J
(defun c in () (command "osnap""ins"))6 ?3 o2 F7 Q4 f- d* S" P
(defun c:oa () (command "osnap""nea"))% Z* K! {# ?. V" g7 b8 }: u2 [$ S1 a
(defun c:ol () (command "osnap" "End,Mid,Cen,Node,Nea,Int,Perp,Qua")(princ))
5 m, D2 A3 d; {# |# d. s- L& v;(defun c:du () (command "dim1" "up" "s" "pick" "other"))5 M9 N% E- C% [0 m6 e4 c2 \9 O
;(defun c:nn () (command "new" "y" ))7 e% @. I% u# g
9 H& u, o& k' X) [; O& y( `% q
(defun c:/ () (command "limits"))
2 q: P7 C) F8 p(defun c:`1 () (command "region"))# @# h/ ~2 R) e) q$ f! Y4 l
(defun c:`2 () (command "subtract"))
4 m) P; y. B3 _5 m7 @. ~(defun c:`3 () (command "union"))2 X: C x. |" D; }
(defun c:`4 () (command "intersect"))& O/ O+ W3 c( i4 @: k1 i
(defun c:`c () (command "cal"))
$ d3 g+ h3 Z: l) c- u' r. O9 P8 J(defun c:`g () (command " olygon"))' S% w! M* _ d# ]
& Z6 M& W7 J4 B4 t(defun c:lmi() (command "LIMMAX" pause "" "zoom" "all" )(princ))
& B" t5 `- Z, y4 {(defun c:drt () (command "DRAWORDERCTL" pause "Integer" "" "" )(princ))$ a) U: P2 x# _) E3 [, c2 n
(defun c:ip () (ssget) (command "print,_plot" ))(princ)0 _; N/ U: I4 o+ ?5 E
5 H4 K! ~8 X" a, u3 @" R- X
(defun c:ddm () (command "ddlmodes" pause))- T0 C2 [& a( c4 g) X8 a: M, M" ?# D
2 U7 M4 h0 Q& Y0 b# L0 N(defun c:sha () (command "shade" pause))
( X& s2 v" x B! A5 Q8 Y' f+ G
) a, h8 Q$ i* u9 ~4 P; i(defun c:sr1 () (command "surftab1" "p" "" pause))$ Q1 l# k7 I2 G+ Q9 P; U; `7 _$ G% |$ ~
(defun c:sr2 () (command "surftab2" "p" "" pause))
' K5 i; |! j M! l: c5 } P5 P2 L& B8 ?" Y `
(defun c:ad () (command "audit""y"))
3 I; l% _* `4 r8 ?8 s2 L# `# e(defun c:q () (command "quit"))$ M) W3 m* U) j* v. s; D: o& a
- }$ R- U; h0 ?% n7 B. |(defun c:30 () (ssget) (command "rotate" "p" "" pause "30"))2 m3 f# A* `0 X" a! L+ [
(defun c:-30 () (ssget) (command "rotate" "p" "" pause "-30")) t9 B/ M% m5 i% @6 E
(defun c:45 () (ssget) (command "rotate" "p" "" pause "45"))
9 a6 y% [3 P; S/ [(defun c:-45 () (ssget) (command "rotate" "p" "" pause "-45"))
4 a3 a G, h& a(defun c:60 () (ssget) (command "rotate" "p" "" pause "60"))- o W8 a5 ^1 A3 l8 n; h' z7 ~0 P
(defun c:-60 () (ssget) (command "rotate" "p" "" pause "-60"))- n* ~; z' `8 l' r. t8 n
(defun c:90 () (ssget) (command "rotate" "p" "" pause "90"))6 k4 y- S4 a, O6 J6 d6 T: N2 M
(defun c:-90 () (ssget) (command "rotate" "p" "" pause "-90")) V! F, N' `8 r) I. x* v# L( o3 ~ j
(defun c:180 () (ssget) (command "rotate" "p" "" pause "180"))3 g4 A' i- K8 ]
0 ?! Y% a! p$ O5 X& O# z
(defun c:u3 () (command "ucs""3"))6 p# ?, _5 e8 f& R" d, Q
(defun c:ue () (command "ucs""o""end"))
/ u C3 r7 r. L5 c(defun c:ui () (command "ucs""o""int")), Z' O" {8 P% S1 u, c' o
(defun c:um () (command "ucs""o""mid"))
* M2 \/ l: {3 N. j(defun c:uc () (command "ucs""o""cen"))
1 V0 S' b. K( O2 X, c4 F* j(defun c:uq () (command "ucs""o""qua")), F8 R" p w- X
(defun c:3s () (command "ucs""3"))
. r! b s6 j, f+ ~5 s" J) T(defun c:sx () (command "ucs""s"))" i, K9 F% h' M- s4 {
(defun c:sf () (command "ucs""o"))
& g- m! b7 q9 t0 p% Q# e3 C(defun c:sz () (command "ucs""p"))4 o* G2 {6 r7 y4 s5 u& i
(defun c:sr () (command "ucs""r"))8 U9 V1 k) H: h& ]6 [$ F* |8 ^" X
(defun c:sw () (command "ucs""w"))
) W( i) G. L+ @. N(defun c:fv () (command "ucs""v"))# w3 d n" Z% M+ G
(defun c:ux () (command "ucs""x"))* p- w2 T8 d( H, t
(defun c:uux () (command "ucs""x""90"))
9 U- S5 m# v2 @; N(defun c:xxu () (command "ucs""x""-90"))! i5 f% Z* v4 C; a8 F! Z9 c
(defun c:uy () (command "ucs""y"))/ ?, M! o4 R3 x$ g. v( ?# J6 ^
(defun c:uuy () (command "ucs""y""90"))
/ x% ]* N7 e- Z/ S: ?1 v(defun c:yyu () (command "ucs""y""-90"))7 K* M1 S/ N8 ?4 b8 a, M' f( @
(defun c:uz () (command "ucs""z"))
. M" H; l) O1 G# q' I1 ]4 }(defun c:uuz () (command "ucs""z""90"))3 P$ U7 G$ f9 [& Z5 |: C# _4 {
(defun c:zzu () (command "ucs""z""-90"))+ ?7 F }" l8 r3 _8 {/ G
(defun c:uci () (command "ucsicon" " roperties" ))(princ)8 Z3 J& P& \) ~6 ]6 F
(defun c:ucm () (command "ucsman" ))(princ); r' B$ ^4 A# l& X. e: D
7 w% n( ~" ]! P, \5 [(defun c:sa () (command "vpoint""_non""-1,-1,1"))* r- W# m: S! a9 z
(defun c:sd () (command "vpoint""_non""1,-1,1"))$ m8 O7 \2 b& F; g. v$ B
(defun c:se () (command "vpoint""_non""1,1,1"))' M$ }2 O: g8 D3 o$ ~0 c
(defun c:sq () (command "vpoint""_non""-1,1,1"))* r5 \2 M, d2 x4 l3 ]( N7 b5 S
(defun c:vc () (command "plan"""))( k, B; x2 ~9 A* k7 ?
(defun c:vd () (command "dview""all"))% I' W a: b" I, @$ B O
( G# g1 A1 @! N; V0 q(defun c:TT0 () (command "tilemode""0"))
1 @6 L$ h1 ^6 a- o(defun c:TT1 () (command "tilemode""1"))7 I9 ^5 N, o/ @
2 |8 G' n0 ^ [3 t: ^(defun c:vt () (command "vpoint""_non""0,0,1"))" a5 |3 A2 T* \# g
(defun c:vb () (command "vpoint""_non""0,0,-1"))
8 `, q* N- `+ ?4 ]$ E1 s(defun c:vl () (command "vpoint""_non""-1,0,0"))' w/ K" W' u) h$ _4 X
(defun c:vr () (command "vpoint""_non""1,0,0"))
0 o5 q! W" p& v2 z4 b5 L(defun c:vf () (command "vpoint""_non""0,-1,0"))
M3 |' p& k+ P1 G: Y(defun c:vk () (command "vpoint""_non""0,1,0")); X* Q' ?6 U) K, L* \" U; A
8 y4 u9 `3 i5 y9 ]3 V(DEFUN C:MM () (COMMAND "MIRROR"))3 W( O. v! n8 d& J
(DEFUN C:MP () (COMMAND "MOVE" " "))
& k. n! P+ T, C7 n
& X" e8 T$ p8 T(defun c:mee (/ a)
! B' ]9 y9 R! U/ I (setq a (ssget))(command "move"a"""end"pause"end"))
# ]1 v3 f' U5 A2 f(defun c:mc (/ a)
+ F/ X) ?1 t& a: c7 W (setq a (ssget))(command "move"a"""cen"pause"cen"))5 A8 z- w1 x8 v8 C( i8 j
(defun c:cc (/ a). n4 m6 V0 g5 q! t0 u9 |/ Q
(setq a (ssget))(command "copy"a"""m"))
( y8 c- d$ x7 w* ](defun c:ce (/ a); F' `0 v8 Z; e
(setq a (ssget))(command "copy"a"""m""end"pause"end"))8 u% d1 X; s7 w u
(defun c:cn (/ a)- H' }' ^2 t5 T! t- K
(setq a (ssget))(command "copy"a"""m""cen"pause"cen"))
* A2 F% M5 }0 i4 p2 P: N1 ~# S3 [7 n2 u7 B(defun c:tl ()(command "trim""l"""))* f6 v" v. G0 c3 ]3 Z8 C7 E' I9 ^$ A! o
(defun c:tf (/ a)1 ~$ X& o! [+ \6 Y0 O' Q9 L
(setq a (ssget))(command "trim"a"""f"))
9 @* Z- j, ]) T8 F/ M& L Z(defun c:el ()(command "extend""l"""))
( U1 W8 d) S) x(defun c:ef (/ a)9 F% o/ K$ ~- y- M1 G* S
(setq a (ssget))(command "extend"a"""f"))
# K3 H* I6 k; ~0 _8 m
' _" _: p8 u, y0 E: _1 y. D8 y" G! j" u
(DEFUN C:110 ()(princ "\nChon doi tuong can offset ra 110.......") (COMMAND "offset" "110"))
9 o% N7 z" K S' E(DEFUN C:220 ()(princ "\nChon doi tuong can offset ra 220.......")(COMMAND "offset" "220"))4 I/ w: ^/ I; g% {5 K: u2 U
(DEFUN C:330 ()(princ "\nChon doi tuong can offset ra 330.......")(COMMAND "offset" "330"))9 O) A# @" t( U% T- b( Z
(DEFUN C:400 ()(princ "\nChon doi tuong can offset ra 400.......")(COMMAND "offset" "400"))
' i5 H" d: J/ ^. B q4 F. y(DEFUN C:55 ()(princ "\nChon doi tuong can offset ra 55.......") (COMMAND "offset" "55"))
! H* e* X$ t: U& ]6 W(DEFUN C:600 ()(princ "\nChon doi tuong can offset ra 600.......") (COMMAND "offset" "600"))
& c$ w, ^0 D1 ~' ~(DEFUN C:700 ()(princ "\nChon doi tuong can offset ra 700.......") (COMMAND "offset" "700")), W3 v8 f* v# L r- W
(DEFUN C:800 ()(princ "\nChon doi tuong can offset ra 800.......") (COMMAND "offset" "800"))
) a5 `. F: v3 _(DEFUN C:900 ()(princ "\nChon doi tuong can offset ra 900.......") (COMMAND "offset" "900"))
) U3 F3 J* x# A3 `# N(DEFUN C:1200 ()(princ "\nChon doi tuong can offset ra 1200.......") (COMMAND "offset" "1200"))+ ~: i0 ]2 d7 C$ Q ?0 a. Y/ S
(DEFUN C:1500 ()(princ "\nChon doi tuong can offset ra 1500.......") (COMMAND "offset" "1500"))
: j& @) u, F+ ]3 K3 \(DEFUN C:1800 ()(princ "\nChon doi tuong can offset ra 1800.......") (COMMAND "offset" "1800")): ?4 g- x$ b1 x8 g: V, S; f
(DEFUN C:2400 ()(princ "\nChon doi tuong can offset ra 2400.......") (COMMAND "offset" "2400")): B i0 n: O0 u5 }5 B# z
(DEFUN C:3000 ()(princ "\nChon doi tuong can offset ra 3000.......") (COMMAND "offset" "3000"))2 C3 i# X6 O% B# ~; S
(DEFUN C:3600 ()(princ "\nChon doi tuong can offset ra 3600.......") (COMMAND "offset" "3600"))# [# D R! G1 p1 a1 r
(DEFUN C:4200 ()(princ "\nChon doi tuong can offset ra 4200.......") (COMMAND "offset" "4200"))- U0 v+ P" ^% t+ {8 }8 U( T# ~9 d, B
(DEFUN C:5000 ()(princ "\nChon doi tuong can offset ra 5000.......") (COMMAND "offset" "5000")), j4 H3 M3 ^0 \( T
& F' b$ v; y( t# E+ V; Z! m K; G(defun c:mla () (command "-mledit""av"))" q. q0 u2 t3 V! Q: J* V
(defun c:mlc () (command "-mledit""mc"))
8 d6 u; ~, e. h6 F/ K' C% Q1 L(defun c:mld () (command "-mledit""dv"))
. Q1 m+ B& a$ ^1 i, X(defun c:mle () (command "mline""end"pause"end"))
" N: ? B( d) \ s3 k" S- j: O0 x/ i(defun c:mli () (command "-mledit""ca""int"pause"int"))
+ d" ]% K* h) Z: O(defun c:mlj () (command "-mledit""cj"))
" }! ` f! y5 E(defun c:mlt () (command "-mledit""mt"))' N! ^4 Y/ S1 S/ q& c
(defun c:mlk () (command "-mledit""ca""end"pause"end"))0 ~" n: }( i( ~
(defun c:mlw () (command "-mledit""wa"))
" B9 n' S, [5 H6 X1 O7 y p4 ~6 X* \" |! k9 z8 S% \; i+ M( _
(DEFUN C CA () (COMMAND "DVIEW" "all" "" "CA"))
2 U3 p5 U$ H" V( y8 ~+ H" u(DEFUN C PA () (COMMAND "DVIEW" "all" "" " A"))
) i# ~; u- ?" p& o9 I(DEFUN C PO () (COMMAND "DVIEW" "all" "" " O"))
( O; Y; [! ?* |5 m7 e(DEFUN C DD () (COMMAND "DVIEW" "all" "" "D"))
5 a: ^: U, U4 Y* B8 Y. V6 ^(DEFUN C Z () (COMMAND "DVIEW" "all" "" "Z"))$ `4 \% o, W% Y
$ i- s$ e1 |8 U(defun c:p0 () (command "pline""""w""0""0"))
% R2 s0 B; L0 x+ ~(defun c:ot () (command "offset""t"))2 t$ }. ^. q Q. B s1 s: }# E' B
(defun c:t () (command "mtext"pause"j""bl""h"pause))' O+ }* Y+ O8 s$ D, L; J
(defun c:uo () (command "ucs""ob"pause))% B( g6 ~: k4 m+ ~, {
(defun c:f0 () (command "fillet""r""0")); y, m3 i: `' H3 o! i
(defun c:fr () (command "fillet""r"))# B5 K5 i l) M& L. x* ^! D
8 W9 X& b1 t5 E
;CHAMFER
# G% {& Z8 W+ Q, K1 [(defun c:cf () (command "chamfer"))
4 e3 \2 Q9 V' w# d4 L4 O+ {1 t(defun c:cfd () (command "chamfer" "d"))
7 G( C; o$ a) a! J(defun c:cf0 () (command "chamfer" "d" "0" ""))
; }$ h; ]9 p' }. U# |: @& V8 X1 v m) q6 m" ?
;FILLET
: q+ j+ s5 c" O0 ^) `) q6 C1 T(defun c:f () (command "fillet"))
! T2 X% J* z( x, e3 }(defun c:fr () (command "fillet" "r")), }2 U/ ~' H+ H
(defun c:f0 () (command "fillet" "r" "0"))7 s5 l2 Z' b! |6 m9 s9 d
n' W$ Y& W' k, v( R# s
(defun c:OO () (command "oops"))
7 u( s/ v* m0 D% s) N(defun c:dln () (command "dimlinear"))9 U: W. f4 E& N, p2 B
(defun c:dan () (command "dimaligned"))0 U* o7 M3 |7 m6 U5 N9 l
(defun c:ddc () (command "dimcontinue"))( |( Q) w. J! @. P: s
6 O, z1 E) G7 p8 ^, u(defun c:sc () (command "scale" "auto"))( L2 n2 ^' E0 @$ I& m' u& E& ^' p% ^
(DEFUN C:XO () (COMMAND "snapang"))5 d4 G; n$ h7 D' C0 k( c2 a
(defun c:cc (/ a)' R1 T# _& U: y$ F2 `- ]6 J
(setq a (ssget))(command "copy"a"""m"))
2 r! l2 g3 X( e9 J5 e
$ S0 v4 A+ j7 } k) H" a* d/ v(defun c J (/ a)3 p/ c0 V" B! T; W8 l) r
(setq a (ssget))(command "pedit"a"""j""all""y"))
5 a4 M4 I4 s+ j n(defun c:JJ (/ a)5 T6 D; j& H! b; {% _
(setq a (ssget))(command "pedit"a"""j""y")); N9 E0 d) V; O
(defun c:TN (/ a): z# ?* }2 j4 H
(setq a (ssget))(command "change"a"""p""T"))2 A# w; Q% B5 E. C. x
7 q' W5 j7 l, p5 q8 ?( ?
+ q2 W# F8 @& k
;================== Tran Ngoc Thang - Sinh 03-05-1976 - Suu Tam - Tu nam 2000 - Hoc nam cuoi KTS . DHXD ====================
- Z# ~* r0 E/ I7 Q$ ~
0 I' r% r% F0 z4 K(defun C:IB ()(setvar"cmdecho"1)6 x$ z3 q8 ~% C& |3 p4 {
(setq pt(cadr(entsel"\nSelect Block:"))); N% j* A1 R% z W& O+ p3 K: k
(setq e1(ssget pt))
9 T/ ?2 d1 e1 u9 D (setq e2 (entget (ssname e1 0)))
R* K! a V* R, U& `& }* A (setq blname (cdr(assoc 2 e2)))
) g ?8 b, n u# o (setq oer *error* *error* err2)(command ".insert" blname))8 W5 y0 f4 U! t3 ]
/ x! H9 q O" H9 o% b* H- a( d
(defun c:II ()5 P0 X3 ^' E5 k' X# m5 Y- I+ z
(setvar "cmdecho" 0)$ j' m; I0 o h0 k; P
(setq olderr *error* *error* myerror)% [; _! P6 L) A! W7 v# o' L
(prompt "\nSelect objects: ")
3 u# O: y! u8 \( y- U7 ]( @2 D/ t (command "select" "au" pause)
2 j6 n/ \$ O7 U$ l2 G7 d/ Q/ X2 l (setq sstxt (ssget "p")
0 B, ^, t3 n! p/ } P G' m sslen (sslength sstxt)% @ a" T9 \: w# |9 e
ctr 05 {5 Y7 _& ?% i! A
)* k$ F% T3 L' d3 D( y3 }
(command ".undo" "mark")
4 F/ }0 }* D$ w5 \. B" A (while (< ctr sslen)
# E+ i5 ] V9 Y7 R) D5 |* G9 P( F5 Q& ` (setq listxt (entget (ssname sstxt ctr))
. u% }- p6 b# o }/ } txttxt (cdr (assoc 1 listxt))! ?/ o. y2 D% P; p
enttxt (cdr (assoc 0 listxt))
* G! _& }% J! R/ u )
- [% S* J3 `/ Y' N* Y (if (= enttxt "TEXT")
6 G8 v& a7 s ? g8 G% z% h (progn# e0 N6 Z" }) K( F# q
(setq testxt (substr txttxt 1 3))7 ^) U! d. u; B" Y: j
(if (or (= testxt "%%C") (= testxt "%%C")) X# X' u" i% O
(setq newtxt (substr txttxt 4))* y7 V# a ?. J* m! P
(setq newtxt (strcat "%%C" txttxt)) G2 |% ^2 z) y0 i# i; P4 x* E) Z
)
/ ~& u8 ^1 n- v7 p5 N8 S9 Q (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))3 Z! {. ^0 I( F
(entmod listxt)8 M9 ?2 i& Z3 D- a$ v8 b: d+ f+ e4 I
). W( z3 ]4 _2 f+ B
)
1 K& [8 e! U+ g2 t9 N (setq ctr (1+ ctr))
' Y! s, _/ r2 N, Q A )
1 ]9 X+ Q M C" w# ? (setq *error* olderr)
$ m8 { y0 h1 @' i+ u! y0 r (setvar "cmdecho" 1)" k$ O% Y! J% V+ o" a- [
(princ)
+ |, U) A }7 ?# ^6 _% @)
) T! i+ ]& t& ~+ ?
9 n! s% g* m6 n! Z1 e! t5 E: f; V+ h( ](defun c G ()7 I' L+ E) S* v
(setvar "cmdecho" 0)
2 M4 j8 e8 d* D/ _9 w" n (setq olderr *error* *error* myerror)/ X! j) S1 n- A# F" T
(prompt "\nSelect objects: ")
/ k# j, r" s4 t- K! a9 J" L( o (command "select" "au" pause)& K( m5 {1 n0 y( C1 ]
(setq sstxt (ssget "p")
$ F, d* \) \ X: g4 U% S- `- q sslen (sslength sstxt); }% [0 l8 d# H- ]0 M- Y2 Z
ctr 0
3 a6 k/ |% u5 X+ q: G5 F5 i )
) g$ }) R4 k2 s (command ".undo" "mark")
* i7 s( ~% I3 M9 n/ | (while (< ctr sslen)" h9 Z- A+ o9 L( s7 b$ R
(setq listxt (entget (ssname sstxt ctr))
6 h; N, A4 Y! W& K5 r- T txttxt (cdr (assoc 1 listxt))
0 m' Q9 u0 `4 f {5 _ enttxt (cdr (assoc 0 listxt))
+ x7 p& N; A- L. b1 T* H8 s ). C0 V. ]0 @; }3 X
(if (= enttxt "TEXT")
8 q& X" Z/ k- J# a! f3 a! H, ~ (progn
- }, U$ \( d. F8 } (setq testxt (substr txttxt 1 3))8 y4 Y( L* E% n& n& ]5 t1 a+ _: X2 s4 ]
(if (or (= testxt "%%d") (= testxt "%%d")); \) D( q0 ?) {5 J
(setq newtxt (substr txttxt 4)): E0 |& S% q" J
(setq newtxt (strcat txttxt "%%dC" ))
7 ?6 w, w: j4 b; P% d6 P )
5 J9 K; A& m2 b* i/ j/ E/ M (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))9 j) M# }; K( Q2 O; l. W
(entmod listxt)$ ^) t6 q+ _3 X8 P% i% z
)2 u0 b% [4 `- N9 e$ h
)" [0 t4 U4 J) g4 Q! J" D0 x
(setq ctr (1+ ctr))
( o- T2 k% b* f1 f E) @" r7 F )
- k# R' x0 ?" q& k% A" ^1 _ (setq *error* olderr)
; z; }- j* u% [' T! @ (setvar "cmdecho" 1)3 m+ j" l; T& \) n E
(princ)# S" H8 S/ L% }! s. S
)5 x$ o, Q. d9 {# k
( T+ Z# A; V5 V4 Z- J6 O(defun c I () Y+ M: M' K" L( v, L& k
(setvar "cmdecho" 0)' h0 s: b" d; d, ?& R
(setq olderr *error* *error* myerror)
, u& e$ m' | U" O# f2 J( Y- p9 { (prompt "\nSelect objects: ")6 p* |- N6 S: W3 @% N
(command "select" "au" pause)2 G$ U1 n& ?; I" q2 F5 p
(setq sstxt (ssget "p")# k% _5 ?5 r# p; V& L5 D" d
sslen (sslength sstxt)
2 t& u$ P' Y* e& l ctr 0
" y& d2 Y. U; N4 T3 Z- f" f )
% j( J8 S1 e* e. C (command ".undo" "mark")
- _: F2 c0 K+ R* n9 r5 w } (while (< ctr sslen)( F' w0 l i! m d) ^7 F9 q# j
(setq listxt (entget (ssname sstxt ctr)); Y' u' z; K$ K9 g
txttxt (cdr (assoc 1 listxt))2 j: {0 Y0 _3 w" i
enttxt (cdr (assoc 0 listxt))& z9 |6 z! W0 y5 e0 K! B; v
)+ d+ W0 M; g9 v0 B5 P/ C# b$ J! s
(if (= enttxt "TEXT")
, i0 H' D3 b) P9 Y; g( a (progn3 s; \( |" y5 |7 T4 a0 _; D7 `
(setq testxt (substr txttxt 1 3)), R# \; _6 n1 K9 J# k" e6 s/ x' M
(if (or (= testxt "%%p") (= testxt "%%p"))
5 }' i6 q" k3 u+ A( F" o$ r8 } (setq newtxt (substr txttxt 4))7 }+ l4 F+ G& ~$ v5 |
(setq newtxt (strcat "%%p" txttxt))
% j7 J7 E, u: F2 |, z9 H1 O8 P )2 f& m7 v8 r3 S/ y$ |: \
(setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))
5 P8 ]! b& ]2 L6 s (entmod listxt)
1 L" W* P% @6 h- a )" @3 G/ Q8 c) q4 H
)& J) X9 X1 G9 Q
(setq ctr (1+ ctr))
+ a7 Z) P: }& t" L; V )6 [ E% e$ f5 O( x3 U0 c
(setq *error* olderr)
+ t% Z. Y$ X- T) }: t+ [ (setvar "cmdecho" 1)
9 k. V/ ]# u# P (princ)" s' y3 @0 _. G2 y# |" {/ f: X
)
& `5 m7 g# Z1 N7 ~3 [6 q, W+ d' p: }
* K: W* s/ J# {8 a+ b- a(Defun c:CB (/ a)
# x, J( h# o w# V# G; M9 @ (setq olderr *error* *error* myerror)8 i) B% \: `; f& R: M5 n
(setq ocmd (getvar "cmdecho"))
# A& Q2 _( D% z2 l6 P/ D (setq oblp (getvar "blipmode"))$ f7 f# N5 f3 G/ D. A: ^; n
(setvar "cmdecho" 0)/ e: B0 p: l' z& T8 W6 [
(setq a (ssget)) K' }- |+ p+ s4 {$ P
(command "CHPROP" a "" "C" "bylayer" "")
) z+ i2 W1 M7 a' G (setvar "cmdecho" ocmd), \1 @) W9 S; l3 m: Y1 X
(setvar "blipmode" oblp)* m1 c+ m _- I* ]# I
(setq *error* olderr)- ^+ z6 n G& L" V1 G7 n
(princ), j' D' {& W; d9 D' y% A
)
1 _) [3 ^& U1 k4 _/ d7 G' k; O( e/ b0 J) o2 ~
(defun c CC (/ co43 obj23 la23)
1 C. r9 y0 h* c- Q; p* d (setvar "cmdecho" 0)% v- l9 B& n1 N, z7 j Q* g. T
(setq co43 (getstring "\nNew color : "))
; f! L ^0 `% l4 u4 H+ { (setq obj23 (car (entsel "\nPick object on desired layer: ")))9 `. C7 i: c+ ~1 V
(if obj23 (progn
/ w1 }. k$ ?' p6 \" \% ? (setq obj23 (entget obj23))
* J- w5 Z* t# F: N/ S% t (setq la23 (cdr (assoc 8 obj23)))
) s; F6 y& o: X8 c# H0 X7 T (command "layer" "c" co43 la23 "")
1 X/ m; h! p/ l )
$ W; l* K# s, i. S )
5 E+ U' e! o: N+ U* |& b ]- M (prompt (strcat "\nLayer has changed..." la23))
, e' A; m: E+ a( O3 G" d( Q (setvar "cmdecho" 1)4 c3 O& \4 e0 ^$ U5 ^( U
(princ)
- Z9 k% Z. m$ o4 R)
$ S9 p! \$ b q4 D1 V/ e2 d) f5 I A* Y
(Defun c:RP (/ a)
, o0 A, e. R1 t+ a, s( [ (setq olderr *error* *error* myerror)" }1 d" j) Y; h: k4 b
(setq ocmd (getvar "cmdecho"))( j) A8 x5 l% B. w
(setq oblp (getvar "blipmode"))9 k2 j" V( i3 R. V+ w
(setvar "cmdecho" 0)9 s0 L1 S7 }: r$ c; N
(prompt (strcat "\nUSE: Delete object(s) belonging to"
. P; G7 O( t5 |. N k: } " the layer of the entity picked...!"))
; R+ k; @6 k# T/ Y (setq a (entsel "\nPick the entity with the desired layer to delete: ")), A: }1 C' w2 t" z
(if (/= a nil)* Y. z! F2 M5 T. l" F5 w; f
(progn (setq a (cdr (assoc 8 (entget (car a )))))# v0 F6 v! s: T5 }+ F
(command "Erase" (ssget "x" (cons (cons 8 (eval a)) tempword)) ""))$ @& d3 f; Z2 ~! l
(prompt "\nNo entity selected!"))3 }2 e( a3 G( P% [5 ~( S
(setvar "cmdecho" ocmd)
" W. w, w5 M0 H( T (setvar "blipmode" oblp)
& t& T/ O+ o% h, N e4 v& a% { (setq *error* olderr)( @! a) D+ W# U4 m
(princ)" l) f. ^: K# C# m2 D6 z; g5 r
), H5 e9 N3 G, p, J$ @
( t# d# H. }$ `& H( }) H( I9 u$ b
(DEFUN C:WL(/ SSET NET SSL M)
& g) @+ U# t4 N (PRINC "\nSelect lines :")
' a" G3 x( i* ]! C; o (SETQ SSET (SSGET))% p7 U9 H8 n& Y3 J# U6 t- o; H
(IF (/= NIL SSET) (PROGN4 U, _- p \+ v0 ^% W
(SETQ SSL (SSLENGTH SSET))
s" U/ G9 D6 F+ ~$ x, _% r (INITGET 4)
6 N, ?8 H, ~! @! Q+ f/ @4 m' w# b (SETQ NET (GETREAL "New width : "))
6 a$ x3 c+ j: ?- A (IF (/= NIL NET)
' n( z4 I3 F: n/ p2 j (WHILE (> SSL 0)
# j, g1 A+ E& r( a$ X5 s! J (SETQ M (SSNAME SSET (SETQ SSL (- SSL 1)) ))4 \. {% |) ^/ S8 c. I! j# {
(IF (= (CDR (ASSOC '0 (ENTGET M))) "LINE") " t: L/ o5 Y9 o4 W
(COMMAND " EDIT" M "Y" "W" NET "") & V- g$ r8 B; X2 w; z0 Y: T
)
& `& p5 ]3 s/ t( `. r )
% n* T# z8 Q2 W& {$ W3 O& I. {/ o )))
+ g3 i0 y$ z/ c8 i# j( {, V7 i/ w+ o (PRINC)
1 B# ]( g# B! H)
9 N9 a B- ~" |% m* |8 O
' ?) c! d, I/ Y" L$ O(defun C:MML ()5 T; i- A1 }+ o! p& I w
(princ "\nSelect objects to move to another Layer.")
' `0 C9 a# t: B+ s$ @, m (setq ss (ssget))
. s1 p1 X" Z, v, \ (SETQ UL1(GETSTRING "\nLayer to move entities to : "))2 _2 W' ]& s7 D k, s7 T' Z) b
(setq counter 0)8 e1 N' @- x6 _; D# \; \
(prompt "Moving to layer.....")(princ ul1)3 M: V, z2 S' { N0 k
(setq e (ssname ss counter))+ x0 A) A9 |7 Q, a, M8 b2 X
(setq l (cdr (assoc 8 (entget e)))): N. U" C0 q. k8 w9 A+ X) K
(setq S (ssget "X" (list (cons 8 l))))
: A; Y* T4 k5 q. H: } (command "CHANGE" ss "" " " "LA" UL1 "")
2 [* @. D4 I: U3 U/ i% x5 Y (setq counter (+ counter 1))
( _( k' Z: L2 z2 ]0 W$ U! k(princ)" N) f3 H" k& U- F+ x, O, F7 i
) . L/ P- ^) ]% D) I
' j5 w) m) g6 _;;; ================================ GHI CHU ============================
* f5 E l! X$ O* e;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
$ x% m4 M/ q; E% v4 v7 x;;; =======================Thuong Dung Font Romant.vnh===================6 b1 S9 W/ n' U8 j- a c1 o1 R
;;;==================== Tran Ngoc Thang - Sinh 03-05-1976================ m+ Z Q! K5 B: M2 [
: E! ~2 R& L* f/ _2 ^# p
(defun c:RS (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)
# R" e" @! g7 q. I- J# r) p4 W( s+ C: @ (setq oer *error* *error* err2)2 N/ r: j2 W3 w# B5 ?- N7 r9 @
(PROMPT "\n(VNI-TTF)(D)ining room. (S)torage. c(L)oset. (C)onference. (O)ffice. (K)itchen. (B)ath. (M)aster Bedroom. ")
3 C) p" R4 I' f% L (SETQ Cpt(GETSTRING "\n (RomanT.vnh)(DD).(SS).(LL).(CC).(OW).(KK).(BB).(MM). (Vni-SHX)(oD).(oS).(oL).(oC).(oww).(oK).(oB).(oM).")): Z: W( q% ~& l4 d9 y& j
(IF(OR(= Cpt "K")(= cpt "k"))(SETQ CPT ' "Nhaø Beáp"))
7 H; a/ B {0 s# y5 ` (IF(OR(= cpt "B")(= cpt "b"))(SETQ CPT ' "Phoøng Veä Sinh"))
4 b% t6 [) ?0 }# y) w (IF(OR(= cpt "C")(= cpt "c"))(SETQ CPT ' "Phoøng Hoïp"))
' E' a# j+ ~1 ^' \- ^1 D( Q% Q (IF(OR(= cpt "O")(= cpt "o"))(SETQ CPT ' "Phoøng Laøm Vieäc"))
( m, w3 S3 A- s2 I0 E, C2 \ J (IF(OR(= cpt "M")(= cpt "m"))(SETQ CPT ' "Phoøng Nguû"))
/ l; W2 `6 o' L+ m' P (IF(OR(= cpt "D")(= cpt "d"))(SETQ CPT ' "Phoøng Beáp + AÊn"))6 t% b& R1 E, N. s
(IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT ' "Nhaø Kho"))
0 M) W6 z% x Z7 m! Y. n" a. Z (IF(OR(= cpt "L")(= cpt "l"))(SETQ CPT ' "Phoøng Ñeå Ñoà"))3 f) M) @4 ~% m6 s3 E* x
1 R$ o( n0 S1 B! `
(IF(OR(= Cpt "KK")(= cpt "kk"))(SETQ CPT ' "Nhµ BÕp"))
3 V2 x- ]# `+ ~0 N9 R (IF(OR(= cpt "BB")(= cpt "bb"))(SETQ CPT ' "Phßng VÖ Sinh"))
- k5 @+ U' `+ y9 Z; h: M (IF(OR(= cpt "CC")(= cpt "cc"))(SETQ CPT ' "Phßng Häp"))
7 x% _$ b5 Z& h* s6 G& T* {9 {. ? (IF(OR(= cpt "OW")(= cpt "ow"))(SETQ CPT ' "Phßng Lµm ViÖc"))
3 b/ b1 }3 Q0 N/ i8 n! H (IF(OR(= cpt "MM")(= cpt "mm"))(SETQ CPT ' "Phßng Ngñ"))) x2 `: H4 ]4 a! u( U
(IF(OR(= cpt "DD")(= cpt "dd"))(SETQ CPT ' "Phßng BÕp-¡n"))3 F! ~7 @4 F4 E5 Y
(IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "Nhµ Kho"))
9 ]9 q0 x& s$ ] (IF(OR(= cpt "LL")(= cpt "ll"))(SETQ CPT ' "Phßng §Ó §å"))
# H: h! Y0 V$ J5 g/ P* t; @9 T" f$ t' x6 @* Y5 q, Y
(IF(OR(= Cpt "oK")(= cpt "ok"))(SETQ CPT '"NHA/F BE/M/SP"))' Q- ?: u. w# J. ~' E
(IF(OR(= cpt "oB")(= cpt "ob"))(SETQ CPT '"PHO/F/NG TA/W/SM"))
- ~, b/ @. {4 n' w# z/ r6 ] (IF(OR(= cpt "oC")(= cpt "oc"))(SETQ CPT '"PHO/FNG HO/JP"))
, \4 H! F% v' l8 i7 q2 y- _ _ (IF(OR(= cpt "oww")(= cpt "oww"))(SETQ CPT '"P.LA/FM VI/E/M/JC")): E! h7 x: t3 D* c, i! B
(IF(OR(= cpt "oM")(= cpt "om"))(SETQ CPT '"PHO/FNG NGU/R"))
1 D M0 O: a$ Q' @) H. U& `- S- W (IF(OR(= cpt "oD")(= cpt "od"))(SETQ CPT '"PHO/FNG A/WN"))
# m9 L; x, N$ ]' }& M7 Z8 W6 @ (IF(OR(= cpt "oS")(= cpt "os"))(SETQ CPT '"NHA/F KHO"))2 R) n4 A1 c* s" x, U( n
(IF(OR(= cpt "oL")(= cpt "ol"))(SETQ CPT '"PHO/FNG /DO/M/F"))5 r4 j, y4 I f. n- V
(setq pta (getpoint
! d3 w4 P& q$ U# I "\nPick first corner. : "))" q7 k( m: v& K, Z5 v
(setq ptb (getcorner pta
0 j! l+ [8 p% R+ V3 V1 C "\nPick second corner. : "))
9 e/ Z: Y! }" R B (setq ptc (list (car ptb)(cadr pta)))
5 D+ P2 o( J: o* r$ X5 ]: w' T (setq ptd (list (car pta)(cadr ptb)))$ d1 @, u8 L* c3 j1 D! |
(setq ang (angle pta ptb))# }* E* D T c1 T6 } H8 [
(setq d1 (/(distance pta ptb) 2))
4 ]. H. T |& g e: h' w2 o (setq cp (polar pta (- ang (dtr 0)) d1))+ u: o/ o- `! W! S7 I4 E
(setq X (distance pta ptc))
+ v* d% o9 S( z& }. Y5 ] (setq Y (distance pta ptd))% r$ K2 V ^9 v) v
(setq X1 (rtos x 2 1)): y6 m, L' u: W1 H6 X
(setq Y1 (rtos y 2 1))& L+ w! ]+ M( R) P5 P
(setq rmsz (strcat "(" X1 " x " Y1 ")"))
5 @) A9 U* D5 A7 H9 F2 c (command "TEXT" "c" cp "0" CPT "ROMANT-TEXT" "" rmsz))
) C9 k6 m; | `, t5 Y9 ` (defun dtr (angg)1 S1 `; B$ \$ d' M
(* pi (/ angg 180.0))) Q# }! U2 ^' Y) R9 |5 F8 h5 f/ J$ \
% F$ G9 K. _* } b; a(defun c:ZS (/ pta ptb rmsz pl1)
6 i; U6 m# o. p# c! v. A (setq oer *error* *error* err2)
5 h8 n( N! e$ p/ x) O (PROMPT "\n (Vni-SHX-TTF)floorp(L)(oL)an.(E)(oE)levation.(S)(oS)ection.(M)(oM)planFoundation.(C)(oC)Found.(K)(oK)Khung.(P)(oP)View3D.")
: e9 |; I: D! b (SETQ Cpt(GETSTRING "\n (RomanT.Vnh)(LL)floorplan.(EE)elevation.(SS)section.(BM)planFoundation.(CM)foundation.(KC)Structure.(PP)perspective."))8 W& M8 R, g. c6 z0 A
- Y; O$ t5 J7 W4 c* S
(IF(OR(= Cpt "LL")(= cpt "ll"))(SETQ CPT ' "MÆt B»ng TÇng 1 : TØ LÖ - 1:100"))4 l% ?$ \7 A. r
(IF(OR(= cpt "EE")(= cpt "ee"))(SETQ CPT ' "MÆt §øng Trôc ?-? : TØ LÖ - 1:100"))' q) f! k0 P9 n8 @1 B* i2 U9 ?9 B [
(IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "MÆt C¾t A-A : TØ LÖ - 1:100"))
$ a% i* s- p; d* C }7 m (IF(OR(= cpt "BM")(= cpt "bm"))(SETQ CPT ' "MÆt B»ng Mãng : TØ LÖ - 1 : 100"))
6 q( Z1 m: Y" W3 } (IF(OR(= cpt "CM")(= cpt "cm"))(SETQ CPT ' "MÆt C¾t Mãng : TØ LÖ - 1 : 100"))
5 V W$ |8 [' k C3 h (IF(OR(= cpt "KC")(= cpt "kc"))(SETQ CPT ' "KÕt CÊu Khung Däc Nhµ : TØ LÖ - 1 : 100"))" r4 U; [& f' C! I" w& {( B9 \4 d
(IF(OR(= cpt "PP")(= cpt "pp"))(SETQ CPT ' "Phèi C¶nh Mét Gãc Nh×n"))
, U* |* Z" v, j, q0 K
$ m) T# g0 w; E5 f8 O$ g- n (IF(OR(= Cpt "oL")(= cpt "ol"))(SETQ CPT ' "MAËT BAÈNG TAÀNG 1 : TÆ LEÄ - 1:100"))7 @8 ^5 D& c& \5 s
(IF(OR(= cpt "oE")(= cpt "oe"))(SETQ CPT ' "MAËT ÑÖÙNG TRUÏC ?-? : TÆ LEÄ - 1:100"))' ] m+ C' ~; u7 e* G
(IF(OR(= cpt "oS")(= cpt "os"))(SETQ CPT ' "MAËT CAÉT A-A : TÆ LEÄ - 1:100"))9 ?$ u) E# x9 |; g1 W
(IF(OR(= cpt "oM")(= cpt "om"))(SETQ CPT ' "MAËT BAÈNG MOÙNG : TÆ LEÄ - 1 : 100"))
% `5 y) t. f: o! B (IF(OR(= cpt "oC")(= cpt "oc"))(SETQ CPT ' "MAËT CAÉT MOÙNG : TÆ LEÄ - 1 : 100"))
7 Z% C! N2 E& ]+ D' y. v4 q; l (IF(OR(= cpt "oK")(= cpt "ok"))(SETQ CPT ' "KEÁT CAÁU KHUNG DOÏC NHAØ : TÆ LEÄ - 1 : 100"))$ H+ l# I* q F% N& Y2 J5 V3 ~' Q5 P/ R
(IF(OR(= cpt "oP")(= cpt "op"))(SETQ CPT ' "PHOÁI CAÛNH MOÄT GOÙC NHÌN")) R+ \" J) {6 K# S9 r
- W# |& `1 ]' D# C* ]$ p; M
(IF(OR(= Cpt "L")(= cpt "l"))(SETQ CPT '"MA/W/JT BA/W/FNG TA/M/FNG 1 : TI/R LE/M/J - 1:100"))* i; y. B2 O' `: ^
(IF(OR(= cpt "E")(= cpt "e"))(SETQ CPT '"MA/W/JT /D/}/SNG TRU/JC ?-? : TI/R LE/M/J - 1:100"))
5 o1 M; E' E; o) R' }. l2 ^. ] (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT '"MA/W/JT CA/W/ST A-A TI/R : LE/M/J - 1:100"))
: Z6 @8 J- h, n3 J2 n n) a i (IF(OR(= Cpt "M")(= cpt "m"))(SETQ CPT '"MA/W/JT BA/W/FNG MO/SNG : TI/R LE/M/J - 1:100"))! \# ^& O' _" z2 j
(IF(OR(= Cpt "C")(= cpt "c"))(SETQ CPT '"MA/W/JT CA/W/ST MO/SNG : TI/R LE/M/J - 1:100"))
: Q: _, }' k7 E. v (IF(OR(= Cpt "K")(= cpt "k"))(SETQ CPT '"KE/M/S/T CA/M/SU KHUNG DO/JC NHA/F : TI/R LE/M/J - 1:100"))& K$ e- F' e& F: E& V3 v
(IF(OR(= cpt "P")(= cpt "p"))(SETQ CPT '"PHO/M/SI CA/R/NH MO/M/JT GO/SC NHI/FN")). t2 y, P& C3 z
(setq pta (getpoint
# m6 C; T$ [9 y( s$ B8 B* w9 \0 g+ l "\nPick first corner. : "))! W3 g4 f! T+ D. X0 S
(setq ptb (getcorner pta! P% _+ M" C7 f$ c4 }9 N
"\nPick second corner. : "))
2 Q1 M/ [1 s0 a& Z5 I (setq ptc (list (car ptb)(cadr pta)))
. v, o+ C6 p5 v- U& }, ?! t (setq ptd (list (car pta)(cadr ptb)))9 F6 d( ?. H* d3 J, t3 n
(setq ang (angle pta ptb))6 e+ }! ] U! r5 s# R
(setq d1 (/(distance pta ptb) 2))% \9 F* U3 L; ]9 _9 m. u3 m; w$ u( s
(setq cp (polar pta (- ang (dtr 0)) d1))2 H6 u, U* `/ M a. e
(command "TEXT" "c" cp "0" CPT "ROMANT-TEXT" "" rmsz))
; N+ E6 D, L0 A0 L2 I% X( n7 f (defun dtr (angg)( R* ?. r7 n2 q/ a4 |
(* pi (/ angg 180.0))): |! ]1 M' a7 `' c
5 A7 w$ O$ N# ^5 r( T* m! {1 X
;;; ================================ GHI CHU ============================& T! s- ?3 j% _, r3 H! {
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========2 `$ c& b+ I) Q ?
;;; =======================Thuong Dung Font Romant.vnh===================+ o3 @; `4 z+ V, P4 W2 r# }% O
;;;==================== Tran Ngoc Thang - Sinh 03-05-1976================
( `5 X( V: h- U3 E9 |
4 V. P7 L# ^: f3 e(defun c:RRS (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)
! @, H# T+ K* V0 c1 p& v (setq oer *error* *error* err2)/ k8 G* k+ ?# s- V3 l
(PROMPT "\n(Vni-SHX-TTF)(oD)(D)ining room. (oS)(S)torage. c(oL)(L)oset. (oC)(C)onference. (oWW)(O)ffice. (oK)(K)itchen. (oB)(B)ath. ")
% M8 a- w+ |, `$ g (SETQ Cpt(GETSTRING "\n(RomanT.Vnh)(M)aster Bedroom. (DD). (SS). (LL). (CC). (OO). (KK). (BB). (MM). "))
6 g' [7 a$ |7 f: Q5 @, ^- p (IF(OR(= Cpt "K")(= cpt "k"))(SETQ CPT ' "Nhaø Beáp"))* b4 D1 S3 ~/ o$ u/ j# x
(IF(OR(= cpt "B")(= cpt "b"))(SETQ CPT ' "Phoøng Veä Sinh"))
0 c9 i5 v7 d& H' }4 R (IF(OR(= cpt "C")(= cpt "c"))(SETQ CPT ' "Phoøng Hoïp"))
/ g% [ ~: u& W( x1 C8 t1 k9 z, x (IF(OR(= cpt "O")(= cpt "o"))(SETQ CPT ' "Phoøng Laøm Vieäc"))
0 r" W$ ]0 y6 K- _! E+ } (IF(OR(= cpt "M")(= cpt "m"))(SETQ CPT ' "Phoøng Nguû"))& W0 N' L7 s5 \# K
(IF(OR(= cpt "D")(= cpt "d"))(SETQ CPT ' "Phoøng Beáp + AÊn"))
! e. u, @ C5 r9 h5 t (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT ' "Nhaø Kho"))9 P; g8 ~/ a; b$ K" p6 A
(IF(OR(= cpt "L")(= cpt "l"))(SETQ CPT ' "Phoøng Ñeå Ñoà"))
: u( Q7 p& W m0 V
1 ~* z6 I2 D) U5 Y: Z1 F (IF(OR(= Cpt "KK")(= cpt "kk"))(SETQ CPT ' "Nhµ BÕp"))& C3 M* {0 L7 L( v
(IF(OR(= cpt "BB")(= cpt "bb"))(SETQ CPT ' "Phßng VÖ Sinh"))8 A1 A( H, O. M5 D, O
(IF(OR(= cpt "CC")(= cpt "cc"))(SETQ CPT ' "Phßng Häp"))) T+ r9 z- }8 t9 J( K4 e- a
(IF(OR(= cpt "OO")(= cpt "oo"))(SETQ CPT ' "Phßng Lµm ViÖc"))
7 p. h8 `' j: r (IF(OR(= cpt "MM")(= cpt "mm"))(SETQ CPT ' "Phßng Ngñ"))
i! z5 |/ B+ W, Y/ _: k1 Y5 [ (IF(OR(= cpt "DD")(= cpt "dd"))(SETQ CPT ' "Phßng BÕp-¡n"))
: _" V& J8 t2 G (IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "Nhµ Kho"))0 o4 v& Y& V& g) Q
(IF(OR(= cpt "LL")(= cpt "ll"))(SETQ CPT ' "Phßng §Ó §å"))( t# E& y: K3 M( {, @. l* b
" ]$ D$ d& S# I' P! Z9 ?
(IF(OR(= Cpt "oK")(= cpt "ok"))(SETQ CPT '"NHA/F BE/M/SP"))
8 f( v* X8 n6 v3 h (IF(OR(= cpt "oB")(= cpt "ob"))(SETQ CPT '"PHO/F/NG TA/W/SM"))) ?! x7 [0 ~# g9 e$ N
(IF(OR(= cpt "oC")(= cpt "oc"))(SETQ CPT '"PHO/FNG HO/JP"))
1 c& X/ K& M/ i% N# A6 d (IF(OR(= cpt "oww")(= cpt "oww"))(SETQ CPT '"P.LA/FM VI/E/M/JC"))
9 o: F) Q1 W3 H' k A (IF(OR(= cpt "oM")(= cpt "om"))(SETQ CPT '"PHO/FNG NGU/R"))
p( F4 B1 X3 ?0 r' Q (IF(OR(= cpt "oD")(= cpt "od"))(SETQ CPT '"PHO/FNG A/WN"))* t1 J) G! u! h* [' {
(IF(OR(= cpt "oS")(= cpt "os"))(SETQ CPT '"NHA/F KHO"))
. Z6 j4 i- } _; n+ G* M4 j (IF(OR(= cpt "oL")(= cpt "ol"))(SETQ CPT '"PHO/FNG /DO/M/F"))# ~3 N. y( R; {3 S2 p
# w7 f1 T3 W; d* r6 h
(setq pta (getpoint! _3 h9 N; b( L; h; C
"\nPick first corner. : "))) \' ~8 e l3 ~ v
(setq ptb (getcorner pta: F! L) P( b" W" S
"\nPick second corner. : ")). _3 G' |% L% D! q
(setq ptc (list (car ptb)(cadr pta)))
4 t& t S6 o) {' Q4 m (setq ptd (list (car pta)(cadr ptb)))
1 I3 E. {% l% D! M. J (setq ang (angle pta ptb))1 G8 x3 R# T, i0 e ^$ B
(setq d1 (/(distance pta ptb) 2))
) H" e/ U% ?$ T (setq cp (polar pta (- ang (dtr 0)) d1))
6 Q3 p* R( Y( d: S# k+ t7 t( V (setq X (distance pta ptc))
& j% e2 L' c3 O& I' e (setq Y (distance pta ptd)); o s( N5 r: b( `% w9 G8 n
(setq X1 (rtos x 2 1))
. B+ P! L9 l: |9 J) e (setq Y1 (rtos y 2 1))
0 [8 G4 X0 Y5 x4 S# q$ K! a( u (setq rmsz (strcat "(" X1 " x " Y1 ")"))
' y3 n8 Z8 C% I) I- c (command "TEXT" "c" cp "0" CPT "text" "" rmsz))
3 _' A$ C# E! k7 L# T, \6 _ (defun dtr (angg)
5 X5 V8 b0 ?( O1 y+ H% y) \3 j (* pi (/ angg 180.0))): f# i; f* w2 a) |
( K ?0 W& \; X
;;; ================================ GHI CHU ============================& ^: T+ V2 H3 F% Q, J; {
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========2 z7 U# A" y+ ^4 M% E% p7 O
;;; =======================Thuong Dung Font Romant.vnh===================3 N' Y$ e R; S& w/ }# {
% G1 a# A" L5 s/ h+ E(defun c:GS (/ a b c d)
2 c$ l( y# A. f; p6 r7 N @' B+ \ m0 n (graphscr)' [0 t) ~* \3 ]' ~, t" k6 a
(prompt "\nSelect text to set style....")
+ n& z$ n! r& f' P0 T (setq a (entsel))
x% p) g; W E# o, }& w (setq b (entget (car a)))8 E+ I+ a G3 t; j
(setq c (cdr (assoc 7 b)))
( s- A# d! q9 j, {& G (setq d (cdr (assoc 40 b)))4 s$ U$ q6 R& p$ t: o' f9 L9 J
(command "style" c "" d "" "" "" ""))4 t" s. Q1 K5 s
(princ "\nType GS to set text style.")4 Z8 X6 e3 j2 Z& [' w( V+ u: ^, x
9 r: f8 `! D( z N1 F
(defun c:RC (/ olderr ocmd oblp pt1 pt2 pt3 pt4 l w)' y/ d( ~+ M# q. b7 X. Q8 h; |
(setq olderr *error* *error* myerror)
1 \0 M, t) W3 b' I* t; u( ` (setq ocmd (getvar "cmdecho"))* z& l3 U% ^8 ~" }4 ~5 O
(setq oblp (getvar "blipmode"))2 T) d: ]7 S# c8 ~0 `3 q0 T
(setvar "cmdecho" 0)
1 |% S; P% F( p _ (initget 1) ;3D point can't be null; j: k& y) k0 [' ?$ z* ]
(Setq pt1 (getpoint (strcat "\nCorner of rectangle or square: ")))7 n. e3 {, M2 C5 N% s
(setvar "ORTHOMODE" 1)
0 T7 `$ U* L& [8 j' Z. Z b$ G! F (initget 7) ;Length can't be 0, neg, or null- C. w1 j8 i3 p$ o" l" r" a
(Setq l (getdist pt1 "\nLength: "))
3 ?; Q" c7 v; M. k; j. v3 N (Setq pt2 (list (+ (car pt1) l) (cadr pt1) (caddr pt1)))
, p" X- ]: ~% `0 ?# O8 m+ u' c$ F) I (grdraw pt1 pt2 2)
+ J( Y9 q8 _* W5 q# m* L% Z (initget 7 "Square") ;Width can't be 0, neg, or null9 N" h/ D0 t4 i2 g1 w# g9 x
(setq w (getdist pt1 "\nSquare/<Width>: "))) ^# g- i- l1 Q6 l5 E
(if (= w "Square")
1 E, P1 L2 H& {- ]$ P6 @ (setq w l)$ X0 B0 U0 M, \; l) |: V
)
5 c) O8 h1 B# o (setq pt3 (list (car pt2) (+ (cadr pt2) w) (caddr pt2)))
1 K8 l" Q8 Q) `7 @) n4 B- V5 }) F- I (setq pt4 (list (car pt1) (+ (cadr pt1) w) (caddr pt1)))- n1 d$ M5 ~. z. J4 h: }
(grdraw pt2 pt3 2)
- l; C: L# L: }6 T0 @6 \ (grdraw pt3 pt4 2) k8 L) |; c: N- `" y" L: a
(grdraw pt4 pt1 2)9 k; N5 g" M, D7 [1 b& P c1 i
(setvar "ORTHOMODE" 0)0 m& |5 E3 I& [" v% E7 e$ d* _
(command "pline" pt1 pt2 pt3 pt4 "close")# z7 @' D# Z) l) B" e
(setvar "cmdecho" ocmd)
5 I' K) g$ C2 D# V# p (setvar "blipmode" oblp)0 M1 |; A' l% a0 C+ f, k
(setq *error* olderr) ; Restore old *error* handler
$ Z! W4 }# `/ P (princ)
6 \( F/ a" O# }7 V+ h2 z. ?7 j3 e)
' N% f& F; n% @( L& w( V
/ [! I$ q- q7 o( A# k& Y(defun c:SG (/ ent pt1 pt2 ang). M/ V$ N5 J2 ~& @' i$ I* A
(setq cmd (getvar "cmdecho")), w8 D( R+ c- }8 k$ X* o9 J2 _
(setvar "cmdecho" 1)
3 S# Q0 P$ h5 A& M$ q6 I (prompt (strcat"\nSnap angle will be set to angle of line"))/ h2 ]# d! J# J5 N3 f7 W: c
(setq ent (entget (car (entsel))))5 [# {) ?% E9 t, _! ?) G
(setq pt1 (cdr (assoc 10 ent)))
, V0 f) ~# T4 X (setq pt2 (cdr (assoc 11 ent)))
- O: o8 q" H7 F* B- |1 [ (setq ang (angle pt1 pt2))
1 x" ^ c& _0 g* E. t% r (setq ang (/ (* ang 180.0) pi))
6 d* L' d" m4 ]7 | (setvar "cmdecho" 0)
: s; Y1 k' c# u (command "setvar" "snapang" ang)
: k, o% p6 k$ f# o) r4 R (setvar "cmdecho" cmd)( M# I1 N9 X( v3 k
)
/ ?/ Y0 d/ w0 [# P1 @) x
! c' _9 N5 W- {, n5 k2 K(defun C:TG ()$ E( w* S- f( Z! a) T; T
(initget "Increase New")
8 g: W* Z3 Q# G, V x" s (setq ans (getkword "Increase/<New>: "))0 o) K+ u& X' O- [
(modang)- i+ D2 R. v6 m1 k' e
)9 m$ w/ p) p" Q* c4 |$ ^4 Y
(defun modang (/ ang ss ca e na ssl)& h: |& h+ h! N& x# s( g+ N0 \9 w
(if (= ans "Increase")+ b3 _4 g" L% K& U5 H, R7 {# H
(princ "\nIncrease angle for text by: ") C* {3 k: {2 Y6 u
(princ "\nNew angle for text: "), Z2 W) V& Z0 r) I p. x
)+ d0 ~, F; u4 V& i
(setq ang (getreal))8 q8 a% c; l" Z
(setq ang (* (/ ang 180) pi))
. U7 I) e6 x. |+ R$ | S (setq ss (ssget))& | J9 G4 A. `7 q2 y$ Y
(setq ca 0 ssl (sslength ss))9 x- [9 ~& u, R3 F
(while (< ca ssl)9 G a& O% x- Q
(if (= "TEXT" (cdr (assoc 0 (setq e (entget (ssname ss ca))))))! p. a) _& K2 g
(progn, h; G, R1 D1 v- l
(if (= ans "Increase")
2 z/ S& u( K% e! \9 v1 l9 g (setq na (cons 50 (+ (cdr (assoc 50 e)) ang)))& N7 r1 C. T1 W3 v% j5 }4 l( H
(setq na (cons 50 ang))7 _, {4 {# p9 Q: v K( Z$ S$ @* i
)
Q* G1 v1 E$ o" F( N (setq e (subst na (assoc 50 e) e))
/ g6 A! k: K+ c$ _: Z/ K W (entmod e) {% `( u8 k* t( b$ G1 }
(setq ca (1+ ca))
) j/ w% z5 D) a- {+ R1 V! X )
) s: g$ X$ d- `2 e9 L )
. ] y+ i# C1 X1 e+ M, ` )* j# W2 n. y- V/ ~
(terpri); [0 d0 S$ d F4 ?9 h
)* L& C. n1 k& B6 s
3 M. v6 S: o/ n$ X, g; z* i; r1 u+ _0 ? S
(defun c:WL ()8 c* n5 c: H) O. J
(setvar "cmdecho" 0)2 s8 X( b! Y5 n- x" o. |
(setq a 1)$ {/ [% {8 l, a1 q' N& b+ A1 H
(prompt "\nSelect Polylines to change: ")/ y: Y( B* B0 h! v* {# M }
(while (/= a nil)" h! }! B6 o9 I( U& U* P0 C# S
(progn
; ~+ _' ?' ~3 J; b, h (setq a (entsel)); T2 L; @& o7 v
(if (/= a nil)1 e7 D9 g0 j& D: V4 G) a0 A0 _
(progn
/ Z2 O) n' D& J3 T- s1 R- t (setq b (entget (car a)))
$ s* r0 `' I- O, K (setq c (cdr (assoc 40 b)))2 a% f4 t" j# z( d
(princ c)6 ^2 p0 `' P6 d! `
(command "pedit"a"w""lw""")
0 p: e# A8 u( S" V )))) # P3 ?/ e' g& h2 A* e
(princ)9 p+ |* n, t8 O4 l
)
! j, e: J1 x# X6 I* f# W- D6 v' L' r& [4 Q( b0 i. L; b
;;; ================================ TEXT FIT ============================
' |$ U4 N/ ^4 e: x2 b5 {
6 q9 B) D: P- C2 W(Defun c:FT ( )
- A* P" j1 K- N! P2 k6 D! Q/ J! M2 C (defun setsnapang (arg /) (setvar "snapang" (angtof (angtos (cdr (assoc 50 arg)) 0 8) 0 )) )/ \; b5 F/ _- c- t9 V
(Defun LL-xyz (arg) (CAR (TextBox arg)) )
4 L$ I/ X5 r1 z( B* F- P (Defun UR-x (arg) (CAADR (TextBox arg)) )& A- V8 W% Z+ |& y. S- s
(Defun LL-y (arg) (CADAR (TextBox arg)) )6 @: Z% ~* ]) i" G% h8 m- V8 s( s/ Q
(Defun LR-xy (arg) (List (UR-x arg) (LL-y arg)) )5 o9 ]- e: Y6 N$ O' w9 @
(Setq ename (CAR (EntSel "\nSelect Text to stretch/shrink:" ) )+ }3 b1 @6 f; i( Y- M4 o
Textent (If ename (EntGet ename)) )
1 g4 g7 A+ w q1 M8 n (If (= (CDR (Assoc 0 textent)) "TEXT")
' D- w+ c( O( W' z (Progn (initget 0 "Start")
- o) f; Y# m! y5 J& F (Setq NewEnd (Distance (LR-xy Textent) (LL-xyz Textent) ) )
, |7 M, \9 d/ i! d/ P5 G4 p* f (setsnapang Textent) ;set snap along text entity
! { A1 k& C, q* I; E! `/ T (setvar "ORTHOMODE" 1) ;drag along the text/ |/ t" a& Q; P
(setq
0 b6 P6 h7 D. q2 k& l8 XTMP (getpoint (cdr (assoc 10 Textent)) "\nStarting Point/<Pick new ending point>: ") ). j1 y1 H; h+ \
(setvar "snapang" 0)
! q T6 Q% D6 O: @) e (cond, f# f, b( w% D; \8 ]0 ~4 P
((= (type TMP) 'STR) ;;new starting point to be selected
. v6 U5 r/ W) H% o% F) W4 j' n s (setq Start (getpoint "\nPick new starting point: "))
t6 }& J! h4 u2 \ (if Start (progn3 l3 K. n4 k/ V* i! `# e
(command "_UCS" "_E" (cdr (assoc -1 textent)))9 E6 s9 L% g9 T: F( o+ j
(setvar "ORTHOMODE" 1)' r$ j. S- P$ H, `
(setq NewPt
8 R4 W& e/ J0 h' E (if Start
: g( ?) L3 @; }5 Z& K (getpoint (trans Start 0 1) " ending point: ") nil ) )5 z+ N8 A2 v2 P3 G( c! N6 ~
(if NewPt (setq NewPt (trans NewPt 1 0)))
! F v0 m. C* J2 ~2 S7 e% U% ~+ M (setvar "ORTHOMODE" 0)
" K& M2 A- Z6 E$ D& Y (command "_UCS" "_W") ) ) )
+ e4 L/ L* C" m8 Z. u( a1 S4 _ ((not (null TMP)) ;;new ending point selected6 X* F' d+ ]5 ?/ y! A
(setq Start (cdr (assoc 10 Textent)) NewPt TMP) )
F6 ~" C' N! r1 s (t (setq Start nil NewPt nil) ) ), F$ D5 r1 F' v R0 |' l
(if (and Start NewPt) (progn, k" \3 g3 a# I% `* G9 I5 _
(setq Val (Assoc 41 Textent) ;;current width factor6 d# v' l# I" [( S( l9 N
Val (if Val (cdr Val) 1.0) LTC_% % k. X; K g$ u$ J6 ]- J* W
(* (/ (Distance Start NewPt) NewEnd ) Val )
* k9 e! e5 w, h i6 Y( j textent (Subst (cons 41 LTC_%)0 M; m, P+ R% p
(assoc 41 textent) textent)3 @. u2 i+ W: x" O
textent (subst (cons 10 Start) (assoc 10 textent) textent)
; s1 s5 T1 {, T' m. m textent (subst (cons 11 NewPt) (assoc 11 textent) textent) )3 l2 @: d* V3 M4 c9 i% C- X
(EntMod textent) (EntUpd (cdr (assoc -1 textent))))))) (Princ))/ l7 @) y: B6 I; D
3 t# W/ r( {! k' y! D;=====================================================================2 H8 O0 Y$ H% ?( }8 H
;=========================COPY + ROTATE ==============================
: ~; q' x, @' T p6 m( l) W1 x;=====================================================================
2 D" V, g) K2 S p0 D) d2 A- p* g
% e9 ?7 ?0 F$ |7 c: D(defun c:CR(/ olderr cm loop ss1 ss2 bp mult lent ss2 lp1 lp2)
) V$ L% c- A9 f) f (setq olderr *error*/ F. I: f; D9 m2 c
*error* croerr)
! _: a0 z% ]+ T9 @7 z* o) p2 P (setq cm (getvar "cmdecho")), H/ V# q& l, O7 g: M, d1 ]
(setvar "cmdecho" 0)
K1 p3 h( J" E! [- E1 Z& k1 M (setq loop t)
7 z1 n$ l! [8 \" \ (while (not (setq ss1 (ssget))))
. c; g: X, x5 x' F* B' n (initget 1 "Multiple")
% K. Q4 W: J3 | (setq bp (getpoint "\nBase point or displacement>/Multiple: "))
; @$ y" ], b+ W I. ]3 [) H% x (if (= bp "Multiple")3 `( p) {. W Q* i: M! W
(progn1 X8 _7 A7 h5 ^9 i0 _8 q
(setq bp (getpoint "\nBase point: "))
1 V. T4 }/ t. j' F- V( V& u (setq mult t)7 j( F! N" r3 }3 f t
), B( X/ c2 d0 L: L2 T
)) |- Y" G5 t; F3 E4 Y" w! i& ~
(while loop
% d1 L# u8 `& F# ?. K+ v6 q (setq loop mult)
7 |! @- r$ g) C8 t (setq lent (lastent))# j/ R7 {4 I( w3 s9 @/ z
(command ".copy" ss1 "" bp bp)% E- n5 N6 X3 x& ~! g: O+ \
(setq ss2 (lss lent))
8 Q5 v0 d( j" O# z v) A (setq lp1 (getvar "lastpoint"))3 ^! X! S. j" i- n3 p4 X0 h
(prompt "\nSecond point of displacement: ")
; ]+ y/ x0 _( ?! }/ u& _ (command ".move" ss2 "" bp pause)3 q' \7 g, D! J [4 r% Q6 H* y' l3 {
(setq lp2 (getvar "lastpoint"))4 e3 g7 r; A* X) x
(redss ss1)
' ^- B, Z& a% J (if (and (not mult)
, E4 t6 U9 V( t' ?! b$ r( Q, y (= (distance lp1 lp2) 0)
6 H$ v8 z: ?; B1 u+ s )
( x& f+ u8 k! |: g; x (setq lp2 (getpoint "\nRotation Point: "))
% a$ O4 B2 Q: N, w )
; j) k/ {8 @3 T, ~/ A, y; I (if mult4 v* t4 X: I/ d& f5 ^* |
(prompt "\nRotation angle ")
" u/ r! b2 ` E- t, ~8 M/ k (prompt "\nReference/<Rotation angle>: ")
. @0 T% I6 ?' e, B: R# W$ {, o )
" ^* k$ M5 M/ [ (command ".rotate" ss2 "" lp2 pause)6 @( T0 s2 h d! y
)
/ U0 z1 N8 t; k! x* S) W# K; D (setvar "CMDECHO" cm), H7 K( \8 s: K+ W& M# @9 v1 ?
(setq *error* olderr)5 a/ q) O- P) x# c
(princ). C& n/ S5 D2 _4 ~; H
): M6 L! f6 e! ] ]- T
(princ)
A5 |1 Y0 p3 t" Q$ B(defun croerr (s)
9 u+ M; F" }5 m8 }. [! }7 u (if (/= s "Function cancelled") / g( D2 C$ o( j. ]. ^4 \; U
(princ (strcat "\nError: " s))) o, [$ P6 J# ~# x
)
* m- v. p$ w. S! I0 `. H; g/ n) v% ~$ z" { (setq S nil)
5 T# H& @6 m) s l/ y (setvar "CMDECHO" cm), a2 d* U5 X5 v1 w
(setq *error* olderr)! T' G( `& F1 b( U. Z* `
(princ)/ u2 k5 I5 Y4 I1 q) I' c4 r2 D
)
5 ?$ l! Q( G5 b' Y* ~(defun lastent (/ a b)
! y1 u7 I. s3 V* f, z (if (setq a (entlast))4 ?) I1 z* b2 L4 p# J
(while (setq b (entnext a))1 A$ I, z8 e, ]3 z% r) k
(setq a b)
) K+ y8 T7 V- k. }% R. p ); D8 R9 Y/ v& k3 U5 N
)+ j8 B6 L+ M f1 \; f5 t
a$ G$ y5 E* X" m* l
)$ e2 p) J/ R; p# y6 ?
(defun redss (ss / en i)
* {% x, i+ y$ }. {- A/ y (setq i 0)7 Y& b$ F$ X6 h- f6 b& Y: T0 {
(while (setq en (ssname ss i))
x% s+ p0 p: [( W* Q; } (redraw en 1)
: A1 }- I' c' S4 R+ F# c% j (setq i (1+ i))/ }& t2 k u- _* E' V ^- ~% j$ m2 F
)( P8 V, }2 g: I" |( v. m, G
)
1 V0 D$ G* L- S5 {. z(defun lss (en / sels ed)% V$ A4 f% |; V" E1 m
(setq sels (ssadd))
6 J5 a) Z3 Y% f3 I2 l4 N R: ] (while (/= en nil)
8 L. X; q: U& t4 c (if (setq en (entnext en)) (setq ed (entget en)))7 s7 V$ h: x; B
(if (/= en nil) (setq sels (ssadd en sels)))
T2 U; d7 N7 W/ g9 i (if (or (= (cdr (assoc 0 ed)) "Polyline")
$ B) X+ \$ E1 o' g1 s/ q) k (= (cdr (assoc 0 ed)) "Insert")/ D! o# W u- D7 d- w, s! B/ ~
); s' a* H% R9 w& a) P9 y( X8 o1 ^
(while (/= (cdr (assoc 0 (entget (setq en (entnext en))))) "Seqend")). d4 O. E+ P, ?" v. T4 a
)( {) [4 k- N% s" i( M
)
" V0 ?( }0 e% P, ^ sels$ c% `" }- b+ C$ g4 i; m6 L, K5 L
)+ k3 ]) ^, e6 Y) {
1 x4 d7 U+ K" q* ], a7 z/ j# l3 Q
;;;; ================== CAC FUNCTIONS DUNG TRONG ACAD.LSP ==================' `( ^ R' W6 V) h; G, P% ?
;;;==================== Tran Ngoc Thang - Sinh 03-05-1976===================0 u+ w H* ]. D) i+ W
$ u* {3 `9 Y' }0 E8 n. Q+ b( I
(defun c:00 ()(princ "\nChon doi tuong net Defpoints")(ssget)(command "change" "p" "" "p" "la" "Defpoints" ""))( ~& M2 d! Q, i9 `" S; t' p4 z
(defun c:0 ()(princ "\nChon doi tuong net 0")(ssget)(command "change" "p" "" "p" "la" "0" ""))
+ V3 F# l; t8 y. w; O9 h# ^(defun c:1 ()(princ "\nChon doi tuong net COT")(ssget)(command "change" "p" "" "p" "la" "COT" ""))0 o' u! A4 e" u" @
(defun c:11 ()(princ "\nChon doi tuong net DIM")(ssget)(command "change" "p" "" "p" "la" "DIM" ""))2 \* j4 x1 c$ x
(defun c:22 ()(princ "\nChon doi tuong net MANH")(ssget)(command "change" "p" "" "p" "la" "MANH" "")). `- h1 }" B# C, r. f3 I3 F
(defun c:33 ()(princ "\nChon doi tuong net NETMANH")(ssget)(command "change" "p" "" "p" "la" "NETMANH" "")). ?* f9 d. t$ q/ k/ Y E! m# W- s
(defun c:2 ()(princ "\nChon doi tuong net NETDUT")(ssget)(command "change" "p" "" "p" "la" "NETDUT" ""))
0 h7 p- W7 ^, t" d+ k1 q(defun c:3 ()(princ "\nChon doi tuong net NOITHAT")(ssget)(command "change" "p" "" "p" "la" "NOITHAT" ""))
% a7 s) P7 J: j/ G(defun c:4 ()(princ "\nChon doi tuong net TUONG")(ssget)(command "change" "p" "" "p" "la" "TUONG" ""))4 p7 t: x7 b! y3 M3 M0 y7 A
(defun c:44 ()(princ "\nChon doi tuong net KHUNGTEN")(ssget)(command "change" "p" "" "p" "la" "KHUNGTEN" ""))
2 M+ H( W6 J0 x(defun c:5 ()(princ "\nChon doi tuong net TIMTUONG")(ssget)(command "change" "p" "" "p" "la" "TIMTUONG" ""))6 X% W7 X" Z( s% i! P: U
(defun c:6 ()(princ "\nChon doi tuong net CUA")(ssget)(command "change" "p" "" "p" "la" "CUA" ""))
P6 u8 b/ O/ C9 b7 |" e(defun c:77 ()(princ "\nChon doi tuong net THAY")(ssget)(command "change" "p" "" "p" "la" "THAY" ""))
3 I) U! k6 X0 J) M4 C. [(defun c:7 ()(princ "\nChon doi tuong net NETTHAY")(ssget)(command "change" "p" "" "p" "la" "NETTHAY" ""))
2 f! n# {- l7 t9 M/ K+ @(defun c:8 ()(princ "\nChon doi tuong net HATCH")(ssget)(command "change" "p" "" "p" "la" "HATCH" ""))% ?% j$ G: j& D k1 P7 |8 u
(defun c:9 ()(princ "\nChon doi tuong net TEXTTXT")(ssget)(command "change" "p" "" "p" "la" "TEXTTXT" ""))) z* R/ o/ E7 s9 B, [3 b2 h" P
(defun c:99 ()(princ "\nChon doi tuong net TEXTVN")(ssget)(command "change" "p" "" "p" "la" "TEXTVN" "p" "C" "bylayer" "")), D7 \* M8 v% Q5 i# l
(defun c:td ()(princ "\nChon doi tuong net THEPDOC")(ssget)(command "change" "p" "" "p" "la" "THEPDOC" "")). E7 ~4 [4 i C9 ?0 k+ ?: a
(defun c:ddt ()(princ "\nChon doi tuong net THEPDAI")(ssget)(command "change" "p" "" "p" "la" "THEPDAI" ""))8 z& h1 t$ w. s/ R, P/ I4 h
$ g4 h# y: c( z+ Y# m( S- b;=====================================================================, u! Z% x1 W$ d8 J
;===================DAT Ti Le Theo KHO GIAY BAN VE====================
+ \: ?' q4 `! F8 F;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
9 v7 a6 A5 }8 M- X$ d
/ P$ R' ^6 j' R! ~+ M% t, V/ D;(defun c:SA6 () (Command "DIMSCALE" "111.11111" ))(princ)5 k: i' ]) E0 @3 j8 q+ M
;(defun c:SA5 () (Command "DIMSCALE" "1111.1111" ))(princ)7 @6 [$ {: L' c
;(defun c:SA4 () (Command "DIMSCALE" "1111.1111" ))(princ)
`9 W% z' E8 `5 _: }' g4 E;(defun c:SA3 () (Command "DIMSCALE" "11111.111" ))(princ)+ w7 X, n Q3 e" H1 }* a; w" j
;(defun c:SA2 () (Command "DIMSCALE" "111111.11" ))(princ)4 _, g( A5 U( ~6 r& m/ @( i. }
;(defun c:SA1 () (Command "DIMSCALE" "111111.11" ))(princ)! a* k2 d' Y J
;(defun c:SA0 () (Command "DIMSCALE" "1111111.1" ))(princ) u/ _. R3 \5 s
) f; j9 R% |9 z! D1 @+ }1 Q
;=====================================================================
- N% @# X0 L! \. _4 o;===================DAT Ti Le Theo KHO GIAY BAN VE====================/ x; ?6 T, L" I' ^( |" e0 D
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
0 V8 ]2 {- A7 R$ r/ X! C Z5 x! I7 ?8 U
;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =============2 F% S, [! Z ~5 e) q8 x' f7 M9 ]( b
! I8 _( n" J T+ L X
;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =============3 X" h8 ?3 P3 |: D
+ U5 O: j& s& ^(alert "Using the NetXuatAnh-[ 5940.00 x 4200.00 <pixels> ] command!")
i2 U) i2 V+ d5 Q(princ "\nEnter (DEFUN C:netxuatanh () to get to real LAYER command.\n") (command "NETXUATANH")% B5 x: i% t. W$ W
2 }) h; E4 l( H1 y) \;=============== DAT LAYER NET de xuat anh JPG [W x H] [5940.00 x 4200.00] ===DRAW===
$ q6 ]" {) `) m A4 o: F
$ B3 L% A2 L( p/ S: a/ r;(DEFUN C:netxuatanh () ~3 y# ~- T7 n
(COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.6" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "5" "": D. [( i5 s8 i# ~7 C5 v. ~: E
"-LAYER" "M" "TUONG" "C" "4" "" "Lw" "1.58" ""
+ X: v' J0 |' q. M1 w "M" "MANH" "C" "9" "" "Lw" "0.5" ""
3 d! i3 h' B M i+ ` "M" "DIM" "C" "1" "" "Lw" "0.6" "". B9 @1 P( @& }: `( I
"M" "THAY" "C" "7" "" "Lw" "0.7" ""+ E, j/ p1 P$ y4 d* ^4 G# {
"M" "NOITHAT" "C" "60" "" "Lw" "0.5" ""
1 M/ c8 W# A$ R6 o/ \& a3 i "M" "HATCH" "C" "5" "" "Lw" "0.35" ""2 C' X- }9 o7 g+ L( _5 U4 i; H
"M" "COT" "C" "2" "" "Lw" "2" ""( n, C4 l0 V2 A" t, y/ ~
"M" "Defpoints" "C" "7" "": W3 q: Z1 K" P6 O# O+ Z( f
"M" "0" "C" "3" "" "Lw" "0.5" ""
! y9 i& y* P1 s! e+ [0 f$ g; "M" "1" "C" "1" "" "Lw" "0.5" ""1 x( c( a6 ?" T* F
; "M" "2" "C" "31" "" "Lw" "0.5" "" c4 s6 U2 _5 q! B0 S/ T3 G# k
; "M" "3" "C" "8" "" "Lw" "0.35" ""
1 o" U. [1 W; e( z; "M" "4" "C" "4" "" "Lw" "0.8" ""
" l2 t8 n) l! k) Y5 }9 D; "M" "6" "C" "6" "" "Lw" "0.35" ""! r; z8 a: }2 k0 D" X
; "M" "7" "C" "7" "" "Lw" "0.4" ""
# t0 O5 s; o9 w }: W7 J( w; "M" "8" "C" "8" "" "Lw" "0.35" ""2 F0 D" C$ J; F& `
"M" "DAY-DIEN" "C" "3" "" "Lw" "0.5" "", z3 s# Y1 _% X. g1 i4 r
"M" "DUONGBAO" "C" "7" "" "Lw" "1" ""
6 ?' U4 ]+ e; R8 `: A" |7 Z- x; "M" "KE" "C" "8" "" "Lw" "0.3" ""
4 F: i8 P* F0 f+ I W9 v; "M" "KT" "C" "9" "" "Lw" "0.35" ""4 `" H, ~- a! @, K' l2 g
"M" "NETDAM" "C" "4" "" "Lw" "1" "") h: ?& U& M9 y' n, l8 h
"M" "NETTHAY" "C" "255" "" "Lw" "0.7" ""
2 R- w. B4 F+ z: k, M "M" "NETMANH" "C" "43" "" "Lw" "0.5" "") @6 i% g4 V5 _: e% O9 o
"M" "ThietBiDIEN" "C" "2" "" "Lw" "0.8" ""
% d4 M$ A0 n0 _8 a+ t "M" "TEXT" "C" "7" "" "Lw" "1.58" ""
/ o6 Y& ^. ~' @0 P& V" ~9 j "M" "TEXTTXT" "C" "7" "" "Lw" "0.5" ""
" l% ~; _/ V) ^% A3 c "M" "TEXTVN" "C" "60" "" "Lw" "0.4" ""6 K; Z) P4 m" G3 x: U; ^" x
"M" "TEXTVNi" "C" "60" "" "Lw" "0.4" ""
7 J; ?1 J0 H# H/ R- u- l/ a) p' w. A "M" "THEPDAI" "C" "3" "" "Lw" "0.7" ""
; a; V) L. J/ o) H- q8 P3 G& G "M" "THEPDOC" "C" "2" "" "Lw" "1.58" "") `7 B& q+ b, {/ r j& s( ^* H7 Z
"M" "CUA" "C" "6" "" "Lw" "0.5" ""- @' v; o+ l# l1 X- Y F8 q
"M" "CUAMATDUNG" "C" "6" "" "Lw" "0.5" ""( _2 G9 r! F/ E6 A5 |1 ?: \9 z
9 Z1 A1 |0 a3 _! Y4 Q' f7 v) ^;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] ===NUOC===
" j# C% U* r9 G0 H: I9 b2 \! Q+ C& ?, H. a0 w
"M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.5" ""
' {) |& y5 j$ Q6 v/ B! U "M" "4-WateR_IN" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE1" ""! a1 l/ e" _+ Z
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE2" "" d! \3 A7 x, y2 @* n6 t
; "M" "250" "C" "250" "" "Lw" "0.35" ""8 \+ D: @/ p, o/ P
"M" "KHUNGTEN" "C" "4" "" "Lw" "1" ""
2 p+ D3 ?0 a$ p( p5 z$ J1 X "M" "TIMTUONG" "C" "5" "" "Lw" "0.5" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "10" )(princ)& }2 u3 H4 G& H* k7 f9 O
# e) X6 J' ]9 k( n! v;=============== DAT LAYER TEXT de xuat anh JPG [DIM] [TEXT] [GHI CHU]======
. C+ I# i7 I/ Q9 M4 ~;===================================30|04|2024==============================7 p. ~7 e$ l d* p1 V
^5 y& \" |; W" S7 V0 ^ (Command "-style" "VNi-AUCHON" "vauchon.ttf" "225" "1" "0" "n" "n" )(princ)
7 \ `$ {8 ^2 c (Command "-style" "VNi-COURI" "vcouri.ttf" "200" "1" "0" "n" "n" )(princ)
5 w: ~/ [* @7 X" D$ a (Command "-style" "VNi-COURIB" "vcourib.ttf" "200" "1" "0" "n" "n" )(princ)
( l' \) w% R2 b" R/ Q (Command "-style" "Vni-VietNam" "vn_vni,vns.shx" "0" "1" "0" "n" "n" "n" )5 W3 L: b- B9 s; @2 H1 \
(Command "-style" "Vni-ROMANS-TEXT" "vni-romans,vns.shx" "200" "1" "0" "n" "n" "n" )
9 [" j6 [$ g2 N9 D6 {: h' T (Command "-style" "COTES" "tcvn3italic,vns.shx" "0" "1" "0" "n" "n" "n" )" \! E4 d$ `0 w7 t# T) n
(Command "-style" "TRUC" "impact" "0" "1" "0" "n" "n" )
8 }9 {$ G7 b6 Q' r" B& ?# g$ q6 k (Command "-style" "VNHELVLT-Hoa" "vnhelvh,vnh.shx" "500" "1""0" "n" "n" )
) M; f, u$ V6 o( g. |# q (Command "-style" "VNHELVLT-Thuong" "vnhelv,vnh.shx" "500""1" "0" "n" "n" )( c. G, [) T" o, P6 k
(Command "-style" "STANDARD" "Cambria" "250" "1" "0" "n" "n" )
+ Z8 a- f$ ?/ h4 j& o# |/ h (Command "-style" "CAMBRIA" "Cambria" "200" "1" "0" "n" "n" )
+ v0 }. R/ h2 @2 n$ t: H (Command "-style" "GHIKH" "romant,vns.shx" "0" "1" "0" "n" "n" "n")
, ]. T( s: g4 w# W (Command "-style" "GHISH" "impact" "0" "1" "0" "n" "n" )& \/ R9 I( _8 U) ]
(Command "-style" "ROMANT-DIM" "abcroman,vns.shx" "0" "1" "0" "n" "n" "n" )7 H& K( b+ g9 K7 s: l0 I% \! Y
(Command "-style" "ROMANC-KhungTEN" "abcroman,vnh.shx" "200" "1" "0" "n" "n" "n" )
. H* {6 L; ^$ [4 K& O (Command "-style" "ROMAND-TEXT" "abcrom,vnh.shx" "200" "1" "0" "n" "n" "n")
& T. X" }" z4 n (Command "-style" "ROMANT-TEXT" "tcvn3italic,vnh.shx" "200" "1" "0" "n" "n" "n" )(princ)2 k# f" d* g8 ~0 a. S
: H& n, O" ]2 \3 r+ `0 }7 A. U;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=) a+ M; I' w% t' `' B
;===================================17|10|2024===================================! V d6 |. w7 S0 b
4 W& J! \/ D5 ~ F$ `
(Command "DIMTXSTY" "ROMANT-DIM" )(princ)
% N0 K1 d3 E5 L3 i& i (Command "DIMBLK" "Closed" )(princ)# ^+ m& ?. L M- T2 P- V( I
, V" ]3 X4 z& @" ];============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=
* M6 z5 o3 A# G( X8 O& U( ];===================================17|10|2024===================================, K0 G0 Y4 p# b! S9 c9 H" s
0 a! L1 Z W8 {' J) c' R;(Command "-units" "2" "8" "1" "8" "" "N")
& R- J! m8 K+ G3 D(Command "-plot" "Y" "" "publishtoweb jpg.pc3" "User 1 (5940.00 x 4200.00 Pixels)" "Landscape" "N" "Display" "Fit" "Center" "Y" "monochrome.ctb" "Y" "" "N" "" "N" )(princ)
5 n. \# d$ P( `. L, P- t
; b1 K5 q: q9 |: m- q0 s;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=1 J n& W+ Y( n* d3 [6 {
;===================================17|10|2024===================================
k+ J4 ^* U% `2 r; ~' F( e& G4 G: s' M: R) s! d, Y
;======== KET THUC - DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =====# }9 M5 ^% c4 m8 Z
! E. l4 f) s7 f1 z" q3 r: `;======================== DAT NET IN & TI LE BAN VE =============================1 r V8 ?; [3 }( }6 E
& ~( x j& z- B) l;=================LENH VE KHUNG TEN - Tieu Diet Lenh==================
5 a; L8 l" p0 Z;=============== DAT KHO GIAY BAN VE - KIEU KHUNG TEN ================# Y( |& |# }5 L( `
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
v# ^3 b" G! g6 J;=============================11|07|2025==============================5 [, T4 f. P, O8 s
;Ti Le Ban Ve - 1 : 100
]8 O) G2 t* n- m(Defun c:kta4 ()
' `% S* t( Q% \; j$ m- I& x/ r (setq mv_sc 100);Ti le ban ve
; S' Y% z* i/ l (setq x4 297)
2 S2 @/ k- n% l& H) y (setq y4 210)2 N0 K% N9 f1 R* z
(setq x4 (* mv_sc x4)
( f/ @; d6 U4 \0 p9 i4 {$ f y4 (* mv_sc y4) )# ]* ]/ i. N6 P. ?
(command % V; O% X+ w% p2 R
"LIMITS" "0,0" (list x4 y4)! j' q; B% |3 z; E# n* Q
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C", I+ I& m' I' \0 }! s" I
;Khung CHU NHAT Chinh & O3 Q2 D9 u3 `8 Q) T
"RECTANG" "500,500" "@28700,20000"$ W. Q8 m+ o" z( v, C* z
"RECTANG" "700,700" "@28300,19600"
( H9 i5 R7 C% A) Y% c# o;Khung Ten Chung, O% H0 i' d( G, D) i
"RECTANG" "700,700" "@8000,1250"7 ~' O1 K6 N, Z4 ?) L( e
"RECTANG" "700,700" "@17300,2500"
6 z, [; ?, ?- X. Z ~;Ten Ban Ve/ L! q# g* K# R/ p' d
"RECTANG" "18000,700" "@11000,1250"
. f' d+ |" d. p# a "RECTANG" "18000,700" "@11000,2500"
' ^1 @0 g# a% J1 x8 o9 |/ \;Khung Ti Le + Ngay Thang Nam$ s+ [4 t# Z; H \9 ?
"RECTANG" "22500,700" "@2000,2500"2 L2 X* r) ?2 ?. f7 H/ n
;Khung CHU TRI
8 ]4 \8 }8 d! d# {/ c% @- ~9 T "RECTANG" "8700,700" "@3800,2500"
: D) I3 f# O7 j"ZOOM" "_a" ))9 w' I- m- J. B+ v, L
;=====================================================================
7 J3 T: |3 O, R* Q$ Z;Ti Le Ban Ve - 1 : 100+ _. z* X/ g8 ]% q% c
(Defun c:kt4a ()4 j6 `/ u; ^* d6 @5 r3 T# h5 S3 O2 }7 G
(setq mv_sc 100);Ti le ban ve
3 i9 ^; V; J# D: j- v' l) R2 ]; Y (setq x4 297)
5 w5 r" `5 X% m (setq y4 210)9 e, G w8 g; }1 \* J
(setq x4 (* mv_sc x4)
2 i1 C6 _5 y% n5 s8 Z! k: b1 g y4 (* mv_sc y4) )
% Z. s$ C1 O- o- V1 j* H (command : d( Q, Q, L1 S% g% X
"LIMITS" "0,0" (list x4 y4)
0 H7 _" `, M0 w "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
" Z' S: \5 l8 l# r: j;Khung CHU NHAT Chinh & F/ Q$ P/ x4 }" G: D" N) [
"RECTANG" "2000,500" "@27200,20000"
- J& L4 E4 C1 w, H$ v( J "RECTANG" "2200,700" "@26800,19600"
( G# s3 t1 ^3 z. k6 a8 i;Khung Ten Chung, i, p: P# |0 a7 i, t
"RECTANG" "2200,700" "@6500,1250"( @$ A, F6 u M+ M/ e9 h5 X
"RECTANG" "2200,700" "@15800,2500"# v0 x* p7 `9 W) S6 J5 p$ ?* h
;Ten Ban Ve
7 E' I% {* k" d7 c "RECTANG" "18000,700" "@11000,1250"+ p: ^, A' n: k/ T" O6 C: k
"RECTANG" "18000,700" "@11000,2500"8 ` g7 Q+ f. v4 {+ O& o
;Khung Ti Le + Ngay Thang Nam4 l/ [/ s* O8 ^% L6 ]
"RECTANG" "22500,700" "@2000,2500"
8 U$ {) j2 n& }* ]% \" W;Khung CHU TRI8 P) _( Y' n" f8 Q% g! f
"RECTANG" "8700,700" "@3800,2500"
$ K$ ~+ O ?6 T% P* w# i2 ?" ^6 L "ZOOM" "_a" ))/ X% K( w7 g; v. _: v
6 V8 R9 _) Q8 A3 ^4 m% h& l
;=================LENH VE KHUNG TEN - Tieu Diet Lenh==================5 x9 j$ M& A4 a, I
;=============== DAT KHO GIAY BAN VE - KIEU KHUNG TEN ================
3 L+ L! P9 Z- U8 D;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================4 M: Z+ V0 U+ Q) P# J7 b) _. v
;=============================04|07|2026==============================+ C# }' D/ D( q- q4 w: |0 p
;Ti Le Ban Ve - 1 : 1002 e7 o8 M% [6 W" t1 L) k
(Defun c:za4 ()
. A u* ~5 V5 M# |& i (setq mv_sc 100);Ti le ban ve
; c. Y5 o/ W; R5 C4 o# V; T (setq x4 297)( O4 E$ M! n- I
(setq y4 210)
4 V5 ~7 K- u+ B# u% o (setq x4 (* mv_sc x4) - S/ Y/ T. u E; ^3 j3 {
y4 (* mv_sc y4) )1 [, r2 d6 i H0 l7 G: |# d7 G
(command , L* F* T- N; s, q4 ?' @% S& E
"LIMITS" "0,0" (list x4 y4)0 f' f& P3 } R1 V7 r$ I; m
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
% U# ]; h( f3 b8 o8 y+ n5 }+ j;Khung CHU NHAT Chinh
7 u& ]+ v: q6 W4 I) L+ t& R "RECTANG" "500,500" "@28700,20000"
" F/ @4 a" U5 g$ }9 w" Q& V1 [ "RECTANG" "700,700" "@28300,19600"5 n5 B/ `5 x5 }
;Ten Ban Ve
$ R: ^# ~! W6 I( [8 V- s* I/ @ "RECTANG" "24500,700" "29000,1950"1 O# N- ~3 ~6 _) u: Z3 [/ O
"RECTANG" "24500,1950" "29000,3200"
6 u3 o% m' j3 K( C1 U" o# F;Khung Ti Le + Ngay Thang Nam
" F* {! z+ `) `! s "RECTANG" "24500,3200" "26750,4450"
1 P! O- U5 X0 J( h "RECTANG" "26750,3200" "29000,4450"$ x e0 t! W7 f* h; O# W
;Khung Kiem Tra6 f1 v l- x* _/ K7 a$ B1 h
"RECTANG" "24500,4450" "29000,6325": c* Z; _' }+ n, K: a: L( E' c
;Khung Thiet Ke9 Q' W* X B: k5 _# I. ?4 `" l
"RECTANG" "24500,6325" "29000,8200"
' ?$ Z: J, q( d;Khung CHU TRI: t6 y8 f, Z% i6 i' W! T* ?6 i
"RECTANG" "24500,8200" "29000,10075"$ W+ e" Z' |* u! c
;Khung GIAM DOC. i; Y9 j1 K- n' T2 J; c
"RECTANG" "24500,10075" "29000,11950"
7 N. ?( i7 p; I* |$ l* y;Khung HANG MUC, ]5 {: d' X9 @+ R
"RECTANG" "24500,11950" "29000,14450"
8 G7 v8 Z" M! {2 Z$ T7 A# |;Khung CONG TY
m3 H. K! y% P "RECTANG" "24500,14450" "29000,16950"
( Q z7 {: V% N4 N1 N;Khung REPAIRE7 F0 j& A) m) x5 N" k
"RECTANG" "24500,16950" "29000,18125"$ M7 g- {; V7 n
"RECTANG" "24500,18125" "29000,19300"3 g# T- |6 c; v: ~: ]! K5 L1 _
"RECTANG" "24500,19300" "29000,20300"% k, C+ E" L; Y: b# `9 {6 h1 l; J* u: ]
"RECTANG" "25500,16950" "25500,20300"
5 S) `* m M, J1 k S+ P% u1 | "ZOOM" "_a" ))6 E; U4 @( e! T/ Y1 o
;=====================================================================( X+ Z5 _* j- u: G; G' k
;Ti Le Ban Ve - 1 : 100% V5 s2 V1 L& k7 F
(Defun c:zb4 ()
_6 t* V# K) m9 V5 i (setq mv_sc 100);Ti le ban ve
5 I' t- l0 s3 P+ @3 A5 ?# N7 m7 p3 Q2 U5 H (setq x4 297)
]3 B) L" u; Z- R( v (setq y4 210)
0 R0 u4 {) J9 E3 h0 r (setq x4 (* mv_sc x4)
; ~0 i7 l3 j4 @1 A4 e8 Y" x. K y4 (* mv_sc y4) )
" ^8 a5 V6 a4 l8 m (command " l3 c7 z0 A0 p7 J' Y. f$ Q) {" _- X& ~
"LIMITS" "0,0" (list x4 y4)
w9 E% U4 g2 ~ D' e& ]0 J "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
% S( r6 `/ c7 d;Khung CHU NHAT Chinh ! f X8 [/ r' o" A! p& l
"RECTANG" "2000,500" "@27200,20000"% e$ x T- y. ?( r7 c4 }1 {( W
"RECTANG" "2200,700" "@26800,19600"
0 j+ f, {; W: Z* [# ];Ten Ban Ve' W3 W4 | y( }! D' j
"RECTANG" "24500,700" "29000,1950"" C3 I1 e2 w3 G7 i$ }) E: A
"RECTANG" "24500,1950" "29000,3200"
7 r3 y/ | c# E! d- @. @$ p# d;Khung Ti Le + Ngay Thang Nam
) w4 ~0 E" |0 g. ]5 _: I' J9 G "RECTANG" "24500,3200" "26750,4450"
5 z3 F0 e, k% {* N' k3 Y& _' R$ w "RECTANG" "26750,3200" "29000,4450"
9 X/ n. P+ _0 p1 [: |0 G;Khung Kiem Tra6 r( d0 K% D7 e: `) L O
"RECTANG" "24500,4450" "29000,6325") R# B9 \" @, y. m
;Khung Thiet Ke4 ] @" E6 \8 |: i5 [& o
"RECTANG" "24500,6325" "29000,8200"4 B: K; d" w: z0 G# p/ [! \' z
;Khung CHU TRI
; W; ~1 h" t: }, R( ], l, {1 J "RECTANG" "24500,8200" "29000,10075"$ {) i" ?: c& t5 i! s' ^' C# h
;Khung GIAM DOC
! j/ F; c& _! E3 e$ a "RECTANG" "24500,10075" "29000,11950"$ X3 o+ |8 ]' l( ?! {# S5 ?1 _2 c# W6 m
;Khung HANG MUC' p( {" f5 M' e! r+ z2 n8 w7 l
"RECTANG" "24500,11950" "29000,14450"* @. h9 S1 `' ]$ Q& Q3 K9 J
;Khung CONG TY' g k* X% l: s q7 A
"RECTANG" "24500,14450" "29000,16950"9 i5 t: w/ j6 [2 |5 i7 U& G5 q
;Khung REPAIRE
n, M9 ~3 V1 o "RECTANG" "24500,16950" "29000,18125"
7 [& D# R- y2 z" Q "RECTANG" "24500,18125" "29000,19300"
2 x: u6 J% v; }, z" O" B "RECTANG" "24500,19300" "29000,20300"
$ n' ]1 G* R' z: m' k( y' Q* @ "RECTANG" "25500,16950" "25500,20300"
7 M3 t% E5 t0 p' T "ZOOM" "_a" ))! F" x: n' c# s7 B$ q" I
( x$ g+ D9 U6 u;;; ============================GHI CHU Khung Ten========================* @1 }; U" D% w8 q8 L
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========# j" x% t0 z4 W4 Y0 Q& O
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================2 X9 h& B8 R- J G; W' Z7 g* ~
;;; =======================Thuong Dung Font Romant.vnh===================. i% f- b; W* P
5 Z) M- S4 Y2 X6 {
(defun c:GhiChu (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)
; |+ H* F0 a' r* E$ _2 F (setq oer *error* *error* err2)" E% L+ J) A8 k
(PROMPT "\nChuTri. ThietKe. KiemTra. TiLe. Ngay. HangMuc. QuyMo. KieuNha. CongTrinh. KyHieu. TenBanVe. Kts. TranNgocThang. ")
u7 R) N, l9 k& m (SETQ Cpt(GETSTRING "\n(CT). (TK). (KT). (TL). (Ng). (HM). (QM). (KN). (CTr). (KH). (TBV). (Kts). (TnT). "))
5 i" u5 _5 F, k# { (IF(OR(= Cpt "QM")(= cpt "qm"))(SETQ CPT ' "Hå S¬ ThiÕt KÕ Nhµ D©n Dông quy M« :"))
0 B4 s* F( N& [6 E+ W7 Z (IF(OR(= cpt "KN")(= cpt "kn"))(SETQ CPT ' "2 TÇng 1 Tum Thang")), ]! i. ` t& }2 ]2 z$ O
(IF(OR(= cpt "CT")(= cpt "ct"))(SETQ CPT ' "Chñ Tr× :"))* z& P- E3 ? E6 V: p# I4 N* @; F+ M' _6 z
(IF(OR(= cpt "HM")(= cpt "hm"))(SETQ CPT ' "H¹ng Môc :"))
: l. {3 W; s$ Q, e (IF(OR(= cpt "CTr")(= cpt "ctr"))(SETQ CPT ' "Nhµ ë Gia §×nh - Nhµ LiÒn KÒ"))
" a% t& n6 j& l, E8 D w* ?9 A- m. B$ p (IF(OR(= cpt "TK")(= cpt "tk"))(SETQ CPT ' "ThiÕt KÕ :"))
0 H3 p. A, S" K; Q4 Q( Z (IF(OR(= cpt "KT")(= cpt "kt"))(SETQ CPT ' "KiÓm Tra :"))
1 H$ C5 N0 D6 j2 o' I y' p (IF(OR(= cpt "TL")(= cpt "tl"))(SETQ CPT ' "TØ LÖ :"))
; y" b$ E7 |/ t+ j- i# A$ l$ ` (IF(OR(= cpt "KH")(= cpt "kh"))(SETQ CPT ' "Ký HiÖu :")): I) s' W3 ]. H; k: h. \
(IF(OR(= cpt "TBV")(= cpt "tbv"))(SETQ CPT ' "Tªn B¶n VÏ :"))
" b$ Q8 K2 t0 f' q (IF(OR(= cpt "Ng")(= cpt "ng"))(SETQ CPT ' "Ngµy :"))
- H% j" @" ?$ i. C2 v0 w4 z (IF(OR(= cpt "Kts")(= cpt "kts"))(SETQ CPT ' "Kts. TrÇn Ngäc Th¾ng"))) ~; x# `5 u ~; \ f4 s9 Y
(IF(OR(= cpt "TnT")(= cpt "tnt"))(SETQ CPT ' "TrÇn Ngäc Th¾ng"))
7 R) O9 I. Y# x* m$ F (setq pta (getpoint2 _2 [! n. f2 Q+ d
"\nPick first corner. : "))
) S7 C2 p h5 t3 v; s. d9 W1 x (setq ptb (getcorner pta
( B) ?' I# F1 \ "\nPick second corner. : "))
! `2 M* ~& O1 q4 D; o (setq ptc (list (car ptb)(cadr pta))), Y% q5 `( G7 a, F$ H! ~2 n
(setq ptd (list (car pta)(cadr ptb)))
) ~* V1 S- G6 e$ J7 Z' {7 N/ [ (setq ang (angle pta ptb)). D) L4 g' K) o3 l3 W( x
(setq d1 (/(distance pta ptb) 2))
3 l1 m$ v; Q* A# v3 I/ r( h (setq cp (polar pta (- ang (dtr 0)) d1))2 n6 y! ?* T2 N" J8 I6 {' \: x5 v
(setq X (distance pta ptc))
1 g2 M( K1 Y$ l0 @+ P0 _) S (setq Y (distance pta ptd))
) V9 L4 `5 l% H9 q3 ^ (setq X1 (rtos x 2 1))
: b5 t, Q0 D( d (setq Y1 (rtos y 2 1))
" |! _ i$ x& L! J (setq rmsz (strcat "(" X1 " x " Y1 ")"))
' w; z6 ?+ M c9 B. F: c9 T+ g (command "TEXT" "c" cp "0" CPT "text" "" rmsz))# T5 H" i9 y1 ~# n1 C+ S' b
(defun dtr (angg)
& t& _) F+ j0 u- Q5 b1 b# H# M (* pi (/ angg 180.0)))
9 t( W% R' [3 j8 A# L+ \ Y+ O- K4 B+ \ J
;;; ============================GHI CHU Khung Ten========================
# e( x& ^, r# ^+ j L9 Z4 \8 g/ a! m;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
g/ G( R% J* D5 i;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================
1 g2 k) S l/ `3 t+ l7 z# d;;; =======================Thuong Dung Font Romant.vnh===================
% A6 \* V5 J, s3 ~3 J6 ?. @) Y# q* j1 r% ^; H( S R
(defun c:iit (/ pt str pta ptb ptc ptd X Y X1 Y1 rmsz pl1)
: E0 ]5 v, b/ B$ [ (setq oer *error* *error* err2)
, n! U" z+ k/ }1 ^+ u7 D0 y (if (not h_text) (setq h_text 250)) ; Kích thuoc chu mac dinh là 2.5
3 ]/ ?, x* D' r7 i! R4 i8 F( [/ L7 N2 \
# A2 [$ S: Z7 c9 O$ |/ q) ]2 t( E (setq ht (getreal (strcat "\nNhap chieu cao chu <" (rtos h_text) ">: "))), H( _6 b' I" l' D9 J) y6 D
1 m n: t+ p5 F3 p: x) m* W
(if ht (setq h_text ht))
$ g( A2 k( d) ]& r8 v) f; B0 h# D6 J- ?# D* T6 ~
a6 {1 P f1 n/ e
(setq ang (getreal "\nNhap goc nghieng moi (do) <0>: "))
# z/ W! f9 p" n( ~# A, |: Z5 [# n0 c( _( W6 q w7 W/ x
(if (not ang) (setq ang 0.0))6 Q% B7 B Z5 k1 i$ t9 X* Z
2 l) N w- Z2 o" J, |; x
; ^+ K( {' e$ ~! D- V- ?) _1 ~1 W& Z3 M9 |. I
(setq pta (getpoint* q, g" r7 j- U8 d, V3 p5 A* b
"\nPick first corner. : ")) _: c! P9 h. I# I* W* H
(setq pt (getcorner pta+ |$ o* l- q& S5 x0 c
"\nPick second corner. : "))
% C3 E* o: A- l5 [7 C/ W/ E% J; Z. \" n6 ?0 _9 a
; s. h& J T O7 e5 Z) X (command "TEXT" "j" "M" "4700,2575" "0" (SETQ pt ' "Hå S¬ ThiÕt KÕ Nhµ D©n Dông Quy M«") ) (princ)
# ?; X# O( [. [5 F% I$ ^' c4 F2 z* K2 X* c
(command "TEXT" "j" "M" "4700,1325" "0" (SETQ pt ' "2 TÇng 1 Tum Thang") ) (princ)9 W1 a7 {# Z9 G' r' I. w; H1 W
$ |- F% G( k2 a1 ^- D0 c
(command "TEXT" "j" "M" "10600,2850" "0" (SETQ pt ' "Chñ Tr× :") ) (princ)
. v! S2 E8 b' u* C
6 d! s; k; `* V8 [- j (command "TEXT" "j" "M" "10600,1100" "0" (SETQ pt ' "TrÇn Ngäc Th¾ng") ) (princ); a8 F: B7 N% _+ B1 I
4 l: n6 F; i: h (command "TEXT" "j" "M" "15250,2575" "0" (SETQ pt ' "H¹ng Môc :") ) (princ)9 t" d) x" M1 ^8 e. q2 @
. y2 |" X6 z" G
(command "TEXT" "j" "M" "15250,1950" "0" (SETQ pt ' "Nhµ ë Gia §×nh . Nhµ LiÒn KÒ") ) (princ)
# d; i) ]+ E7 L5 o
3 m; y7 ^9 a$ U/ u0 U! U (command "TEXT" "j" "M" "15250,1100" "0" (SETQ pt ' "Tel : 09.76.89.12.94") ) (princ)' R7 \7 E: w! W) J4 b J5 g# I4 [
3 P8 f* d8 z0 q. G% z m; L" i (command "TEXT" "j" "M" "20250,2850" "0" (SETQ pt ' "ThiÕt KÕ :") ) (princ)
1 n/ ] ]9 n+ y4 `+ J
7 K) m1 _/ P8 u f" L5 W# X (command "TEXT" "j" "M" "20250,2300" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)/ T2 f5 ]( k! {6 g6 R0 _" ?! p
( D _; K% x4 `# d6 `* c- i( k
(command "TEXT" "j" "M" "20250,1600" "0" (SETQ pt ' "KiÓm Tra :") ) (princ)
. f P0 g! ?0 a0 j; P; w" f c6 `8 T! O- o# n" t" c1 @9 B7 K) h" X
(command "TEXT" "j" "M" "20250,1100" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)" d( V/ i/ h* q
w. K' w7 b% ?* K% V
(command "TEXT" "j" "M" "23500,2850" "0" (SETQ pt ' "TØ LÖ :") ) (princ)' [% K p5 f) @/ d& O* \) U" S
; N; C) Q d% j; B& `$ ~7 e (command "TEXT" "j" "M" "23500,2300" "0" (SETQ pt ' "1:75") ) (princ)/ L2 w4 o2 _3 a0 t( H
! V$ W8 L0 [, C/ o" M0 M (command "TEXT" "j" "M" "23500,1600" "0" (SETQ pt ' "Ngµy :") ) (princ) r! q U; m/ ]8 D: j4 R% C
2 ]0 G# C6 c8 D (command "TEXT" "j" "M" "23500,1100" "0" (SETQ pt ' "2026.07.02") ) (princ)4 B1 H$ n4 ~; j
: Y# R+ h N# K1 ?
(command "TEXT" "j" "M" "26750,2850" "0" (SETQ pt ' "Tªn B¶n VÏ :") ) (princ)- V+ Y& J% p5 T- b; q1 ?) }7 e- v
0 r& h+ o( s: r3 z/ C% x4 U, q
(command "TEXT" "j" "M" "26750,2300" "0" (SETQ pt ' "MÆt B»ng TÇng 1 + 2") ) (princ)# E3 t2 k! [& V0 m- q$ _
. a1 S1 l- |/ g$ t+ J. j( h
(command "TEXT" "j" "M" "26750,1600" "0" (SETQ pt ' "Ký HiÖu :") ) (princ)) b5 i' @8 _% s6 X8 N! x
2 v: N9 n9 H( z( f9 ^1 ^
(command "TEXT" "j" "M" "26750,1100" "0" (SETQ pt ' "KT-01") ) (princ)
0 V% s9 A. |; o. E( _, E1 Y
2 b8 r, {4 }/ g (setq ptc (list (car ptb)(cadr pta)))' q5 Y2 R2 i% C8 S) q6 N8 N* A4 C
(setq ptd (list (car pta)(cadr ptb)))
8 _5 B( {1 R( o( B (setq ang (angle pta ptb)): ]. o# A- o2 D% l/ a& _' A
(setq d1 (/(distance pta ptb) 2))
' G7 L% h+ ^8 G4 |1 B0 S (setq cp (polar pta (- ang (dtr 0)) d1))
) ^0 o3 p- ^4 n. b; x0 G (setq X (distance pta ptc))& b% Q$ }% @& L
(setq Y (distance pta ptd))/ g* V" h4 s# O
(setq X1 (rtos x 2 1))
1 f7 L: X& B; U: x (setq Y1 (rtos y 2 1))
; A$ ^( n) D' _' T. P$ t6 ` (setq rmsz (strcat "(" X1 " x " Y1 ")"))9 n U% Q3 Q' |. ]' T* H
(command "TEXT" "c" cp "0" CPT "_text" "" rmsz))
8 Q8 N/ H0 v) x m8 |, U6 V (defun dtr (angg)
' \4 b5 W0 J+ e4 d (* pi (/ angg 180.0)))6 D M5 D7 `" q$ w
" P$ O, W$ U) r( ` W9 I1 Y" o
;;; ============================GHI CHU Khung Ten========================
8 e' h, Q# x6 q. ^4 v;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========0 j9 u0 K% ^; w$ `
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================
; e6 R7 C* ^5 u' \0 G; m;;; =======================Thuong Dung Font Romant.vnh===================
7 l+ w( N6 n% X3 g+ H+ U1 j) p4 v- R) c" Y* m8 Y
(defun c:ipt (/ pt str pta ptb ptc ptd X Y X1 Y1 rmsz pl1)6 I7 T3 C9 g4 x- g
(setq oer *error* *error* err2)
/ q6 M9 D9 v$ e7 u { (if (not h_text) (setq h_text 250)) ; Kích thuoc chu mac dinh là 2.54 d, a& |; V7 P; W! [
+ ]$ e" Y& S) P8 X1 c
(setq ht (getreal (strcat "\nNhap chieu cao chu <" (rtos h_text) ">: ")))# w2 |( v r: h) ]1 H% a1 z
" @" O( |6 P6 ^) h+ z) y- T
(if ht (setq h_text ht))
4 a. Q* K) x, m% @
9 K% j) S5 y) S1 }* p" H/ J f% |9 V- I9 Z* u
(setq ang (getreal "\nNhap goc nghieng moi (do) <0>: "))9 A0 d2 B1 v8 `. o
+ m- a4 g7 u! S. R! q+ o8 k6 g
(if (not ang) (setq ang 0.0))
$ J5 c0 w" e. p
$ X: z2 \* t$ E( v% d
a4 k& }8 [" j6 h- {4 E' I7 a
: D* ^/ t% l/ x' i2 q4 m (setq pta (getpoint
' @7 Y/ w4 Y0 P& V" I& Q "\nPick first corner. : "))
7 s9 b+ R6 t: z (setq pt (getcorner pta
; B/ G: Y5 N( S: F7 | "\nPick second corner. : "))3 N. F7 u( j* k$ }7 o* W
6 ^9 Z' x+ y1 q5 `& b
9 Q/ d" g$ s" L& i% O (command "TEXT" "j" "M" "5450,2575" "0" (SETQ pt ' "Hå S¬ ThiÕt KÕ Nhµ D©n Dông Quy M«") ) (princ)( g1 [* i f# b* R. @8 Y( Q: }5 R
+ i, P5 B d1 _; I
(command "TEXT" "j" "M" "5450,1325" "0" (SETQ pt ' "2 TÇng 1 Tum Thang") ) (princ)( @4 ^* U2 I$ c- Y2 a1 s
/ _. V1 d9 w/ s4 A2 W
(command "TEXT" "j" "M" "10600,2850" "0" (SETQ pt ' "Chñ Tr× :") ) (princ). I4 o- |" J& w+ R5 A* R( E
9 O' S* L/ H" O% |8 E) }- _3 f
(command "TEXT" "j" "M" "10600,1100" "0" (SETQ pt ' "TrÇn Ngäc Th¾ng") ) (princ)
/ u2 ^ J. |1 |) X/ h& ]2 O7 Q' i& `( F0 ^
(command "TEXT" "j" "M" "15250,2575" "0" (SETQ pt ' "H¹ng Môc :") ) (princ)
2 `1 g: Y/ d) {& ^& K' ]+ `
) K+ @& ]" |9 N1 X9 I i (command "TEXT" "j" "M" "15250,1950" "0" (SETQ pt ' "Nhµ ë Gia §×nh . Nhµ LiÒn KÒ") ) (princ)
/ Z# o- ~' i9 e- ?% g0 I
; d" B8 S0 J4 Z- V* L8 n (command "TEXT" "j" "M" "15250,1100" "0" (SETQ pt ' "Tel : 09.76.89.12.94") ) (princ)4 V( Y3 R6 {/ g2 I
7 O5 D& A' Q; E$ v (command "TEXT" "j" "M" "20250,2850" "0" (SETQ pt ' "ThiÕt KÕ :") ) (princ)5 y" m1 Z# ~% y2 w; ]: O
' p, u3 a+ \ j$ ?
(command "TEXT" "j" "M" "20250,2300" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)
! w8 o- x$ K8 `6 e0 u8 g' q* C4 ?$ i, \& Z7 T
(command "TEXT" "j" "M" "20250,1600" "0" (SETQ pt ' "KiÓm Tra :") ) (princ)9 D6 X( M8 n6 J/ s9 r+ l# N/ w" \
4 d; ~/ S/ l R (command "TEXT" "j" "M" "20250,1100" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)
0 x2 w' `' W3 A) Y
* h6 O: L- S5 w: a3 ~5 L (command "TEXT" "j" "M" "23500,2850" "0" (SETQ pt ' "TØ LÖ :") ) (princ)
2 e- v" v- ~: y1 w/ }/ e; n% {$ b/ a- Y
(command "TEXT" "j" "M" "23500,2300" "0" (SETQ pt ' "1:75") ) (princ)9 t O! C: Q$ u5 h% y
5 w7 @1 u7 U5 m1 ?0 Z3 Y) z& t (command "TEXT" "j" "M" "23500,1600" "0" (SETQ pt ' "Ngµy :") ) (princ)
# t" `+ [$ t$ p I$ q7 {
V" M a& l! s c+ M& k H, Z- X (command "TEXT" "j" "M" "23500,1100" "0" (SETQ pt ' "2026.07.02") ) (princ)
4 Z& g4 u$ l4 d6 l& x
9 ~8 S' W8 n: O y0 A1 p& l (command "TEXT" "j" "M" "26750,2850" "0" (SETQ pt ' "Tªn B¶n VÏ :") ) (princ)
. r& o3 B. c; m5 m' ]% @2 W% ]8 L. X4 G& s
(command "TEXT" "j" "M" "26750,2300" "0" (SETQ pt ' "MÆt B»ng TÇng 1 + 2") ) (princ), `0 p+ R8 n& b" _: l$ T/ X
G' m8 ? Z4 F9 Y& J (command "TEXT" "j" "M" "26750,1600" "0" (SETQ pt ' "Ký HiÖu :") ) (princ)
! Q* T7 M5 H7 E7 ], x' Y6 C w# K! c5 c! _8 T* k! |
(command "TEXT" "j" "M" "26750,1100" "0" (SETQ pt ' "KT-01") ) (princ)
$ ~% O S' k4 D( E; g& K3 t/ o/ {/ j% N% C
(setq ptc (list (car ptb)(cadr pta)))/ ~( A2 m6 N: r+ Q8 ^* e! L) l1 f
(setq ptd (list (car pta)(cadr ptb)))# p9 ~" n' [$ f% |3 @1 u
(setq ang (angle pta ptb))8 w" S ~# b) k, e) d( e
(setq d1 (/(distance pta ptb) 2))
( d9 {5 E. ^( C! i+ m+ o8 t (setq cp (polar pta (- ang (dtr 0)) d1))* ^( @. H0 a7 j% o# [
(setq X (distance pta ptc))
" V$ O! Q: N5 K6 _1 A" \ (setq Y (distance pta ptd))
; \) e0 q b0 j r+ i- G (setq X1 (rtos x 2 1))* a& F8 \: X3 Z% c5 ~6 L% P- A
(setq Y1 (rtos y 2 1))5 I/ V, E1 {) I) f& [
(setq rmsz (strcat "(" X1 " x " Y1 ")"))8 V1 `1 ~% t1 J2 p' r
(command "TEXT" "c" cp "0" CPT "_text" "" rmsz))
, P2 C t& P+ } (defun dtr (angg)$ ?- R* W+ V' B9 B, V# n, a
(* pi (/ angg 180.0)))3 |2 _/ q( k6 w+ a7 n: [: E' O
3 |/ k" _; b' T( X' L;;; ============================GHI CHU Khung Ten========================, j& q* H9 V7 a0 Z5 h. N
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
1 H& R; Y( `7 W5 h5 T;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================
+ n, b+ Y" _+ ^% p;;; =======================Thuong Dung Font Romant.vnh===================
* s( R2 {" X; m% m& R, l! F8 j3 n) f
(defun c:iza (/ pt str pta ptb ptc ptd X Y X1 Y1 rmsz pl1)$ O) Y t$ K1 s1 c2 S$ \* f7 b
(setq oer *error* *error* err2)
* E P# Y/ G% }4 Q. ?0 a: F, X (if (not h_text) (setq h_text 250)) ; Kích thuoc chu mac dinh là 2.5" _" P! _- c- C9 ^6 ^
$ j: k# s; ~3 Q0 f7 S8 A
(setq ht (getreal (strcat "\nNhap chieu cao chu <" (rtos h_text) ">: ")))
& H. x% A$ l! N1 L( g2 A
0 G# ~( X5 n2 v (if ht (setq h_text ht))1 i1 S0 O2 T; k( @ t0 Q& q
' O1 G2 X& d- Z: P/ C0 F8 O
5 C. U7 C4 X8 Z) N$ I, a(setq ang (getreal "\nNhap goc nghieng moi (do) <0>: ")): }4 M5 l2 E8 l! H8 S# i
5 F) m* }, m% v% |' G e
(if (not ang) (setq ang 0.0))
& F e* }# X. M7 h2 J7 k. ~+ R$ i; W# b( M' U" R
}0 `' F! x3 }" M$ y
" Z$ D4 x: Y% p8 z (setq pta (getpoint
: ?# q) v$ k/ V8 g6 _ "\nPick first corner. : "))
' ]9 t2 a/ Z: S- Q7 y- g (setq pt (getcorner pta. e% E& | p- G0 s3 Q, X
"\nPick second corner. : ")). ~. r3 F+ f( l$ c2 n4 H$ Y2 d
: U4 l/ u0 J: D5 k V
" p7 s, F0 g% q$ k# R
" T6 {; A/ g# [; a3 T (command "TEXT" "j" "M" "25000,19800" "0" (SETQ pt ' "STT") ) (princ)
. G! }6 m) D" C/ s% }, q; U( I" y" w4 W8 K9 |
(command "TEXT" "j" "M" "25000,18712.5" "0" (SETQ pt ' "1") ) (princ)6 M1 C; t" i( X! D3 a$ h, U2 O
( \' x& G6 [9 L! u4 U1 m' i- y (command "TEXT" "j" "M" "25000,17537.5" "0" (SETQ pt ' "2") ) (princ)/ }8 H& P/ y1 @1 U% l4 V
% [" g: m$ [" W" I
/ f1 Q/ Z4 |9 e
(command "TEXT" "j" "M" "27250,19800" "0" (SETQ pt ' "Ngµy Söa Hå S¬") ) (princ)
; V8 a+ I! l- b# Q7 G- J" S- Z( i4 z0 L) a& O5 `
(command "TEXT" "j" "M" "27250,18712.5" "0" (SETQ pt ' "15.05.1997") ) (princ), [9 Y/ g7 G, E# h, L( D
, P* Q' |; w" e% ^( `* L* H
(command "TEXT" "j" "M" "27250,17537.5" "0" (SETQ pt ' "04.07.2026") ) (princ); _" `4 U, @7 I$ ?9 V0 F; X2 r4 y2 c
8 x+ n9 A$ C/ m$ [+ S0 O- z8 K
: g) _- f [6 l0 p( p5 V (command "TEXT" "j" "M" "26750,16600" "0" (SETQ pt ' "C¤NG TY - Corporation") ) (princ)
) `+ I1 H' v- s6 T0 N7 K/ n# |) L+ n
(command "TEXT" "j" "M" "26750,16016" "0" (SETQ pt ' "ZENNI.S.Z.T.K") ) (princ)
2 v0 `! a3 F1 I1 s" k7 _+ i5 l7 Z" P
(command "TEXT" "j" "M" "26750,15433" "0" (SETQ pt ' "§Þa ChØ C¤NG TY") ) (princ)6 V! ~) h8 n- g# K: w
- S: o* d- \6 R7 a& }1 G9 c; X% |/ n4 F
(command "TEXT" "j" "M" "26750,14850" "0" (SETQ pt ' "§Þa ChØ : 00.00.00.00.00") ) (princ)4 L! n! s" f" o
9 O( f, q ^+ _3 v2 Q2 ?
z9 Y+ }, b; L% f' i, t& ? (command "TEXT" "j" "M" "26750,14100" "0" (SETQ pt ' "H¹ng Môc : Part Project") ) (princ)5 ?; I1 q+ T6 h$ F# }8 x( }5 W
4 n% h3 P- }: P; G3 G (command "TEXT" "j" "M" "26750,13516" "0" (SETQ pt ' "Nhµ ë Gia §×nh") ) (princ)6 r' N4 f" w ^! F9 _% Y' p" Y2 y
+ Y. W7 [. Y2 ~2 y (command "TEXT" "j" "M" "26750,12933" "0" (SETQ pt ' "Nhµ LiÒn KÒ") ) (princ)2 \* |7 L, l% Q0 |! H+ s5 A7 l& {
" S2 L* G! D, i1 m/ q7 T' `% k
(command "TEXT" "j" "M" "26750,12350" "0" (SETQ pt ' "Tel : 00.00.00.00.00") ) (princ)) p* M7 X1 a: u' h2 F4 K% b
+ F Q) ] S* W1 \
6 S. V V6 O) `5 I7 X# F
(command "TEXT" "j" "M" "26750,11600" "0" (SETQ pt ' "Gi¸m §èc : Director") ) (princ)# U( z) h/ ? }1 n
& ^/ n, v" |) a7 [7 e# W# J! N4 n (command "TEXT" "j" "M" "26750,10475" "0" (SETQ pt ' "ZENNI.S.Z.T.K") ) (princ)
: e* j) e2 n1 ?; z1 f0 Q# ^5 G7 h) y
(command "TEXT" "j" "M" "26750,9725" "0" (SETQ pt ' "Chñ Tr× : Main Project") ) (princ)
3 e4 C0 I- d: K, \% g/ V! X a \) E# P6 M1 T/ j0 N9 m
(command "TEXT" "j" "M" "26750,8600" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)
, ?! Y: r9 y, c! o ?' ^% ^
) w, v( d3 q, ?" Z& a1 V (command "TEXT" "j" "M" "26750,7850" "0" (SETQ pt ' "ThiÕt KÕ Vµ VÏ : Design") ) (princ)3 d# p: q: @1 f3 N
3 S) C h5 o& m
(command "TEXT" "j" "M" "26750,6725" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)
3 H/ J) b8 g9 y: J4 J5 @
, l, A, V G! p (command "TEXT" "j" "M" "26750,5975" "0" (SETQ pt ' "KiÓm Tra : Checking") ) (princ)
6 U; P( ~6 ^: C, A3 x2 [" b- d0 F( j3 U7 x: C6 n
(command "TEXT" "j" "M" "26750,4850" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)
# {, [6 Q! G" Q% E& a/ g9 w2 W7 G; z+ p) f6 H4 h4 s
% Q% F" ]) D2 V) y6 b- e/ T2 h: O1 ?$ ]3 \. R- U
(command "TEXT" "j" "M" "25625,4100" "0" (SETQ pt ' "TØ LÖ-Khæ") ) (princ)- z/ ~1 m, @! w* Z% [2 C" m8 ^: ~
/ ~4 L: r1 i z (command "TEXT" "j" "M" "25625,3600" "0" (SETQ pt ' "1:75 - A4") ) (princ)1 v+ e5 z' b3 S9 @% Y- @, }
" w6 C8 C% X; A4 O) m4 A# ^) ]
(command "TEXT" "j" "M" "27875,4100" "0" (SETQ pt ' "Ngµy Xong :") ) (princ)
# o2 f0 X4 y: Q% }. ~( _7 o+ h( d5 W7 j
(command "TEXT" "j" "M" "27875,3600" "0" (SETQ pt ' "2026.07.04") ) (princ)1 \' H! _8 H: ^% x9 s0 t9 C$ x
! G4 J7 }1 W1 X. M( e8 `, G
(command "TEXT" "j" "M" "26750,2850" "0" (SETQ pt ' "Tªn B¶n VÏ :") ) (princ)9 W+ s' f# g4 z0 ]( P
1 S) b9 w. s, G$ q) K (command "TEXT" "j" "M" "26750,2300" "0" (SETQ pt ' "MÆt B»ng TÇng 1 + 2") ) (princ)( Z& s* Y3 L* B, y% [# U3 y% U
0 f$ ~3 Q) ?& u2 n3 a
(command "TEXT" "j" "M" "26750,1600" "0" (SETQ pt ' "Ký HiÖu :") ) (princ)
) d- b& {9 E T3 _! r1 h
* k& L' Y3 E* G* G# j6 f (command "TEXT" "j" "M" "26750,1100" "0" (SETQ pt ' "KT-01") ) (princ)8 A0 q3 `( ~7 o( ?+ E3 b
' J& W3 i' X' d0 \) N1 K' |* C( ?
(setq ptc (list (car ptb)(cadr pta)))
) `: j' E6 j, v* t% p (setq ptd (list (car pta)(cadr ptb)))( d5 {8 D7 S0 h
(setq ang (angle pta ptb))
( A8 N4 g7 O& I% D (setq d1 (/(distance pta ptb) 2))
$ l$ h5 U/ `. I! B" x$ D' }4 x (setq cp (polar pta (- ang (dtr 0)) d1))
: D% B$ A( Y9 O# T) ]9 W; z (setq X (distance pta ptc))
* M/ V- |3 ~+ j- C$ m4 k (setq Y (distance pta ptd))' h. ?: m4 k# G1 ^0 H0 E; k
(setq X1 (rtos x 2 1))
' u$ Q6 T9 m" K8 _% b$ m, |; t$ k2 I# `7 K (setq Y1 (rtos y 2 1))9 G0 K4 t4 o% v; K- d" e
(setq rmsz (strcat "(" X1 " x " Y1 ")"))! g) P5 l" ~' J/ X' q+ i
(command "TEXT" "c" cp "0" CPT "_text" "" rmsz)) d& G3 ^. k9 k7 N
(defun dtr (angg)
; b& T) m, t; H (* pi (/ angg 180.0)))( I3 A$ m8 O+ x/ l/ s4 C
2 j. P# x2 o. ^, M" @( X" j
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
9 ?" B2 E% Y' ~% E y+ a;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================3 [+ K# ? X) S. t4 W
;;; =======================Thuong Dung Font Romant.vnh===================
5 e- h+ o5 j; X" x; |1 m! Y/ r( e2 q. }) i
(defun c:pta4 (/ pt str pta ptb ptc ptd X Y X1 Y1 rmsz pl1)
( t" n$ c# e' E+ O) M (setq oer *error* *error* err2)
/ v" |( [) ~ g1 k (if (not h_text) (setq h_text 250)) ; Kích thuoc chu mac dinh là 2.5
+ Q4 j0 C6 `1 H/ X7 G# k
' P) y; e5 r( j' k4 c A$ o% X (setq ht (getreal (strcat "\nNhap chieu cao chu <" (rtos h_text) ">: ")))# E9 N# F/ u" U; P$ H
: `$ n/ t \, j4 t (if ht (setq h_text ht))! \3 E& C5 {* I0 q( N/ A
8 C4 s8 M% D- i/ ]6 T# B% ?0 V$ s0 a5 J
(setq ang (getreal "\nNhap goc nghieng moi (do) <0>: "))
7 g: d# ]0 M! e4 m4 x/ j+ v; K" w* J l5 I; x( \6 j1 I
(if (not ang) (setq ang 0.0))
2 u3 c* m, P( z% Z9 |" }; A; [: D& w2 _# {
+ `" `1 Q+ r& }' ?7 v5 ^2 n/ j0 M: o5 g9 ?4 s% e1 _6 Q
(setq pta (getpoint
5 ? f+ X; o# K( J5 }1 ^ "\nPick first corner. : "))
4 }% k- F' R* X/ j% X! W ]. i+ Z (setq pt (getcorner pta1 [" e4 U* R8 s2 k
"\nPick second corner. : "))4 m+ p4 @# d% b1 t6 M/ Y
9 j7 n/ k% Y- G
; z. N R; v2 J8 u3 [8 S
(command "POINT" "4700,2575" ) (princ)
* d) Z! u! T2 {. F6 b& B# e5 b9 E i( i
(command "POINT" "4700,1325" ) (princ)" ]& W& d5 x1 M4 J9 P `/ B9 t
, g4 e* _) \$ r, c! {5 M) m (command "POINT" "10600,2850" ) (princ)+ k* T/ V- q0 M8 m
3 y4 W; f6 q9 Y1 s7 y; o
(command "POINT" "10600,1100" ) (princ)9 K- ]! C& m+ q7 c& F5 U# U
$ ~0 c! T' B' @2 A+ f3 D/ e
(command "POINT" "15250,2575" ) (princ)2 M& S( b: K( w
: O# q$ G6 e+ j0 e5 _ (command "POINT" "15250,1950" ) (princ)
, b/ U) X$ H |; W) G
" L/ Y/ s: v4 q) E/ _9 K8 U9 o (command "POINT" "15250,1100" ) (princ)6 z8 M3 `. q1 b0 b) k
. A- ^. \3 k: Y5 n0 J9 Y
(command "POINT" "20250,2850" ) (princ)
# x1 O+ ~7 G! q
; u# g: \/ c% Z7 L (command "POINT" "20250,2300" ) (princ)* |/ z* b0 `" N7 K4 o
2 P/ n% O9 a/ _7 \. c (command "POINT" "20250,1600" ) (princ)
+ r1 Z% q- ]3 a+ {1 r: s( j7 n+ U1 p! T3 K1 Y1 t
(command "POINT" "20250,1100" ) (princ)' Q3 q+ P0 h( h8 y; s* z1 l5 m
2 v( \7 m6 j( n" f3 f (command "POINT" "23500,2850" ) (princ)
9 h% `3 s! Y+ J; j4 X$ e% |) p( V0 ^) T& A: E# N
(command "POINT" "23500,2300" ) (princ). \: U: D* Q% [! F
, u1 _! w6 J/ g- C) X p/ {( [0 j! W (command "POINT" "23500,1600" ) (princ)4 G0 ~* p9 \6 d3 {. h1 ?
8 C0 Y3 o* g$ n! |( F
(command "POINT" "23500,1100" ) (princ)
$ i! U2 {# J% R
5 t) y" P; s" ?4 X( H (command "POINT" "26750,2850" ) (princ)
. `4 n. E2 {" d; k# U& w4 h
4 R0 O2 m' Z+ G (command "POINT" "26750,2300" ) (princ)
! W; C8 `8 }$ S" _! Y/ }1 u# e: ]
/ z1 ?1 m) I; O2 @6 i7 G( i+ d w (command "POINT" "26750,1600" ) (princ)
: |+ T; \2 m0 l% S
6 B2 Y" `9 o5 ^1 d/ a ~0 k (command "POINT" "26750,1100" ) (princ)/ b+ v* W. g/ c+ E6 O5 s q5 x
; e w9 s2 r& P4 c# C% F (setq ptc (list (car ptb)(cadr pta))). H( x; H+ r, V. D
(setq ptd (list (car pta)(cadr ptb)))
" Y% p4 U8 m. m. T2 l% D: f% z (setq ang (angle pta ptb))0 {+ k4 e' A2 ~7 r
(setq d1 (/(distance pta ptb) 2)) Z2 F1 @ a+ Q: u$ U
(setq cp (polar pta (- ang (dtr 0)) d1))8 I* V1 I3 K7 \5 J
(setq X (distance pta ptc))
2 h( t+ v4 k. @ (setq Y (distance pta ptd))# j: M2 w5 c R5 }5 B- B4 D! A
(setq X1 (rtos x 2 1))& q4 _" H2 i$ V. Q
(setq Y1 (rtos y 2 1))
/ V# p3 t7 c+ Q (setq rmsz (strcat "(" X1 " x " Y1 ")"))
: Y' o9 v. |3 v# m! @5 l (command "TEXT" "c" cp "0" CPT "_text" "" rmsz))
+ G* s2 z5 f( C6 [% l6 Z5 v (defun dtr (angg)# x6 Z k2 f- }- c
(* pi (/ angg 180.0)))# s8 y9 k5 V7 I3 \5 t# g
" _% ^) m* W0 G( U3 ]4 [
;=====================================================================4 a4 m$ H+ O5 ~$ H! T; f: M# t% H$ O% c
;====================DAT KHO GIAY BAN VE - KIEU 1=====================
2 M( `8 ^* ] p4 t7 k;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
; @0 D. a0 h5 F& f! k$ U' C/ t S3 l
5 \$ F" o- }% l: r2 }(Defun c:a6 ()
3 S' O. D6 o6 u& N: J (setq mv_sc 100);Ti le ban ve
) _3 o) b: ?' E+ z% N (setq x4 74.25)9 v Q0 n3 p- G& M; ]# e
(setq y4 52.5)' ]5 Q/ z# w; J2 C4 v! b# c% e
(setq x4 (* mv_sc x4)
L6 U$ \; b9 ~ y4 (* mv_sc y4) )
! f- t" A _- O9 G: u6 h: K: o (command
# A$ |2 {. j+ z9 o' a "LIMITS" "0,0" (list x4 y4)7 d6 J( a s. z: c) l
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
5 d; S$ z) c+ y; r' E5 Q "RECTANG" "125,125" "@7175,5000"
3 B+ D! f9 b0 @, k4 ^8 x "RECTANG" "175,175" "@7075,4900"
) E, X4 ?% p) W& B "ZOOM" "_a" ))
( p6 t5 @, c7 f;=====================================================================
$ d0 e. e. P% [2 G5 J(Defun c:a5 ()
) I' |$ N: y" P! A- E+ v7 n& H (setq mv_sc 100);Ti le ban ve* s. e0 b! G; J4 Z4 R; ~ Y3 X5 d
(setq x4 147.5)
# y/ H' p) u: t: R6 \1 E$ ^" @ (setq y4 104)+ \2 n4 T7 W& c. q4 z2 X* K a* p
(setq x4 (* mv_sc x4) 9 n8 X# z; p/ n$ G+ ?
y4 (* mv_sc y4) )( Z$ ?, a+ f, X7 F" v
(command - }0 |, v0 H, @8 f! D
"LIMITS" "0,0" (list x4 y4)* ?0 _8 A/ K" C1 o1 M
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"1 T; i- N; E" r3 ~) S
"RECTANG" "250,250" "@14350,10000"
( w# i* w8 `6 f! k' e* a3 i o1 w" _ "RECTANG" "350,350" "@14150,9800"3 [2 w+ C+ Q* a8 F+ {' |: j
"ZOOM" "_a" ))# b1 y1 Z+ n4 L
;=====================================================================# W5 T# ?. V& Z+ U9 [- ]+ f$ o6 p
(Defun c:a4 ()
% b1 j$ |. z- X- I (setq mv_sc 100);Ti le ban ve
. I1 V3 f9 I1 f9 l5 z0 z$ B0 p (setq x4 297)6 u' l s) [5 ]
(setq y4 210)% X* p; f2 c6 \4 v- ]
(setq x4 (* mv_sc x4) ' P. p7 m- @5 q' p+ S. y9 V8 _& u
y4 (* mv_sc y4) )* Y7 W; _% a( A1 C/ P, T
(command
3 y. m! I! I7 @: O% p "LIMITS" "0,0" (list x4 y4)/ x" h5 U7 l3 g2 B& a6 W5 b5 K
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
/ W1 q. j& C7 W& T) k5 t "RECTANG" "500,500" "@28700,20000"
# w1 Q+ K7 G# p+ A8 A "RECTANG" "700,700" "@28300,19600"* Z" ^7 x! X6 e$ S
"ZOOM" "_a" ))* C% [1 r1 n# n4 e: W3 Q% p1 i
;=====================================================================. `* ?" s! a$ ^( ^; w/ _
(Defun c:a3 ()
. `, U1 t/ d3 n% p% K" W+ d a (setq mv_sc 100)
5 v) u) T' k1 }$ { (setq x3 420)
; \; n& L3 D/ j y/ O5 I9 v" @ (setq y3 297)
! ~3 ^* s m2 U& f2 ` (setq x3 (* mv_sc x3) 9 R/ Z |2 G$ N8 G( j
y3 (* mv_sc y3) )) y+ X4 |2 \& x
(command
' s5 c# k. h1 Q1 b "LIMITS" "0,0" (list x3 y3)& L/ X, `3 U! m
"PLINE" "0,0" (list 0 y3) (list x3 y3) (list x3 0) "0,0" "_C"
# ^% ]" l @' Q7 L3 J/ G+ D "RECTANG" "707.14285714,707.14285714" "@40590,28285.71428571"4 U8 ]$ g2 O5 g) {+ J" b
"RECTANG" "990,990" "@40024.28571429,27720"0 J# K' O6 X0 J" F) a# S* Z
"ZOOM" "_a" ))
) E! X# G# I& O;=====================================================================
6 |$ f( E) V+ i* K4 `) `) G% e(Defun c:a2 ()
) @8 J6 c2 a* C (setq mv_sc 100)2 D: h. ^6 R. r7 _# ~/ c
(setq x2 594)
2 K( g$ X0 a, V$ u/ G' g (setq y2 420)
]0 k% h$ m4 h' m1 ^0 b (setq x2 (* mv_sc x2) . G: r+ |7 d3 T( _
y2 (* mv_sc y2) )% e4 Z, n$ U8 i" a5 g! K
(command
, Q0 ?0 I$ l0 D2 {& \ "LIMITS" "0,0" (list x2 y2)
2 \2 H( J; D, K- X "PLINE" "0,0" (list 0 y2) (list x2 y2) (list x2 0) "0,0" "_C"
- b o% g6 e9 X "RECTANG" "1000,1000" "@57400,40000"
( S9 t; J; i; m$ B2 ] "RECTANG" "1400,1400" "@56600,39200"
# E. X! ~% _- o: a/ X- C2 t5 \ "ZOOM" "_a" ))
8 q! f1 _, X2 \+ s;=====================================================================3 z3 U3 M6 b( [! d9 T: s
(Defun c:a1 ()
" s; V0 w/ u3 R1 c. \) u+ p: s (setq mv_sc 100)
4 M4 e5 |9 r: ^3 [* n, U& \ (setq x1 840)
' G0 I7 e* e# ]4 j' u8 E. G (setq y1 594)
* S- ^* y) @' F" u( U: T (setq x1 (* mv_sc x1) $ X! A# E. D, @$ y
y1 (* mv_sc y1) )# i. d- t2 N0 h7 N
(command
2 L: I! i# b7 Y& `1 q "LIMITS" "0,0" (list x1 y1) ~+ L$ e' @# f. C
"PLINE" "0,0" (list 0 y1) (list x1 y1) (list x1 0) "0,0" "_C"& {7 C) P+ u2 |1 d. b$ ~6 i3 l
"RECTANG" "1414.28571429,1414.28571429" "@81180,56571.42857143"
+ J7 m/ z9 Y) j' ? "RECTANG" "1980,1980" "@80048.57142857,55440"1 ^0 t. @! U. d9 d( z. Q- n
"ZOOM" "_a" ))
; e* e* u: H& I! m6 H6 D" l' x;=====================================================================
1 y4 C, ~, R% r/ L! a% B% a2 L( ~(Defun c:a0 (). L/ E7 ~9 q- T/ {9 x
(setq mv_sc 100); v5 M0 m/ P2 `4 ?- N) O- P! O
(setq x0 1188)7 B, @# W# h4 E$ e$ o
(setq y0 840)
1 F' W- ~( k# F: j/ t4 J% L" h (setq x0 (* mv_sc x0) & p2 n; W$ A1 C7 X3 U& ?
y0 (* mv_sc y0) ) \5 i( C* {* m3 q' J
(command
8 u" e: w1 U7 v7 `+ I0 A "LIMITS" "0,0" (list x0 y0)
" i0 H6 W% F/ I0 n; P' S "PLINE" "0,0" (list 0 y0) (list x0 y0) (list x0 0) "0,0" "_C"# K+ O* x' l9 D+ G/ L/ h
"RECTANG" "2000,2000" "@114800,80000"
) F* y( b0 V# {5 K "RECTANG" "2800,2800" "@113200,78400"% A2 R& F5 O Y( u
"ZOOM" "_a" ))
; O3 Y4 u- j- f
* M! c/ q- G5 q! R# W% [;=====================================================================
: e9 X) A- d4 L" X: H;====================DAT KHO GIAY BAN VE - KIEU 2=====================0 Z5 u6 a Y: F! H! } @
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
3 r* H4 d4 W- p% O% t5 a9 L- s# K) h9 D
(Defun c:6a ()
) E6 j* P$ i7 O- l2 U (setq mv_sc 100);Ti le ban ve* p0 m7 `( Y% f
(setq x4 74.25)3 r% T2 ]3 T D+ U
(setq y4 52.5)8 Q1 j0 d6 L& P* `8 @; M$ t
(setq x4 (* mv_sc x4)
, j! f* O# y; f' J" b# }' ] y4 (* mv_sc y4) )& ~" A+ n$ g/ O0 \" o6 s
(command ! C3 e0 _) R" N, } T1 p
"LIMITS" "0,0" (list x4 y4)
) Q+ |0 R3 G8 T& C6 z "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"2 ]$ b7 K- p Y; M2 A6 E' M
"RECTANG" "505,125" "@6800,5000"
4 D/ m! x, a) [2 A8 `0 V' t0 n "RECTANG" "555,175" "@6700,4900"- H* O; j) X: x* _6 `% G
"ZOOM" "_a" ))' U7 h" Y- e. d0 b& G' z. c+ S
;=====================================================================+ q; Q& K. V s2 D3 ^6 F
(Defun c:5a ()
- K D* U$ P; |9 O (setq mv_sc 100);Ti le ban ve; ^, W; A) r% v1 ^$ B r4 f
(setq x4 148.5)
; X9 ?& S2 y# c- T0 l9 P (setq y4 105) U8 O+ T- ]0 @9 H- ^. F
(setq x4 (* mv_sc x4) - r& F& S- _9 {! G2 P
y4 (* mv_sc y4) )! M4 T* d* k4 ]0 F
(command
6 ^. k3 g) |& y" j: _( m: R "LIMITS" "0,0" (list x4 y4)
" w, p( u: z' t- ~' n* L( k "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"3 l7 C0 f* U8 [! q- P$ F% [7 h# G3 m
"RECTANG" "1000,250" "@13600,10000"7 D. U( {3 ~! x7 W; {
"RECTANG" "1100,350" "@13400,9800"0 O$ _) \6 F0 g% `, T# [
"ZOOM" "_a" ))& w2 W0 t1 y8 H2 r) _# ~/ x9 j
;=====================================================================
/ W, p1 S' U8 T( P9 x. w' h* H(Defun c:4a ()
* a0 n$ s+ B5 B( Y! M (setq mv_sc 100);Ti le ban ve
8 Q: L! d' g' `. } (setq x4 297) s5 w; Q: h2 j- y+ M9 ?
(setq y4 210)
" _3 u5 L5 z# j2 K) H0 j (setq x4 (* mv_sc x4)
: D0 O+ P! |" I3 x5 E d* K8 j y4 (* mv_sc y4) ), _8 {; @( M& I: {) U# Q" n$ v
(command
) y2 h! v7 e& I "LIMITS" "0,0" (list x4 y4)# A4 Q- }( y, H7 u/ h5 M2 V
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"( {) r% b6 T, v- i! x; n: j
"RECTANG" "2000,500" "@27200,20000") @2 L/ }, a1 A2 {% s) ^
"RECTANG" "2200,700" "@26800,19600"
, B9 `0 I3 B# m0 S4 @* ] "ZOOM" "_a" ))4 L! d1 n. E' |7 R2 U, T
;=====================================================================
) l9 v% C# |) P7 h* y, [* o(Defun c:3a ()' J/ |% ]4 B/ J% @7 `8 q
(setq mv_sc 100)1 G! _5 m) x. u2 r Z+ i
(setq x3 420.0428571429)
4 e% z5 J( Q! `, ^9 @ (setq y3 297)
+ F: M" i8 E0 S7 f4 @* W4 ]/ T6 s4 a: x U (setq x3 (* mv_sc x3)
& {/ N! g7 m: [$ G$ z y3 (* mv_sc y3) )& ^& Z# E6 {9 C4 C
(command ! f$ Z9 A1 Z4 m& P; ?, Y* r
"LIMITS" "0,0" (list x3 y3)+ o* z% \$ m; H: ?
"PLINE" "0,0" (list 0 y3) (list x3 y3) (list x3 0) "0,0" "_C"5 }( b t: {7 c( e8 ~
"RECTANG" "2828.57142857,707.14285714" "@38468.57142857,28285.71428571"
- w4 P1 `0 e8 l' m0 x "RECTANG" "3111.42857142,989.99999999" "@37902.85714287,27720.00000001". d6 ]% J' A, _: M
"ZOOM" "_a" ))
9 G& D! m+ S. H) `;=====================================================================+ R% v% E5 x$ K$ u
(Defun c:2a ()0 h' D4 G7 k% Q4 x3 c
(setq mv_sc 100)0 c. e+ S6 |' x
(setq x2 594)& o5 e/ X; C* f3 u9 b7 P
(setq y2 420)' E4 ? c/ D: D( F0 S1 K! y
(setq x2 (* mv_sc x2) 8 S K# p0 H2 C* c
y2 (* mv_sc y2) )
( H% E5 p; F$ K$ r, K2 Q (command : _+ d0 l! a. d
"LIMITS" "0,0" (list x2 y2)
" Y- k0 Y; z; F "PLINE" "0,0" (list 0 y2) (list x2 y2) (list x2 0) "0,0" "_C"
, p) C; o; N5 k( Y- Q2 H "RECTANG" "4000,1000" "@54400,40000"* b6 E7 a' k9 R- e0 U0 S$ ~1 @" h$ b; X
"RECTANG" "4400,1400" "@53600,39200"* Z! v/ l- ^4 n4 V
"ZOOM" "_a" ))0 Y/ S T( ^* e9 h7 j9 S9 A* {! h
;=====================================================================% N" G1 |' F7 d4 M0 K
(Defun c:1a ()+ T& `- \+ f9 A( V" V5 D
(setq mv_sc 100)
5 e/ C4 _; [) s8 J% j (setq x1 840.0857142857)
' a- o' z, S, [ (setq y1 594)
. }1 I0 x3 D' L5 B1 { (setq x1 (* mv_sc x1) . m' b: C5 S% l) ~" l
y1 (* mv_sc y1) )
% K6 m% v* I! v6 P4 O (command , n1 g3 H2 x" r* b" g# q8 |
"LIMITS" "0,0" (list x1 y1)' J! C% L2 ~+ q8 H2 t
"PLINE" "0,0" (list 0 y1) (list x1 y1) (list x1 0) "0,0" "_C"
. S: f5 E- f e& k& `$ Z2 s0 j "RECTANG" "5657.14285714,1414.28571429" "@76937.14285714,56571.428571436"7 W: @$ N2 ^+ Z2 [# p, J- b
"RECTANG" "6222.85714286,1980.00000001" "@75805.71428570,55440", _" p# j; Z9 W- ~
"ZOOM" "_a" ))
7 d# [9 y4 ^) r3 K$ M4 N9 u2 j;=====================================================================
, K; R1 a3 p2 Y% j(Defun c:0a ()
" B7 q8 @/ ~* V' g (setq mv_sc 100)$ b! i6 j' N; L! D2 V
(setq x0 1188)
. O& Q2 R- ?/ S (setq y0 840)
: B& f+ O3 n& R; ~; V/ W+ N4 _ (setq x0 (* mv_sc x0)
* a _, D4 A8 [( G; X y0 (* mv_sc y0) ), P6 A% R' k( n/ M" Q
(command # |* t. p$ l' y9 x: S
"LIMITS" "0,0" (list x0 y0)
% h7 K, { [9 k& j "PLINE" "0,0" (list 0 y0) (list x0 y0) (list x0 0) "0,0" "_C"9 h" ? k* J. d# p
"RECTANG" "8000,2000" "@108800,80000"
5 A, E/ J" ]/ `" e; g "RECTANG" "8800,2800" "@107200,78400"' J/ \; N5 Q! f8 g4 z3 x& Y2 T. L
"ZOOM" "_a" ))- M, J4 \2 @2 X& G
6 {5 O) w- Z+ v* t: b: h) v+ q- r8 r;=====================================================================
/ @) Y' s- ^: `. E* n0 K- Y;==================DAT KhoGiay Theo KHO GIAY BAN VE===================
% m4 k. Z1 C q8 f! e* y;=========================== Nguoi Khac ==============================
9 @7 `' j9 y, J& u# V(defun c:khogiay (/ oldlst a b c d e f g h kho TL); N. L( h5 A# x' @# Z% p! d z
(command "undo" "be")
. z6 a' D) x8 a$ Y& v2 P% Y. y(setq oldlst (mapcar 'getvar (list "CMDECHO" "OSMODE" "cecolor")))
9 s3 F8 c; U* z3 ?# a6 b(setvar "CMDECHO" 0)- {$ o& l5 ~1 T4 O
(setq a (getpoint "\n chon diem chen :"))3 u0 H* q, @0 @) U5 B, O) x, Q, }
(if (not TL) (setq TL 1.00))0 O" A% {+ c2 ^5 E7 y8 G
(setq TL1 (getDIST (strcat "\nScale <" (rtos TL 2 2) ">:")))
8 n }2 q& l! T8 V s8 y- N+ y(if TL1 (setq TL TL1))! b* j7 T. Z* @7 q6 z; H6 i+ u: b0 L
(setvar "osmode" 0). g! X* H. X3 f
(if (not (tblsearch "layer" "Defpoints")) (Command "layer" "N" "Defpoints" ""))' l: f) x& M! G r% b* q
(initget "0 1 2 3 4")4 `8 ?: G0 E) w+ X8 e) l+ J! P1 T
(setq kho (getkword "\Kho A0 _ Kho A1 _ Kho A2 _ Kho A3 _ Kho A4 [0/1/2/3/4]? <0>:"))* o) ^6 _, l* W
(if (= kho "0")( `/ q) e- a7 y% v* F0 J) g) Z2 y
(progn4 M1 R9 h: v! R) j
(setq b (polar a 0 (* TL 1189)))( c: O X2 B/ Q2 {1 ?& R9 d
(setq c (polar b (/ pi 2) (* TL 841)))* ?0 i( Y* L9 ^. u g @
(setq d (polar a (/ pi 2) (* TL 841)))
2 A7 M# t" n- B: R* j: ?' t9 E8 i (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 12 12)))))
* N7 x# P- ~3 W+ Q1 v# |7 U- l (setq f (polar e 0 (- (* TL 1189) (* TL 24))))2 H, {3 h; T4 M6 ^7 |; H3 C( S2 O
(setq g (polar f (/ pi 2) (- (* TL 841) (* TL 24))))
3 d# l, s' J% B/ i5 | (setq h (polar e (/ pi 2) (- (* TL 841) (* TL 24))))7 w- p0 u; X$ Q J
(command "Pline" e f g h "c")
2 z& s) C5 c. o* B$ |: |% K% b) `(command "change" "last" "" "properties" "layer" "0" "")
9 e' V; j" s3 ?4 m(setvar "cecolor" "4")! e" M$ `7 J! u0 G9 N0 N
(command "Pline" a b c d "c")
" w0 V# Q2 F3 L4 M(command "change" "last" "" "properties" "layer" "defpoints" ""))) ; z' r8 y4 ^ d# G [
(if (= kho "1")
7 t! A- j& w8 `( S (progn$ d- {1 @3 F, G' V* C: {
(setq b (polar a 0 (* TL 841)))8 p. L1 s* C; n+ B f+ R" c
(setq c (polar b (/ pi 2) (* TL 594))) o5 E5 Z2 _4 L/ \ L8 R$ O6 K
(setq d (polar a (/ pi 2) (* TL 594)))
( y1 C) \& d3 J& W6 ^; S* i (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 12 12)))))( f9 @) a6 q' \2 C, x
(setq f (polar e 0 (- (* TL 841) (* TL 24))))
8 @ K, q* W B1 B- Y) |! K (setq g (polar f (/ pi 2) (- (* TL 594) (* TL 24))))1 C0 A8 F) }; _ }7 N: Y: Z
(setq h (polar e (/ pi 2) (- (* TL 594) (* TL 24))))* T4 s7 \" c4 e# j7 v
(command "Pline" e f g h "c")
. g* U) D& c5 D9 x# `5 A1 o- U(command "change" "last" "" "properties" "layer" "0" "")
0 v9 N9 ^1 T! {7 j+ c(setvar "cecolor" "4")
- y4 B& L8 w6 g6 p. q- p3 Q, J7 h (command "Pline" a b c d "c")
* _0 S+ R: h* V5 F2 e(command "change" "last" "" "properties" "layer" "defpoints" "")))
. o' ~. E; D+ N. \# K/ u) B- A (if (= kho "2")
$ D2 o6 c6 H4 L t (progn
" N: p: t; H; E (setq b (polar a 0 (* TL 594)))6 w i. b# h4 q9 @( y* [, H: Z, w
(setq c (polar b (/ pi 2) (* TL 420)))
; O4 c/ R8 F, S: e) w& l: F (setq d (polar a (/ pi 2) (* TL 420)))
* E# Z3 I* B9 I/ ~) s (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 100)))))
2 W* Q/ { M9 F# `) g4 O4 o2 L+ l (setq f (polar e 0 (- (* TL 594) (* TL 20))))
& k8 w- Z& \" q. Z: j% c- m (setq g (polar f (/ pi 2) (- (* TL 420) (* TL 20))))7 S0 B$ R- \. u3 a/ E9 ]
(setq h (polar e (/ pi 2) (- (* TL 420) (* TL 20))))& t# i# ~- _: B R3 }3 X
(command "Pline" e f g h "c") ) }% u* i- Z, U3 F
(command "change" "last" "" "properties" "layer" "0" "")
& Q4 k) X3 h1 d5 p G) `: ~- |3 S(setvar "cecolor" "4")* M# G( n G7 b' B" J( x9 E4 W
(command "Pline" a b c d "c")+ S. w* _5 }( e$ D$ h" K
(command "change" "last" "" "properties" "layer" "defpoints" ""))); ]. d- ?) i% ~* ^* f q
(if (= kho "3")+ m' ~, k, r; c0 g; C" x; @" u
(progn6 V: a! x1 `; ?
(setq b (polar a 0 (* tl 420)))
/ J( y4 V& z8 p6 S, ^9 H9 i (setq c (polar b (/ pi 2) (* TL 297))); i+ Q+ ^0 v S0 m; T, U$ J h5 s
(setq d (polar a (/ pi 2) (* TL 297)))3 m5 {- Q/ F7 `4 Y |( c
(setq e (polar a (/ pi 4) (* TL (sqrt (* 2 100)))))* m9 q b" L: s8 m: k% \- v& n/ e
(setq f (polar e 0 (- (* TL 420) (* TL 20))))
9 s; E- Z$ |7 d3 C2 g/ D# j. F) } (setq g (polar f (/ pi 2) (- (* TL 297) (* TL 20))))
; d7 f# S3 S% U$ U (setq h (polar e (/ pi 2) (- (* TL 297) (* TL 20))))
' c% s# i# E+ x(command "Pline" e f g h "c")
& Y' w. b6 w0 s' m; F (command "change" "last" "" "properties" "layer" "0" "")
! \$ I: X( u0 D' R! i) z* H(setvar "cecolor" "4")8 l, m5 f4 C. @4 J2 E
(command "Pline" a b c d "c")4 \! P- e7 w+ Y% f6 A# N7 G+ P& `
(command "change" "last" "" "properties" "layer" "defpoints" "")))
* @) e( J4 I0 f2 ]9 K (if (= kho "4")- V0 k' s0 ]# {( A; [# W
(progn
- v0 @9 L" X% H6 F. ] (setq b (polar a 0 (* TL 297)))4 n E( u6 m; k
(setq c (polar b (/ pi 2) (* TL 210)))
" x ~$ q C3 R, t- I; z( s- L (setq d (polar a (/ pi 2) (* TL 210)))
: Y1 i/ u( [2 s4 V' k G; e: } (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 81)))))! }, Y; j( u( d# k
(setq f (polar e 0 (- (* TL 297) (* TL 18))))- \5 @- b7 f# F# l: y
(setq g (polar f (/ pi 2) (- (* TL 210) (* TL 18))))
3 m$ j* _. T3 v (setq h (polar e (/ pi 2) (- (* TL 210) (* TL 18))))- }1 }# A- A$ m& q6 M7 [* ~1 L6 n
(command "Pline" e f g h "c")
- Y; O/ g- T1 s: i(command "change" "last" "" "properties" "layer" "0" ""); L2 P$ V" w7 A, V, @6 Q: h5 e' X3 u
(setvar "cecolor" "4"), [( t% \; h; ^' P( |5 L
(command "Pline" a b c d "c")
@7 }# d! a" }% K3 v+ D(command "change" "last" "" "properties" "layer" "defpoints" "")))$ T, M' m3 o2 i$ n( v
(mapcar 'setvar (list "CMDECHO" "OSMODE" "cecolor") oldlst)
% {0 j/ o- E' g& K, e& c/ i(command "undo" "e")$ {7 j5 z( P% g) x; @, `
(princ)). W$ l! L5 S4 ^% z3 @! R
;=====================================================================9 T% K; v ~ G e
;==================DAT KhoGiay Theo KHO GIAY BAN VE===================* |3 K$ _0 I) E+ z* y7 ?" P
;=====================================================================
- O8 S) u( d1 z( c2 ~! ~
" p7 R# n& p; H5 O;=====================================================================! B4 o$ F( h7 q9 ?! y8 ?
;===================DAT Ti Le Theo KHO GIAY BAN VE====================
) F' i; \7 |9 g5 B* j% {* d;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
" m+ d2 F0 @% V1 B3 }" Q/ I0 q1 S; O; u/ P; V$ O& Y2 i
(DEFUN C:SA6 () (setvar "DIMSCALE" 411.11111)0 p5 d7 Y/ {8 k- z; f
(COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.1" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "5" "", V$ M; R I3 M& f
"-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.3" "": g! \+ {4 z4 u9 B9 N" [
"M" "MANH" "C" "9" "" "Lw" "0.1" ""
8 N" B5 f8 v3 I9 T. ~& h/ A# J; _ "M" "TEXT" "C" "7" "" "Lw" "0.12" ""- H4 o+ U# v" T2 d" _' L
"M" "DIM" "C" "1" "" "Lw" "0.12" """ N* G, O* ]/ b0 x" A
"M" "THAY" "C" "7" "" "Lw" "0.2" ""
/ M5 @' M* P2 [1 y; _: c) w& ] "M" "NOITHAT" "C" "60" "" "Lw" "0.12" ""
* Y n9 m; C+ Z" C, ~: `3 d "M" "HATCH" "C" "5" "" "Lw" "0.1" ""4 v6 o+ O! W. ]' ~/ e6 J0 w8 b
"M" "COT" "C" "1" "" "Lw" "0.3" ""
! t/ y& o+ X. A" m! K( k- e5 O "M" "Defpoints" "C" "7" ""
& b& G1 U6 t: V- Y$ p "M" "0" "C" "3" "" "Lw" "0.12" ""
! L: ?6 F' u3 n B6 I; U d0 z7 ` "M" "CUA" "C" "6" "" "Lw" "0.12" ""
2 M, |5 D# m6 o g; J6 x0 b7 ] "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.12" ""
8 |/ Y/ S4 Y# D! z+ {" l "M" "DAY-DIEN" "C" "3" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"6 m3 b6 P) m* K3 ^
"M" "NETDAM" "C" "4" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"( k4 \- F' P9 z. N2 H1 L2 C
"M" "NETTHAY" "C" "255" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
( F3 a8 i1 S+ _) u" J "M" "NETMANH" "C" "43" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"$ y& J1 ^$ z; I- ~4 H( e
"M" "ThietBiDIEN" "C" "2" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
0 \) J/ c& P' ]) a "M" "TEXTTXT" "C" "7" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"
$ p1 y: K/ i5 d) r, V6 H "M" "TEXTVN" "C" "60" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"
# U$ \8 H+ x' c g* l/ l x "M" "TEXTVNi" "C" "60" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"
9 g' p/ x) Z! `' S& U "M" "THEPDAI" "C" "3" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"" e* m& g4 y% ]! V' F2 B
"M" "THEPDOC" "C" "2" "" "Lw" "1.20" "" "LT" "Continuous" "" "" "LTSCALE" "1"
3 t4 K" l% \8 n% e O' e/ t* p$ N "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"! S. x" e! ?! \7 h$ G( L
"M" "4-WateR_IN" "C" "4" "" "Lw" "0.4" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2". m! c8 P; k( e! _5 u) ]
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.4" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"
" M2 E N' ]4 |: e2 |6 f "M" "KHUNGTEN" "C" "4" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
( I, D4 ]# b* f1 n "M" "TIMTUONG" "C" "5" "" "Lw" "0.1" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "3" ""))(princ)% M& ~% | ?/ S) |9 M3 u
(DEFUN C:SA5 () (setvar "DIMSCALE" 611.11111)
) e0 C# k; v+ N (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.12" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "10" "" i- @4 Y- W" S; o
"-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.4" ""
; }7 F* T( B: E% g "M" "MANH" "C" "9" "" "Lw" "0.12" ""4 M3 n: o G2 W4 [, T( @$ G2 D
"M" "TEXT" "C" "7" "" "Lw" "0.12" "", F, K- g# h% {8 |! j* K
"M" "DIM" "C" "1" "" "Lw" "0.2" ""
5 V! h. R K. k6 ^/ R "M" "THAY" "C" "7" "" "Lw" "0.2" ""
! g Q* F1 F* `5 K+ Y "M" "NOITHAT" "C" "60" "" "Lw" "0.2" ""
7 }, D; N0 V3 j! {+ K6 u8 W "M" "HATCH" "C" "5" "" "Lw" "0.1" ""
/ k7 [; {0 M5 ^ X "M" "COT" "C" "1" "" "Lw" "0.4" "", p% ~. Z! l6 N" g. m& U
"M" "Defpoints" "C" "7" ""
( n' d$ Z5 T- C! X2 P "M" "0" "C" "3" "" "Lw" "0.2" ""
! C0 r" U: F% A! X B "M" "CUA" "C" "6" "" "Lw" "0.12" ""% U3 W' V- x2 F# r
"M" "CUA MATDUNG" "C" "6" "" "Lw" "0.12" "") b. V" v6 p" Y8 m
"M" "DAY-DIEN" "C" "3" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
- ]. g! E; H2 P. \7 s! i "M" "NETDAM" "C" "4" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
9 h4 a2 x5 {+ N) @ "M" "NETTHAY" "C" "255" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"/ m; z1 \# m# F* h( k% P
"M" "NETMANH" "C" "43" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1". s+ w7 t I0 ~3 P+ _+ b3 z, E
"M" "ThietBiDIEN" "C" "2" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
) n1 x% F) \2 i5 ~5 `5 u "M" "TEXTTXT" "C" "7" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
" D9 k& {, Q9 N( @+ I0 A0 b "M" "TEXTVN" "C" "60" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"4 t2 O9 n# i! X
"M" "TEXTVNi" "C" "60" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1" Y2 Y/ u3 S$ l2 V H2 H
"M" "THEPDAI" "C" "3" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"' P3 E2 X+ T3 y5 i
"M" "THEPDOC" "C" "2" "" "Lw" "1.40" "" "LT" "Continuous" "" "" "LTSCALE" "1"
% c) i/ m7 { a6 _7 ?" s "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"! @, ?: h% _0 a2 Q
"M" "4-WateR_IN" "C" "4" "" "Lw" "0.5" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"
) q1 x% o1 @8 p4 F "M" "4-WateR_OUT" "C" "4" "" "Lw" "0.5" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"
( j! `1 ~! X- @; ^ "M" "KHUNGTEN" "C" "4" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
" I$ b( f4 x7 X/ s "M" "TIMTUONG" "C" "5" "" "Lw" "0.15" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "5" ""))(princ)* I2 g, I# |! N) w2 `. \6 i
(DEFUN C:SA4 () (setvar "DIMSCALE" 1411.1111)
* y+ Q* O7 O& _+ U+ | (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.2" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "20" ""
! a8 P% [7 w1 H- \0 V' \' Q( \ "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.6" ""
- f: g) J3 T& ?: t" q$ V. G Z "M" "MANH" "C" "9" "" "Lw" "0.2" ""- C3 b* B: X2 ]! ]
"M" "TEXT" "C" "7" "" "Lw" "0.2" ""( P$ b( e) g' x7 K
"M" "DIM" "C" "1" "" "Lw" "0.25" "". l- h/ s2 u* T2 D
"M" "THAY" "C" "7" "" "Lw" "0.35" ""
* W- L3 j" ~9 H- K "M" "NOITHAT" "C" "60" "" "Lw" "0.25" ""' ^7 c8 q9 \% {# i+ ^
"M" "HATCH" "C" "5" "" "Lw" "0.15" ""
8 }7 p- r, C b3 a8 j$ @ "M" "COT" "C" "1" "" "Lw" "0.6" ""/ y! D' N) U# h" k5 g# i
"M" "Defpoints" "C" "7" ""
" W$ A: k+ W, L3 T y8 {% k "M" "0" "C" "3" "" "Lw" "0.25" ""
- b# f9 ?' z8 o# H9 l- I "M" "CUA" "C" "6" "" "Lw" "0.25" ""% ~5 C6 g+ c& s0 b
"M" "CUA MATDUNG" "C" "6" "" "Lw" "0.25" ""
- E {! ?7 b6 u# ?" N! p4 e "M" "DAY-DIEN" "C" "3" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"7 i+ f! t- @- Z1 |( z
"M" "NETDAM" "C" "4" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"8 | r5 V% t; _+ y& ?' r
"M" "NETTHAY" "C" "255" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
" t2 S5 e6 J) R "M" "NETMANH" "C" "43" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
8 L$ u, q3 i2 p3 v# R5 t "M" "ThietBiDIEN" "C" "2" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
; U( d! d1 H/ P. m "M" "TEXTTXT" "C" "7" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"- C/ s3 B* {9 V7 _! K k( D
"M" "TEXTVN" "C" "60" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"3 ~( ]+ ?+ K# F7 X, ] c( h
"M" "TEXTVNi" "C" "60" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"1 r2 f0 R7 X; y( A0 E. e$ X
"M" "THEPDAI" "C" "3" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
/ |; o) d8 G0 q$ H: K" N/ K "M" "THEPDOC" "C" "2" "" "Lw" "1.58" "" "LT" "Continuous" "" "" "LTSCALE" "1"
. B$ I0 _# a+ d$ [5 ^* j "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
* K& |- o$ @: Q1 w% h "M" "4-WateR_IN" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"
2 f$ V$ Z0 L8 O# r0 ] "M" "4-WateR_OUT" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"4 O+ i; Y# n |) K5 H) q
"M" "KHUNGTEN" "C" "4" "" "Lw" "1.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"
! r1 R4 w) N5 M5 }( y "M" "TIMTUONG" "C" "5" "" "Lw" "0.2" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "10" ""))(princ)
9 _! Z( i5 o( o3 K* J( Y4 R ) h P/ J" U4 {
(DEFUN C:SA3 () (setvar "DIMSCALE" 1611.1111)1 V, q# Z% @8 v' \& K( J3 i
(COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.35" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "30" ""
. k: f+ S9 i2 U+ j, W "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.7" ""
7 t1 w- Q/ I0 U- N( p "M" "MANH" "C" "9" "" "Lw" "0.25" ""
3 B9 S9 ^5 |/ e* e0 x "M" "TEXT" "C" "7" "" "Lw" "0.2" ""
* g( I: M4 `0 M7 h/ w' p "M" "DIM" "C" "1" "" "Lw" "0.35" ""; I. N8 l$ s$ X8 U& w3 g+ _5 P
"M" "THAY" "C" "7" "" "Lw" "0.4" ""
4 Q. u) t" |0 c; \! b "M" "NOITHAT" "C" "60" "" "Lw" "0.25" "" e9 e5 y7 G! Q3 ~; k4 d6 `* H
"M" "HATCH" "C" "5" "" "Lw" "0.2" "": A0 g& Y2 C, O2 N
"M" "COT" "C" "1" "" "Lw" "0.7" ""$ [+ Y+ M! g* k% V8 n8 k
"M" "Defpoints" "C" "7" ""9 b& S$ x! ~6 r( l$ |, o& R
"M" "0" "C" "3" "" "Lw" "0.25" ""
: K3 }- o2 [ m* m. ^ "M" "CUA" "C" "6" "" "Lw" "0.35" ""
, e8 i8 _# ~, w \* `/ v "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.3" ""& ], H( m0 v t+ {6 O- x2 a# l
"M" "DAY-DIEN" "C" "3" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"2 t5 q+ ^& r: o' y
"M" "NETDAM" "C" "4" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
4 ~8 P& V1 h' x: B0 A "M" "NETTHAY" "C" "255" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
6 _9 i' y7 R: z) ~) d: D M1 @ "M" "NETMANH" "C" "43" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1". B% F" n& _0 C0 n2 r
"M" "ThietBiDIEN" "C" "2" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"# n7 X; D) c# @3 B' `
"M" "TEXTTXT" "C" "7" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"$ q% J& D2 w, b4 L- ?5 w
"M" "TEXTVN" "C" "60" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
K4 W( f8 F9 Z. F* | "M" "TEXTVNi" "C" "60" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
) F7 r, d u( s; b2 n/ s. h "M" "THEPDAI" "C" "3" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
- s/ F" f' R# \; K$ b5 M. _ "M" "THEPDOC" "C" "2" "" "Lw" "1.58" "" "LT" "Continuous" "" "" "LTSCALE" "1"& u/ W% v# |# |
"M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"+ |2 F x! A- l! |! u
"M" "4-WateR_IN" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"7 C+ `* y8 x2 x5 C
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"
: S, Z" i/ k( o- n3 X% D" H+ m; U! O0 i# } "M" "KHUNGTEN" "C" "4" "" "Lw" "1.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"4 B# p7 U1 }9 X! E1 `3 `: p. u8 z
"M" "TIMTUONG" "C" "5" "" "Lw" "0.25" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "20" ""))(princ)+ h! `# e& x" c* c& N
3 w' |* G: t% y* @6 d8 w% H: D% _(DEFUN C:SA2 () (setvar "DIMSCALE" 4111.1111)
* G; A5 G: g; [ (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.35" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "45" ""
) d& d' v: c5 B/ v& i6 V "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.7" "", H. p6 i# ~5 J
"M" "MANH" "C" "9" "" "Lw" "0.25" ""
J7 D1 f/ j' G, F1 l2 w "M" "TEXT" "C" "7" "" "Lw" "0.25" ""& @/ D$ b" d c6 I$ N, |
"M" "DIM" "C" "1" "" "Lw" "0.3" ""
) U0 z4 x% c& z. f1 M) i "M" "THAY" "C" "7" "" "Lw" "0.4" ""
2 C% @- V2 `) Z( `- X1 `" r "M" "NOITHAT" "C" "60" "" "Lw" "0.3" ""
: P6 o0 X/ X Q" C# q% a3 w8 f "M" "HATCH" "C" "5" "" "Lw" "0.2" ""8 M/ g0 ^" q0 }, ?; O
"M" "COT" "C" "1" "" "Lw" "0.7" ""; G; N4 Q8 f7 C8 {. T( e$ E+ Y1 g
"M" "Defpoints" "C" "7" ""( l. @" A* e; p) ? O c
"M" "0" "C" "3" "" "Lw" "0.35" """ G Z% f8 K8 l9 L
"M" "CUA" "C" "6" "" "Lw" "0.35" ""5 |( y4 b8 O: k) H% Q2 X8 C
"M" "CUA MATDUNG" "C" "6" "" "Lw" "0.3" ""
8 s! `4 B" M5 y) {2 m3 S "M" "DAY-DIEN" "C" "3" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"; F2 f; P/ Q0 p6 H$ D% E' L# N
"M" "NETDAM" "C" "4" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"4 R9 g0 b, F- j6 G! ^' h7 i
"M" "NETTHAY" "C" "255" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"( y! [7 Z2 I- ?: l) @* }* J
"M" "NETMANH" "C" "43" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"1 g/ {7 h* C& _$ z/ T
"M" "ThietBiDIEN" "C" "2" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"4 i% E3 Q3 Y8 t) E
"M" "TEXTTXT" "C" "7" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
# v0 O/ o z2 k7 t+ H; ] "M" "TEXTVN" "C" "60" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
9 o. F# D% H2 t) L \$ t "M" "TEXTVNi" "C" "60" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"+ Z6 B3 A5 L5 J) k8 |
"M" "THEPDAI" "C" "3" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
1 H; s/ C6 O- W. p& J* ?: J "M" "THEPDOC" "C" "2" "" "Lw" "1.58" "" "LT" "Continuous" "" "" "LTSCALE" "1"+ b O7 z& m' p0 f( t" Y
"M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"- n5 r% H8 u) k8 n/ ?0 Y
"M" "4-WateR_IN" "C" "4" "" "Lw" "0.7" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"
/ p( M: e( a" { x% ]. }( r "M" "4-WateR_OUT" "C" "4" "" "Lw" "0.7" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"
: a3 m0 L. ^9 N' e "M" "KHUNGTEN" "C" "4" "" "Lw" "1.20" "" "LT" "Continuous" "" "" "LTSCALE" "1"& n! h: a% ]! G5 @ k9 Y
"M" "TIMTUONG" "C" "5" "" "Lw" "0.25" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "30" ""))(princ); O' K: k# ^+ u* A. L, ~
0 C5 c' _+ _: q(DEFUN C:SA1 () (setvar "DIMSCALE" 4411.1111)
% W/ j5 r$ t1 \/ O2 J+ O5 ~3 d (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.4" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "60" ""0 |. ~" B7 x: o& ]# E& i
"-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.85" ""7 _- m& [' W6 ^7 M4 _& v4 T: v
"M" "MANH" "C" "9" "" "Lw" "0.35" ""/ ]* S+ Y0 G; Z
"M" "TEXT" "C" "7" "" "Lw" "0.5" ""
8 V9 b' |4 Q) w "M" "DIM" "C" "1" "" "Lw" "0.35" ""
9 l1 O6 s4 `( u9 e "M" "THAY" "C" "7" "" "Lw" "0.4" ""
3 n9 j' G, J* t "M" "NOITHAT" "C" "60" "" "Lw" "0.35" ""
; x+ p. M9 b, x* R& A5 i "M" "HATCH" "C" "5" "" "Lw" "0.25" ""7 l+ P0 k! U0 `# q/ c
"M" "COT" "C" "1" "" "Lw" "0.85" ""
) i' O* I6 k2 W "M" "Defpoints" "C" "7" ""6 |( `+ M" @+ ~( i4 x" K
"M" "0" "C" "3" "" "Lw" "0.35" ""6 C) K8 ~0 w! K4 n8 q4 k
"M" "CUA" "C" "6" "" "Lw" "0.4" ""' Q* m- ^& Q1 j" i% m4 F8 ?1 h* |
"M" "CUA MATDUNG" "C" "6" "" "Lw" "0.35" ""
+ w C0 S; W3 R: N- \% g* { "M" "DAY-DIEN" "C" "3" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"8 P6 ^/ A3 Q1 ^1 m; Z2 N
"M" "NETDAM" "C" "4" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
" S* S# A3 @6 d5 |) u% R "M" "NETTHAY" "C" "255" "" "Lw" "0.9" "" "LT" "Continuous" "" "" "LTSCALE" "1"
: J' _5 U3 k* ~0 q4 ^) o9 K Q "M" "NETMANH" "C" "43" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"0 G1 K2 t& G% h7 j1 _$ ]
"M" "ThietBiDIEN" "C" "2" "" "Lw" "1.0" "" "LT" "Continuous" "" "" "LTSCALE" "1"
' H2 l3 X. W7 _9 O9 a "M" "TEXTTXT" "C" "7" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"0 C! N+ f4 U2 o4 y7 y" n
"M" "TEXTVN" "C" "60" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"9 W8 W, o& z! _/ Z) Q' T/ M: ?, f
"M" "TEXTVNi" "C" "4" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
6 j( r& M; ?& Z; ` Y "M" "THEPDAI" "C" "3" "" "Lw" "0.9" "" "LT" "Continuous" "" "" "LTSCALE" "1") C* O2 m1 V' x7 p9 i" ?% U# h
"M" "THEPDOC" "C" "2" "" "Lw" "2.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"
- A9 U. o( g' ` "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1": c4 p2 S9 q) n' W
"M" "4-WateR_IN" "C" "4" "" "Lw" "0.8" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"
4 K, l5 O* |2 z) T$ I" y3 q "M" "4-WateR_OUT" "C" "4" "" "Lw" "0.8" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"1 J5 V1 R2 S5 p7 E
"M" "KHUNGTEN" "C" "4" "" "Lw" "1.40" "" "LT" "Continuous" "" "" "LTSCALE" "1"9 i- ~- e+ Z, j
"M" "TIMTUONG" "C" "5" "" "Lw" "0.3" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "40" ""))(princ)* p3 z' s2 t" v% D1 F( J) j: n1 f
4 l" i" A. k9 _6 k2 V(DEFUN C:SA0 () (setvar "DIMSCALE" 6111.1111)
* I; H* e2 {( L5 G G (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.5" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "85" ""1 l; l: c( z1 `! H0 ~9 ?
"-LAYER" "M" "TUONG" "C" "4" "" "Lw" "1" ""
6 v: C) T. ]0 A; ^ "M" "MANH" "C" "9" "" "Lw" "0.35" ""' W; Z7 U k1 r: i8 s, t) Z
"M" "TEXT" "C" "7" "" "Lw" "0.5" ""+ D6 n% k( |' z( S8 u
"M" "DIM" "C" "1" "" "Lw" "0.35" ""
: ^" d( L! l" y0 }6 t' D* e "M" "THAY" "C" "7" "" "Lw" "0.5" ""
: }; ? i* @8 F$ R "M" "NOITHAT" "C" "60" "" "Lw" "0.4" """ L: ^: E5 f: S1 Y' i& B
"M" "HATCH" "C" "5" "" "Lw" "0.35" ""' ^* |7 [7 R$ ^; E/ Z6 P# a& B9 c9 i
"M" "COT" "C" "1" "" "Lw" "0.1" ""0 a- b! H! b. l& l0 Y# y) u
"M" "Defpoints" "C" "7" ""
' v! G6 r4 A1 b- p! p9 O "M" "0" "C" "3" "" "Lw" "0.5" ""
% n5 Q. V$ Y6 v" q* g! g( Q "M" "CUA" "C" "6" "" "Lw" "0.5" ""- q( g* D, ~0 a# ~' [
"M" "CUA MATDUNG" "C" "6" "" "Lw" "0.4" """ m; F6 U- ^# F4 @ _% E
"M" "DAY-DIEN" "C" "3" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"& M1 S# b! F9 M' l; ?; m- u' R
"M" "NETDAM" "C" "4" "" "Lw" "1" "" "LT" "Continuous" "" "" "LTSCALE" "1"6 w! U7 K0 C1 L8 Z, e3 [
"M" "NETTHAY" "C" "255" "" "Lw" "1.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"3 u: h. Y& i6 x2 P% F) i
"M" "NETMANH" "C" "43" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
* Y7 a; G8 K" t( L$ P3 n5 J1 W6 j/ D "M" "ThietBiDIEN" "C" "2" "" "Lw" "1.20" "" "LT" "Continuous" "" "" "LTSCALE" "1"7 f7 Z) s# X: i
"M" "TEXTTXT" "C" "7" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"1 G3 S9 O s4 _% | x( k ?- v
"M" "TEXTVN" "C" "60" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
- J h, S" h9 }6 t; q "M" "TEXTVNi" "C" "60" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1") U. B: H0 [9 y( R; L
"M" "THEPDAI" "C" "3" "" "Lw" "1.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"
% s4 F0 Z+ L& K "M" "THEPDOC" "C" "2" "" "Lw" "2.11" "" "LT" "Continuous" "" "" "LTSCALE" "1"
6 V6 G# @: y: N% |/ v/ x/ X( G "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"0 T k v) \- S) Z5 a% D% W" }
"M" "4-WateR_IN" "C" "4" "" "Lw" "0.9" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"7 W* l' K' @/ y! ^1 ]% x& k
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.9" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"
9 {. r4 Q+ W# N, B "M" "KHUNGTEN" "C" "4" "" "Lw" "1.40" "" "LT" "Continuous" "" "" "LTSCALE" "1"% I) h+ D3 `2 a) f
"M" "TIMTUONG" "C" "5" "" "Lw" "0.35" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "55" ""))(princ)$ i9 _& f$ M9 h h7 }, m
(DEFUN C:O () (COMMAND "OFFSET"))
4 _$ v) m7 c' G: S. X; w(defun c:s1 () (command "surftab1"))5 Z# j2 |* X7 K# A
(defun c:s2 () (command "surftab2"))
- B1 L0 ]6 x1 w(defun c:ep () (command "explode"))
; C ~, R/ p% F$ K(DEFUN C S () (COMMAND "AUDIT" "Y" "purge" "all" "*" "N" "QSAVE"))
: Q- j8 J7 V8 E$ v4 Y4 S7 i" o* c(DEFUN C V () (COMMAND "QSAVE"))6 z. G3 E% R1 R- L M
(DEFUN C:S () (COMMAND "STRETCH" "C"))- _. ~- V3 W6 G
0 m f/ \1 R& H3 ^- [+ @
;************************** CAT DIM **************************, U4 ]6 @0 p" M1 b3 A
/ S) w: t4 O, V- }+ T
(DEFUN C C (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI PT13I PT14I
) C. E, O/ W* o/ d, w- ^ PT13N PT14N O13 O14 N13 N14 OSM OLDERR PT10 PT11)
( a0 ~. L4 t) G! D) \ x(SETQ CMD (GETVAR "CMDECHO"))+ Z- W7 u# | b9 w2 r- T- _
(SETQ OSM (GETVAR "OSMODE"))( o) y C" M+ j& Y( K" t
(SETQ OLDERR *error*
0 E' G, |/ x' u3 b3 \# G *error* myerror)
- n' c1 e/ a" z6 @; i( x(PRINC "Please select dimension object!")1 ~% _# Q; p6 s
(SETQ SS (SSGET))' e2 @8 n5 p$ c( `6 }
(SETVAR "CMDECHO" 0)
( W$ @9 v! r6 x7 W4 V9 O1 n' w(SETQ PT (GETPOINT "Point to trim or extend:"))8 p8 e, ~! ~6 a! @' @1 q, v/ V
(SETQ PT (TRANS PT 1 0))
4 A! Q( }. O4 C8 x5 @5 N# @(COMMAND "UCS" "W")
1 @: F: Y! ?# a9 q. k(SETQ LTH (SSLENGTH SS))
- L' R' _0 }/ W, P. \(SETQ DEM 0)4 r. C) u2 X9 s. {% c
(WHILE (< DEM LTH)
- x1 T" E& G8 _6 g( E+ v (PROGN
6 R5 S1 n4 Z; N, d1 }# \ (SETQ DS (ENTGET (SSNAME SS DEM)))
& s. l2 }/ Y8 ]; K1 t, c* X% Z3 F (SETQ KDL (CDR (ASSOC 0 DS)))! N( f' f1 W$ w" C, t' N
(IF (= "DIMENSION" KDL)
7 B M8 W7 J$ j0 }7 d5 F (PROGN# S# c7 l* L+ Z0 E
(SETQ PT10 (CDR (ASSOC 10 DS))), F6 V& B: L- N* Z; b% ^, v
(SETQ PT11 (CDR (ASSOC 11 DS))); @* A: f. {4 k V7 K
(SETQ PT13 (CDR (ASSOC 13 DS)))' |- i' u" v7 g" E* G, W) N$ {
(SETQ PT14 (CDR (ASSOC 14 DS)))9 H0 S" W; \. G( p* x8 b
(SETQ N70 (CDR (ASSOC 70 DS)))
4 k0 L! b9 R1 s4 N! Y (IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))7 a9 ~+ Q; N7 q+ p) f# R
(PROGN
5 z" ?6 x6 Z% O9 U (SETQ GOCY (ANGLE PT10 PT14))6 [8 U5 Q0 C3 F) n
(SETQ GOCX (+ GOCY (/ PI 2)))
0 _, |4 D$ _1 x/ h )
2 g$ J; V# P" x- h- } )
* C. |3 [9 m7 t9 ~ (SETVAR "OSMODE" 0), S. U: @/ k! S7 b$ s \, ?0 y3 u
(SETQ PTI (POLAR PT GOCX 2))+ @" g* z: i0 ?+ F9 R+ \! G
(SETQ PT13I (POLAR PT13 GOCY 2))
+ n) O! C: ]. x. V (SETQ PT14I (POLAR PT14 GOCY 2))
/ w ~! k) z/ ]# a; [6 Z `, i& `; n (SETQ PT13N (INTERS PT PTI PT13 PT13I NIL))& \+ J* y( t+ M7 v, _2 ^
(SETQ PT14N (INTERS PT PTI PT14 PT14I NIL))- }3 b0 d! V7 \$ e! V% [8 a: c
(SETQ O13 (ASSOC 13 DS))
# e: }2 M! `. o h# c# n2 A# }" x (SETQ O14 (ASSOC 14 DS))
F! c2 }7 q4 Q7 ]- J( ^4 g/ [ (SETQ N13 (CONS 13 PT13N))
2 G6 c3 \8 U0 Q2 M& g- v$ l- } (SETQ N14 (CONS 14 PT14N))8 R( P+ D. n9 `" W8 v1 i
(SETQ DS (SUBST N13 O13 DS))& S0 D, l+ I/ [6 C0 ?, N
(SETQ DS (SUBST N14 O14 DS))
5 s+ j+ }) L0 _0 f6 R. V. r (ENTMOD DS)
! r% w. p5 y- Y# o; P9 b" s )
x% g/ x1 w: s )
2 v/ c" V$ G* K# ^ (SETQ DEM (+ DEM 1))
% c7 N. \2 w; }' _ y( _8 R8 { )
- |% G( _! J* D6 F)6 q4 A w2 y8 z- n. m) l
(COMMAND "UCS" "P")
5 E' k# E; R" ]" s! _* X& K(SETVAR "CMDECHO" CMD)
! w( V7 N1 e1 u2 J5 @( S5 O3 Q3 c5 a(SETVAR "OSMODE" OSM)6 v3 O1 j) V# e1 s# v
(setq *error* OLDERR) ; Restore old *error* handler
0 ^- B3 I# Q& i5 f- N% _(PRINC)
8 M" {7 g( y2 z# L5 f)8 d3 w; P" N( B
: W/ h7 e# F9 y/ p2 c& q
(DEFUN C:BD (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI
) y- ^( ] D3 o9 ~ PT10 PT10I PT10N O10 N10 PT11 PT11N O11 N11 KC OSM OLDERR)" q/ W0 b% K+ L& G& b) Z' W! H" E1 Z' F
(SETQ CMD (GETVAR "CMDECHO")), i2 J% |4 ~. O! i
(SETQ OSM (GETVAR "OSMODE"))
9 e$ H" }7 e$ O(SETQ OLDERR *error*3 E5 c! j. ~: P' H5 V7 X
*error* myerror)) t5 O2 ~9 p& L/ R9 X( p
(PRINC "Please select dimension object!")& n, y5 e/ }! _
(SETQ SS (SSGET))) `5 f8 I% }; z+ F) F
(SETVAR "CMDECHO" 0)
3 ?* |" n2 O1 g(SETQ PT (GETPOINT "Point to trim or extend:"))9 y, W& e* y! \/ u" u
(SETQ PT (TRANS PT 1 0))7 h8 B& [; q$ @ g) T
(COMMAND "UCS" "W")& ]7 q& h! A: s3 ]
(SETQ LTH (SSLENGTH SS))! O! ]; l+ ^; c6 P4 e; L! c8 X
(SETQ DEM 0)! X9 Q3 a7 g& e/ q
(WHILE (< DEM LTH)0 C! V3 t8 S( S' F6 w' f
(PROGN0 ]: h3 N7 r! a5 b5 h0 _) v
(SETQ DS (ENTGET (SSNAME SS DEM)))9 u# t" a9 N* B0 n K
(SETQ KDL (CDR (ASSOC 0 DS)))
6 \8 N4 a2 f9 J4 p. u% Q (IF (= "DIMENSION" KDL)3 I ` e) N v# W
(PROGN q2 W/ P q% o; z1 G0 O
(SETQ PT13 (CDR (ASSOC 13 DS)))5 m2 c p J4 b+ x9 Q: J
(SETQ PT14 (CDR (ASSOC 14 DS)))
& E( T7 b; [) A4 ?. | (SETQ PT10 (CDR (ASSOC 10 DS)))0 e2 K; x& V! p$ @, f
(SETQ PT11 (CDR (ASSOC 11 DS)))
2 T1 `: X( T/ D4 C6 Y& T (SETQ N70 (CDR (ASSOC 70 DS)))
, S- T9 H9 W! p9 F1 D+ V6 B (IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))2 N4 x3 c( ] C- T1 U1 R
(PROGN+ i7 b$ S' G! b7 U
(SETQ GOCY (ANGLE PT10 PT14))
$ L1 g' Q1 x0 a (SETQ GOCX (+ GOCY (/ PI 2)))/ S) N8 b; v; g' i* I1 [' X
)% i% k( }$ B1 e9 O' ^# E
)' i# J0 @. `( V' f' M/ s1 T
(SETVAR "OSMODE" 0)! [& K: j8 s) u9 ^$ K# L
(SETQ PTI (POLAR PT GOCX 2))
. Y" `7 [7 M1 l) [( @* f- W (SETQ PT10I (POLAR PT10 GOCY 2))
, k2 J+ h+ O" H6 D& ^. N0 }; `% ^! { (SETQ PT10N (INTERS PT PTI PT10 PT10I NIL))$ h" ~2 J1 N/ I. e# b% y/ Z
(SETQ KC (DISTANCE PT10 PT10N))
6 s1 |& D7 g5 a: e8 F* `) X (SETQ O10 (ASSOC 10 DS))
3 |/ m! L8 u, ^" t (SETQ N10 (CONS 10 PT10N))
: S, v! i! u# ]. q+ Q- \/ S (SETQ DS (SUBST N10 O10 DS))2 V0 n7 Q; `9 f# } m' P6 ~
(SETQ PT11N (POLAR PT11 (ANGLE PT10 PT10N) KC))5 A0 i( g8 k% Q @' R3 u o- u8 ?/ o
(SETQ O11 (ASSOC 11 DS)), v/ x" y' Q- T( e3 v
(SETQ N11 (CONS 11 PT11N))! t% U2 N2 C3 {) {1 K7 v$ U
(SETQ DS (SUBST N11 O11 DS))5 ~3 Q, ?- C r/ M8 R2 w0 q9 ~
(ENTMOD DS)
: i6 j( h+ l! o, q ) k' Q8 c$ Z$ Z1 Z+ L/ ~9 W6 f. s
)& q0 o- ^; Z- L8 s/ `7 h
(SETQ DEM (+ DEM 1))" G; r+ a3 v6 I) `& z. \
)
. O& u" Y$ M4 ]8 J)
; Q' |8 A! O- F; S4 _(COMMAND "UCS" "P")" Z& V) c; B4 I8 e( I
(SETVAR "CMDECHO" CMD)
* @ J* g' |; b4 |! y(SETVAR "OSMODE" OSM)
8 o+ C; a7 V/ b. T# g$ l(setq *error* OLDERR)! {% E, [$ s( G+ P3 m9 L* r# A
(PRINC)
: e; _; a5 Q2 G/ H$ v)
+ J, b- X: c7 u2 t; V8 P
' d* l! ]2 t- R0 i$ m/ \+ Q" H
9 v, J/ H! \6 I/ U;;; ================ BAT - TAT CHE DO GACH CHAN TEXT (TU) =================
9 _( w! s$ f, U+ Y, M8 W# I
& |8 f& U0 w5 N' n; B" T- b, D. K(defun c:tu () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can gach chan ")1 E) J5 W4 ~& b! r0 |9 ]
(prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")
/ }: j) h9 {( d% u% q" D/ o sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt
U, B$ X/ a1 G$ ]' w F( o |9 ?8 Y (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt)))
0 T+ R3 w7 R' y5 H4 n" O (if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%u")# o a4 Y7 m" r3 z2 c
(= testxt "%%U"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%u" txttxt)))% {3 j; E- W2 a8 i: I) V- I# I
(setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))
! D+ l1 n1 I/ @9 e (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
' v0 `3 }- d; Z3 O9 G2 g* d, U$ {; V9 \/ @2 I6 ]
;;; ================ CHEN COT (TUU) ================= J) I" @! z" J* Z% _: O7 W' ~
q& j, ?/ E% h) y( P& X(defun c:tuu () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can chen cot ")6 J! m' x) E2 _
(prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")4 |' y& O e7 S7 S5 v
sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt
2 ?4 t# U! j+ c7 b (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt))); O" z8 }2 D4 @# q }3 v
(if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%p 0,000")
! G- O; ?% N* l$ w$ Z# _* ~ (= testxt "%%P 0,000"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%P 0,000" txttxt)))
6 d$ K+ }& O( O% z# l0 |9 I* m (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))
* [5 _6 T7 V7 k& @2 m5 {. N9 v: ` (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))0 d2 o% Q) u N3 l1 f+ q! K2 W) g
0 o0 q9 ]* x9 O0 {" _;;; ================ CHEN KY HIEU THEP (TP) =================
+ g6 ] ?) V; H2 }% [7 B5 m9 L) F6 g# h$ W1 l( Z$ y! u& R
(defun c:tp () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can chen ky hieu thep ")
, ?& y( L6 O2 S" Y! I8 _' N: f (prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")0 V8 E1 c7 v( V) _
sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt
/ I9 L' A2 ~- C7 i% f- V (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt)))
8 |3 b. p' L3 {) s( N (if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%c")
c( g' f: z, d (= testxt "%%C"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%c" txttxt)))
+ t; Y+ Z/ p" d3 D7 Q. ~! ` (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))
# V! }: I, W9 Q$ x* X (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))) E" a; n* ~ t8 N) d: s
; ^$ ~% j& x2 F: d
;=========================== TAM TUONG (TAM) =================================; m0 v8 i8 g" w9 S) j4 m
! Y" d5 x& X$ E# ?- W O
(defun c:tam(/ data_m)
& x/ Q) j9 l5 A0 b1 F. G- M (defun import_data(/ i)(setq data_m (ssget))(if (= nil distan_m) (setq distan_m 110.0))# j" e0 b" T q' k
(princ "Distance (")(princ distan_m)(princ "):")(setq i (getreal ))(if (not (= nil i)): ?8 K& `) Z. Y
(setq distan_m i)))(defun process(/ ent check)(defun p_check()(setq check 0)
( s/ |/ u5 I5 D& |8 D4 J' d/ j (if (= "LINE" (cdr (assoc 0 ent))) (setq check 1))(princ))(defun p_d_offset
* f4 g5 \5 z$ `+ i! X# p6 f L! q, H (/ p1 p2 p3 p4)(defun makeline(/ e2 e5)(setq la (list (cons 0 "LINE")(cons 5 (cdr: e" t3 f$ h4 P7 B! [9 B4 q
(assoc 5 ent)))(cons 8 (cdr (assoc 8 ent)))(cons 10 p3)(cons 11 p4)))(entmake la)(princ)+ j& c$ m4 c3 Z; B, p+ l4 N
)(setq p1 (cdr (assoc 10 ent)) p2 (cdr (assoc 11 ent)))(if (not (= p1 p2)) (progn (if; V$ W: e# i/ `2 f' G5 C+ P
(< (abs (- (nth 0 p1) (nth 0 p2))) 0.000001) (progn (setq p3 (list (+ (nth 0 p1)
* p0 V) ] c! Z( e* U4 \( B distan_m) (nth 1 p1) (nth 2 p1)))(setq p4 (list (+ (nth 0 p2) distan_m)(nth 1 p2)
1 }: l/ u/ H% G* _/ V( e2 L (nth 2 p2))) (makeline) (setq p3 (list (- (nth 0 p1) distan_m) (nth 1 p1) (nth 2 p1)))" ?; @- G$ u" o, ~( [- m
(setq p4 (list (- (nth 0 p2) distan_m) (nth 1 p2) (nth 2 p2))) (makeline)))(if (</ h. e9 z4 k0 |. ?( k
(abs (- (nth 1 p1) (nth 1 p2))) 0.000001) (progn (setq p3 (list (nth 0 p1) (+ (nth 1 p1)5 t4 m7 M2 w& Q. U9 O& ~ O; I% L" u
distan_m) (nth 2 p1)))(setq p4 (list (nth 0 p2) (+ (nth 1 p2) distan_m) (nth 2 p2)))
, `7 U+ x) V/ f; {; Z/ p (makeline) (setq p3 (list (nth 0 p1) (- (nth 1 p1) distan_m) (nth 2 p1))) (setq p45 A# _) L# b+ P$ Q! w: {. E, P
(list (nth 0 p2) (- (nth 1 p2) distan_m) (nth 2 p2)))(makeline)))))(princ))(if (not! C, N5 Y$ |$ Y
(= nil data_m)) (progn (setq i 0)(while (< i (sslength data_m)) (progn(setq ent (entget
4 u, J7 i' i! F( q1 G' S1 x8 K. N6 n. C (ssname data_m i)))(p_check)(if (= 1 check) (p_d_offset))(setq i (+ i 1))))))(princ))
# W& j8 |0 M, V5 s- O e9 d$ C (import_data)(ai_undo_push)(process)(ai_undo_pop)(princ))4 r) l# O( R) A- ~. {, G# }
- E. J; a) N/ H- A+ C;============ GHI CHU PHI (T1) ================
/ M. \% h8 ^0 Z- ~# T$ }8 j J9 O/ @5 j( {
(defun c:DuongDan ()(setq D1 (getpoint " Diem thu nhat: "))(setq D2 (getpoint "Diem thu hai: " D1))+ c4 D: c& D' i. n7 \
(if (> (car D2) (car D1)) (setq D3 (polar D2 0 16)))(if (< (car D2) (car D1)) (setq D3% I5 C( v3 V' r0 P5 N
(polar D2 PI 16)))(if (= (car D2) (car D1)) (setq D3 (polar D2 0 16)))(if (> (car D2) K5 e) N8 i; @: ?: [$ p
(car D1)) (setq D4 (polar D3 0 3.2)))(if (< (car D2)(car D1))(setq D4 (polar D3 PI 3.2)
" K6 H+ b9 v' l7 T ))(if (= (car D2) (car D1)) (setq D4 (polar D3 0 3.2)))(if (> (car D2) (car D1))4 ^: E5 a1 v# A3 Z& T* _' g
(setq D5 (polar D2 (/ PI 9) 3)))(if (< (car D2) (car D1)) (setq D5 (polar D3 (/ PI 9)
2 p; x' L4 V7 x I: `0 z 3)))(if (= (car D2) (car D1)) (setq D5 (polar D2 (/ PI 9) 3)))(command "color" 1)' R1 y! c4 X$ ?2 x3 J
(command "line" D1 D2 D3 "")(command "circle" D4 "3.5")(command "color" 7 )
8 H9 q, i, t% N) O- [ (command "text" "m" D4 2.5 0 "1")(command "text" D5 2.5 0 "%%c6a150"), D' I3 \4 Y1 S
(command "ddedit" pause))2 Y" u: v5 F8 y6 s( ^: N
# F7 w1 \% T! e# N5 \
;;; ========================== Join (J) =================$ T8 F' F0 Q% E; P, k8 {* d; d4 x0 l, ]
0 I6 r& Q+ Q" ]+ n
(defun C:J () (Setvar "cmdecho" 0)(setq m:err *error* *error* *merrmsg*)(setq sset (ssget))
% a" o& \' M! d. u! S (if (null sset) (exit))(setq kt (getstring "\nJoin all (Y/N) <Y> ? "))
; t+ Q/ o! m! S& | (setq ssl (sslength sset))(setq temp (entget (ssname sset 0))etype (cdr (assoc 0 temp)
) k J* l; Z; j. H ))(cond((or (= kt "Y") (= kt "y") (= kt ""))(progn (cond((= etype "POLYLINE")+ K$ w! O& x! r1 {2 n* ]/ B
(COMMAND "PEDIT" sset "J" "all" "" ""))(if (or (= etype "LINE") (= etype "ARC"))
7 m/ R/ m8 a! a. f2 T& ] (COMMAND "PEDIT" sset "" "J" "all" "" "")))))((or (/= kt "Y") (/= kt "y") (/= kt ""))
0 c- N% a6 ^2 I( @; v# ^& ]1 J6 X (progn (cond((= etype "POLYLINE")(COMMAND "PEDIT" sset "J" sset "" ""))
- N; S9 w% f/ \6 D2 V! I- }; T (if (or (= etype "LINE") (= etype "ARC"))(COMMAND "PEDIT" sset "" "J" sset "" ""))))))+ N" a! u/ y1 i( u# _
(setq *error* m:err m:err nil)(princ))
* ^$ t, A7 R3 Z ]0 ~/ m+ {
- C/ Q2 @' g+ F/ _8 q( Q;=====================================================================
0 u: n! Y. n1 J# I" p;;; DOOR.LSP 1.0, Copyright (C) 1998 by CAD Department, HUCE./ b* r0 q2 e; D. z/ B
;=====================================================================; M E3 `3 G+ Z2 V6 g' D
2 U$ I" U5 \ ?, d c% \9 V' I
(defun C:D1 (/ p1 p2 p3 p4 side dis wid ang angsile old)
& D6 w; D4 r/ z2 e) j! }4 I$ d1 N ~ (setq old (getvar "OSMODE")) % f [' ^& U* \" f$ z( U0 O
6 D$ J! L. _, X3 L6 l- e
(setq p1 (getpoint "\nStart point:"))
8 t5 H( ~- G; F* k (setq p2 (getpoint p1 "\nEnd point:"))3 `/ c0 `4 ~) \, @
(setq side (getpoint p2 "\nOpen side"))% X! F9 O. H) J% J' T4 `, p) R
: q/ S! v2 g4 T (setq dis (distance p1 p2))0 G$ L# S& c- b& g! R y' X9 q. E# `
(setq ang (angle p1 p2))
4 w9 _7 T- o/ B+ _ (if (< ang (angle p1 side))
) U1 R2 B3 ~$ p( \ E" @ (setq angside (/ pi 2) )3 H4 T1 K& O' X- ^% n
(setq angside (- (/ pi 2))). N8 [0 c1 F3 a# A
)4 F$ T; D+ g$ V h1 b6 D7 m0 I/ _
(if (>= (- (angle p1 side) ang) pi)
! k/ M' ]( {# J! ^! y+ i4 j (setq angside (- (/ pi 2)))6 ^3 C0 S( v! L2 a
)2 k3 Y/ o. |( f$ l1 I b% u
(if (>= (- ANG (angle p1 side) ) pi)5 W7 s( N+ }4 t- Q8 j: y2 L0 p- H
(setq angside (/ pi 2))* P5 D7 T9 E6 e5 o
)
G7 s* G/ o( H) a
" }- d$ Z" ?' `! V4 S6 \& k (setq p3 (polar p2 (+ ang angside) dis) )9 J8 N* _5 g9 S" {9 u' {5 i9 V# l
(setq p4 (polar p1 (+ ang angside) dis) )
- [# ~# B9 }6 i f% A9 ? (setq wid (/ dis 15))
5 y% X4 d3 v/ w7 c" \0 j; Z( d! Z# }, m8 E: [
(setvar "OSMODE" 0)0 a4 p; z% y! B: i @
6 s- R- Q! n0 f" e% P# g" ^
(command "PLINE" p1 "A" "D" p4 p3 "L" p2
! r7 v; o- X. f (polar p2 (+ ang pi) wid)
V, C( }+ d+ i t (polar p3 (+ ang pi) wid)
; c4 h# V3 |: s* r7 e5 l8 `; I( w+ M "")
4 M* k' v: {& [
$ G" L! t, @; L' n (setvar "OSMODE" old)
* o! s0 }9 v9 {9 G' b* u' p (princ); W4 J7 p% Y3 c4 c
)
3 S2 a$ t. O! K6 n6 ~, H8 k. t1 Z- Q3 }+ z
;=====================================================================
4 k( d( l( Q8 J; h8 K% b
& E* r& v5 ]- r8 K(defun C:D2 (/ p1 p2 p3 p4 side dis wid ang angsile old)
/ ~8 A \; r' {9 D5 y( ^; ?% l (defun cua1 (pt1 pt2)
- u4 |' v# V( O# g& c/ c (setq p1 pt1
) }$ a- Y% M" z" S2 ~ p2 pt2)
2 D: F& o6 y# G4 K9 ?9 d5 b0 K, r- u" |
(setq ang (angle p1 p2))& v5 r3 j- n/ j, ^8 c( Z& s$ z
(if (< ang (angle p1 side))1 v+ a4 F9 L s8 O
(setq angside (/ pi 2) ), e. |, Y3 f+ B3 Q- I% A4 ^- L# r
(setq angside (- (/ pi 2)))+ [+ E6 U( \' m2 p8 O4 \% ?' y a
)% k+ V/ v, w9 M: p0 g3 j
(if (>= (- (angle p1 side) ang) pi)
2 R7 t9 C! @* U$ c (setq angside (- (/ pi 2)))
l+ g6 I: u, v6 y% H* [& J )
' K% {; }; p7 I; Z8 g! [ (if (>= (- ANG (angle p1 side) ) pi)
- w) g- O" V5 D' @ (setq angside (/ pi 2))2 @& i& M% c/ ?; ]! H7 `
)
/ w! @% P' o' e" N$ d( j7 c' f& ^" [& {9 D% \( F! z/ c3 C
(setq p3 (polar p2 (+ ang angside) dis) )
: y' [. A) a$ d2 {4 e+ Y5 d8 P I (setq p4 (polar p1 (+ ang angside) dis) )9 n, q* d3 r' V6 U. j
(setq wid (/ dis 15))
8 Z% ^! M8 V" m9 U
! ^! o' L i- T (command "PLINE" p1 "A" "D" p4 p3 "L" p2 3 \5 W+ M% x F
(polar p2 (+ ang pi) wid)
. X. B: `' g/ g9 x- |. \. c0 {/ s (polar p3 (+ ang pi) wid) 2 b: u9 ] n7 i% n, j
"")3 \' J7 c% T6 B' F4 y- F* v4 ?
)
8 i) J2 _- E. _! y8 h;=====================================================================5 C, |9 Y4 }% o: B% \# X: |/ Q
(setq old (getvar "OSMODE"))
; _' K, C- I' G2 d7 ]1 C) Y& {$ I$ B- J F7 |
(setq p1 (getpoint "\nStart point:"))
% t2 \# E5 [+ i2 I (setq p2 (getpoint p1 "\nEnd point:"))4 O5 j$ u9 |5 ?
(setq side (getpoint p2 "\nOpen side"))
' s8 C2 J" W* N0 q, [, z+ b; B) Z. r
(setq dis (distance p1 p2))- e$ C. a h7 e0 _& h0 t
(setq dis (/ dis 2))+ M) a. E6 o, ^; u) L
# `2 k: y) s+ e" R% V9 o (setvar "OSMODE" 0)
% { t% H# \8 |" e& Y
% Z* K! o+ l9 r- [! G, V (setq p1 (polar p1 (angle p1 p2) dis))3 x: J& l' o& {+ s a
(cua1 p1 p2) l' x3 [& q+ U+ e
& t# l: W8 j, h8 M
(setq ang (+ ang pi))& d# m3 D& U% z! h
(setq p2 (polar p1 ang dis))
: R% m$ {; h1 y' Y2 ~2 u; (setq side (polar p1 () dis))/ `2 x, V: [$ P; P8 D
(cua1 p1 p2) + ?; k6 \/ P+ Y3 `3 K$ e* \" v' V+ N
- L. x7 P( C2 l8 n! v( n
(setvar "OSMODE" old)
, L. f' e4 c1 c* a8 p$ X' U (princ)
- ] ], T9 l. t% v1 y)
0 H0 O n- ]- y0 r9 ]) i2 ^, G: F8 x1 _9 w
;=====================================================================1 m1 {/ |! R0 M0 q1 z+ n
;"Glue" text strings. All adopt first's properties.
# N7 y2 g0 r0 V; Author:+ i# {# t* \( C' s6 J$ M7 U
; Henry C. Francis
5 @, C7 M w; A: p( X; ~; 425 N. Ashe St.9 a$ x; E+ J2 a2 R
; Southern Pines, NC 28387- \% C; l) H) R9 H% \# ?7 z
; http://www.pinehurst.net/~pfrancis# x4 A: `, r" F3 K! U
; e-mail hfrancis@pinehurst.net
7 V2 s1 _, s h$ u8 j4 N I; All rights reserved.
+ r! q9 c% B$ r" ~(defun c:gst ( / ename ent1 ent2 old1 oldsl old10 old11 old40 old50 newstr newsl new1 new10 new11)
5 @& O! a7 G# J+ n# g6 E0 F R(while/ d# d1 i# J) Z- _& G/ x2 t
(not
; s, p+ `; }0 b3 v8 a5 j (and
$ c2 H/ V. n' V0 j" q (setq ename1 (car(entsel "\nSelect first text string to join: ")))! t) U& |, ]: k
(setq ent1 (entget ename1))" k; D6 M9 y2 j, T- f/ r* Y
(eq(cdr(assoc 0 ent1))"TEXT")) c0 \1 E- F' j
);and3 M4 z: c: c: s/ ?; w2 f8 o2 T
);not& _& D5 W$ i" `) m! O- ~
);while' S3 K* l, q8 l% O, J% ]
(setq old1 (cdr(assoc 1 ent1)))
3 L0 g& w$ L- d. [6 O. p(while
- J+ z) ]. G# S$ S! ^ (not5 d% n1 q) m# n4 r
(and
4 J$ a# B0 O+ l1 v: n) Y (setq ename2 (car(entsel "\nSelect second text string to join: ")))) ~1 j i7 p/ [9 v# D0 ]
(setq ent2 (entget ename2))& ]; I" V8 a; O
(eq(cdr(assoc 0 ent2))"TEXT")) B6 b/ t/ d4 s. D! S; J
(not(eq ename1 ename2))) _) Y1 M! K( o, j7 e4 {
);and/ h: b; h! d$ Z+ G: T' j2 g( k/ x
);not
$ o" Q3 k: L, Y# `( I% h2 R: i);while
8 [1 N z8 N; L9 i! ^(setq old2 (cdr(assoc 1 ent2)))) \' Z6 U2 k3 U" N3 m4 V2 |
(setq new1 (strcat old1 " " old2)
6 ?1 T3 u. C7 N' ~3 F% b ent1
/ r, T# R' @5 z) u+ W, k (subst (cons 1 new1)
/ E& S5 G' C1 g+ ]- L7 b7 q, ` (assoc 1 ent1)$ l3 ]( T. I$ E& q. z% V% Q e) o+ V
ent1)
! l, [- o% h$ i9 p# s);setq
- @9 t- |. V" u7 `, v! M(entmod ent1)* `! R) b+ m7 M% B( o. A
(entdel ename2)
" I( K6 H$ B! y: [8 m4 F g(princ); P& @* L m9 @2 ]( b* V/ @4 q
);defun
+ k& q+ A) ] N2 a- j9 g) A6 r7 v A, J1 G1 K/ \. P/ m, b
;=====================================================================1 q5 G9 ^/ Q6 z' h4 ^6 K
- ^% \( v. ?1 U, X3 o
(defun c:nt (/ g1 g2 ss1 olderr nterr l i temp e1 e2 new old dd dc)3 U$ o4 U) Y% Z: H
3 h" V$ h& Q8 F
(defun nterr (s): F' H! o7 J# h2 d
(command "_.UCS" "" "_.UNDO" "E")
: F3 ?% j4 Q, t (setvar "cmdecho" 1)* W; {* H, H' M
(setvar "blipmode" 0)9 d8 ]! [, q3 a7 {
(setq *error* olderr)' ] p& I. o" ~) e& s
(setq g1 nil g2 nil ss1 nil e1 nil e2 nil olderr nil
# X' E( e$ F+ b) Y( b! Z, z+ t nterr nil temp nil i nil l nil new nil old nil dd nil dc nil), s+ P, N& t, i+ a. A* H
(princ)
# U/ [$ ]2 n, f: L+ x! K" V2 J )
3 N' G% l8 R: p) e% B
6 m# I1 `$ O' l0 {( t (defun tim_in (dt / p01 p02 ktra)7 P6 F- T6 @6 x5 }4 U
(setq p01 (cdr (assoc 10 (entget dt)))). }5 \ n O9 T' J' d0 `
(setq p02 (cdr (assoc 11 (entget dt))))
: k/ g/ j, L& z1 {2 m9 i (setq ktra T)
7 J. A' @5 y7 A* V( ~ (if (and (> (car p01) (car g1)) (< (car p01) (car g2)) ) k O3 r2 |+ Y% Y
(> (cadr p01) (cadr g1)) (< (cadr p01) (cadr g2)))8 n) |$ q$ l) C- g9 W7 f
(setq ktra nil)
& X; _) X. b, L- l$ j& g2 }5 l/ w' d )
4 U. S& X. B* l# |9 p/ B* w* W# v (if (and (> (car p02) (car g1)) (< (car p02) (car g2)) ! T1 J+ K" y8 [0 G$ g- y
(> (cadr p02) (cadr g1)) (< (cadr p02) (cadr g2)))
$ ]2 ^0 y+ P) j2 T% c, g (setq ktra nil)
6 z! `2 U c( }0 w8 B )( D3 K h0 S) G
ktra+ _8 ^, y/ |6 `- D# l5 T; ?
)
! i! Z: Q0 x$ x) B3 l$ b
! b" h3 l% ~! g( g8 w (defun timdt (dt1 dt2 / p01 p02)
0 P0 F& k# O6 E% r+ c (setq p01 (cdr (assoc 10 (entget dt2))))
# D3 f" N; y; F0 Y# Q) Y- G7 ` (setq p02 (cdr (assoc 11 (entget dt2))))
5 m8 b, J; R! Y5 _ (setvar "ucsicon" 0)
2 v7 L3 J' L: e* }* f (command "_.UCS" "E" dt1)' S: s+ ~8 D$ z9 S2 Q- f
(setq p01 (trans p01 0 1))( ~/ }; H; O% \# O# _, ~) D
(setq p02 (trans p02 0 1))5 \6 t; j( ~/ [, R: E9 z H+ s
(command "_.UCS" "")2 x: e0 i2 F9 c3 B% q! c+ e
(setvar "ucsicon" 1)
0 A8 W% M) `5 z8 m- h (if (and (equal (cadr p01) 0 0.001) (equal (cadr p02) 0 0.001))) c& q- X" m. J! p. q
T/ V" m# ^2 S: _0 c& r9 B% l
nil3 H6 I: O2 d5 f9 H/ G
): `# i" b; o% a+ p/ b
)5 M; ^/ q/ r1 `: N$ M+ x- ?
) i1 N) G1 c- M3 f (defun tim_out (dt / p01 p02 kt)
1 s0 ~6 h- b; I# g, L9 Y3 h$ I4 i (setq p01 (cdr (assoc 10 (entget dt))))
. J+ Z: F7 N/ E/ d& Y* E (setq p02 (cdr (assoc 11 (entget dt))))
+ e1 Z9 U2 f' e: o5 e (if (and (> (car p01) (car g1)) (< (car p01) (car g2)) 9 d9 {- t* o1 \& d
(> (cadr p01) (cadr g1)) (< (cadr p01) (cadr g2)))
" l4 I9 L' V- C7 G. u (setq kt p02)
/ q- G+ h1 n) o! G9 L7 b )
* J r2 f' B! z2 e6 i g (if (and (> (car p02) (car g1)) (< (car p02) (car g2)) 8 L; g% E/ @. ?* M9 ~# a0 h" z
(> (cadr p02) (cadr g1)) (< (cadr p02) (cadr g2)))
5 L/ Y' J, g$ b& T: h+ T/ I, `9 _4 f (setq kt p01)
; x& n9 e5 U) g; n2 c; | ), g! S6 N7 g4 H) F" u% b- F
kt
; i+ Q" x5 I6 ?* m )
* G# f' ?3 {; r( u
' j7 L: ~4 N) @- B( ]! K m (setvar "cmdecho" 0)
& J& n ^; z7 K: I! N (setq olderr *error* *error* nterr)' C: q H6 M; y' T; {& {' q& k
(command "_.UNDO" "G" "_.UCS" "")
" S! p' \/ j& U3 ~. | (while (null ss1)1 S% v9 G1 ]( w% _, v# R
(princ "\nChon tuong muon noi...")/ ?# ^$ B, V, r9 g
(initget 1)
3 ?+ n8 F% L0 G3 N (setq g1 (getpoint "\n>Goc thu nhat:"))
/ G7 ~2 p) V% r: G (initget (+ 1 32))
}2 f+ A) i8 K( ^3 {3 j/ q) s (setq g2 (getcorner g1 "\n>Goc thu hai:"))0 ?: G0 M- n! Q- v# Y
(setq ss1 (ssget "c" g1 g2 '((0 . "LINE"))))$ j; r! L# V4 [3 ^4 o
(if (null ss1) (princ "\nKhong tim thay doi tuong!")) U0 i" [# Z1 c7 I# I
)
8 B% }& E: s9 q( @4 V- w* S* b7 ^1 U& G2 V
(setq temp (list (min (car g1) (car g2)) (min (cadr g1) (cadr g2)))
+ w; l% i2 ~7 [9 w2 |' g g2 (list (max (car g1) (car g2)) (max (cadr g1) (cadr g2)))# j2 z/ b6 l% \" S3 k" W
g1 temp)" C& [" |0 B5 D9 i/ Z0 j( J, j
(setq ss1 (ssget "w" g1 g2))
: u& Z Y2 Y6 H' `, h' D (if ss1 (command "_.ERASE" ss1 ""))
4 f& x! B8 r5 }0 t (setq ss1 (ssget "c" g1 g2 '((0 . "LINE"))))% O) ]* g* Y& M( @$ t6 r
' i7 F! F( B0 t# W# U! [+ S (setvar "blipmode" 0)
) B3 ^0 A5 {( T( R (setq i 0 l (sslength ss1))
# G! l, k) D( U6 S) b& d, n6 K0 r1 ^0 C (while (< i l)0 D; ]9 ~2 c. P
(if (tim_in (ssname ss1 i)). i' U$ F& |+ C& O5 B
(progn
1 ?7 j k7 k# }8 a% G (ssdel (ssname ss1 i) ss1)
1 p, L: c* J6 G" S! @, F8 L* R% _* G% e (setq i 0 l (1- l))
# d/ o: H+ p/ ~/ P) c ) : h4 }1 i: L+ q0 h% n8 @# m1 p
(setq i (1+ i))
# H; v! n! Z1 l/ c3 o( K. Y/ T% t' Z/ p ), T; C# n7 A) R# n
)2 j$ \8 z; z' c
(setq l (sslength ss1))
1 Q: b6 n; l3 U- m- [: A (while (>= l 2)
% n0 r w, j: r: {: ^- [; P (setq e1 (ssname ss1 0))
$ k# Q0 I0 s$ X v. a$ k (ssdel e1 ss1): d) T" n8 T U* M# Z( i
(setq e2 nil i 0 l (sslength ss1))
: D7 U( k1 c& Q2 \6 l (while (< i l)
8 a5 z+ k4 G% j z (if (timdt e1 (ssname ss1 i))
6 J3 O5 `6 A& F5 p5 r (progn
9 `4 H% o3 ?6 e& Y: T! ` (setq e2 (ssname ss1 i))
+ r0 \4 c. M$ v# y* ^ (setq dd (tim_out e1)) O( {8 z5 l$ R% Q
(setq dc (tim_out e2))
+ w! F- w: R( R' |% H) L )
2 h; a1 I$ [% ]8 n( b )
& M: [# b9 c! R, \% O8 A1 u (setq i (1+ i))
& i8 ^0 c; [, ]' F5 E' k6 j )
) h0 _, `( X# Z1 y+ q (if e2 (progn
9 S! r& R9 T# q9 Q (ssdel e2 ss1) / \1 U' h+ A ?
(command "_.ERASE" e2 "")
; Q% B1 y' E6 K/ e n8 i (setq temp (entget e1))" Z7 `( T/ _- I: ~3 Y0 y4 k
(setq old (assoc 10 temp))$ h, z/ J( T. \
(setq new (cons 10 dd))
9 ?& X$ u( m, Y! w1 G) O1 D2 z' K: v (setq temp (subst new old temp))! x; t. [( x0 X2 [
(entmod temp)5 m9 x3 o. b6 H) M% n
(setq temp (entget e1))8 `1 c+ w& @2 O/ I
(setq old (assoc 11 temp)); m) A, W5 Q- C; f4 J' r' G2 |
(setq new (cons 11 dc))+ e, b% y3 B* {1 |! j+ j5 p
(setq temp (subst new old temp))
. Y% \0 N3 X1 y, @ U) d7 T: G (entmod temp)
8 t" l/ |1 N# }+ @' z+ ]' [ (redraw e1)
# S/ o6 O# p1 ?0 N. b: D' [/ B. l (setq l (sslength ss1))
1 A8 X. b9 s: P+ F8 y* A )3 U5 b- Y" `! Y/ ?+ E; F8 t
)# k! B. K/ E& `! j6 ]) @. f
)
4 r/ s( q _2 t! I0 G- J
9 S$ c& I# Y P$ C$ {+ J& z (command "_.UCS" "" "_.UNDO" "E")" o8 b$ ?! @( \: s/ ]
(setvar "cmdecho" 1)5 T& g3 p4 p* b6 L9 ]( k3 [3 J: o
(setvar "blipmode" 0)
3 `( ~6 s5 `* D! z6 r1 D6 M4 X (setq *error* olderr)* o3 n9 K7 [) ?& ~, n3 L: x, V5 M' R
(princ)
p) a- C5 t2 x& q: o# y9 E)
+ i4 C( M' k/ h) Z;*********************************************************************
# Z/ B3 W& I" ]1 c$ g3 ?(defun ketthuc ()
! G) n( M% H; n, P (setvar "cmdecho" luuecho)
! E0 ^3 T% `2 v1 A- ?* X (setq *error* luu* r. B5 b* s9 |
luu nil ' W8 M& I( Z3 B+ @' T- p+ l2 d
luuecho nil4 ~/ C$ G& D# [3 ~
);setq" N7 J! y1 D: o# Z6 n; n
(princ)
4 J$ @0 o5 w) G4 B9 X) 1 S9 _, @1 t& o! j* R* ?/ b
;*********************************************************************
. u; Y2 S/ K( J% N. @9 ](defun modau (): B7 G4 d2 ]& `1 D$ L8 G
(setq luu *error- e; N% K( a; v# U8 s2 u ^9 G
luuecho (getvar "cmdecho")
; ^+ t' ^& |$ \6 k *error (ketthuc)
) X/ u4 w2 A( `! j: U, w1 v)
0 T, G8 n8 D) t; H, O5 H' R1 L)$ k0 \1 L6 W& \& o
;*********************************************************************4 ^7 R. r) Y' ^+ h6 W! s6 n4 ^
(defun xulytext (text / kytu ma sokt luusokt lui )
1 K# N4 h& G O. t) C( V* U! L(setq kytu (substr text (strlen text)); Y7 R% G7 W6 H7 W' U ~8 \, }" i
ma (ascii kytu)
0 X* N$ D1 J9 l0 }- m sokt (read kytu) C5 s- @0 s3 g h9 t
lui 1
4 f! @) x- D/ |; o* b x)
$ Z" B2 O" u G8 F: O" ~(if (numberp sokt)
' O! M, \3 H0 F+ f# _: \/ A0 S (progn7 x7 t. j# D" p0 \( f/ t
(setq luusokt (1+ sokt)): c" W: w' x$ E
(if (and (numberp sokt) ; Q0 t! | q& s$ W( u( k/ C# v! R
(> (strlen text) 1)- ^& I. v% u o; Q3 J
)
8 L$ B, ?. R) G# i0 S (progn' z: ], y; I0 m* V* R' f8 V' c7 v
(setq kytu (substr text (1- (strlen text)))- z e9 m" {; { V* y
sokt (read kytu) # v9 k! v8 F! [- H
)! `: v$ T7 D; r8 n
(if (numberp sokt)
3 @0 e' c7 q+ t6 W3 f% `0 w, D (setq luusokt (1+ sokt)
6 B% Q" O( L6 l4 K: a2 B lui 2
+ ~( x4 V1 d* D% ], M4 f! l) Y# b* L2 d7 t% B
)
: {; i0 r6 W' }' [ )
4 k, @3 Y- R+ c7 B) p$ n3 ] );progn 2 d- ]1 q& @* F) Z& a" r/ F
)" p$ f- F9 y- G* e
(if (= luusokt 100) (setq luusokt 0))
: r: X( w8 r) M" L" i% c (setq kytu (rtos luusokt 2 0)9 P: x. y2 _# W( V6 C: L
) c- U( _% N5 N1 h text (strcat (substr text 1 (- (strlen text) lui)) kytu)
$ {* K3 H1 Q0 A: t* V4 }! I )
; ^5 f$ L7 p2 _7 s" V0 H3 w );progn + X# j) m% V" r P& |
(if (or (= kytu "z")9 d- r$ u6 q8 [2 u! Q4 T3 |
(= kytu "Z")
$ c0 v" U/ O5 @& |- ]# ]. `; R+ R# e# q )8 `7 ~# N' w* I4 H! J
(setq text (strcat text "0")# F$ S( n: q' s" h2 z
textxl "0"
# r5 y' j |3 H )2 v6 ]6 P# X$ u' X3 j+ D3 L' V
(setq ma (1+ ma)8 o& M( r) j$ V/ @( M7 j) d
text (strcat (substr text 1 (1- (strlen text))) (chr ma))$ Q3 {4 m- K" z- D8 P* _$ _6 T
)5 Y6 |: y" F. G
);if
4 q; u$ Z3 {, @; H4 i U2 N9 m3 H);if4 L" h8 C& J' d
)
v. h5 z) t4 B4 }* h7 Y;*********************************************************************4 s: f+ U8 R0 e1 m
(defun doitext(tendoituong / chuoi doituong thoat tam dsach kieu text vitri10 vitri11 dem canle)
7 C9 z/ z4 [) h1 G% _3 l;Neu doi tuong la text thi tiep tuc
6 ^% q7 w: x( _- N(setq doituong (entget tendoituong)
2 o7 Z/ \) [4 T2 Q% W kieu (cdr (assoc 0 doituong))# ~+ [$ Y6 P6 `) B1 R& t% M
canle (cdr (assoc 72 doituong))" S/ c4 y* {6 d8 ~$ ^! J, s( a; r
)
* j. z& j7 c n& L6 A& U(if (or (= kieu "TEXT"), a. ?2 F' h: l8 g% k/ V( d4 ]
(= kieu "MTEXT") / ?" g6 e1 q( O/ `4 A# j: ?8 Q
)
8 q$ o; [& J. k (progn7 T3 A! h; F5 Y J* B6 A# V; F
(setq textxl (xulytext textxl)2 X, X- x9 ?: h8 V
text (cons 1 textxl)9 ]/ d7 N; w8 _% x& y
vitri10 (cdr (assoc 10 doituong))8 V8 O! j( u6 Q3 t; `3 M
vitri10 (list (+ (car vitri10) (car vitrilech)) (+ (nth 1 vitri10) (nth 1 vitrilech)))+ n$ ?1 Q. K' r9 ~
vitri10 (cons 10 vitri10)
R" Z q1 `) [3 h" @2 _ vitri11 (cdr (assoc 11 doituong))- w7 s, B W0 W+ T2 ~
vitri11 (list (+ (car vitri11) (car vitrilech)) (+ (nth 1 vitri11) (nth 1 vitrilech)))- f: N# t0 z+ j- B3 _8 y
vitri11 (cons 11 vitri11)5 c* `5 b B6 r! T9 q
dem 0
4 o, _% I4 K% R6 y5 [0 ~ dsach nil1 [( G1 ^4 R D
)
. V9 E" J- h6 n( |3 Y0 \! W (foreach tam doituong
2 t- M3 Q4 H- I! P& {% x6 r0 C (cond
/ |) s% z8 K& Y6 h9 n ((= (car tam) 1) (setq dsach (append dsach (list text))))# i) g( }$ H* t/ X& j$ y8 [
((= (car tam) 10) (setq dsach (append dsach (list vitri10))))
8 i# K, J) k- F# i- _" P! [, O ((= (car tam) 11) (setq dsach (append dsach (list vitri11))))
2 ~4 z$ i: c7 F/ B H( K4 H ((setq dsach (append dsach (list tam))))
" L' o8 J6 }7 _# E- z )1 g0 T3 g( s3 W0 ]! I
)/ S. w6 z) k& X- q6 | G% \0 m2 ~+ B3 ?1 [2 c
(entmake dsach)6 N$ P- s7 Y; T! E
);progn
5 Q4 D* a, s. q; e);if
3 Y1 }7 D0 V, }8 [# U# | );1 h6 Z" q" ^4 L
;*********************************************************************
$ J+ P( n9 W( _;sao doi tuong cu sang vi tri moi. t: C0 `& C* S$ E
+ ~3 h0 j1 D# o$ Q(defun copy_dt (tendoituong )
3 O# h8 G- q3 H. X$ j(command "copy" tendoituong "" goc toi )
$ C" G, l6 f/ [6 X( H8 M" F);defun
( ^" f, P5 Q% y, X4 q( {) ^; e. D- {0 F8 F. i$ g
;*********************************************************************, }: f+ z2 L2 g4 ]9 h, n) @
' P2 c8 P3 o1 `; X7 D Y$ G
(defun c:ct ( / cumdt dodai thoat dem ten doituong textxl dem goc toi)
1 N8 O2 l. D% ?; Khoi dau cua chuong trinh
4 T0 C* K4 |; n0 k/ v5 b(princ "\nCopy Inteligent...\n")
2 C! e+ W" u. D. N( V(setq luuecho (getvar "cmdecho")
5 b+ |5 k4 K; s$ e luu *error*
; {. b6 K$ r& S: Q/ Y1 m *error* ketthuc N( I& H! D+ U$ ~8 H
cumdt (ssget)8 Q3 G$ e" A9 l' r* A
dodai (sslength cumdt); v! {, e c' r3 F' V2 w
goc (getpoint "\nSelect base point:")) {$ C$ Z. | F
thoat nil1 A% K+ f' v% ]1 w" u" ?
dem 0. {# X0 g! g& T, h
textxl nil$ u, s4 Q# |0 S. | W: G6 ^5 H! O
);$ i" l& Q8 r, G. l N6 g6 i4 M, x
(setvar "cmdecho" 0), M! @. D6 @9 m, ~# x
; Loc ra duoc ong text de xu ly
* h' \; U! a" [( X; ?0 U- H(while (and (= thoat nil)) \' j- j6 d! j0 {& ]* y
(< dem dodai)
- r) O( `7 C/ \ )( N! o- L- s' p$ ?1 S8 }
(setq ten (ssname cumdt dem)
) N7 b7 R" V6 w3 ^7 R* e- K* g* f dem (1+ dem)
5 \) k2 B' d: A' y; `! u$ q1 q: r doituong (entget ten)+ C% T5 }: X0 W# L
kieu (cdr (assoc 0 doituong))
0 \& t0 k; B! |/ q )( E& d3 Q! [* |% j% a
3 ]- h" R1 V A5 Y (if (or (= kieu "TEXT")
% I: T% N/ ]' G( s+ q (= kieu "MTEXT") . O' V# g/ K4 y8 d% r: v, D
)9 A: O! P& z& \
(setq thoat T' G7 q; }/ e# E" ?" F" D, v
textxl (cdr (assoc 1 doituong)) : L& Y! o7 Y. M" P* c# [
)' m7 T( }% S: e1 o4 ^6 P
). s Y/ Y# N, y0 k4 W5 r' u
);1 }0 j/ v: _3 g. m
(while T
! P& V' L% j- X% K1 S(setq toi (getpoint "\nSelect next point: " goc)
6 X9 F) |" n# J2 H3 V" I vitrilech (list (- (car toi) (car goc)) (- (nth 1 toi) (nth 1 goc)))
' J) a$ w9 w: _! s0 W6 d dem 0( v: {& M) W9 t* F9 @% ?9 u4 M! G( b
)# V+ b7 g3 |. J" [& V. \
(while (< dem dodai)
8 q* a4 W+ |* I# f; } (setq ten (ssname cumdt dem)$ G$ E' [- H- `, v6 C+ `
dem (1+ dem)3 c; f, t J/ a) S- R
doituong (entget ten)+ L- X+ ^3 I' s8 ]3 N5 J2 w# |: `
kieu (cdr (assoc 0 doituong))
/ e6 u1 z! o4 m. P )
* r% g3 c E) O/ x) j* U+ w0 {& ^ c3 x. C4 P C+ O5 v' x$ ~
(if (or (= kieu "TEXT")
8 n* H8 O) k1 E& j; _/ d (= kieu "MTEXT")
; p; \5 a2 _ x4 T o6 u7 z )+ m# R/ t* B& j, c, w
(doitext ten)! e* e# x3 t; g3 }
(copy_dt ten)0 ^. u: `8 j- ^# c
% M( J4 k# W3 U; X
);if$ U3 C9 A/ [* f L7 w- A
)
: b' \3 W- S3 z8 n0 d);while" H$ f# ]3 {( [5 G4 X
(ketthuc)5 d% k0 w/ M" }9 N
);defun+ }) T% {% e$ T( k( S! w- S- _1 w
(princ "Type \"DG\" to start"). y# o! E% [! t5 F
;Note: bien toan cuc: textxl vitrilech
& c1 f+ G9 \# g8 C" R
6 c/ g Z# }5 {: ~;=====================================================================
0 R* U; H% v6 M, x7 O;;; PLJOINFUZZ.LSP
5 \2 u# [5 y3 P. M; K;;; Joins lines, arcs and polylines using a fuzz distance/ }6 X; ^( h. k0 m0 W3 ]% C' ?
;;; If only one object is selected it tries to join to all objects that are possible
: D0 C0 ~% C: _" Q5 y;;; By Jimmy Bergmark; \- t& m* P$ }- Y
;;; Copyright (C) 2003-2004 JTB World, All Rights Reserved
! m$ T1 k; ~- P; p- w8 m& J9 H2 h: y;;; Website: www.jtbworld.com! i0 D; a; F5 K9 l# H. Q4 t
;;; E-mail: info@jtbworld.com0 N( R9 r# s. I' T( B- e5 Y
;;; Tested on AutoCAD 2002,2004 and 2005" A! F, ^/ Y+ N" w2 t& @$ z+ C
;;; Latest revision made 2004-11-11# Y3 z6 J$ A1 c
;;; Minor code cosmetic change made 2004-11-134 i8 f2 j6 Y4 n" m! H
;;; Bug corrected 2004-12-232 [7 ]' t r0 ~8 r. \2 z3 E/ f$ n$ `
6 ~+ ?- \! x6 s2 z. U3 F(defun c:jf () (c:pljoinfuzz)) ; this line can be commented out if there is an existing command called jf( n. n* w0 A) N% J6 S6 [2 n
(defun c:pljoinfuzz (/ ss1 entLine objType oldcmdecho oldpeditaccept fuzz okObjects)
7 U; x2 D& B" f# ` (setq oldcmdecho (getvar "cmdecho")) w; M2 Y. s( r( I5 C6 b
(setq oldpeditaccept (getvar "PEDITACCEPT"))
) t+ e4 h: S4 }/ X' Z* R (setvar "cmdecho" 0), N% i/ e' Q" D' N
(setq A2k4 (>= (substr (getvar "ACADVER") 1 2) "16"))2 \0 ], X9 ?; l0 n0 e0 y, Z
(if A2k4 (setvar "PEDITACCEPT" 0))% E3 S; m& ^* q- n5 h7 T* V
(setq okObjects '((0 . "LINE,ARC,POLYLINE,LWPOLYLINE")))7 J) S0 _. {; k% O
(princ "\nSelect object to join: ")- A9 }1 l, R: h6 N) j
(setq ss1 (ssget okObjects))
9 G& A% [2 _5 N3 X5 E9 { (setq fuzz (getdist "\nFuzz distance <0>: "))% o6 z) V! J3 `5 D& N
(if (= fuzz nil) (setq fuzz 0))
( L1 |4 `2 M: q; h- O* w (if (/= ss1 nil)
* g& |: |% i" p: D1 J (progn2 b) f4 G3 f O0 N
(setq objType (cdr (assoc 0 (entget (setq entLine (ssname ss1 0))))))
* d, ]. j8 g7 k. {7 _ (if (= (sslength ss1) 1) (setq ss1 (ssget "X" okObjects)))" n2 }! ?4 v4 E7 F T( D) a
(if (member objType '("LINE" "ARC"))
' ^# X( r! N. |* ]+ y (command "_.pedit" "_M" ss1 "" "_Y" "_J" "_J" "_B" fuzz "")
1 H! J4 f$ a, @( w (command "_.pedit" "_M" ss1 "" "_J" "_J" "_B" fuzz "")) T: L0 |+ u# e3 e% [
)
$ {6 m6 W! Y) C; N+ p9 a )
; ~: B/ ?- e3 p1 E( E )3 W6 l& D: g9 n8 A5 h
(setvar "cmdecho" oldcmdecho)
. C& S l, s8 `$ O0 n1 h (if A2k4 (setvar "PEDITACCEPT" oldpeditaccept))
/ s7 s4 k. A2 \2 g) t+ z8 S (princ)9 O% T. \* F: K7 Z6 f* `$ [
)! L! ]! h- e0 V9 O" j( A
( r8 c1 d1 m) |2 ^
;===========================VE CAO TRINH===========================
! t% r2 M! h4 d! ^
6 a7 r4 R( _6 I2 v# Z& ?(DEFUN C:Cotcao (/ CMD PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 NPI TX DX DY TL OSM OLL
& W6 ~. m& @3 u- N1 G6 {- C. P CRST RSIZE TSIZE STR PRMT FCH NBC OLDERR)) U2 U1 l/ x7 h
(SETQ OLDERR *error*
- \- O% j( }& T( a *error* loisb): _% Z/ P# s! N( c8 l- d' l
(command "layer" "m" "dim" "c" "" """")
! I5 C* b* u5 ?% f(SETQ CMD (GETVAR "CMDECHO"))* O1 ]" k4 {4 U4 b, Y: O
(SETQ NBC (GETVAR "CLAYER"))
) M3 c( B# z* d- E) F- T(SETQ OSM (GETVAR "OSMODE"))) e/ H7 J; U/ A" W/ \6 _
(SETVAR "CMDECHO" 0)8 Z- g& k4 f l9 O6 T" N
(SETQ PT1 (GETPOINT "\nDiem cao trinh:"))
1 h* m! }; ]; _& ~7 f' V(SETQ TX (GETSTRING "\nCao trinh:"))
4 O! m3 ]1 l) ?6 u(SETQ FCH (SUBSTR TX 1 1))" Y5 [. } a7 G1 i" k
(IF (= FCH "@") (SETQ TX (STRCAT "%%P" (SUBSTR TX 2 (- (STRLEN TX) 1)))))! I) T; Y; F0 Z& P9 m0 M7 t
(SETQ CRST (GETVAR "TEXTSTYLE"))& U* c# _4 f5 S5 n6 a- U
(SETQ RSIZE (CDR (ASSOC 40 (TBLSEARCH "STYLE" CRST))))
" c9 Q( t1 v5 |(SETQ TSIZE (GETVAR "TEXTSIZE"))
9 v& A% p7 F& X, j( J$ `4 l K(SETQ STR (RTOS TSIZE 2)), O, ]9 e( }* `4 Y, P# R N
(SETQ PRMT (STRCAT "\nText height <" STR ">:"))
, [. ]" q4 j% | S- b9 _ {1 ~(IF (= RSIZE 0)
- w6 W8 W5 X- c8 N- }9 i (PROGN6 g5 j" T, L ?" t; l0 C0 x2 |1 O
(INITGET 4)
6 v$ @: K$ ]) b3 K0 o- `6 u (SETQ TSIZE (GETREAL PRMT))1 j6 y3 D# |) q) _( U
(IF (= TSIZE NIL) (SETQ TSIZE (GETVAR "TEXTSIZE"))9 {; x3 v) @" q/ F2 K
(SETVAR "TEXTSIZE" TSIZE))
3 H. O+ X+ d5 r R) T )
7 m0 K4 k2 B1 {, c/ b: B$ })$ H. F8 |/ M7 z
(PRINC)
+ s* ]. R) m" x; v7 H& p(SETQ TL (/ (GETVAR "TEXTSIZE") 2))* V ^0 i" o5 g) ~; J: S9 v
(SETVAR "OSMODE" 0)$ _4 y) v! ^' ?
(SETQ DX (CAAR (CDR (TEXTBOX (LIST (CONS 1 TX))))))
8 `7 \8 q% J Y- W) U& b% ~(SETQ NPI (/ PI 2))
2 J8 l4 E) p) k0 R(SETQ PT4 (POLAR PT1 NPI (* 1 TL)))7 _6 I: t5 w/ G* C4 D4 d
(SETQ PT2 (POLAR PT4 PI (* 2 TL))). E* Z7 V! O9 U! z: P* |- t
(SETQ PT3 (POLAR PT4 0 (* 2 TL)))
! e2 F' ]5 u2 K(SETQ PT5 (POLAR PT4 NPI (* 5 TL)))
) P% C. Y, r; y: F(SETQ PT6 (POLAR PT2 NPI TL))
7 }6 H5 M1 P5 B1 o(SETQ PT7 (POLAR PT6 0 (+ (* 3.7 TL) DX)))! F, @/ n7 c: Q2 j/ E- w
(SETQ PT8 (POLAR PT6 NPI (* 1 TL)))
+ ^3 S! L- ?) n# b6 T) U. v8 F(SETQ PT8 (POLAR PT8 0 (* 2.5 TL)))7 D1 R, N/ [8 D5 z1 T% j
(SETQ PT9 (POLAR PT1 pi (* 2 TL)))& ?$ @8 x' J3 t( r8 j7 F4 O
(SETQ PT10 (POLAR PT1 0 (* 2 TL))), A# y3 D. |: k
(COMMAND "COLOR" "7" "")
5 B3 G/ |. e# Q( w& [+ t(COMMAND "STYLE" "COTES" "tcvn3italic,vnh.shx" "" "1" "0" "n" "n" "n"): Q$ p, `: W2 W6 j( B1 A p6 C
(IF (= RSIZE 0)(COMMAND "TEXT" PT8 TSIZE 0 tX) (COMMAND "TEXT" PT8 0 TX))
! N' u4 N# ~* [; D K(COMMAND "COLOR" "BYLAYER" "")2 H1 b( E8 {6 i. w# h, G
(COMMAND "SOLID" PT1 PT2 PT4 "" "" "pLINE" PT1 pt3 pt2 "")
4 m) o: j4 F' m(COMMAND "COLOR" "BYLAYER" "")( `7 y4 Z" w4 q+ f$ x: s5 P( f& H# F; O y4 ~
(COMMAND "pLINE" PT1 PT5 "" "pLINE" PT6 PT7 "" "pLINE" pt9 pt10"")2 m6 n; D* }( b6 Y9 a- b& N0 _/ ~
(SETVAR "CLAYER" "0")- |/ ^: ^, t; a( j
(command "ddedit" pause)
- r( X4 x2 ]0 i( o! N(COMMAND "COLOR" "BYLAYER" "")
3 M9 B" S6 U% \. a& ~1 k B' }(SETVAR "CMDECHO" CMD)
* ^4 G' B- u& | a- a5 K(SETVAR "CLAYER" NBC)
5 p! N: [4 Y+ B4 K, S4 [(SETVAR "OSMODE" OSM)" g) ~5 n i! h c2 [! M
(PRINC)2 x' P1 b6 }. L I+ H. F6 c$ W
)% {8 T" Y/ {, n0 w0 L( b
) E3 k/ l$ T ]$ B+ {
;;; =========================== VE NET CAT CHEO (GC) =============================
" V, U: a- l1 W; a' F6 y* K3 ]" A& L4 U. P& f) X" C) H8 c5 ^3 I; g
(Defun c:G1(/ p1 p2 p3 p4 p5 p6 p11 p12 l ang)
, n5 S' x8 T2 b3 V& `0 C8 t2 u+ o$ u (setq x (getvar "osmode"))
( i/ p+ E1 Q {# B/ K! J$ b (setq p1 (getpoint "First point : ")
$ u! X. ]9 J5 T A% P1 [ p2 (getpoint p1 "Second point : "))" |5 Y& o2 E5 A6 s5 @# X0 W4 n
(setq l (distance p1 p2))9 K# J& R8 ^! M- I* X
(setq p11 (polar p1 (angle p2 p1) (/ l 5))
: {* S1 [% N* v5 l( z X p12 (polar p2 (angle p1 p2) (/ l 5)))
# ]! f* T0 s _& N: s$ h) M% _6 M! A. w (setq ang (angle p1 p2))
3 c1 C- V' W% q0 s: G (setq p3 (polar p1 ang (/ l 2.5))1 |7 h$ z4 D, P0 q
p4 (polar p3 (+ (/ pi 2) ang) (/ l 5))5 t" X2 T$ ]% G3 B
p5 (polar p3 ang (/ l 5))
& Y& j/ |' i6 v( c V1 x, a; m; a p6 (polar p5 (- ang (/ pi 2)) (/ l 5)))
9 f. U9 J; z" K' e( U6 E9 O (setvar "osmode" 0)% k/ }( V4 o8 i- m" g% {
(command "pline" p11 p3 p4 p6 p5 p12 "")
) {/ U8 ?& F/ T2 n" P* ^ (setvar "osmode" x), b4 J' H" e9 _7 w5 f
)
9 Y6 q/ t! N* R, ?;----------------------------------------------------------------------------------6 B. p9 R8 W$ _. X/ h" h8 h
(Defun C:G2 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6
$ z! Y) {( T. x" ` pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE"))
5 W9 J6 \/ u! r; F1 \' C& X (setq ps1 (getpoint "\Chon diem thu nhat: "))% i k( L7 z( W- `4 X
(setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))( x3 S; \" N$ ^* g- z
(setq sb 50.0 sh 200.0 se 20.0)! G+ o% I* S1 U$ T! _7 x* S
(setq ang (angle ps1 ps2))
; C3 L. K E h/ c: c* h) P (setq pf1 (polar ps1 ang (- 0.0 se)))6 l5 ]2 }' g6 d7 i
(setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) ))
& B% H: F1 P3 I3 F$ Y; l5 { (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))" b" }% v/ S2 V+ z9 f3 Y3 U
(setq pf5 (polar pf2 ang sb))
3 q$ k8 g; M* K0 G5 H (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0)))
6 }; ?$ g9 H; b! h (setq pf6 (polar ps2 ang se))
' Y0 w" Y6 {* |4 Z' l, p& y2 A; x (setvar "OSMODE" 0)$ V2 ^' J1 e" [ ]" X: a# U
(setvar "BLIPMODE" 0)
$ h( g R8 j/ T7 E' t# _3 ` (command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")
) ^; o% p" W+ ?5 A (setvar "OSMODE" 703)4 {$ E+ d8 V8 U2 P8 ^ h
(princ) )
0 X5 U8 g3 a* d3 ?8 X& k;----------------------------------------------------------------------------------3 d' Q5 b% Z* g H
(Defun C:G3 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf61 O9 g1 K0 p! }7 a% b
pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE")) l' {6 @( j9 P
(setq ps1 (getpoint "\Chon diem thu nhat: "))1 a9 G! r, ?% I h7 D$ z* m5 @
(setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))( ]6 X' t) w9 z c
(setq sb 100.0 sh 150.0 se 20.0)
8 m2 G' I; v* z) _ (setq ang (angle ps1 ps2)) ]; j9 l) B1 s
(setq pf1 (polar ps1 ang (- 0.0 se)))- P! U" i# N. w/ m ?' @
(setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) ))+ [+ z# Y, O/ s; I
(setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))
6 F+ D" E( ]! w1 d- X* ~ (setq pf5 (polar pf2 ang sb))
8 \' N1 A# s5 ]- M: i' P `2 w (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0)))
) k* G+ p5 j& u (setq pf6 (polar ps2 ang se))3 ~; y7 D) i: {8 F* c
(setvar "OSMODE" 0)1 I6 S; w9 n+ Z9 F; m
(setvar "BLIPMODE" 0)
# s% d0 u7 z) t3 E& h& a (command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")
, f! e8 T6 A; e (setvar "OSMODE" 703)- i+ `3 m, F$ p! Q+ z- f$ o; r
(princ) )
+ |4 C& E$ Y2 c3 u, Y;----------------------------------------------------------------------------------
( w! q; j9 ^4 f# E- Z! L C X(Defun C:G4 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6
( e* y0 }1 F; H- @1 K! W# G pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE"))/ q; I8 o7 T5 M) f
(setq ps1 (getpoint "\Chon diem thu nhat: ")); ^3 ]4 Q9 I( H' G5 E
(setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))
. v! W2 ^0 p; h (setq sb 100.0 sh 250.0 se 20.0)& L" w0 o: e9 C' i% ]4 N
(setq ang (angle ps1 ps2))- a5 R1 D. U' g: A0 s
(setq pf1 (polar ps1 ang (- 0.0 se)))
* K4 E6 W5 T, [; i$ M. g3 g; i1 S (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) ))
0 ^9 H5 Q# M! n (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))4 o+ g+ b1 F4 y- O0 @. e
(setq pf5 (polar pf2 ang sb))
! H# C- u' M" c. Q (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0)))
* N; \6 a2 e/ R( L (setq pf6 (polar ps2 ang se))7 `7 D7 p: ^9 G3 C3 e: R# |2 X4 _4 W
(setvar "OSMODE" 0)
. P, }' [, K: m0 Q* F (setvar "BLIPMODE" 0)
5 O# D& |, n9 c- o; e7 P (command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")
( s/ h: ?, ?2 K# P8 e1 Z (setvar "OSMODE" 703)7 b7 ?" ^+ V; X6 X& g
(princ) )
" u) \* s. q( [1 y" j" N4 ], ^7 x, ^3 {
;==================================================================================0 j" ]0 s- {: T; I7 C7 p, b
(defun c:ang (/ ent pt1 pt2 ang)
1 p# m( o% W$ e9 o (setq cmd (getvar "cmdecho"))$ k. G& f ]+ U: h5 |/ i |8 N
(setvar "cmdecho" 1). F! H# |: U# r3 \' t) L( _8 k' w
(prompt (strcat"\nThay doi truc toa do theo duong thang chon truoc"))6 e2 d; u2 i9 d
(setq ent (entsel "\nChon duong thang:"))
' P; F# P5 E7 t1 ^6 g (if ent
0 ^* I" Y% b8 y7 I (progn. V% S7 h0 ^; J4 ]9 s
(setq ent (entget (car ent)))9 n$ w& c7 r) W8 a
(setq pt1 (cdr (assoc 10 ent)))4 U# o% j D, S6 z: c% j( R; R
(setq pt2 (cdr (assoc 11 ent)))! r0 Y' e& ?4 e0 |/ d6 E
(setq ang (angle pt1 pt2))8 }" W. E. {% ^. l$ r; b' z$ V
(setq ang (/ (* ang 180.0) pi))2 t) O2 v8 z. F/ m
(setvar "cmdecho" 0)2 T7 F+ v) i) g+ I+ K. _4 d% ?
(command "setvar" "snapang" ang)$ R5 I0 V. N! \, |; {% Q
(princ "\nGoc cua truc toa do moi : ")3 J U6 X8 ~# U( {
(princ ang)
# g9 D( b/ I( E )! |6 d/ S/ w6 E0 I Z
)/ F" S4 X* `3 ]2 Z
(setvar "cmdecho" cmd)
5 M9 _8 L: F3 z* L3 B; ^# G (princ)# x2 t' P1 ?, S0 O2 _
)
- i2 F( g( D7 G# W;==================================================================================4 k8 q) l; s" ~5 ~7 A0 M {
;============================== KY HIEU DOI XUNG ==============================
! E, N! _5 |, C8 Z0 x, u" ?' U! ^) p;==================================================================================7 F' N( M% ~) B5 D% u! j
+ c- I e9 B4 W/ j
(DEFUN C:DX (/ CMD OSM OLDERR PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 PT9/ v% Y+ o4 b" v6 R/ a
SZ G45 G135 G90 G180 SS loi)
% n' T( P& Z; d: w- ?$ a(defun loi (s)
) Q8 D, L' H' q (if (= s "Function cancelled")
' T. X c$ E+ P (princ)
6 z L' [3 I$ Q6 S! ]+ P. N5 K8 |, ] (princ (strcat "Error:" s))4 x8 F" U" {; G; `
)
/ P; _! e. d y( b6 \3 V! N* V (SETVAR "CMDECHO" CMD)
/ \; z" L) i; t' N7 _- C% m (SETVAR "OSMODE" OSM)
" _7 u5 _9 F' G# N) J0 }8 n (SETQ *error* OLDERR)
% Y% `6 k( g6 @+ }+ _ (PRINC)3 ^8 Z' \7 N5 z ^% J2 z. ]
). ]- m; I o; c) z) `' S0 g! I! N
(SETQ CMD (GETVAR "CMDECHO"))
( F3 }7 U; Z3 {7 ?- d* s (SETQ OSM (GETVAR "OSMODE"))
6 d( w/ Q1 W/ Q% C N2 B (SETVAR "CMDECHO" 0)- [* {8 A3 b1 ~' {5 T
(SETQ OLDERR *error*
T* W+ l, Y0 S" y8 ^4 g9 S: \$ s *error* loi)
7 F r1 t3 @ P4 n7 F0 v5 T0 @% F! t' F (SETQ SZ (GETREAL "Size <1>:"))
' K* |* m' Y3 O4 ? (IF (= SZ nil) (SETQ SZ 100))
4 } ^4 [# c" U9 t+ Z- s% j1 o (SETQ G45 (/ PI 4))
: S1 P# t+ x& Q (SETQ G135 (* 3 (/ PI 4)))
& p. L( H6 |' w$ l% P. O (SETQ G90 (- G45 (/ PI 2)))% C& ^) m& ~0 V+ i" D5 G
(SETQ G180 (+ G135 (/ PI 2)))" `) U. N5 M; G9 x1 L
(SETQ PT1 (GETPOINT "\nDiem doi xung:"))8 q1 Z" W; H* Z, J2 `6 s
(SETVAR "OSMODE" 0)
& k J! p1 j6 b+ `$ T3 y2 J0 c! j (SETQ PT2 (POLAR PT1 G45 (* 2 SZ)))" x7 i5 s: y; h: a6 U* ]
(SETQ PT3 (POLAR PT2 G90 (* 2 SZ)))& I5 y! Q" V& {
(SETQ PT4 (POLAR PT1 G45 (* 1 SZ)))
' k0 i" m* p4 R& r; L: M" k& t (SETQ PT5 (POLAR PT1 G135 (* 2 SZ)))
! F# X# g4 v+ E% ? (SETQ PT6 (POLAR PT5 G180 (* 2 SZ)))
) f8 [# s3 V8 Y& ~8 I' k. M( y4 S" w (SETQ PT7 (POLAR PT1 G135 (* 1 SZ)))
/ i* o2 p3 {6 g; ]# |6 W5 T @ (SETQ PT8 (POLAR PT1 G45 (* -0.7 SZ)))) C" K* F' W( c
(SETQ PT9 (POLAR PT1 G135 (* -0.7 SZ)))
# O* i3 D3 ]5 {/ F (PRINC "\nGoc quay:"). J8 s: a. ` m8 n9 U5 w
(SETQ SS (SSADD))( ~5 w# R$ R4 p1 A/ \$ S( V
(command "layer" "m" "Dim" "c" "" """"). ^* t2 w5 g6 z$ a
(COMMAND "COLOR" "1" "")
- x P3 n9 f* K (COMMAND "LINE" PT8 PT2 "")
5 E% Y7 F0 K4 i (SETQ SS (SSADD (ENTLAST) SS))
O) |: f s# @& R3 J/ V5 R (COMMAND "LINE" PT9 PT5 "")
* c4 P u& f; A7 r1 K7 w (SETQ SS (SSADD (ENTLAST) SS))
3 J* r2 x1 ]* u( K0 q(COMMAND "COLOR" "1" ""), u$ Q; N: Q( C1 m: ?- ~8 a+ W
(COMMAND "SOLID" PT2 PT3 PT4 "" "")- H5 F1 Q8 `1 I. [& K- i/ F
(SETQ SS (SSADD (ENTLAST) SS))
$ A/ W4 ]4 q+ b5 |7 ^6 F (COMMAND "SOLID" PT5 PT6 PT7 "" "")* j+ F* i' H; D1 o& Z
(SETQ SS (SSADD (ENTLAST) SS))
0 X1 m9 o, K D* U- Z1 `, n (COMMAND "ROTATE" SS "" PT1 PAUSE)
# g2 {1 v0 K+ A( U1 ~8 i( f8 f(COMMAND "COLOR" "BYLAYER" ""); t1 ]" { b4 b' i) i# b( j
(SETVAR "CMDECHO" CMD)
! ~/ [7 c( r1 _# X' T (SETVAR "OSMODE" OSM)9 i0 R- b8 l" U
(SETQ *error* OLDERR)
, _* j# e& l; f% L4 @# q (PRINC)' ~) m' b/ Y9 a$ G& ?
), o; l6 p3 m; u8 y r8 T4 @
2 Y7 F8 u9 s7 j; U5 K;==================================================================================
& K# h* b" h/ Z0 f7 _- W, V;================================= KY HIEU TRUC ===============================
( |6 m6 V6 C* G [) F" `;==================================================================================+ j$ H8 E X2 N4 g3 q; x7 O
* m8 {9 m5 R6 K/ M8 \0 s(defun C:vetruc ()
& Z4 f0 T! s. u$ l- [(setq bk (getvar "USERR3"))& b5 G) t( y: M
(if (= bk 0)/ t- y2 R! Q* |% b; r
(progn$ E4 A5 Y/ N% p/ s( i: a6 |
(setq cont "1")( M* [/ _8 I* Z
(setvar "USERR3" 1)/ r2 @1 a2 a4 l! H) J# a
)* G9 r- q& N, s* c2 N# O
(setq cont (rtos bk))+ H P6 A) z! z) I G
)6 _- j" h5 @# p+ U0 M5 N
(setq pt1 (getpoint "\n Nhap diem dat:"))
# [$ G! \, x+ A9 N0 W* F0 N(command "layer" "m" "Dim" "c" "" """")
/ m G3 [5 n, q(command "osnap" "")/ h: P+ W. H* Q, Z% k8 B9 w0 j' M
(COMMAND "COLOR" "7" ""). Q0 J1 f: j ?& D' \
(command "circle" pt1 150 "")
/ K2 A- r2 o0 T: h+ N3 I# l(setq pt2 (polar pt1 0 150))
/ y3 Y) v/ y* |! u* n9 I9 s(setq pt3 (polar pt1 (/ pi 1) 150))
& n7 Z: _1 Q; d& e, L1 `1 M% m% i(setq pt4 (polar pt1 0 300))5 u: F* F. ^* W* ]
(setq pt5 (polar pt1 (/ pi 1) 300))
2 H! o' ^3 F; j( B+ H(setq pt6 (polar pt1 (- 0 (/ pi 2)) 150))7 ]6 P3 p! {$ Z) E' D6 \
(setq pt7 (polar pt1 (- 0 (/ pi 2)) 300))
5 Y/ |& \" j4 Y' d3 A(setq pt8 (polar pt1 (/ pi 2) 150))
4 ?; \& u! M/ |8 `(setq pt9 (polar pt1 (/ pi 2) 300))# y! w0 q3 _3 A5 c$ M
(setq pt10 (polar pt1 0 150)) l; V! Q4 ]3 U
(setq pt11 (polar pt1 (/ pi 4) 150))* T% P. U" ^7 ~0 i1 a9 k
(COMMAND "COLOR" "BYLAYER" "")/ f+ ^3 ~4 w: j% ]" ^
(command "line" pt2 pt4 "")
: j: o3 l) G8 J6 W) R(command "line" pt6 pt7 "")/ c7 |0 s" P) T9 Q1 M& i
(command "line" pt3 pt5 "")) I0 {4 J/ K& \0 q4 O5 ?
(command "line" pt8 pt9 "")
s `9 z$ O+ M(setq dk (strcat "\n Size:<"cont">"))# C. D; v# w" p9 D& \6 G
(setq bk (getreal dk))) `+ p) G" m+ z# D+ V! ^: W
(if (= bk nil)
! U) Q ~: A2 Y% S# L7 ? (progn
2 J+ j* y: d/ s5 I. {; d; n (setq bk (getvar "USERR3"))
/ B6 Q5 n! E1 u/ m4 ] )
; r7 g. }* G! X' k. H: U k (setvar "USERR3" bk)
0 \# \' ~: ^8 W! U: y )2 C5 }( ]4 U5 W9 K$ W
(command "scale" pt4 pt5 pt7 pt9 pt11"" pt1 bk"")
# L! ?* n2 }3 W- S$ |2 s(COMMAND "COLOR" "7" "")
6 ?/ K+ r: j9 z: }+ r(COMMAND "STYLE" "Truc" "impact" "" "" "" "" "")
8 t* \# u- [& M(command "text" "j" "mc" pt1 (* 150 bk) pt10 "A" "")
$ v( ~2 z# w$ B" F& c0 ^7 g(COMMAND "COLOR" "BYLAYER" "")
6 B" ` v O+ ^)# ?& d% z; H5 w/ }. i
: c7 ~6 ?9 j, Z( `! n Y5 B/ I
;=====================================================================
4 ?# ~4 h4 ^) {$ F;CA - Reverses the case of text. (Upper to Lower and Lower to Upper.)* L# u; S) f, v) x0 L
;
- T" b; b( M- S. @; u( ~. a3 g# V;Jeffery P Sanders
) E! }. s' V* _6 C/ [. a. Q: y/ U: l;
) ?% n/ t7 i. Q2 E. h" E(defun C:CA(/ en enlist tx newtx cnt tp asc note)
3 q7 e( r" w8 c (setvar "cmdecho" 0)/ b, S4 n0 U2 ^0 S, W+ Y
(if(setq en(entsel))
' g5 W/ X% |% m: }# p% ?) x (progn! {1 i6 S; n: m& g ^0 I
(setq enlist(entget(car en)))
3 o$ }! _ m# g" y6 b* N" b (if(= "TEXT"(cdr(assoc 0 enlist)))
2 j: S2 C, Q3 z0 p" Y (progn
# r, K+ I: W4 z" i (setq tx(cdr(assoc 1 enlist)): s( i9 d. D8 h3 A! ]1 D4 L3 }
newtx "" cnt(strlen tx)" }9 ?* l$ g K
note "\n...CASE Reversed. \n "* }: x1 }3 N& z3 s! i. E
)
, D8 N0 c t% |! L (while (> cnt 0)
* Z# f5 d' T4 a# ~ (setq tp(substr tx cnt 1))
( g" I* j7 I; q (setq asc(ascii tp))# J! ?$ t# b' Q/ \, o
(if (> asc 96)
$ N9 \. z) K! L4 p/ X: s' d (setq tp(strcase tp))
3 b" K5 U+ _- ?. F* G [( r (setq tp(strcase tp T))0 r& [8 ^/ m( K4 {$ r
)3 A+ a$ k4 Z+ E. S
(setq newtx(strcat tp newtx))8 b V" P6 y: {6 r; W
(setq cnt(- cnt 1))+ Q, ?4 V, a( e$ ^- u+ h5 C/ Y
)
) `% m! c* p7 w0 M6 k6 L# f (setq enlist(subst(cons 1 newtx)(assoc 1 enlist)enlist))
7 p' G6 H d9 F* B+ l5 h* d& x (entmod enlist)
A! z5 w: | H9 [$ m. q )
2 j' g8 u J" T# b8 G, B- ^" J: ? (setq note "\n....Text Only Please. \n ")
/ F$ [( _ g. @$ L. W' | )& n0 O- [$ T" a& g' }8 J
)
/ F$ ~1 ^5 ]. g& z2 U5 e4 | (setq note "\n....Nothing Selected. \n ")* N6 c9 F, G; _ a
)6 L6 a) j: K( H. v( J/ W5 j
(setvar "cmdecho" 1)' W5 f/ Q7 h5 q: K m' O
(princ note)
/ y/ k1 }& V3 \7 W9 k; u (princ); `9 ~, t5 v7 K0 m1 z$ W3 Q
)
- F1 `9 d+ a4 d4 Y8 |% v, X Y6 P4 n: m3 P4 X+ Q0 e
;=====================================================================
% F B2 x% \0 O9 I;==================== NEW TEXT STYLE UPDATE ==========================
& ?0 R) N$ `3 f% v' j7 _% _4 `;=====================================================================
% s2 K" f1 B" |. [( q
3 w# F; j; z2 g+ _& U(defun c:nS (/ tdt ssdt sodt index)+ ^( o; x: u0 O0 R/ L
(defun ObjName (ssdt /)& p, N' B. ^5 M& ?. Q' _
(cdr (assoc '0 (entget ssdt)))) i3 C/ r4 `( `. e' |" \
)! B- i8 y3 U- z- i- m
(defun MoPL (ssdt /)7 Q3 k' F- H% M; @+ U: i% k
(= (cdr (assoc '70 (entget ssdt))) 0)3 K2 d* h3 Q$ v( W% D* Z; T
)3 C/ ], I6 M& Q) K4 |$ i! p& N& o
(defun NoiPL (ssdt /)8 q' O/ ?9 l m6 @2 g7 u
(if (MoPL ssdt)
# C2 c0 q" L6 Z0 M a(command ".PEDIT" ssdt "J" "All" "" "X"). |0 a( s2 J' d7 |- I
)
( E4 y9 s" S2 }" h0 T G$ ?2 c)
3 C- C* v7 V; @(defun NoiLC (ssdt /)
1 \( o0 g& @! N! O% a: T: E(command ".PEDIT" ssdt "Y" "J" "All" "" "X")
* c1 z6 G6 C' \% j5 t)# Z" \' V2 f2 W) { I0 {0 K
(setq
1 X, z! Q& Y! Utdt (ssget)( M) I4 {) N9 N( T r( R
sodt (sslength tdt)# `( C+ P+ y0 ]0 G
index 01 g% v& I4 z w- d" Y) d
)/ i2 L* ?, h2 I9 A& A: K6 Y1 N, A& G
(repeat sodt+ S* H8 u8 l$ w$ _& y' i4 [- s
(setq
9 U2 ]2 M8 f4 {* i0 Gssdt (ssname tdt index)+ [ O8 }2 m G. ~
index (1+ index)+ b; l; P: i+ h0 x5 F3 P: u
)
0 P8 Z1 y3 e7 J! T8 `$ P1 ?2 O$ g3 ?(if (or (= (Objname ssdt) "LWPOLYLINE")
- x+ f7 Y) D8 _(= (Objname ssdt) "POLYLINE") g# K' r6 P4 m, J. p8 x
)
0 @/ }$ u, z+ ?9 z% m5 _(NoiPL ssdt)
) u! S) s2 {3 b9 @8 O+ L- r' Z)
5 q. ~4 r! N" o6 D(if (or (= (Objname ssdt) "LINE") (= (Objname ssdt) "ARC"))$ ~9 j+ Y8 ?$ S! D! e5 W; ~
(NoiLC ssdt)
. z/ l1 x3 `+ H/ e)
- S, m. v4 |6 K0 H. f% `1 R5 ?)
. u9 v# n% t- ]' R* a+ c(princ); t) z0 I6 l0 J( o
); S+ B7 S* a O; T* k! B2 ^* k
6 I" m/ O: e% ^$ [9 @! |% a
;=====================================================================
2 k' j4 L6 r" F- H1 P2 k;;; AREAM.LSP& a) f* u9 |) }
;;; Function: Calculates the total area of selected objects6 Z1 i* p" s2 P+ {8 _5 L
;;; By Jimmy Bergmark
4 [4 J6 J _& s# H+ h9 J;;; Copyright (C) 1997-2006 JTB World, All Rights Reserved
6 [. M4 l/ l0 q0 {- g7 C+ y! O: F2 J;;; Tested on AutoCAD 20007 Z, s- u7 T8 n
" k! p7 z+ b6 A" L$ S2 F(defun c:ea (/ olderr oldcmdecho errexit undox restore ss1 nr en tot_area)
/ V; z0 C( V# u# R, O } (defun errexit (s)! M6 e; K' W1 N3 }3 b
(restore)
' j' L6 I" R5 ~1 ~' p4 ? )8 \2 F& n. J& `5 q+ K" L3 a5 s6 U
3 B1 ^3 F" }6 _9 Q# q5 Q# j7 Y: Y6 z
(defun undox ()% @6 G! C) @( v4 X$ `9 C
(command "._undo" "_E")
: ~; c, _' A7 }# c (setvar "cmdecho" oldcmdecho)
& L% a9 X! c, A& d, ^, z. _& w/ c (setq *error* olderr), B1 H* z% C7 C' @
(princ)
& @. T" \2 C" ^' F1 s* _5 ?" u' ` )
" E4 \. N3 s) Z" G
- ^" ]7 t) l3 ?" N7 h; J (setq olderr *error*4 |/ u5 x* U" s' z+ @( M
restore undox
* {/ }- N$ O0 Y# C2 a$ M *error* errexit, ?( d& M- V% ~7 y. E- q" Z6 {
)9 [0 @: m' s8 p
(setq oldcmdecho (getvar "cmdecho"))
! g3 g) o- A! E (setvar "cmdecho" 0)
* j& V7 C- K. A (command "._UNDO" "_BE")0 q# {+ v( W8 Q) d( h! @
(if (setq ss1 (ssget '((-4 . "<OR")! r7 \0 [/ P7 O8 Q9 S4 ` g, Y* J1 _
(0 . "POLYLINE")
( _" b( C. Q. s( O& g; [3 G (0 . "LWPOLYLINE")- x4 l! B& |7 i( ^" w( s" o
(0 . "CIRCLE")
. n: t. D9 U; ]6 ` C (0 . "ELLIPSE")
$ j' m+ g9 g/ Z: m5 c2 b (0 . "SPLINE")
+ W/ S- L2 }: B6 A (0 . "REGION")* q9 [6 U& w' k) E1 k) i# x. {" k
(-4 . "OR>")
& y- \. m9 x, Y/ e. p0 z5 ] )" M$ `6 F- L2 K% }7 T
)
/ V1 |1 ]9 u/ ]2 |, n8 {- D )6 d$ Y2 U5 |, H6 ^, Z, A4 O4 J
(progn* P" O% P2 q2 [
(setq nr 0)
+ U% W4 c. f( V4 Y0 v3 k (setq tot_area 0.0)
2 J( t% |3 L- a/ L) W. _ (setq en (ssname ss1 nr))
' d0 i/ s) s; \0 ] @4 ]4 _ (while en s8 Z8 s' l8 C, H
(command "._area" "_O" en)" T% j1 `& _7 Y% [( V& M
(setq tot_area (+ tot_area (getvar "area")))
9 A" c9 P1 G) i2 l5 s: y4 H9 p (setq nr (1+ nr))
1 a9 }5 T2 [4 L' {. c& B (setq en (ssname ss1 nr))
' l# p- u9 k7 F; `' k )$ n8 L5 ]+ \* p1 j# G4 `7 P
(princ "\nTotal Area = ")
( K7 p2 r/ v+ H4 U (princ tot_area)
4 |( e! S8 w. r/ B$ ?* r )3 F. I m7 u6 Q- b" m* Q* H
)8 i) ^9 i$ h- x u7 O1 @$ C) A
(restore)$ q+ s' W+ W+ k! b/ u" W9 p* S
)
4 K. u3 o6 ?$ B) r$ T1 b4 k; d2 e4 Q* M, v3 d! y1 M3 W
;=====================================================================
7 r* ~. ~8 a5 p: X0 Y4 o;;; By Jimmy Bergmark
6 N m, f9 r) m0 M; z;;; Copyright (C) 2008 JTB World, All Rights Reserved
* T! d- F4 E0 D/ V;;;
- Q0 ]' h+ m* @' C3 D;;; Created: 2008-03-31! t" |$ z9 N, W! e
;;;) m {) G& t, |/ a* x
;;; Convert Attribute definitions to mtext
. A/ H2 j' F/ _;;;9 ^# y, O' F7 Z% j& t' z
6 B& D# H. T; H$ F& R5 w(defun c:ATB (/ eset1 blkcnt en enlist tag1 ht pnt vl space)
2 J8 F0 H( ]/ b0 H* Y% x ? (setq eset1 (ssget (list (cons 0 "ATTDEF")))
% K4 o, Q7 V# L' w$ d blkcnt 00 P4 e% e3 y2 I6 a
)
3 @& o& E* c- t* r6 |7 z
7 e" f2 n. P- ^9 S (if eset19 F+ J9 o+ ]$ k2 G+ D7 _6 p. g. T
(while (<= blkcnt (- (sslength eset1) 1)). O- g0 W2 x( R
(setq en (ssname eset1 blkcnt)
; P( o' w9 V8 m( C" @: W enlist (entget en)
% {9 D) Q, y9 M* x ht (cdr (assoc 40 enlist)), ?# ]/ G# s; M0 u# D
pnt (assoc 10 enlist)# l9 V9 e+ D) @8 `' C3 g
pnt (subst (+ ht (caddr pnt)) (caddr pnt) pnt)
( [' u' R- u' }" M+ Q space (cdr (assoc 67 enlist))7 L1 W+ F* n4 p# x
)3 z7 }- U. H" o# F0 j
(setq vl (list+ }) d5 t- G7 e# A/ ]
(cons 0 "MTEXT")
# i; r9 P% b+ G [$ N( u (cons 100 "AcDbEntity")# f9 @: ?: r2 Y \
(cons 100 "AcDbMText")
6 B4 I7 A8 u' Z* E3 F (assoc 7 enlist)
4 u: _- c! w" \4 Q- C6 P (assoc 8 enlist)
3 E1 Y9 n: u5 ]2 T5 D3 w2 C' ? pnt
7 {1 }1 a) _; B# _) M8 Q (assoc 40 enlist)+ J8 O; @5 m- V8 X1 R
(cond ((assoc 62 enlist))
5 v* e/ s* ^2 B& l% k9 m5 K4 @0 V ((cons 62 256))) L, a& \% i( k3 J
)
# y. |3 `+ U4 N' u1 g/ o; U- S b (cons 1 (cdr (assoc 2 enlist)))! p2 e% D% v; o
(if (= space nil)
. J! Q& W: T6 v0 j0 y2 Z1 {/ M# [ (cons 67 0)
, I7 E1 P& ^2 y* ?; ~ (cons 67 space)
, o$ F+ d/ X; s! ?; M: H! m )
' |4 e( K" r9 G) |+ n9 x )
- m( D; k5 M% M t3 {4 }5 C ) J9 O7 r" X0 Y8 r& M6 g2 A7 j
(entdel en)6 |9 e9 c$ d+ z G0 G0 ]. a9 X
(entmake vl)
/ C6 _7 Y: a8 m0 G1 g( p (setq blkcnt (1+ blkcnt))- I/ ]0 R% U# ^. W& m
)# @$ J& z0 F. ^7 \! l, V
)) n" V9 j7 |; p7 ?' x% r5 U
)
5 m8 x3 F) Y$ N3 F7 c5 { G
5 ^4 b, k* \/ `;=====================================================================, k% f$ ~! a8 q$ V w* s
- `* g! L3 c' ?(defun c:xxx ( / cumdt dodai thoat dem ten doituong textxl dem goc toi)/ Z% P7 y. q# [$ D* k- m
; Khoi dau cua chuong trinh
2 X0 w. N2 }# Q3 x$ t(princ "\nCopy Inteligent...\n")
: A$ Y8 O( ?5 @+ e3 Y5 P9 K* n(setq luuecho (getvar "cmdecho")
# u M% E3 c( x0 j9 D# l* j9 X5 D5 x luu *error*
5 A7 \% I1 _, g! Z8 I( H0 j( R$ y *error* ketthuc
+ G3 v/ G1 Y2 Q, X cumdt (ssget)
" i: o; m& w9 x9 Z+ W; @! X dodai (sslength cumdt)- f% e! c3 ^& B& P
goc (getpoint "\nSelect base point:")
/ }, d5 S5 P: E! n3 K- X, X thoat nil
9 n3 b7 |3 `( N6 g3 G3 | dem 0
: Q& |0 X' ^' {9 u0 T5 y+ X5 ` textxl nil
+ o! g) w. J e x! [. K/ F);
# R. k$ h$ y+ l(setvar "cmdecho" 0)
* K8 D* Q1 e' f+ ^* P4 ]% p4 Y; Loc ra duoc ong text de xu ly
. [3 o9 o7 L. j( U! W9 |(while (and (= thoat nil)) ]9 g" `9 B" \' H$ W% k% M
(< dem dodai)- j( r) y! Y1 ]4 ]
)
( Z. \6 X; m, k7 J3 C- r: r (setq ten (ssname cumdt dem)6 N2 e" H5 \! K. n8 T
dem (1+ dem)
% u; R5 Y/ J& b, {5 ` doituong (entget ten)
! N% Y+ i$ p i kieu (cdr (assoc 0 doituong))
1 H/ T3 U0 D) t, `, H4 E )
8 [+ o) K b5 I4 Z; n' A7 A- V
C$ i' f* f, r4 [ (if (or (= kieu "TEXT"). F' V- B/ N& ]" [9 B* S
(= kieu "MTEXT")
% g) y/ Q, n4 q! u; V6 S )
4 m& Q- H! C2 I ] (setq thoat T' T% J0 i, \# Z i
textxl (cdr (assoc 1 doituong))
# U9 k8 _& T; ?2 ]& {$ U* p r ), u/ t4 ~* t y5 A
), r: |0 R" P) a; I
);
; b0 X- X# p# Q7 H! M9 ~3 [(while T
s d- e- p# x8 u' r5 O- ~(setq toi (getpoint "\nSelect next point: " goc)& {# d1 {( Z, G- D; w' C# W; K& I
vitrilech (list (- (car toi) (car goc)) (- (nth 1 toi) (nth 1 goc)))
8 f+ h4 p1 _7 S" X( w dem 0$ l( B t7 G% D( n
)
, A3 Z3 o$ ?. }* k' d# z5 a7 F$ s. i(while (< dem dodai)
?" |6 `1 X7 J [6 I1 I (setq ten (ssname cumdt dem)/ b+ \* y, _6 g2 f- ]5 w' a
dem (1+ dem)
( Q* o3 i5 e+ ^, H5 F doituong (entget ten)
% S( _) ~* ^7 f+ C, h- f! @! s. u kieu (cdr (assoc 0 doituong)) 4 n5 C9 k- M9 d& n
)- v$ b$ ^0 X! K; f( V0 ?
: x, ?$ k c2 V# A" y
(if (or (= kieu "TEXT")
) }1 ]) O1 g* k* g (= kieu "MTEXT") 0 X% D3 G) C! a# f. ?
)
& E" b* B9 o* m2 Y- H (doitext ten)
7 C) K- f, D3 s0 k" D" r8 E" V' }2 h# V (copy_dt ten)
5 p* x/ u: B" T$ G
$ ^' l- L. R4 ?) i );if
/ U8 n, A( Q& W$ m7 K- L)
% B" U" {% e' K9 w- |# J$ M5 ~);while$ t B5 |( @! l9 s1 d) }
(ketthuc) N1 x* g' M. V6 m( n3 ]0 M0 O+ S
);defun
. i& }" u2 X y: x2 K(princ)1 {) C K n8 J$ l$ Z
& m9 a$ e& H3 t# P: Y b2 P$ S5 J" i;=====================================================================3 ? s* E# K) `
;;; By Jimmy Bergmark: |4 \1 _$ Q4 u2 K* n# k7 ^
;;; Copyright (C) 2008 JTB World, All Rights Reserved
! I4 q) {; T, z5 H$ y5 g;;;
5 H, p* B& p) j) Y;;; Created: 2008-03-31' W, C+ z0 O- z4 M! c0 [
;;;
* A( ?9 C6 v9 Z$ ^8 l* W;;; Convert Attribute definitions to text2 p+ g; t4 }1 g! m! z* w* x
;;;
( g) a3 ?! e( r8 B, ?9 J* F1 \$ R6 D& W6 P
(defun c:ATT (/ eset1 blkcnt en enlist vl space)
6 B3 ~* E6 ~ m* R (setq eset1 (ssget (list (cons 0 "ATTDEF")))$ p( t& H* @ n |% b7 p
blkcnt 0
4 a/ ~1 `: J& E) i8 q )' o7 W3 t6 H& t. j' u8 q1 X
1 K X0 }% g7 Z: ~6 o (if eset1" ^, \! U: p1 j! @
(while (<= blkcnt (- (sslength eset1) 1))+ K% \ U& u+ _/ u: q
(setq en (ssname eset1 blkcnt)+ D d1 ~+ y) m. ~& K# A
enlist (entget en)
2 w! T$ t& f: N4 J! |( i space (cdr (assoc 67 enlist))
, e2 e" q" B" S, c3 G- p( p, Q5 J )
, f; ] |7 s x2 D0 k (setq vl (list' g9 M: v7 Y& G8 \6 O" i7 |
(cons 0 "TEXT")
* ]6 D& \" B9 ?: |# A (cons 100 "AcDbEntity")3 t1 V7 w% g" Y2 U I
(cons 100 "AcDbText")* q* ~6 N5 `# L) I7 O
(assoc 7 enlist)
2 R* n5 D/ Z! d8 i (assoc 8 enlist)
$ H2 |* |& [" C1 L9 @/ u0 g( o (assoc 10 enlist)
" E+ C! X0 D) x- y$ \9 B; K' x, d (assoc 40 enlist)
, |' l/ E$ ~/ i" z2 K' n$ | (cond ((assoc 62 enlist))- Z. V. C" P9 }( H
((cons 62 256))
' V$ [5 k2 s" L( b( R )3 ^& {6 y3 a1 |& [" _. L* J
(cons 1 (cdr (assoc 2 enlist))), J+ h' ]4 o2 \7 r) r1 D/ c! w
(if (= space nil)& g! p0 h5 [' b4 a7 H
(cons 67 0)
7 ~6 S6 I+ p+ U- E. q. P! c (cons 67 space)$ A$ s0 o- }3 o+ z/ B
)$ ]: M9 J9 }4 O0 A. B6 z
)
, Z& d0 y1 D* e, f+ Z5 y# h )$ @# o' J0 m4 Y% Y# X' j) i
(entdel en)
8 p' ]+ } y# O# I# m (entmake vl)
2 ]% E& U5 G% P- m9 a" w (setq blkcnt (1+ blkcnt))
, M7 z; H# `1 Z) Q$ U8 i9 S N ): X* K% y: b' P3 U7 H t$ ]7 o
)+ y) ~4 _/ H; F) H* k
)
y; h: k9 x2 `' P;=====================================================================' {6 k+ ]4 }- G$ ?' l O( w
;============================ Doi Truc ===============================$ D7 K8 z9 t# C0 \' K
;=====================================================================
! d$ H# @& @( {. ]: e) z% h, | Z( D4 ]0 D9 [
;=====================================================================' D; x6 d+ A# ~1 F0 Y0 V# N9 D {2 R
;=============== FUNCTIONS GA 1+3+5+7+9+11+13+15+17+19 ===============
- b1 Z9 G" f, W) [- S( w( j;======================== Tran Ngoc Thang ============================
: f5 T v$ e0 _(defun c:ga1 ()
" L/ K. Y f+ {9 ^4 m! r(setq a (getpoint "\nChon diem: "))4 I5 Y" O i5 l/ `. T' [7 f
(setq b (getpoint a"\nChon diem: "))
5 H" E- Q) p; }+ l% r; l; a( Z(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
/ m4 c6 ?2 p1 P; Z1 Z! d B(command ".circle" c a)
6 d: q! q& c9 }(command ".line" a c "")
: h6 E, u/ ?* K5 `) ^/ \(command ".array" "last" "" "p" c "1" "" "")
3 \: U# E3 q; _: ~% l(princ))
4 y+ x; R3 x3 D R5 G
% B& w) q) ]8 h: F: b: k5 p7 _(defun c:ga3 ()- Q8 A7 u) ]( ~" X# Q7 m# O
(setq a (getpoint "\nChon diem: "))
5 }* R5 w2 W: m7 M% g(setq b (getpoint a"\nChon diem: ")), N/ Q, @ u3 o3 m) F
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))) I+ l& t" j% b$ u0 o5 ^
(command ".circle" c a)
p6 V3 k6 l# g8 h) X X. v(command ".line" a c "")
+ Z9 M" G3 \7 n$ ~; t) z(command ".array" "last" "" "p" c "3" "" "")
3 `( k4 \+ K& r5 k% q! p(princ))0 h+ e* G5 J$ n
; ]* z J6 n) {& t' A. U$ P(defun c:ga5 ()
/ \7 L7 R \. |# c1 E' X(setq a (getpoint "\nChon diem: "))
/ S# ?0 z' I) O1 I(setq b (getpoint a"\nChon diem: "))
8 _ L, i4 n3 W& R0 L" ~ ^(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))), Q8 R! @2 i, X1 A2 f- c0 m: h
(command ".circle" c a)
4 V" Y( S, \ R/ G" r, E0 @(command ".line" a c "")! h( }( U' z( X: f6 j& o
(command ".array" "last" "" "p" c "5" "" "")
* O, J- F* g, x( U K(princ))
7 L" e0 K9 v: V: B
1 P. ?+ Q+ ^4 H5 q! @$ R(defun c:ga7 ()
$ r% `# H0 c5 _+ g) N+ r+ N(setq a (getpoint "\nChon diem: ")); X% y W( Q, U& C2 R8 u- y* m
(setq b (getpoint a"\nChon diem: ")): i! g3 [. Y2 [1 T0 o
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))% m6 a- k! \" A+ q1 M- }
(command ".circle" c a)8 Z2 i1 f$ T* G0 B' h" z" B- Q
(command ".line" a c "")0 A3 Z, ]; t7 w. u# b. l% Y% L7 V
(command ".array" "last" "" "p" c "7" "" "")
. ^& ]* R5 C3 E8 l. Q7 \! T: n(princ))
8 D# U U0 G* N9 k2 F/ L7 _/ O; ]% Q5 r+ Y2 t9 F2 L
(defun c:ga9 ()+ S8 S0 P7 B* G; S
(setq a (getpoint "\nChon diem: "))8 c8 d) E, {8 w
(setq b (getpoint a"\nChon diem: "))# i! F: x d# N" c) R% C) G
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))0 D C; Z' {- _7 f; p
(command ".circle" c a)
) A0 N# ?; f* U% ?(command ".line" a c "")3 e. x3 N1 A' `# j0 I: i, g
(command ".array" "last" "" "p" c "9" "" "") a7 f) w. u Q5 }, @
(princ))
: ~ t# S: }' F- |) Q8 _) B
, H$ L% I1 @. O) H7 ]/ }(defun c:ga11 ()
0 X, H& o9 t& k(setq a (getpoint "\nChon diem: "))* x: `( e3 s# j% i
(setq b (getpoint a"\nChon diem: "))( I( i9 `! f; ]1 R. h" T* U( w! \
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))1 F1 ^3 H* L* d0 V
(command ".circle" c a)$ D0 q0 P6 G3 v9 v9 k+ O
(command ".line" a c "")) v, p$ L# l( n
(command ".array" "last" "" "p" c "11" "" "")
( I; H4 J7 ?* U7 {. ~+ _7 b(princ))1 P+ A- ~+ L7 D! k; v
1 D8 {; y9 S, `/ O( F9 m
(defun c:ga13 ()
! S. [) h( y% q5 j) X(setq a (getpoint "\nChon diem: "))# \; H* U4 f+ l( f% j: M
(setq b (getpoint a"\nChon diem: "))
/ `0 G9 k3 D* _; M, G(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
, o6 o/ F9 R4 ~( o(command ".circle" c a)
" t, D' i6 @! m2 M/ U" x(command ".line" a c "")
6 } t/ ]. p! K4 u) X. S8 K, A(command ".array" "last" "" "p" c "13" "" "")6 v" V4 R& e8 |2 l& \, y3 O
(princ))
( D' S3 T! p2 @ U2 A1 `; J2 P l: e8 c: v
(defun c:ga15 ()/ [; k6 ]" N- Z) { Z- z
(setq a (getpoint "\nChon diem: "))
! l& j1 N6 E# J1 [7 T$ ^% F(setq b (getpoint a"\nChon diem: "))9 a, {0 s% [# E, I/ S
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))). w8 b7 C0 h0 D, u; o2 q6 K! U
(command ".circle" c a)2 @+ c$ C3 b% M5 i h; |
(command ".line" a c "")0 r% Q* b" H6 p$ z
(command ".array" "last" "" "p" c "15" "" "")
0 f: E5 i5 V5 \) D(princ))
5 Z1 R: P, Q/ {. d5 F/ ?+ Z Z5 e
/ Z7 O7 V2 Z/ ~! C6 O' b! t(defun c:ga17 ()
% V. w4 Z' m# w" i8 K(setq a (getpoint "\nChon diem: "))
8 @' U" n0 }) J1 A. s# m# D6 X) c1 v) f% s(setq b (getpoint a"\nChon diem: "))! n9 _* [& \5 Y( g; E6 C2 t
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))( i5 N, n! J2 W/ R1 \
(command ".circle" c a)4 ~1 r7 X7 D! z, h- `6 G1 b
(command ".line" a c "")! U! y- j" L( ^
(command ".array" "last" "" "p" c "17" "" ""): p3 ~. _. U9 T" u# K8 B1 U
(princ))
! P- q* B8 T' ^1 V% h
0 |4 \' {( {! {0 O(defun c:ga19 ()
: E4 e5 u# C+ X(setq a (getpoint "\nChon diem: "))+ ^' g5 n9 ~) W: l- S+ l% V/ x
(setq b (getpoint a"\nChon diem: "))
+ m9 U7 n9 [' y! n9 G(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))), e8 C8 @- ?3 Y1 O, C/ ^3 u
(command ".circle" c a)
9 t3 a7 G/ F x3 O) b4 W(command ".line" a c "")0 S( m7 b# e2 \2 W
(command ".array" "last" "" "p" c "19" "" "")
, {0 h" h0 r. e(princ))
% ?' h* ^/ m' ]& u) c
, ? m0 J. L1 X;=====================================================================
1 f$ K3 z f! `1 ?9 O8 M1 X9 E;============== FUNCTIONS GA 2+4+6+8+10+12+14+16+18+20 ===============
( o# D5 M, }3 { L2 V0 z( m$ R1 M;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================( I& I$ W3 U9 }4 R4 y7 [
(defun c:ga2 ()
% \( b v& a% f, y" l% u(setq a (getpoint "\nChon diem: "))5 p% r2 _3 g* z1 z
(setq b (getpoint a"\nChon diem: "))) F) v+ ? q$ F* u5 U; X" x, ~1 V3 v1 q+ p
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
2 s4 D. n9 e" P(command ".line" a c "")
9 A2 ~2 a, L' j: r# d, E& i(command ".array" "last" "" "p" c "2" "" "")
0 i& s3 j9 X0 A4 x) p; V9 R& ](command ".circle" c a)
4 r+ ^" W. [2 G(princ))) `/ f# G9 o. N" Q+ k, @
u- w. @5 }" t Q2 d% [(defun c:ga4 ()( X$ j. O2 N0 u5 o2 x; J. J
(setq a (getpoint "\nChon diem: "))
! x9 D: F8 x, A+ z$ O7 B1 V(setq b (getpoint a"\nChon diem: "))# C+ e) c+ n& G2 \) L6 H6 r
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
" e" w. V$ f+ d" k(command ".line" a c "")
! Q8 b1 X8 y$ G(command ".array" "last" "" "p" c "4" "" "")( m4 [6 G( X& J9 G0 r% u4 a/ \
(command ".circle" c a)
* X+ K Z7 O/ j: W8 b(princ)); H) n7 l; N/ I# c
1 q/ |5 D% K% c2 }! c6 Q9 P
(defun c:ga6 ()% D B H- v3 G8 d
(setq a (getpoint "\nChon diem: "))
2 [. Y+ e: n9 i9 k6 j1 e(setq b (getpoint a"\nChon diem: ")), p) C3 l5 ^9 c2 F( S! P) R5 w' ^
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))); O( K9 Y) j- O4 ^' C4 a9 b7 j
(command ".line" a c "")
w: A: `8 k$ D(command ".array" "last" "" "p" c "6" "" "")
2 q. q `+ T- i; j# h7 p* \(command ".circle" c a)0 J0 Z7 ~- }! ^
(princ))
+ v$ ^$ a* {: f5 D( c
6 w! {( T! ` F2 s(defun c:ga8 ()
8 N& Q0 J* K# e* D+ q9 A- U(setq a (getpoint "\nChon diem: "))
# ^/ L8 c8 F# C" F1 V+ f% v+ ]4 ^(setq b (getpoint a"\nChon diem: ")) m7 U$ z- V- S. \8 X
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
6 x, Z; ?/ g+ G* S# T(command ".line" a c "")9 `% J+ a' w! [ x P" D6 {' ?# f" \- u. q
(command ".array" "last" "" "p" c "8" "" "")
; }8 [! ^: R, u* R- y3 V(command ".circle" c a)3 B& E" d6 d% a; g% c6 w
(princ))
; J' {2 }" O. C0 Y8 ]/ ~5 _9 F8 F# T9 S3 H
(defun c:ga10 ()
1 g8 G5 z0 l/ ]9 s0 v+ @ f(setq a (getpoint "\nChon diem: "))
- ?, R# l% k ?# Y: L2 d(setq b (getpoint a"\nChon diem: "))
" X0 B S' w+ r1 f7 r6 @4 i/ Y(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))) l ]$ {) w5 ^0 k6 n/ U" E
(command ".line" a c "")
1 N7 I7 L( X& Q1 {(command ".array" "last" "" "p" c "10" "" "")
/ o2 H9 x& q. ^9 g/ B(command ".circle" c a)
2 f6 _4 {4 F# ~, v/ S, ^6 s% }(princ))% r: x, _/ j& M% C! K8 ?7 G
6 I6 T5 F% E. d t) G Y) F+ h(defun c:ga12 ()
1 V/ x/ v) u6 {(setq a (getpoint "\nChon diem: ")): D- }3 I. z# |9 g1 r
(setq b (getpoint a"\nChon diem: "))
) m6 U" p' d" Z(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
S. b! e# V0 v) E5 S. s(command ".line" a c "")
' J0 T8 F1 I$ Z7 k(command ".array" "last" "" "p" c "12" "" "")7 E8 p& {3 C, H: a) U) v
(command ".circle" c a)* G# E* [: E- k# ^* Q0 w* w" \
(princ))1 K" N6 h) j( Y$ r% K, z
5 A7 a' G M5 W; Y1 [% a+ L(defun c:ga14 ()3 L9 R% [9 D$ @+ i$ r
(setq a (getpoint "\nChon diem: "))
) i Z, x" \% ^- O0 L(setq b (getpoint a"\nChon diem: "))& Q- V3 u6 ?. g Z6 [% g! X
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))1 P! `& a( @6 U! b0 @
(command ".line" a c "")
5 u8 ?6 M0 B5 S' w(command ".array" "last" "" "p" c "14" "" "")
5 X( r1 X8 w& d( X$ N(command ".circle" c a)) V+ ]$ R# l( s3 p1 g, J, O! b9 a' Y, I
(princ))5 h( j; v: e* N* o7 ?
7 H, m3 {2 p4 S* j
(defun c:ga16 ()
( C# `4 J/ ? @2 c/ t- v(setq a (getpoint "\nChon diem: "))
% v: [$ n- r) Y* M+ Y(setq b (getpoint a"\nChon diem: "))
) O" P% b8 K* @2 O j(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
8 F6 C$ B' r' x( ^(command ".line" a c "")
% u0 _" w! }9 M2 U9 W2 H# ]9 h4 v(command ".array" "last" "" "p" c "16" "" "")! K" d. v9 h/ J- L# f' [
(command ".circle" c a), h7 _+ c8 e! A7 M. `3 r# Z
(princ)), {0 W6 S. B; j
. j2 M& H7 A' M7 a( E1 c(defun c:ga18 ()8 }( x* d7 t: [9 Y! x
(setq a (getpoint "\nChon diem: "))3 O7 B+ q, ]/ J! }- K) Y, @
(setq b (getpoint a"\nChon diem: "))/ b( s5 [' F+ W6 D- }; ^" ]
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
: m: ?1 A1 X ?, U' \7 @(command ".line" a c "")
4 n' p/ d( P: W(command ".array" "last" "" "p" c "18" "" ""); \! K. A8 B& K8 x2 f9 t
(command ".circle" c a)" [8 h$ Q2 i4 t8 ~
(princ)), ?8 n8 X X- X' ]9 J
( u8 x3 J7 C1 |# j3 Y2 u* | u
(defun c:ga20 ()
4 v3 e) [/ i( V9 j9 n(setq a (getpoint "\nChon diem: "))& t: j0 L/ ]4 B) N q( t7 h& k
(setq b (getpoint a"\nChon diem: "))" u; K" L" P1 ^4 \
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))), ^: h2 y/ |& a0 v; m
(command ".line" a c "")
" `2 O9 D8 X# m% d: z9 {% q: H(command ".array" "last" "" "p" c "20" "" "")* E9 I6 r [' B7 A4 w. ^2 i
(command ".circle" c a)
; g ~. N* Z% B- q' o9 N( ?+ [(princ))
' y& z. ]9 g6 }1 [4 `: B6 @ D- Y% h) T0 o7 `2 U, I2 @& q' C
! f2 @% i2 L' j0 A3 I0 m& _* J9 M3 A; X- T
;=====================================================================
4 `; C* d$ u% ~;============== FUNCTIONS GA TUY THICH : EVERYTHING IF ===============
3 u1 ^& P+ q1 l. i$ ]# `6 G;========================== 06-11-2016 ~ 18h00 =======================
5 B4 s- P g5 ~) r% E;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
! p% h& ]2 x' z: f3 p9 ^' X+ ?(defun c:ga ()! {: V/ q, M& q& i" l" y: t
(setq a (getpoint "\nChon diem: "))
" a A4 s( R, \* a( u( N+ s(setq b (getpoint a"\nChon diem: "))
, D6 N/ A3 Y2 K! \(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))1 [+ a- V1 k+ E! a! o9 x' M* R
(command ".circle" c a)' W% E( U% s- s; c; y8 n
(command ".line" a c "")- Q/ _: L! U; Y
(command ".array" "last" "" "p" c "NUM" "" "")4 n7 ^- c9 N/ U7 d
(princ))
9 K/ V2 G* J: J! C. e* d3 y
$ J, l5 G. Q8 g) x: p/ f( T;=====================================================================
" G% N% |9 B, W3 i;=========== FUNCTIONS HOA THI TUY THICH : EVERYTHING IF =============
. e& @ X' r/ ] u- I7 l; n0 G' r6 w;========================== 06-11-2016 ~ 18h40 =======================
& O# [" `4 `6 l- z;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
|5 G& q0 N5 W' g. ?2 c& h
' h) ~& O9 G$ y5 r V(defun c:hoathi ()
) _) L3 O; C" Q E! q# O(setq a (getpoint "\nChon diem: "))
5 J# T9 b! \3 z% \8 x(setq b (getpoint a"\nChon diem: "))
6 ^1 }8 [, b) H6 `8 _(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))% D% |( {" G5 ?/ A
(command ".line" a c "")
7 }$ |9 D& |% f(command ".array" "last" "" "p" c "NUM" "" "")
. M, q. `. I6 S, a" V(princ))% [3 _) r) T0 U+ E
1 k- G2 @2 ]: i' u# h
;=====================================================================# Y$ J* c, G, ~
;============= FUNCTIONS CUNG TUY THICH : EVERYTHING IF ==============/ d( E3 L" O H
;========================== 03-11-2024 ~ 19h33 ======================= \5 D3 h9 @4 K* k
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================* r2 p# z1 w4 A/ S( S+ f
$ t; C. U% M9 M: H
(defun c:cung ()
. p9 e" ^" P* h(setq a (getpoint "\nChon diem: "))8 p8 J5 Y$ C. B* _" q# i
(setq b (getpoint a"\nChon diem: "))) W$ A7 v- x3 ?- r# y
(setq c (getpoint a"\nChon diem: "))8 w' ^2 E7 s" |9 X- v8 Q* n
(setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
8 C8 R' s; j6 i6 C9 n9 }(command ".arc" a b c "")
; @/ b6 r( n8 A8 C; A: l(command ".array" "last" "" "p" c "NUM" "" "")' [6 r. {% P% e
(princ))
) h: s! N0 r! U+ s+ l) D
: d% Z4 n4 Q7 ^' ` V# @6 t;=====================================================================
9 t: r* A$ L9 g( ~: u' |$ Q;============ FUNCTIONS HECLOIC TUY THICH : EVERYTHING IF ============6 a4 s) S) M& h" c, W
;========================== 03-11-2024 ~ 20h02 =======================
+ K! N- Y& Y4 \% Y;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
. ^# C. u$ ]0 }; o+ e; b& X(defun c:hecloic ()( n$ ^* e! l& d) x% Y) C
(setq a (getpoint "\nChon diem: "))
" {6 a! b- p* [% \(setq b (getpoint a"\nChon diem: multi "))' J1 H9 [9 m' c& K* H) \
(setq c (getpoint a"\nChon diem: "))(princ)
; s: d- r; H; }4 {/ P; z; U ~, u(setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))); n/ U8 H+ d3 E
(command ".arc" a b c "") t, _$ K% C3 y* h4 {" G
(command ".array" "last" "" "p" c "NUM" "" "")
* W; `( j( P' G' a$ {(princ))9 Z7 U+ \. L1 |/ j
# d/ ~1 y% w+ y; w+ ];=====================================================================1 U8 [' [* g9 l5 a
;============== FUNCTIONS GAY TUY THICH : EVERYTHING IF ==============
( s% X0 c( t v" t: n% G" w;========================== 03-11-2024 ~ 19h38 =======================% n" x5 f$ }. y0 o+ B
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================; n0 B; x+ K( o) e3 I/ |" T% ?% J
+ e: y& E9 S* a* e- |) ^3 S(defun c:gay ()3 [- v( K# P# X
(setq a (getpoint "\nChon diem: "))4 h% |* N9 c) H9 _1 t( u
(setq b (getpoint a"\nChon diem: "))
1 l9 W$ ^8 @5 P9 Z: U B) D+ N(setq c (getpoint a"\nChon diem: "))(princ): v/ H" }9 l. X; B0 S+ K
(setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
8 G+ [" g0 f/ {0 A8 y(command ".pline" a b c "")7 d, o* B* h5 M; K# Q
(command ".array" "last" "" "p" c "NUM" "" "")/ ~( C' @* ~) ]
(princ))/ I6 `# z. P9 o6 e
9 k: i2 x, S Y* t: B- |;=====================================================================
4 m6 e& K) e# d g; j;============ FUNCTIONS HECLOIT TUY THICH : EVERYTHING IF ============% {& o% a# g4 Q
;========================== 03-11-2024 ~ 20h02 =======================6 h, o( ~% w( x
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
" f2 Q. X1 |2 O4 L0 ]; i* |
( `- v1 y9 m y9 \8 e(defun c:hecloit (). @) f# l8 Q" K i4 R
(setq a (getpoint "\nChon diem: "))
4 [- z4 D2 b$ P3 f# C0 _0 h0 x( o(setq b (getpoint a"\nChon diem: multi "))
% y2 h7 g% p2 N4 z. _5 R. m(setq c (getpoint a"\nChon diem: "))(princ)# c$ T ?$ h. J/ N2 L! |% P
(setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
2 s k( y0 R+ e6 k+ a, T(command ".pline" a b c "")$ u" T1 F& v* d7 e9 N( {) z
(command ".array" "last" "" "p" c "NUM" "" "")
1 Y; T/ A- M6 R! [+ |% p; @(princ))
/ Z! V0 |1 l j! P. Q# D2 ]) t/ {* d. Q. A0 M7 c. g, m% ]
$ g, ~& b9 Q; @
;;; ============================ Merge Hatch =============================6 {( I6 D0 X& V2 t2 b- ]5 }% ]
5 W1 \" v8 j: f% }" ~+ g
(defun c:mh (/ ss entht sl i dt dtht)3 ?* @3 t! D! O0 g. ^1 G
, {5 w* Y( K3 ^3 Z% A( j; X (princ "\nMerge Hatch - free lisp from CADViet.com")
$ a8 P0 ?/ M2 e/ c
f1 p# {# n/ I% Z9 r6 x# x (setq% f3 b( p+ G3 ?% _1 G: U& k( N7 e
ss (ssget '((0 . "HATCH")))
' D' z* b9 u4 F2 k" e sl (if ss0 T4 i1 c$ t+ k: v% N
(sslength ss)
' m u9 T" t* R7 [0 l 0( W' a8 A4 r+ J% U1 L& N% m2 i
)) r9 [/ P8 Y8 _$ E+ T8 e# N
i 0
& h9 n/ B0 X4 `) \0 X, E- w8 y# c l 07 h$ l! W @1 b0 ~6 w/ x9 S
)
6 K; C8 O# u0 i6 `4 T( x) ?' d) A1 E
(repeat sl
! m+ r9 C: [1 ?/ w2 t (setq( M4 R0 {: t4 h1 {5 i5 F
entht (ssname ss i)
5 h+ L' N# U$ |1 y1 f dtht (getbdata entht)
0 N! C4 G2 _1 h' |# f. }8 [ dt (append dt dtht)- t; _3 E+ x4 D: v9 B! v
l (+ l (cdr (assoc 91 (entget entht))))
# H# s+ h( s3 r. k, ` r i (1+ i)
' |* A a9 ]/ w6 f+ J )9 x& [& |2 {0 c& v: B
)
0 ~- G. u0 T0 Q2 I* I$ A( j, H) q1 V, n0 E
(setq ent (ssname ss 0)
0 M; O7 Y! o5 @* y3 w4 u6 q ss (ssdel ent ss)
) C9 s( X5 k* o9 \( i# o1 C- G tt (entget ent)3 s! e7 u/ M5 s/ b) |/ L/ @
duoi (member (assoc 75 tt) tt)
6 V, P8 q7 E- Q0 A0 [$ h dau (reverse (member (assoc 91 tt) (reverse tt)))( ]. y/ M) `5 N
tt (append dau dt duoi)7 _/ u5 N Y" x5 \# A
tt (subst (cons 91 l) (assoc 91 tt) tt)0 p4 d6 {8 y3 U# l$ _
)' U% Q+ f7 V) X5 d8 o) w/ x' s4 o
(entmod tt)
: A% e% R Y+ T" }' k" R2 g6 s
(command ".erase" ss "")
& q/ D2 \* J u2 t (princ)
, r# f2 B% A. N- l2 N* t2 \/ P' u5 F5 j)
* \; }% }1 I7 _9 {. p o3 K
5 Z6 X$ t8 ]. @6 \1 x9 I$ @(defun getbdata (ent)
" B. E8 o- }" w6 s$ d+ n" ?* w6 O7 h (setq tt (entget ent)
, }/ I# H$ {, W( ?, ^$ D5 t2 Y tt (cdr (member (assoc 75 tt) (reverse tt)))
' \, k3 D- `- i+ c tt (cdr (member (assoc 91 tt) (reverse tt)))4 `5 G* t; L9 g1 t; L: L. `
), I9 W; S4 z3 I7 q; Z: U9 s
)$ o- O3 s- J- x$ M7 U4 Q2 a! H# p
2 i/ s8 O5 p/ ], l4 E, E
# h) Y" n# N/ e1 g* [7 N(princ), {, K7 O5 m+ _ g7 i. C8 F+ M
( C+ n. e7 ^3 q: s( @6 o9 W;;; =========================== CAC LENH LAYER ==============================7 V0 K' m3 c% T8 n1 h2 _0 F- ~
;;; =========================== Layer hien hanh =============================
7 B8 M8 u: _/ R1 E. N7 _$ A. o+ T" D& @/ h. K4 O& y
(defun layset (/ LAY) (setvar "cmdecho" 0)
6 L2 e$ R1 K/ z3 [; { (setq LAY (entsel "\nPick vao doi tuong muon Layer hien hanh la Layer cua doi tuong do : "))
, n* r- i1 b9 t9 q* T (if LAY (progn
. I' k$ N! g( I* E5 s* Q (setq LAY (cdr (assoc 8 (entget (car LAY)))))
, }) u$ q, G+ n4 x (command "_.layer" "set" LAY "") (princ (strcat "\nLayer : " LAY " da la hien hanh.")) )
! G V8 r$ c5 A3 P5 C0 Z2 L (progn C+ t z( ?, W8 b
(if (not ddlop) (load "ddlop")) (if (setq LAY (ddlop)) # h% T3 @6 v2 x) k
(progn
3 K6 Q+ J9 e' t( i) C0 g (command "_.LAYER" "ON" LAY "THAW" LAY "SET" LAY "") (princ (strcat "\nLayer : " LAY " da la hien hanh.")) ) ) ) )(princ) )# H# Z( o7 T! v& h7 z
(defun c LL () (layset))(defun c AYSET () (layset))
5 ]9 t$ W9 M5 Z1 K# t' ~( ^6 |2 {5 o
;;; ================== Cap nhat doi tuong vao layer hien hanh ==================3 \2 t Y1 ]) S1 R
/ m6 y8 u4 C( \8 n1 M& N3 T) S5 a(Defun LAYCUR (/ SS CNT LAY) (setvar "cmdecho" 0)
% o5 E: c9 H6 E+ Y( Z2 r (if (not (setq SS (ssget "i")))& q0 m# C3 J3 _+ N9 H9 l
(progn (prompt "\nChon doi tuong cap nhat vao layer hien hanh: ")" @6 d* F2 K0 c$ \; b
(setq SS (ssget)) ) )+ f0 r1 Y4 x! N! S: n5 U* q- Y
(if SS (progn
) ^" W" ?- B1 S2 o" s; } (setq CNT (sslength SS)) (princ (strcat "\n" (itoa CNT) " doi tuong tim thay.")) (command "_.move" SS "") ) h. d. x$ P- C9 s# y1 n
(if (> (getvar "cmdactive") 0) ) t' D. _6 {% B9 ~- r
(progn& x* x2 e+ e" C) L2 b( g
(command "0,0" "0,0") (setq SS (ssget "p") CNT (- CNT (sslength SS)) ) )7 J1 V h C) K" Q" J& b% [
(setq SS nil) ) (if (> CNT 0)
6 |. S$ k9 d, C/ m. n6 Y. K& { (princ (strcat "\n" (itoa CNT) " doi tuong tren layer LOCK.")) ) ) )
s2 T/ H! h& r' d: F0 ^9 T (if SS (progn/ x4 y- O( }* \
(setq LAY (getvar "CLAYER")) (command "_.chprop" SS "" "_la" LAY ""): L1 c/ a3 {8 K/ O1 O# @
(if (= (sslength SS) 1). ]0 e" [6 T% f, X1 T( e2 n- l
(prompt (strcat "\n1 doi tuong da cap nhat vao layer : " LAY " (layer hien hanh)."))
1 H" g" j, K2 U: L: ?- y2 J# W (prompt (strcat "\n" (itoa (sslength SS)) " doi tuong da cap nhat vao layer : " LAY " (layer hien hanh).")) ) )) (princ) );end
2 A+ @8 r- D) ~! f7 o; A# A(defun c AYCUR () (laycur)) (defun c HH () (laycur))
! q( a; V4 b" ~6 ?+ h" } u; f/ G( q! P/ @' K+ x% d
;;; =========================== Layer Iso ===================================
z0 F8 n, M- t# M2 S
* g9 D/ Q6 \: d% w(Defun LAYISO (/ SS CNT LAY LAYLST VAL) (setvar "cmdecho" 0)
, L7 ?" l6 }' c- |/ `2 z (if (not (setq SS (ssget "i"))) (progn
K, n0 V& r3 W8 v- @1 g (prompt "\nChon doi tuong tren layer(s) muon lam viec doc lap: ")
2 H2 s: y$ v- R* L3 D+ ~( m4 m6 r (setq SS (ssget)) ) )6 t' z# x: D& |+ c, z
(if SS (progn (setq CNT 0)7 H2 d9 H9 F) u& s
(while (setq LAY (ssname SS CNT))
2 q+ h1 l& b3 a, p: g6 Z+ ] (setq LAY (cdr (assoc 8 (entget LAY))))7 M( d9 K4 _3 D8 c" Q. i7 T" i
(if (not (member LAY LAYLST))
* w# y$ F/ e& e9 F- c (setq LAYLST (cons LAY LAYLST)) )
! w6 e4 |! l3 D) q- E7 d (setq CNT (1+ CNT)) )
1 g3 I1 H: ]6 X" L% P (if (member (getvar "CLAYER") LAYLST)
& `: z9 z7 a( i (setq LAY (getvar "CLAYER")). s. Z7 U; b; y- v
(setvar "CLAYER" (setq LAY (last LAYLST))) )- J$ L4 x! M7 \, l. G W
(command "_.LAYER" "_OFF" "*" "_Y")
8 S5 A5 T7 U0 d8 P1 _. z# o! [ (foreach VAL LAYLST (command "_ON" VAL))/ E% u% c' i2 k: n7 O
(command "") (if (= (length LAYLST) 1)( e# F1 V$ t% `: L, N
(prompt (strcat "\nLayer " (car LAYLST) " da tach ra."))
7 ^ c# l4 y; Y+ [ (prompt (strcat "\n" (itoa (length LAYLST)) " layers da tach ra. "
- D" h3 P% j# g+ O9 d "Layer " LAY " la hien hanh." ) ) ) ) ) (princ) )+ Y) v6 |2 r5 B4 K: u$ H
(defun c AYISO () (layiso)) (defun c I () (layiso))
, {$ Z* |. _) ]6 n* k. G1 `
& P7 T; a J% ~: M;;; ========================= Layer Match ==================================
2 M4 U& O2 f+ {2 O" B, a. ]' L8 h: b% |) L" E' S V7 U' I0 N L
(Defun LAYMCH (/ SS CNT LOOP LAY ANS)+ x2 e4 @* @, b! h
(setvar "cmdecho" 0)7 \2 S% N& Q- n5 x* ^
(if (not (setq SS (ssget "i"))) (progn, ^- C1 Y. }0 L
(prompt "\nChon doi tuong muon thay doi Layer : ")
/ M+ z7 E; q* M+ {# S (setq SS (ssget)) ) )8 [! K( g9 Y" O! r
(if SS (progn+ @4 }4 B) z6 G: z" S9 ~" G1 i
(setq CNT (sslength SS))
6 _4 t; F& |- @! R7 | (princ (strcat "\n" (itoa CNT) " found.")) (command "_.move" SS "")
4 w; f" g/ j, }1 r6 ^ (if (> (getvar "cmdactive") 0) (progn
, w3 _3 N( L* { (command "0,0" "0,0") (setq SS (ssget "p")
2 x7 I% h0 m* I9 V2 j$ U1 ]: ^, U CNT (- CNT (sslength SS)) ) ): E) p/ k- R/ I3 E( D9 y
(setq SS nil) ) (if (> CNT 0)
4 z1 i$ E: S. v8 N/ m0 y. ~# _ (princ (strcat "\n" (itoa CNT) " tren layer LOCK.")) ) ) )
9 j7 m% e, U0 {3 N) b7 i (if SS (progn4 L% O. M: N" @( M U
(initget "Ten") (setq LAY (entsel "\nTen layer/<Pick doi tuong>: ") LOOP T )" Q( p! _8 D0 E# k( B8 }# M6 U
(while LOOP (cond
* P3 }* h5 k; h$ e" m$ r+ W ((not LAY)
0 [0 w: q, \6 J- x& } (prompt "\nKhong chon doi tuong.")
; F" Q2 c7 o) @2 b- G t (prompt "\nSu dung layer hien hanh? <Y> ")
. A, q9 j) v) L( [( ?+ a) k7 Z (setq ANS (strcase (getstring)))
5 y! R' `9 h- @: Q5 l (if (or (= ANS "") (= ANS "Y") (= ANS "YES"))* a7 W8 `0 J( p1 P9 M9 I4 V# t4 K
(setq LAY (getvar "clayer") LOOP nil ) ) )
" W5 Q+ ]9 E0 e% M9 [ ((listp LAY) (setq LOOP nil) )
4 a2 [. E. K3 \: R: E/ W! i ((= LAY "Ten")9 p" S( d: h* f4 {
(setq LAY (getstring "\n>Nhap ten layer: "))+ e9 I$ g0 k( u5 M; |8 G% j
(cond" A2 d2 B. j) _
((tblsearch "LAYER" LAY) (setq LOOP nil) )
4 P/ ~% X( ]/ l2 z) c ((/= LAY "")
& {# ?1 Q0 S3 l3 d- ?0 \ (prompt "\nLayer chua co trong ban ve. Tao layer moi? <Y>: ")% V3 Z1 Z9 W X$ w
(setq ANS (strcase (getstring)))
$ b; y$ Z$ V8 z7 W$ U" c( f8 s5 @ (if (or (= ANS "") (= ANS "Y") (= ANS "YES"))# S. ?1 G6 ]5 I4 J
(progn0 A2 |% q* } L/ V7 N$ a
(command "_.LAYER" "NEW" LAY "")
4 l$ V. K) E6 @4 ]' r1 q (setq LOOP nil) ): r. c. G% Y6 p6 p7 W( F
(prompt "\nLoi ten layer.") ) ) ) ) )
* ?2 z0 P* x+ V% ~( | (if LOOP (progn (initget "Ten")
% | ^& h; |& ^; L9 Y (setq LAY (entsel "\nTen layer/<Pick doi tuong>: ")) ) ) ); while LOOP6 q6 ]# Z) D1 v& w8 u" z- l& p
(if (listp LAY)
) ?3 M+ n. e* t( a6 a (setq LAY (cdr (assoc 8 (entget (car LAY))))) )
1 N6 b* `! q' W) T' t" ` (command "_.chprop" SS "" "_la" LAY "")- v! [# n8 E( c
(if SS (prompt (strcat "\n" (itoa (sslength SS)) " doi tuong thay doi toi layer " LAY )) )# t; Q8 b4 R9 P, \* N; H
(if (= LAY (getvar "clayer"))% @$ _6 b! x# E+ q# a4 b+ v
(prompt " (layer hien hanh).") (prompt ".") ) ) ) (princ) ) V, P; c" [3 }0 c' N( T
(defun c AYMCH () (laymch)) (defun c:CLL () (laymch))
4 q& D. O6 C( q
! f1 ]; [1 @; i9 }* {;;; ============================ Layer OFF =================================
+ M% p/ B2 O9 c9 z$ y6 s, M4 x9 A
(DEFUN C J (/ SSET SSL ENT LAY I MODE)- n: Z2 R) g" T( H! X
(SETQ SSET (SSGET))8 U1 Q0 n) V# {+ Y% g
(IF (/= NIL SSET) 0 }% x' f0 a# E3 J; e1 _0 e
(PROGN# K2 i8 d: X1 R e$ k# m Q: L' d. a
(SETQ SSL (SSLENGTH SSET))
1 a6 @3 S6 a5 a O! M3 u' K5 K (SETQ LAY "")
r4 y6 C. q0 ~0 P1 a, m (SETQ I 0)) ]3 |- x5 A3 A9 I4 ~
(SETQ MODE 0) 0 b0 p$ H& I) Y% o! Y
(WHILE (< I SSL)
" u; K- v9 y# m7 ]/ [ | Z q (SETQ ENT (ENTGET (SSNAME SSET I)))
! u7 l$ ]7 r+ Z& Q+ l7 F8 i6 ] (IF (= (CDR (ASSOC '8 ENT)) (GETVAR "CLAYER")) (SETQ MODE 1) )
3 c2 D8 F/ F. I. H% k (SETQ LAY (STRCAT LAY "," (CDR (ASSOC '8 ENT)) ))4 }8 [1 r, P: C' O
(SETQ I (+ I 1))/ q$ j( I$ @! B1 f* ], I
)
# X! }3 L! `9 q. N (COMMAND "LAYER" "OFF" LAY "")
; {0 S/ A# x5 A) @7 B (IF (= MODE 1) (COMMAND "") )
: @! Y9 b4 \5 L) W6 _ )1 \: C3 d5 w% o9 `5 R
)
2 w# N* I4 l/ y. k& M( u (PRINC)
) w z" n$ W0 a s3 P). I7 G( g. S1 l0 S
7 d; J; e0 l! d% J, j;;; ================================ Layer ON ==============================
% |8 @# |& i( a
4 O, ~9 j. l2 g+ y( [# V/ w; r(Defun LAYON () (setvar "cmdecho" 0)
" P1 O. H- ], g) Y5 T; h (setq Lay loff1) (setq Loff1 Loff2) (setq Loff2 Loff3) (setq Loff3 Loff4) (setq Loff4 Loff5) (setq Loff5 Loff6) (setq Loff6 "0")( O3 @3 u" K, }# E
(Command "LAYER" "ON" Lay "") (princ (strcat "\n Layer : " LAY " da ON.")) (princ))
) I: m \% x, X(defun c AYON () (layon)) (defun c:LOO () (layon))# Y1 c2 L- P! d: i( a/ J
(Defun C:LO () (setvar "cmdecho" 0) (Command "_.LAYER" "_ON" "*" "") (princ "\nDa ON toan bo cac Layer !") (princ))4 M( s+ V- @% v* V
6 J6 F2 p+ G! {;;; ============================== Layer Freeze ===========================- T1 ]. l# q" B" g% @+ P4 N
- t T/ M. `# l9 C(Defun LAYFRZ (/ LAY TEMP)(setvar "cmdecho" 0)
$ v* U+ n" `' e(prompt "\nChon doi tuong tren layer(s) muon FREEZE: ") (SETQ SSET (SSGET)). y. I8 p2 r& k6 D1 W
(IF (/= NIL SSET) (PROGN7 R2 D. n$ `1 n+ s
(SETQ SSL (SSLENGTH SSET)) (SETQ LAY "") (SETQ I 0) (SETQ MODE 0) $ q) T6 Y, s/ p7 ~& ^7 D8 T
(WHILE (< I SSL): X6 f/ I0 {& ` p$ x ?$ p
(SETQ ENT (ENTGET (SSNAME SSET I))); X1 h# M' ~, V3 J) \
(IF (= (CDR (ASSOC '8 ENT)) (GETVAR "CLAYER")) (SETQ MODE 1) )3 \" b' r5 X! a( F+ W
(SETQ LAY (STRCAT LAY "," (CDR (ASSOC '8 ENT)) )) (SETQ I (+ I 1)))# h0 E0 j6 c& @0 Y
(COMMAND "LAYER" "FREEZE" LAY "")) b: N- R/ w7 x
(IF (= MODE 1) (COMMAND ""))))
. v7 v8 @9 o, G7 { (setq Lff6 Lff5) (setq Lff5 Lff4) (setq Lff4 Lff3) (setq Lff3 Lff2) (setq Lff2 Lff1) (setq Lff1 LAY)
8 m, o' r: \. p& M0 [) v6 W) ] (princ (strcat "\n Layer " LAY " da FREEZE."))(setvar "cmdecho" 1) (princ) )# u; V+ P& a0 X
(defun c:LAYFRZ () (layfrz)) (defun c:LLF () (layfrz))2 ^$ s) x8 S; d& ~9 F7 ?
& J! M$ {$ |9 o$ L! i, t3 f;;; ============================== Layer Thaw ===============================% B) p$ `- B7 D' O
; A6 }8 x4 B5 b" a9 }- k+ q
(Defun LAYTHW (). [! K) @# X" d' f4 c* t5 a
(setvar "cmdecho" 0)" k+ u( _) z, |! y+ S! }! @
(setq Lay lff1) (setq Lff1 Lff2) (setq Lff2 Lff3) (setq Lff3 Lff4) (setq Lff4 Lff5) (setq Lff5 Lff6) (setq Lff6 "0")3 l$ N2 v9 N. G& p. o7 @9 C
(Command "_.LAYER" "_THAW" LAY "")
' `( A# Y- f6 `/ Q) _5 V% x! ? (princ (strcat "\n Layer : " LAY " da THAW."))" g2 h f/ y7 ~+ ` \ ~; y8 f
(princ) )' W- F# u& X; X3 V" U! Q3 B$ Q
(defun c:LAYTHW () (laythw)) (defun c:LW () (laythw))+ `( }0 T; D4 m, _: C9 K/ V3 K
2 Y3 D8 q3 O( H1 q;;; ============================== Layer Lock ==============================8 H, j1 G6 k& s# L7 T; f
& L# v" x7 ?$ X# M(Defun LAYLCK (/ LAY)
+ k9 R0 D$ q" z! p: C (setvar "cmdecho" 0)
1 ?6 C) ]3 u+ e (setq LAY (entsel "\n>Pick doi tuong tren layer muon LOCK: "))0 b) o% V; l `7 v# q# K; A
(if LAY
6 W _# ^4 @. ]" L$ P (progn
( L8 s, x1 z) O/ K4 y (setq LAY (cdr (assoc 8 (entget (car LAY)))))6 w, W" l( e5 ~0 F
(Command "_.LAYER" "_LOCK" LAY "")
& [& U7 |! _) c (princ (strcat "\nLayer " LAY " da LOCK.")) ) ) (princ) )
% p' j" w j1 M" f k* m9 ^(defun c:LAYLCK () (laylck)) (defun c:LK () (laylck))+ A; n4 _# i: z3 p0 R( r
6 j: Z! B; E9 m* r+ m! L;;; ============================== Layer UnLock ==============================
* {) d) \& k A3 M# a) a' E6 ~: @; r: x& i$ U
(Defun LAYULK (/ LAY)6 M4 _2 {' `; |# b) z
(setvar "cmdecho" 0), p5 ]) R8 w& ^7 _
(setq LAY (entsel "\n>Pick doi tuong tren layer muon UNLOCK: "))& Y; ?4 A' n1 v8 X* x
(if LAY
( ~( |( i: r. Z" ~" r (progn
7 r0 S5 v6 P, d+ p h; e8 C. i! s (setq LAY (cdr (assoc 8 (entget (car LAY)))))
6 |$ a% X7 m/ C (Command "_.LAYER" "_UNLOCK" LAY ""). z! L- m/ y, h$ f
(princ (strcat "\nLayer " LAY " da UNLOCK.")) ) ) (princ) )! ^1 A' P" j' P. I& p
(defun c:LAYULK () (layulk)) (defun c:LU () (layulk))
8 Y W& l+ ?& W- Z$ }7 o+ p1 B3 |- u- F* ]
;;;===================== Delete all objects of Layer ========================
" L7 N. c8 ~+ Y
, r: C; E! ?5 R4 |(defun DELAYER (/ ocmd L S) ' M! v- O/ g X5 R6 ?7 G
(setq ocmd (getvar "CMDECHO"))$ W8 }; S6 u% K& Q1 a: d6 S! h
(setvar "CMDECHO" 0)
- @4 {# u( h' }" [ (setq L (strcase (getstring "\nLayer(s) to delete: ")))
& l4 `6 q) q0 Y; F* m (setq S (ssget "X" (list (cons 8 L)))) + _) C( W u4 P& _% D& O
(if S
+ i; J. N# q* L1 N4 Y, } (command "ERASE" S "")
$ L- V- [9 ^- U- O7 G7 M6 B (princ "Layer empty or not a valid layer name.") )
6 I8 Z2 E/ l" U% [. E1 m" w5 h! J (setq S nil) + J# `* @+ k* p I, ]
(setvar "CMDECHO" ocmd)
+ b8 p+ v2 V5 N# \ (princ) ) * T) w8 r( l/ R' R' f) G7 P: o
(defun c:DELAYER () (delayer)) (defun c:DELLAYER () (delayer)) (defun c:DEL () (delayer)), e$ g! P7 r4 n5 I5 t! p$ c
* V% H. e- d$ U2 U' A$ p
;;; ========================= HET CAC LENH LAYER ===========================
u+ j4 q6 e& ^9 E) F3 P0 q2 e0 c
;;;====================== EXTEND NHIEU DOI TUONG ===========================; j# w4 [1 ~( {
9 o$ V* G6 E9 ]$ K0 i h(Defun C:EET ()- L9 X: m" Z8 V# Y+ s
(Setq CVAR (Getvar "CMDECHO")) (Setvar "CMDECHO" 0)
7 v- W0 Z$ P- F% ?9 ? R% V (Prompt "Chon doi tuong dich cua EXTEND :") (Setq CUTEDG (Ssget))5 m" M6 f4 U5 M: T4 W8 T c
(Prompt "Chon doi tuong de Extend :") (Setq SS (SSget)) (Setq LEN (SSlength SS))$ r1 G4 B) g, E. c H
(Setq I -1)8 J, T& [, O# @& h6 R2 b! ~( }
(Setq SIDE (getpoint"Chon phia de EXTEND")) (Command "EXTEND" CUTEDG "")* f) M2 l) i: T3 }9 x
(Repeat LEN
: g3 A/ F2 e# V0 |, J y (Setq I (1+ I))0 I: E- O9 f- I+ _( _! p
(Command (List(SSname SS I) SIDE)) ) (Command "")
1 j8 }# N' r/ A; m3 O (Setvar "CMDECHO" CVAR) (Princ "Da Extend xong moi ban lam tiep") (Princ) )9 T- G. S. N+ j
8 A! R7 B. a& ]0 `
;;; =============== EXTEND 1 DOI TUONG THEO KHOANG CACH ===============
! ]) m: W; Y9 H6 D# z) m. S$ K0 \7 ?7 w1 I# Z, {: I) s3 ^& J
(defun c:ETT () (setq os (getvar "osmode")) (setvar "osmode" 512)$ o- ^4 V9 _! p- ?6 y! F* x
(setq pt1 (getpoint "\nKich vao 1 dau doan thang can EXTEND "))
" ^# N7 _: E, ~ (setvar "osmode" os)
( @$ ]/ l* V( u( _' ]9 P (setq dis (getdist pt1 "\nKhoang cach can EXTEND :"))5 ]8 f2 d5 H' y8 m2 H3 c, w k
(command "circle" "endpoint" pt1 dis) (command "extend" "last" "" pt1 "") (command "erase" "last" "") (princ))4 w, t3 k( \' {2 @5 w# W
' N+ h* r& K: R5 O6 F7 J9 I& P
;; ================ Change width of polylines ========================= u5 P4 G x" V. B6 N, B3 z& M; H
* o. l3 ^# ^" r6 p(DEFUN wp (/ a b sophantu sodem list1 ha:wid)0 a# t @2 {2 L4 T7 a5 [
(PRINC "\n Chon doi tuong can thay doi do day (Width) !")
9 k* H0 U5 T0 U: N% O+ H (setq b (ssget)) % X7 h7 H0 l4 _1 X4 V, x% i
(setq sophantu (sslength b)) . H$ K* ?' b& L9 }: ~2 q
(if (null ha:wid) (setq ha:wid (getvar "tracewid")))
+ Z- }6 _! C# B- L (princ "\nDo rong polyline <")* {# H" Q9 j* a7 h
(princ ha:wid)9 c4 B) E; b! q* T, @3 [/ E
(princ ">: ")! @4 s% u* _( {, B
(initget 4)9 z; M c5 l8 ?6 a y
(setq ha:wid (getdist))
D7 [. L$ ~. I7 ?4 J6 \/ W (if (null ha:wid) (setq ha:wid (getvar "tracewid")))
7 I0 u& j8 x. Y" j4 M( ~ (setvar "tracewid" ha:wid)
; S% n! b, H4 j9 [8 | (setvar "cmdecho" 0)- U; A- ]. \' P7 \' p
(setq sodem 0) 7 h) K; H+ \+ r
(repeat sophantu+ i) n7 j* Q5 V& ^+ e5 E
(setq a (ssname b sodem))& [8 S5 e- {3 F/ q. A
(setq list1 (assoc 0 (entget a)))
B4 ]2 a+ i- |4 T (cond. _( t3 c) B9 r0 l/ b! }
((= (cdr list1) "POLYLINE") (command "_Pedit" a "w" ha:wid ""))# Q! L& ]% S J% ~; o* D4 o
(PROGN (command "_Pedit" a "" "w" ha:wid "")) )
; f6 M ^6 N( G (setq sodem (1+ sodem)) )(SETVAR "cmdecho" 1)(princ))5 w8 o" D. R$ c0 H" U: h$ J
(defun c:wp () (wp)) (defun c:pw () (wp))
. \# c& C* z. j6 N* e
8 \. x, O5 `! d) d' K;; ================ Change radius of circles ==========================, P6 Z" n/ b% i$ S6 p
a) B& B5 {: f. \; z, C(DEFUN C:CHR (/ SSET SSL M RD I) (PRINC "\nSelect Circles :") (SETQ SSET (SSGET))" r. S$ b5 E2 @+ I
(IF (/= NIL SSET) (PROGN (SETQ SSL (SSLENGTH SSET)) (INITGET 4 "") (SETQ RD (GETDIST "\nNew radius : "))
9 C; f m( ^/ b ]# X' y v& K# } (IF (/= RD NIL) (PROGN (SETQ I 0)8 x" s! j0 W5 K* y
(WHILE (< I SSL) (SETQ M (ENTGET (SSNAME SSET I) ) )$ Y) }; M" f7 e$ Z' i
(IF (= (CDR (ASSOC '0 M)) "CIRCLE") (PROGN5 z8 P8 J+ n* ~% J9 F3 s
(SETQ M (SUBST (CONS 40 RD) (ASSOC 40 M) M)) (ENTMOD M) ) ) (SETQ I (+ I 1)) ) ) ))) (PRINC) )
H) D7 a% O( u+ q
! Q$ F, y& H% G# e;;; ============================== TEXT Hight ===============================6 n" l) J# a& M* D/ g3 @$ G& |
+ X; ~; l4 T# O/ t2 a& R# }* _(defun texthght (/ ent hght)% |8 [: f+ ^4 i
(setvar "cmdecho" 1)
; N* O: n' b3 J4 F1 E) {% t7 K (prompt (strcat"\nSelect text entity with required text height"))
! H6 q5 B, P3 ?% a3 c1 _/ Y (prompt (strcat"\n."))
1 X! J! n) x. b3 e (setq ent (entget (car (entsel)))), l/ g& D9 V5 m
(setq hght (cdr (assoc 40 ent)))
8 |1 e; r9 c; Y7 T (prompt (strcat"\nText height now set at "))(prin1 hght)
- y7 \6 {1 E( E: F1 j2 U (prompt (strcat"\n."))
/ Y/ t6 o0 D" w/ B' t (setvar "cmdecho" 1)
) c/ V- A( i% ~, y (command "DTEXT" PAUSE hght "") )7 D* X: b D* G% x; O
(defun c:teh () (texthght)) (defun c:texthght () (texthght))% f0 c1 K& H# u$ J8 u( |( V
" T% H; `: g. ^" D: S2 h! n
;;; ================ BAT -TAT CHE DO GACH CHAN TEXT =================# g+ {& X* k9 Y2 y0 @: F. w: t
4 k9 g( v: J3 e( {3 V8 d n6 @(defun c:tuu () (setvar "cmdecho" 0)* r$ a# }' |8 J5 C$ a5 e* p5 J
(prompt "\nHay chon dong TEXT can gach chan ")
- ^: n4 g% V& p: M% B (prompt "\nSelect objects: ")
. m; G& }/ B* l (command "select" "au" pause)
2 S' G; e$ t# E# u y (setq sstxt (ssget "p")
5 H6 ?3 u+ T8 [# k( T sslen (sslength sstxt)2 D" z4 n& l1 P' Y8 k* R' J
ctr 0 )% _5 |/ u$ g! X+ ~& Z- r
(command ".undo" "mark")( _* T5 n D2 j& b" m7 ^
(while (< ctr sslen)
& X' @4 ^8 I2 C# X (setq listxt (entget (ssname sstxt ctr))2 R7 C* ?- H, H$ k+ b2 R. j
txttxt (cdr (assoc 1 listxt))
# X4 ~. {' E2 g* [2 O4 P8 g enttxt (cdr (assoc 0 listxt)) )
/ x: o! P- P9 i5 N (if (= enttxt "TEXT")9 m, G+ `) L0 R
(progn& Q! ^( o! C7 W
(setq testxt (substr txttxt 1 3))% P# {4 C* D' c' q2 ~* b' H
(if (or (= testxt "%%u") (= testxt "%%U"))- A6 |0 K+ s) R8 f9 u, a: M
(setq newtxt (substr txttxt 4))% L, L5 {2 |4 ~4 Y( C. A0 d
(setq newtxt (strcat "%%u" txttxt)) )
/ `- P. @8 J' n2 O0 [& l (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))" Z; w/ p- n: C
(entmod listxt) ) )
: j2 Q8 e% e1 q3 c" |/ z2 ? (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))8 d; _5 ~, n6 V+ ~
, t2 e/ F% M. U/ @3 x' p r5 K" Q
;;; ================ BAT -TAT CHE DO GACH CHAN TEXT =================) t) z$ Z8 F- f) d
2 p4 w% n2 X8 Q$ ?" N
(defun c:tob () (setvar "cmdecho" 0)
2 o( S0 l. O% h1 b (prompt "\nHay chon dong TEXT can gach tren dau ")
: R ^. Y$ ~* Z7 y (prompt "\nSelect objects: ")% |3 Q: s# w/ a |5 k# z" v- |: x3 [
(command "select" "au" pause)
. x1 T! Z+ n% `5 r& O! a0 t( h B (setq sstxt (ssget "p") j4 i) Y0 P7 p2 Y
sslen (sslength sstxt)
9 T9 C0 K/ h: m) R d5 M% r* G ctr 0 )2 b* e7 }' f' g6 q
(command ".undo" "mark")- x3 Q9 X% `1 R. E7 Q
(while (< ctr sslen)
3 `$ K3 Y: I- e" `* _ (setq listxt (entget (ssname sstxt ctr))
! T/ d; s5 l9 q. r- s( n txttxt (cdr (assoc 1 listxt))8 A; m: F; G7 |- `. v5 j
enttxt (cdr (assoc 0 listxt)) )
- I2 L7 X+ S8 v/ k$ O$ ~1 F1 T: { (if (= enttxt "TEXT")5 x4 e4 b' O0 i+ [- T5 q c
(progn& o |6 F4 T7 w2 N/ M
(setq testxt (substr txttxt 1 3))
9 f6 \2 O) b1 } (if (or (= testxt "%%o") (= testxt "%%o"))4 F/ ?; G: i' q
(setq newtxt (substr txttxt 4)), E5 H9 n9 W* N& m- R: f( I
(setq newtxt (strcat "%%o" txttxt)) ), L# t3 u' v/ K+ q0 o# T
(setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))! b, O! ]/ |! t0 n0 R
(entmod listxt) ) )# ~+ K1 W! K( Y$ R. J; d
(setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
( Q4 p! W) ~3 W; G
# F5 P: o8 r$ r5 P7 q; p* o. R;;; ========================== Tim & thay the TEXT ==========================# z* l- j; [. K1 R: ^
3 ?* s1 o8 B2 X, ]% g(defun frstring (str search replace / str1 str2 index find)7 d% N7 R7 w9 u, g+ k
(setq index 0) (while (<= index (- (strlen str) (strlen search))) (setq index (1+ index))
W0 A2 A* {: H7 ?- e3 K(setq find (substr str index (strlen search))) (if (= find search) (progn (setq str1 (substr str 1 (1- index)))
) w H) V9 h% ^0 Z(setq str2 (substr str (+ index (strlen search)))) (setq str (strcat str1 replace str2)) ) ) ) (setq str str))
( P* v5 y8 s4 }5 N6 n7 `! R(defun hai (/ dial)( I' r o0 H2 I$ N M6 {+ E
(setq dial (load_dialog "hai.dcl")) ;;goi dialog
" K& Z& I% R" a( o4 V (if (not (new_dialog "find" Dial)) (exit)) ;;, Q3 d% y5 C' J9 Z" w+ O6 b
(mode_tile "find" 2); Tao dau nhac tai hop thoai
) ~4 h% ~ S* j' ?( ~ (action_tile "find" "(hai1)")
- M) l: \& F/ t (action_tile "replace" "(hai2)")' X1 Q9 S* W. Z9 Z
(action_tile "cancel" "(done_dialog) (exit)")
4 z1 w. ] }0 v, c7 \: t3 `3 j9 B (start_dialog) 3 l' C$ {3 Z2 f: I* `
(unload_dialog dial))" S9 n/ H D; u4 {& c7 ]0 ?: R
(defun hai1 () (SETQ str1 (get_tile "find")))$ Q: E0 j: Z$ z( v9 v
(defun hai2 () (SETQ str2 (get_tile "replace")))
8 {; D2 {7 `& s C
, E) O2 n- |5 P/ N(defun c:TTT (/ a str str1 str2 newstr taphop sodem)
6 q1 \8 Y- ~6 b) { (hai)
$ g6 q1 }! w; h! D8 H (if (or (null str1) (null str2)) (princ "\nDu lieu khong hop le")
) h8 |2 [9 c% v& N (progn1 ^9 I6 U2 E( M8 R* w* v) h
(setq taphop (ssget '((0 . "TEXT"))))% F0 h5 X$ ^0 L. r
(setq sodem 0)! ]9 o$ t7 Y* h/ \
(if taphop
. s" n% i2 l( I& a. D (progn& _, z3 @' O' g9 l. @1 x4 e9 J* K
(Repeat (sslength taphop)
& @1 e2 J4 }/ P; ?! L4 [ (setq a (entget (ssname taphop sodem)))
4 Z; F0 w& b" d& x0 Q- | (setq str (cdr (assoc 1 a)))
+ J8 j/ k* y$ [0 d (setq newstr (frstring str str1 str2))
# u0 a! d7 V @" k# r, V (setq a (subst (cons 1 newstr) (assoc 1 a) a))9 }" L9 Z" ?8 s# t/ W$ s
(entmod a)1 Y8 Q( a! S/ W/ n
(setq sodem (1+ sodem)) ) )0 W' g8 R9 I, l) f6 _ t
(princ "\nNone "TEXT" selected") ) ) ) (setq *error* olderr) (princ))
- X, S8 I2 `! N
7 |" l+ d, M7 H$ W$ S;;;============================= CHTEXSTY.LSP =============================- |' E0 w3 ?" i5 Q R' U8 x+ S+ y
& s }; o7 r$ v5 W
(Defun C:TXS () (Setvar "Cmdecho" 0) (Initget 1 "SE ST ")
2 o7 @8 p" t7 @* g7 u( m. j3 G(Setq G (Strcase (Substr (Getkword "STyle/<SElection>:")1 2)))
7 l9 m6 ^1 O% G) V3 m(Cond ((= G "SE") (Setq A (Ssget)) (Setq B (Sslength A))8 j+ a: a0 A/ k# v+ t
(Initget 1) (Setq C (Getstring "\nEnter new text style: "))
( o& I7 d7 @, I, M8 [9 Z& l4 N* k(Extang C) (While (> B 0) (Setq B (1- B)) (Setq D (Ssname A B))2 N/ D% O) c e G s. I; O
(Setq D (Entget D)) (Setq E (Assoc 7 D)) (Setq F (Cons 7 C))
5 S7 L. O2 c; E% _0 a9 x; c- g7 G: G(Setq D (Subst F E D)) (Setq H (Assoc 51 D)) (Setq I (Cons 51 J))/ _/ u4 c( i& b
(Entmod (Subst I H D))) (Setq A nil)) ((Or (= G "ST") (= G ""))$ v, M5 F/ Q; z, b* @) J
(Initget 1) (Setq A (Strcase (Getstring/ u# F9 u& W: B7 V& ~
"\nEnter text style to change: "))) (Initget 1)
5 a, A9 E6 }$ @9 f& d. x3 C(Setq C (Getstring "\nEnter new text style: "))(Setq D (Entnext))# P; u) d a9 B0 x
(Extang C) (While D (Princ ".") (Setq E (Entget D)) (If
3 _+ ?) ?/ v9 @(And (= "TEXT" (Cdr (Assoc 0 E))) (= A (Cdr (Assoc 7 E))))1 n- {* A0 a( W/ Z1 n
(Progn (Setq F (Assoc 7 E)) (Setq G (Cons 7 C))
% l' f2 [% ^6 N0 K(Setq E (Subst G F E)) (Setq H (Assoc 51 E)) (Setq I (Cons 51 J))( ]' Y% P* {+ N+ \7 R/ |7 [
(Entmod (Subst I H E)))) (Setq D (Entnext D))))) (Princ))1 o8 J% a4 R+ ], Q' l7 |0 z% k
6 e& B5 k1 z% {: p/ e(Defun Extang (A) (Setq A (Tblsearch "STYLE" A))& v- l% N1 e D8 A2 m* _; m! t# K
(Setq J (Cdr (Assoc 50 A))))6 d+ u- J E) Y" p
( b) U4 z2 m" |;;; ============================ DRAW CLOUD =============================
- N$ e# m0 O3 s4 L, C3 t9 [; B1 }- `% r" M- `' R
(defun CLOUD (/ pt1 pt2 arc1 cnt ss la) (setvar "cmdecho" 0)# L1 U5 ]( F T. V5 h8 ^: Z7 A# Z [
(prompt "\nVe cloud (may) khong khep kin - Tu khep kin ve diem dau!")2 i% c. `* H+ K. }! t; P
(setq la (getvar "clayer"))8 |% n" ^( g# v( y
(command "layer" "m" "cloud" "c" "5" "" "")
4 w) s K+ [+ [, O! z& p2 K (setq pt1 (getpoint "\nEnter first point of Cloud: "))
/ B, x/ n/ x7 m) L* o! W/ R (if pt1 (prompt "\nProceed in a COUNTER-CLOCKWISE direction..."))7 i( E" F" `" k: c
(setq cnt 1 ss (ssadd))
9 ^3 U$ M: N* ~2 d (while pt1 (setq pt2 (getpoint "\nEnter next point - and close: "))& A; j! I" Z4 [; x* y) i1 K/ ]
(if pt2 (progn (command "arc" pt1 "e" pt2 "r" (/ (distance pt1 pt2) 1.75))( L. m( U6 O( n
(if (= cnt 1) (setq arc1 (entlast) cnt 2) (ssadd (entlast) ss)) ))
6 Z) j1 w3 h( O* d8 I. N (setq pt1 pt2) ) (setvar "highlight" 0) (if (> (sslength ss) 0)
0 P F7 h2 N( V2 F$ d) U; ] i* T (command "pedit" arc1 "y" "j" ss "" "x")
z: C* y6 k1 k/ l (if arc1 (command "pedit" arc1 "y" "x")) ) (setvar "highlight" 1)4 m% }7 r( y. g$ C+ Z: n2 e
(command "layer" "s" la "") (setvar "cmdecho" 1) (princ))
$ U( Y8 O4 ?: {* o; Q4 Y(DEFUN C:CLOUD () (CLOUD)) (DEFUN C:CLO () (CLOUD)). G1 r2 t* p+ w- n" G
$ p6 e" P E7 b9 U1 C;;; ================================ Funtion-Dulieu ========================8 G: E, _" \4 f$ L
;;; ================================ Funtion-Dulieu ========================4 [4 D. E. ^2 W: ` v
;;; ================================ Funtion-Dulieu ========================+ o$ O" ^& Y8 |' e5 p' G! x, T: t. E
5 A! |3 O ~0 R a(defun ha:nhap (kytu thamso) (princ kytu) (princ thamso) (princ ">: ") (setq key (getint)) (if key (setq thamso key)) (princ thamso) )" O3 U9 P* e* r" D
(defun ha:thoat () (reinit) (setq Temp "Da thoat khoi chuong trinh"))
9 |: r) s9 C+ W; P) S& M(defun khoangcach (kh khq11 khq12 / h0 h1) (setq h1 (polar kh (angle '(0 0) (vectophap khq11 khq12)) 500)) (setq h0 (inters khq11 khq12 kh h1 nil)) (distance kh h0))) o9 W& R3 w O7 z s- I1 L
(defun hacat (hacat1 hacat2 / hacat3 chon) (if (and (/= hacat1 nil) (/= hacat2 nil)) (progn (setq hacat3 (polar hacat1 (angle hacat1 hacat2) (/ (distance hacat1 hacat2) 2))) (setq chon (ssget hacat3)) (command "break" chon hacat1 hacat2) ) ) (princ) )
2 x9 f/ {# ]+ y' r5 N* @4 z) k(defun hauon (hauon1 hauon2) (command "fillet" hauon1 hauon2))
I/ |; p: k: M- a8 ^(defun init () (setvar "blipmode" 0) (setvar "cmdecho" 0) (setvar "angbase" 0))) S8 {: H% X/ T }( `( F
(defun reinit () (setvar "cmdecho" 1) (setvar "osmode" 0)): M Y# k( Z. ~# I# T3 d2 V
(defun tichvecto (vecto1 vecto2) (apply '+ (mapcar '* vecto1 vecto2)))% c7 p+ d' y* }0 n
(defun vectophap (v01 v02 / vectochiphuong) (setq vectochiphuong (mapcar '- v01 v02)) (list (cadr vectochiphuong) (* -1 (car vectochiphuong))))
J- z, }9 @$ N(defun ha:giaodiem (dc1 p1 p2 / hc hc1 diem1) (setq diem1 (vectophap p1 p2)) (setq hc1 (polar dc1 (angle '(0.0 0.0) diem1) 100)) (setq hc (inters p1 p2 dc1 hc1 nil)))/ e& I6 | [3 r, M) q
(defun dtr (dtr) (* pi (/ dtr 180.0)))
, B, v* _6 `/ y( p! @: i) U(defun rtd (rtd) (* 180.0 (/ rtd pi)))
* g- z5 ~# ^4 h- Y% s
! W: t; _# E0 c6 C8 T4 ?;;;==============================PROGRAME===============================
5 v% H3 n' W+ o* U6 A;;;=====================EditDiM Hien Hop Thoai Dep======================
3 N5 I6 x/ T) V5 h! U;;;==============================PROGRAME===============================
5 r+ N5 F! l! p0 E7 k5 D1 K- \! |( P+ t! s+ X! A) S: R! T' L
;;Dth Edit Text, Dimtex & Attributes(Chu Co Thuoc Tinh)
( Z V4 ~8 }# C7 W2 f W;;Chay Cung Du Lieu.Lsp & Hai.Dcl
8 f4 ]9 `8 B- h+ O5 z; Z(Defun Hai_Edim (Chon / Dial State Str Oldlis Dimdefault Pt10 Pt13 Pt14 St Ang Dis Pt Hc)
7 J3 L' z& M& k; s (Setq Oldlis (Entget (Car Chon))- b0 u. X2 g8 J% \! W
Pt10 (Cdr (Assoc 10 Oldlis))
) `5 V8 |# P( ?4 H9 A Pt13 (Cdr (Assoc 13 Oldlis))
( r+ {. z3 s* I% Z' } Pt14 (Cdr (Assoc 14 Oldlis))
( u/ X6 I2 G# `0 o2 b* w# P St (Cdr (Assoc 70 Oldlis))
0 x( `- P( i" x Dimdefault (Cdr (Assoc 1 Oldlis))
5 J; Y% d! I# ~, Q6 D )
0 S4 p1 o" s0 I: g {( K- g/ h (Cond
4 V7 B* }- U4 ^& ` ((Or (= 32 St)(= 0 St)(= 160 St))
( g" @! X: A5 Q8 Z2 q (Progn( q |0 E. b! j& H8 x7 Y y
(Setq Ang (Cdr (Assoc 50 Oldlis))
- `, P8 Q) p- | h0 {& A& A Pt (Polar Pt13 Ang 500)* U- Q1 W+ ~" P- d
Hc (Lay_Hinh_Chieu Pt10 Pt13 Pt)3 g' \8 w/ w( d, I) Y% V
Dis (Rtos (Distance Pt13 Hc))
3 l' E. i' `3 }" O )
9 W4 H/ u- ]7 }4 g) S- J; Y8 t )
- [5 J( ~0 V+ v; E3 y$ n3 ]2 i )
4 A. `3 I9 V5 h6 n: L ((Or (= 33 St)(= 1 St))
8 p7 x; w2 }9 b' u3 h; i (Progn(Setq Dis (Rtos (Distance Pt13 Pt14)))))1 e5 ?; @5 } b% A
);;End Cond- o5 z7 g) {7 u& j2 G
(If (= Dimdefault "") (Setq Dimdefault "<>"))
6 Q& I! K% ?$ E: M8 ^ K2 E9 e (Setq Dial (Load_Dialog "Hai.Dcl"))
c0 C# }1 ^+ G) g (If (Not (New_Dialog "eddim" Dial)) (Exit))
4 |$ c/ O a5 l; J# y" q( g (If (Or (= 32 St)(= 0 St)(= 160 St)(= 33 St)(= 1 St))
9 x# z5 G+ n2 s+ ]0 p (Set_Tile "text" Dis))
y$ l' L6 H8 `9 [+ z; e, A: I (Set_Tile "ha:edim" Dimdefault) f3 B8 r* W7 W- V) m
(Mode_Tile "ha:edim" 2); Tao Dau Nhac Tai Hop Thoai
( @: C7 Q/ u: L- c6 _- C (Action_Tile "ha:edim" "(Setq Str (Get_Tile \"ha:edim\"))(Done_Dialog 3)")
# B! [6 A! a7 S6 ~7 S2 r$ d- j (Setq State (Start_Dialog))(Unload_Dialog Dial)3 b1 n+ y, o6 j$ f) ^7 [# q+ G
(If (And Str (= 3 State)) O7 u0 a4 l7 j9 j; j8 {) h
(Progn" e9 V' F9 t4 y9 p, r0 @
(Setq Oldlis (Subst (Cons 1 Str) (Assoc 1 Oldlis) Oldlis))(Entmod Oldlis)))
1 ` k+ x2 X: K; ] )
/ v+ L8 y: L- U6 I8 d# E(Defun C:EH (/ Chon Name )3 j; d7 a v4 y0 Q Y6 B
(Defun *Error* (Msg)) A( o: a d6 G/ |9 m4 l
(Princ "\nerror: ")(Princ Msg)(Princ " ")3 c* d6 t& C5 O' h8 `5 E$ I9 D
(Start_Dialog)(Unload_Dialog Dial)
# r1 ~" p8 ?, O6 Q6 { (Setq *Error* Olderr)(Princ)! s! } e4 c/ J' Z+ ?7 I/ S3 q
)# l0 p- _) s0 ?2 y
(Setq Olderr *Error*)
. u- R! h1 X' a+ L7 ] (Setq Chon T)9 M& x" v# Q2 q h
(While Chon/ k, ^0 z+ r) T. H
(Setq Chon (Entsel "\n\n\nSelect Text, Dimtext Or Attributes To Edit..."))
8 U1 j/ Z' Z: o) X (If Chon% l" N, ~( n8 o1 g
(Progn, w0 N3 G' @- N& ]: I
(Setq Name (Cdr (Assoc 0 (Entget (Car Chon)))))* R- K% f; G1 i. U N
(Cond
' M( R/ D* f4 s5 X: {* Q6 a# y" l ((= Name "INSERT")(Command "Ddatte" Chon))
% W, F0 u: d7 ^4 l/ _ ((Or (= Name "TEXT") (= Name "ATTDEF") (= Name "TOLERANCE") (= Name "MTEXT"))(Command "Ddedit" Chon ""))
! p" K( |- l3 k9 x4 u) h ((= Name "DIMENSION") (Hai_Edim Chon))7 }& i( e! |7 I1 o. z
)
- P g/ m3 {5 T );End Cond4 L9 P' C' Y/ _2 y# D1 R' S& x% J
);End Progn- `7 O4 R w( o5 W+ Y+ n0 z: h
);End While/ v# G# n! T8 f# n; t4 g: M& j
(Setq Olderr *Error*)(Princ)2 ^" n% K' j" C3 S4 b) E+ N
);End Program% ]4 {( `8 h+ q U `1 H5 c0 L
, r, B" V2 n/ E4 C8 ?# `' A
;;;====================DDeditDim=====================0 ^- q: z& K, A+ t. f& ~
;;;=====================Hai.DCL======================
) i$ H; Q( [5 T O3 n3 A;;;====================DDeditDim=====================5 E' W/ `3 Z2 W* h
6 i4 l, X9 P0 v! \1 G# L' y$ p
;;Dth Edit Text, Dimtex & Attributes(Chu Co Thuoc Tinh)
7 p4 T( g" }. O% H2 w;;Chay Cung Du Lieu.Lsp & Hai.Dcl4 {: z$ m7 w% |# U' ^
(Defun Hai_Edim (Chon / Dial State Str Oldlis Dimdefault Pt10 Pt13 Pt14 St Ang Dis Pt Hc)
; l: v- D. R' n8 B% |, X7 l6 \ (Setq Oldlis (Entget (Car Chon))
# b+ @: }7 j$ z+ u/ f* N% C Pt10 (Cdr (Assoc 10 Oldlis))
& ^, e! j; [* x$ w8 a0 e Pt13 (Cdr (Assoc 13 Oldlis)) p+ V6 L& V% v% U% K# `
Pt14 (Cdr (Assoc 14 Oldlis))* x: a( `# M" P7 i9 g$ g
St (Cdr (Assoc 70 Oldlis))
6 h6 _% L0 ?' X' a; S Dimdefault (Cdr (Assoc 1 Oldlis))
; [% ]2 C: b" u b* l7 h# G* K7 h )) p/ T5 R, _! E Z2 d/ [4 u( r
(Cond
* |8 h# M% x- H$ C- q. u/ k- G ((Or (= 32 St)(= 0 St)(= 160 St))
v% H# _' t* H (Progn$ c/ M' s. A" k. t' G2 c: B4 Z- W
(Setq Ang (Cdr (Assoc 50 Oldlis)) }$ k7 M- U9 |
Pt (Polar Pt13 Ang 500)
) s, T9 P a' k4 z0 F Hc (Lay_Hinh_Chieu Pt10 Pt13 Pt): C9 _( X1 l! D
Dis (Rtos (Distance Pt13 Hc))8 t; p7 P9 q5 e. a$ `$ X
)
- [" d$ L; ~. M: R: V4 n3 b }/ L ): R4 D. k0 E5 k7 Q3 {$ e8 W* }- l
)- o9 N2 [0 b( l
((Or (= 33 St)(= 1 St)), ]2 f! r+ ?+ M, h( Z
(Progn(Setq Dis (Rtos (Distance Pt13 Pt14)))))
8 A) W, Y9 q2 A4 B" C- i! N0 f );;End Cond
' c& ^5 t( U- b( D/ P' S (If (= Dimdefault "") (Setq Dimdefault "<>"))
7 k0 \! L6 u/ F4 ^' l E (Setq Dial (Load_Dialog "Hai.Dcl")) ~4 z! f+ t" I6 v+ @7 Y
(If (Not (New_Dialog "eddim" Dial)) (Exit)) F X& D4 J. f2 k- |
(If (Or (= 32 St)(= 0 St)(= 160 St)(= 33 St)(= 1 St))& o1 ? G) b) z! b- d4 f- c* [
(Set_Tile "text" Dis)): F7 L) _8 c1 i& J" S$ W r, q
(Set_Tile "ha:edim" Dimdefault)
5 H+ {$ Z. N8 m* C6 O (Mode_Tile "ha:edim" 2); Tao Dau Nhac Tai Hop Thoai* @) Z: ^+ G& V. u3 G$ [
(Action_Tile "ha:edim" "(Setq Str (Get_Tile \"ha:edim\"))(Done_Dialog 3)")1 e ]. d7 x& I! ~' ~
(Setq State (Start_Dialog))(Unload_Dialog Dial)' j8 ?2 \$ [# D @+ V9 B
(If (And Str (= 3 State))
' p1 h8 v% u" M- z1 e- T (Progn
! C( W1 s, a1 E- I3 u0 C: b (Setq Oldlis (Subst (Cons 1 Str) (Assoc 1 Oldlis) Oldlis))(Entmod Oldlis)))
' H N! @* ]3 B$ q" ~5 p )
: l' Z. A1 r$ W$ T3 t, X, b# O# h* {) V(Defun C:EH (/ Chon Name )
5 F- G4 ]' P/ C# I7 x. h% i$ n: l7 D9 U( H# T, w# C) y R( {) t
;;;********************Du Lieu********************, m8 R! b" Y L" ~: V5 y& @
2 o5 B. t$ a: l, B% F# i! x) w(Defun Ha:Thoat () (Reinit) (Setq Temp "Da Thoat Khoi Chuong Trinh"))
( W6 Q8 R. m! Z& N7 L(Defun Hacat (Hacat1 Hacat2 / Hacat3 Chon)
/ Z s$ S C; o7 j/ O* D& d* ] (If (And (/= Hacat1 Nil) (/= Hacat2 Nil))
* u3 I0 ~+ o' T, h. J$ x (Progn, ?8 q# l8 [) t i3 G' I
(Setq Hacat3 (Polar Hacat1 (Angle Hacat1 Hacat2) (/ (Distance Hacat1 Hacat2) 2)))6 Q) v5 H) z; Y$ n: r, a& Z, Y
(Setq Chon (Ssget Hacat3))6 T. y$ k3 ~, V: {' ]
(Command "Break" Chon Hacat1 Hacat2)7 {* o' _* A% r3 Y, |; l/ x, \
)
* }$ R0 f, k: z ): ?4 R; ^. k( ~" M+ U! O w; r5 C
(Princ)
# Y$ X: c* q7 l3 B1 {" }1 f ), R# a9 @) Y7 Y' \5 V# `, P
;;
m5 i% Z8 h& m% X8 W! s3 x(Defun Hauon (Hauon1 Hauon2)(Command "Fillet" Hauon1 Hauon2))
" P: C6 B% E, |0 F# K5 {' a# @1 O;;
7 @3 f! _" L N(Defun Taolop (Mau Lop / A)(Setq A(Tblsearch "Layer" Lop))(If (Null A)(Command "Layer" "_N" Lop "_C" Mau Lop "")) (Setvar "Clayer" Lop))
. _& J3 u, f6 v L;;% y$ g, ], [3 z3 C0 \
(Defun Init ()(Setvar "Blipmode" 0)(Setvar "Cmdecho" 0)(Setvar "Angbase" 0))
9 G7 D$ G* c) {" @% ~( h& j;;
0 V7 j' _; j( `3 v2 N7 ?6 M( B- D L(Defun Reinit ()(Setvar "Cmdecho" 1))' a! J! [& n5 Q% ?
;;
$ ^. w$ I" n4 Z7 O(Defun Tichvecto (Vecto1 Vecto2)(Apply '+ (Mapcar '* Vecto1 Vecto2))) R% G8 a& A* _
;;
% t+ w' Y* g3 g/ R5 f;;Cho 2 Diem Tinh Ra Vec To Phap
/ x5 t3 o6 b% h(Defun Vectophap (V01 V02 / Vectochiphuong)(Setq Vectochiphuong(Mapcar '- V01 V02)) (List (Cadr Vectochiphuong) (* -1 (Car Vectochiphuong))))3 q, M; i5 q. }: p0 r9 c
;;Xac Dinh Vi Tri Hinh Chieu 1 Diem Len 1 Duong Thang
6 E; E# i, _/ M" P. m, z;;Da Biet 2 Diem Thuoc Duong Thang9 X& V' P3 |2 k, G8 [; ?
(Defun Lay_Hinh_Chieu (Dc1 P1 P2 / Hc Dc2)
5 _, W4 U+ ~6 M6 l" X (Setq Dc2 (Polar Dc1 (+ (/ Pi 2) (Angle P1 P2)) 100)
\/ }& s- i3 z6 D Hc (Inters P1 P2 Dc1 Dc2 Nil)))
0 z/ C. Q/ x: |5 }% V;;Xac Dinh Khoang Cach Tu 1 Diem Len 1 Duong Thang* x0 j1 x; i' H* w
;;Da Biet 2 Diem Thuoc Duong Thang
6 w0 c, n% |8 U; F(Defun Khoangcach (Dc1 P1 P2 / Dc2 Hc); h3 e3 y. Y3 X; p0 H
(Setq Dc2 (Polar Dc1 (+ (/ Pi 2) (Angle P1 P2)) 100)& K1 I Z% O" O; t1 }; q. d
Hc (Inters P1 P2 Dc1 Dc2 Nil))
o) I( |' J E5 I (Distance Dc1 Hc). P6 t% j; O1 c/ a2 L
)! m7 ?( H$ }% u7 g" t$ z
(load "nhapcua.lsp")
% q& p9 n' l1 Q (Defun *Error* (Msg)
1 d$ U9 H7 [9 Z+ I. q- z4 N$ X0 W (Princ "\nerror: ")(Princ Msg)(Princ " ")/ y+ Z% D- D/ S5 R$ Z3 f( r
(Start_Dialog)(Unload_Dialog Dial)
) r7 P4 \" q r4 ~3 C8 G, j: w; ` (Setq *Error* Olderr)(Princ)
7 |2 t$ t9 R: t )6 g5 P9 \5 Z2 U. g5 W
(Setq Olderr *Error*), z/ s9 g! H1 W, s# B
(Setq Chon T)
7 b9 ~- _& s9 D2 N! t ~4 Y9 f# s, U (While Chon" e$ `7 J5 E7 v
(Setq Chon (Entsel "\n\n\nSelect Text, Dimtext Or Attributes To Edit..."))
& ]) `- W$ |: y5 j8 y (If Chon
# O- c% N' f% A3 B' Y, O (Progn @; F# V. \. Q! i! ]
(Setq Name (Cdr (Assoc 0 (Entget (Car Chon))))), T) V5 S. Z* T, @/ u. G
(Cond* ?3 g- L# ?( J
((= Name "INSERT")(Command "Ddatte" Chon))
. ^& ]# g! K: }$ X8 I$ g6 G; \% A ((Or (= Name "TEXT") (= Name "ATTDEF") (= Name "TOLERANCE") (= Name "MTEXT"))(Command "Ddedit" Chon ""))) H3 P5 \6 I8 x. g% ~: G
((= Name "DIMENSION") (Hai_Edim Chon))! I7 C6 i! e- _) e( Y+ y4 I2 k8 b
)1 S& Y, Z/ T, m7 B
);End Cond% n# n+ P, i g& Y4 J
);End Progn
5 _3 T6 s: K% G! N' I );End While
* V N1 W# u$ Y" Y (Setq Olderr *Error*)(Princ)& x- [; l9 m0 L8 f w/ { E
);End Program1 i4 [) G9 Z. f5 m0 M. H% E m, m
3 _, ^3 B$ z8 T/ T* {( P
# ^8 b0 w" D$ X( z3 S9 D3 Q/ _( G B- I
7 a) ?$ M# K) H" K+ [2 y& d;===================HAI DCL Nhapcua.LSP De chay Hop Thoai EditDiM===================% i* t' ?/ X& ^6 @6 N* e
;====================================Nhapcua.LSP====================================1 z# G: C% H7 r) U
;===================HAI DCL Nhapcua.LSP De chay Hop Thoai EditDiM===================
& O' }7 F" Y6 ]4 r
) P- M6 j! g u;;; ============================ Ve Hinh chu nhat ==================================% R4 g: y% J) E, k* h0 E
(defun HCN (/ olderr ocmd oblp pt1 pt2 pt3 pt4 l w)4 _9 \7 W9 F- n5 V' B* R3 R/ ^
(setq ocmd (getvar "cmdecho"))8 q. t0 N8 e" a, X
(setq oblp (getvar "blipmode"))/ k1 h, `0 T5 z! |/ Y" t
(setvar "cmdecho" 0)% U' g7 X5 g) j* o
(initget 1) ;3D point can't be null2 a: `0 A3 Y! m5 M3 ?6 D2 n1 v* _
(setq pt1 (getpoint (strcat "\nCorner of rectangle or square: ")))
% S/ Y( y- u/ W! q# ~% O1 X& V: J! v8 J (setvar "ORTHOMODE" 1)
) y' i2 F8 {0 _% d (initget 7) ;Length can't be 0, neg, or null
, }; v- }) z- p1 I4 Z( a (setq l (getdist pt1 "\nLength: "))2 I- f6 i( {: {% x: c. l7 q9 h3 [
(setq pt2 (list (+ (car pt1) l) (cadr pt1) (caddr pt1)))6 T' L' N: ?+ o: F+ R2 Y9 ]
(grdraw pt1 pt2 2)( x% T" V# `0 K. C2 {9 }
(initget 7 "Square") ;Width can't be 0, neg, or null
) m2 ^4 Q2 o( m1 y (setq w (getdist pt1 "\nSquare/<Width>: "))! T- S# h, ^4 [9 B+ M
(if (= w "Square") - B: P. b9 S* e7 O
(setq w l) )
' u: l4 Z* I4 ~6 @( p! e (setq pt3 (list (car pt2) (+ (cadr pt2) w) (caddr pt2)))2 q$ m1 U' S7 A# @* T
(setq pt4 (list (car pt1) (+ (cadr pt1) w) (caddr pt1)))' d% F9 q' z) m( f
(grdraw pt2 pt3 2)
+ b5 c1 Q2 {0 j/ H9 t% m1 V* F (grdraw pt3 pt4 2)* A* P4 i0 P0 `
(grdraw pt4 pt1 2)# a) u& F% w5 i, \: [9 ~& s
(setvar "ORTHOMODE" 0)
& m f8 p! G- F (command "pline" pt1 pt2 pt3 pt4 "close"); J+ e( x8 o% e- @, w# P0 S
(setvar "cmdecho" ocmd)
4 m! q3 `# E; |7 ~, [! |8 N (setvar "blipmode" oblp) (princ))0 A& y# _7 I* u! Y! U9 I
(DEFUN C:HCN () (HCN))
# ~! q- q4 c( c8 L: q
$ _- T" n" k f) w;*******************;*******************;*******************;*******************4 `5 }# ?+ V! R) g0 O
;****K E T C A U****;****K E T C A U****;****K E T C A U****;****K E T C A U****
8 U) i" o" g% |6 i# a;*******************;*******************;*******************;*******************
; ?" ?4 v) u, `3 W( ^# q3 B# S& X( u2 p5 X. a0 N9 w8 x1 ~
;VE HINH BINH HANH
& ?! |0 ?; z: K; F
4 ` r1 {" M5 ~; v3 T+ w5 d- v(defun c:binhhanh (/ p1 p2 p3)
# E6 J' ~4 _( c (setq p1 (getpoint "\n Nhap diem thu nhat:"))
; l4 O: B+ ~/ L: ^' w (setq p2 (getpoint p1 "\n Nhap diem thu hai:"))5 i4 J/ T6 Q7 [# I% T/ ^
(setq om (getvar "osmode"))
% w" ?* |' T" A. M+ \% r(setvar "osmode" 0)' ?5 G4 l5 t% o' e) q% w& H
(command "line" p1 p2 "")
2 j6 \3 \& S6 |* u1 E(setvar "osmode" om)
- _* \# }3 h6 H# ?. k (setq p3 (getpoint p2 "\n Nhap diem thu ba:"))+ L4 g9 r0 O' c
(setq a (angle p2 p1))
) ] I& z g [% b. I0 o (setq d (distance p1 p2))1 ]$ U& i5 x" C
(setq p4 (polar p3 a d))) m- d) |) [* ~" X7 e0 ?; @+ T
(command "OSNAP" "none"): _* l4 m; n, I
(command "erase" "l" "")
& b" q x' ^6 ^) v( _% | p (command "pline" p1 p2 p3 p4 p1 "")
# a' U) } b1 R# N8 k( N* T7 {(setvar "osmode" om)4 c8 `3 [7 I: ]* \$ K- Q
)
9 Q4 I. r5 S6 Y& s. l1 I- {4 h* a0 Y# X4 t; J. W& {
;VE LUOI COT
1 @ j+ R; d! C4 c
: u$ O; v% Z+ u t6 U(defun c:LuoiCot ()
. i+ T. G$ x7 p2 d(setq om (getvar "osmode"))/ H8 d- H- o' |- j' \
(setvar "osmode" 0)
* Z' t3 q9 F3 ^; x- Y (setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))
, a! B. Q! b8 y8 Y0 ~% A (setq p0 (getpoint "\n Chon Basic Point:"))7 I4 `' B4 ^% u o. O( `# V& O
(setq nc (getreal "\n Nhap chieu ngang cua cot : "))
! ?/ D8 N/ P: s! v# I3 L (setq dc (getreal "\n Nhap chieu doc cua cot : "))
: e: h1 a( m7 a7 S" ~ (setq p1 (polar (polar p0 pi (/ (* nc hstl) 2 tile) ) (* pi 1.5) (/ (* dc hstl) 2 tile) ) )' R6 o) {( U" j5 U) f
(setq p2 (polar (polar p0 0 (/ (* nc hstl) 2 tile) ) (* pi 0.5) (/ (* dc hstl) 2 tile) ) )
9 j% I9 B- s2 k/ N7 d* F. b' T- L (command "rectang" p1 p2)
. I. T" M, U* u- A (command "hatch" "solid" "l" ""), C% k; T: A$ K( W/ Y: o- i
(setq bcn (getreal "\n Buoc cot theo phuong ngang : ")) l: w& R; {' V& u
(setq nn (getint "\n So buoc cot phuong ngang : "))* V7 K! x, x6 g: C
(setq w1 (polar (polar p1 pi (/ (* nc hstl) 2 tile) ) (* pi 1.5) (/ (* dc hstl) 2 tile) ) )
0 ^0 t& {9 A' l: M (setq w2 (polar (polar p2 0 (/ (* nc hstl) 2 tile) ) (* pi 0.5) (/ (* dc hstl) 2 tile) ) )% v; R& n1 n' ^" [' m
(command "select" "w" w1 w2 "")
# W; Z' m n( z2 F8 u- ?. W (command "array" "p" "" "r" "1" (+ nn 1) (/ (* bcn hstl) tile) )
5 q( w5 f/ U) T) e4 H (command "line" (polar p0 pi (/ (* 1000 hstl) tile)) (polar p0 0 (/ (* (+ (* bcn nn) 1000) hstl) tile) ) "")
1 I) x q; h; v3 u2 @ (setq w1 (polar (polar p0 pi (/ (* hstl 2000) tile)) (* pi 1.5) (/ (* hstl 2000) tile) ))' v% X) L6 Z+ _& n2 k% `. a
(setq w2 (polar (polar p0 0 (/ (* (+ (* bcn nn) 2000) hstl) tile) ) (* pi 0.5) (/ (* hstl 2000) tile) ))
. k/ @& _ Z$ W% [: r7 y+ d (command "zoom" "w" w1 w2)
( q. T7 r5 y+ L% }% u- t" C; @1 Z (command "select" "w" w1 w2 "")
6 V- }. i+ J+ ] (setq bcd (getreal "\n Buoc cot theo phuong doc : ")). d+ a* `8 _1 D, l0 s
(setq nd (getint "\n So buoc cot phuong doc : "))
, t1 {* } V1 j (command "array" "p" "" "r" (+ nd 1) "1" (/ (* hstl bcd) tile) )( w" t0 u: K, K7 Q
(command "line" (polar p0 (* pi 1.5) (/ (* hstl 1000) tile)) (polar p0 (* pi 0.5) (/ (* (+ (* bcd nd) 1000) hstl) tile)) "")
+ V' L* v# \3 p4 q! \4 ` (command "array" "l" "" "r" "1" (+ nn 1) (/ (* hstl bcn) tile) )8 E! Y X. [4 u p$ P8 p5 w
(setq w2 (polar w2 (* pi 0.5) (/ (* (+ (* bcd nd) 2000) hstl) tile)) )
6 ]4 s: q% n, N (command "zoom" "w" w1 w2)
' I0 i1 _6 E( e1 D. n# @(setvar "osmode" om)6 w4 w- e' w" D, S9 P
)
$ _8 o+ B, h! T' ]
/ h6 y* D+ c. C, S;VE CUA DI' S4 v5 M3 r. p1 M2 F n8 i
3 w8 G4 ?3 A0 _) ]* w* a
(defun c:cuadi ()5 K9 P. m5 N) L" r7 i
(setq om (getvar "osmode"))+ q) Z+ ?5 `6 ~1 c
(setvar "osmode" 0)1 Z8 O" R2 n. \% N$ o4 _
3 V5 I5 \- [. l8 t' E
(setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))( {1 l; d! N4 t- l
(setq b (getreal "\n Nhap be rong cua : "))) u+ F/ s \% [2 B& j
(setvar "osmode" om)+ X! E0 t R+ `5 S. f
(while (< 0 1)
3 G: C# b. Z) f( p9 u' U (progn
% g" P+ Q* i2 b( X0 X (setq p0 (getpoint "\n Chon Basic Point:"))
/ B- g w4 Y+ K% O4 n7 L& @ (setq p1 (getpoint p0 "\n Chon diem de xac dinh huong cua cua:"))4 E4 J) w' T' Q5 K" d
(command "osnap" "none"). ^5 f1 }- U) r2 C, u* C
(setq p2 (getpoint p0 "\n Chon diem de xac dinh huong mo cua:"))
% I! _- x4 N! a% |5 \- _ (setq a1 (angle p0 p1))
5 R" u1 \! l B6 R$ ~" e7 k9 _, } (setq p1 (polar p0 a1 (/ (* hstl b) tile)))( g" e" y% V2 |; A$ I
(setq a2 (angle p0 p2))
. w/ d7 L# J) R2 ^9 Y; `: k (if (< (- a2 a1) pi) (setq a3 (+ (/ pi 2) a1)) (setq a3 (- a1 (/ pi 2))) )5 w& e* }( s8 K3 X D2 V0 ]
(command "pline" p0 "w" "0" "0" p1 (polar p1 a3 (/ (* hstl 40) tile)) (polar p0 a3 (/ (* hstl 40) tile)) p0 "")
, y6 x- f/ h7 f+ G3 p5 }. b (command "rotate" "l" "" p0 (/ (* (- a3 a1) 180) pi))
( F4 M& p2 r/ _. c5 b- s (command "arc" "ce" p0 p1 "a" (/ (* (- a3 a1) 180) pi)) 5 s! U# t. e$ v- C# O" Q
(setvar "osmode" om)0 S) ~+ Z6 b; W5 h1 }$ d
))) y' A7 B- p9 n. P3 b/ R. T
), f) P8 @, }2 Z+ g
7 w0 a" I$ Q: ~+ n$ G. \/ }3 A+ z4 m/ [;VE CUA SO
/ M4 B, i2 ?2 w0 n9 Q9 x4 q
! A; g( ~/ y& H2 J. X# }. `/ ~(defun c:cuaso ()# v& V9 i6 _* ~& C# p4 X1 E1 p- h
(setq om (getvar "osmode"))
& m- C1 J" d( e! V& B- m(setvar "osmode" 0)
K3 J% t$ Q# n+ D& |% \+ S1 x5 D4 J. r" y. }# P
(setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))% D% `6 a1 {! @6 N
(setvar "osmode" om)/ b0 O: e8 ?$ @+ P5 b
(while (< 0 1)! b! G1 @' D; x- Q
(progn/ e( w& n3 U- W% s
(setq p0 (getpoint "\n Chon Basic Point:"))
" e6 K1 H. A& Q# h (setq p1 (getpoint p0 "\n Chon diem de xac dinh be rong cua:"))
$ f8 O7 Z7 g% a O (command "osnap" "none")2 h, C( [, c, J- f$ k/ Z. ?3 g
(setq p2 (getpoint p1 "\n Chon 1 diem o trong nha de xac dinh huong cua so:"))' \5 I6 ~0 y" m- h
(setq b (distance p0 p1))
]% z' `: ~* I0 q7 t$ N) A (if (< b (/ (* hstl 600) tile)) (setq du 50))
( V9 V' ?. a5 d' _! m6 |5 Z7 E (if (> b (/ (* hstl 600) tile)) (setq du 150))' {- c; z* O3 U" D+ n
(if (> b (/ (* hstl 1800) tile)) (setq du 200))
5 S j: G+ N# C0 f (setq a1 (angle p0 p1))
5 m4 d3 }2 _4 M# |1 Z/ Q (setq a2 (angle p0 p2))
1 y, Y% V, l L0 l" H$ _ (if (> a2 pi) (setq a2 (- a2 (* pi 2)) ) )
J2 [4 f) C9 X" E( k3 ? (if (> (- a2 a1) 0) (setq a3 (+ (/ pi 2) a1)) ) W# \ V% |6 B7 |* O# c# k0 X
(if (> (- a1 a2) 0) (setq a3 (- a1 (/ pi 2))) )
% r% t( o0 p: } (command "pline" p0 "w" "0" "0" p1 "")
/ h* `0 n/ K _ (command "pline" (polar p0 a3 (/ (* hstl 50) tile)) (polar p1 a3 (/ (* hstl 50) tile)) "")2 c; g# Z- n) J0 {& {' Y) s
(command "pline" (polar p0 a3 (/ (* hstl 100) tile)) (polar p1 a3 (/ (* hstl 100) tile)) "")
; S: h; Y- u. ?! {9 P! a6 V (command "pline" (polar p0 a1 (* (- du) (/ hstl tile))) (polar (polar p0 a1 (* (- du) (/ hstl tile))) a3 (* -100 (/ hstl tile))) ; \8 m9 G* ~5 h; C
(polar (polar p1 a1 (* du (/ hstl tile))) a3 (* -100 (/ hstl tile))) (polar p1 a1 (* du (/ hstl tile))) "")% n, l. I* p( d+ k
(setvar "osmode" om): q% L& d/ }2 I8 _6 ?1 M0 I' x( I. M
))3 h/ H% N# E5 A, l
)" @# R7 o; A' g- T4 `2 Q0 k U; m
4 W, m( M# ]/ \- ?4 g+ J6 w;;;=== General Utility Functions ===' k- }3 P7 M: }# n2 l
# ]. w" i4 E! B& l( R; R12 compatibility - In R12 (acad_helpdlg) was an externally-defined ; m# y$ D, c/ o6 b9 J$ T, ]% N: M
; ADS function. Now it's a simple AutoLISP function that calls the
* j8 J# Z9 l$ X; built-in function (help). It's only purpose is R12 compatibility. ( s6 n: @; n; @0 z: F
; If you are calling it for anything else, you should almost certainly o: Z/ b, ?" N# e. w) ]
; be calling (help) instead.
7 h. e: s3 X: P; C) a
% P4 r- q3 `0 Y8 s(defun acad_helpdlg (helpfile topic)
_+ T: \4 n4 c* `! h4 Q, i h ^: Y (help helpfile topic)
, {6 P2 v0 w5 g6 O0 O/ |& T2 `$ J)
# m% @ a: d1 }. M9 M5 V) h3 B( A3 e5 D
- v( B v% L+ ?& N, n7 S" p. w2 ?9 I(defun *merr* (msg)
3 e0 G: a8 d1 Y (setq *error* m:err m:err nil)- G8 u0 @+ P) p+ `, [1 u7 ]2 @* T. i
(princ)7 U3 f+ c1 e/ H4 y; T" ]: V
)4 d' a/ l- a# D" e& p% ]% j4 K: \% u
. X3 T+ W* u. y( Y- }- R( R(defun *merrmsg* (msg)
" k4 |, C% I! X* e- l+ ~) n (princ msg)7 ^. ]: e) V$ `% Z q
(setq *error* m:err m:err nil)3 Y6 v. }* t! u, @: g7 f) Q- S8 Y, S
(princ)) y7 |( |; D. l4 `
)
- Q3 n/ y& d$ X7 U
' F# S' k3 L* Y) b" o;; Loads the indicated ARX app if it isn't already loaded
5 ~2 I$ J. n1 }! {7 V7 ]$ f2 o;; returns nil if no load was necessary, else returns the6 ^ U$ W: k/ M/ |- |) \* V
;; app name if a load occurred.
! [7 F4 p8 d3 O& f$ B& }; {(defun verify_arxapp_loaded (app) / w! P: v) O% n2 I) R7 C
(if (not (loadedp app (arx)))
4 a& Y& F2 [: X (arxload app f)1 R1 B# N& ^) ?9 S& |7 o
)
0 L* y6 J1 h; b" ] t! o7 d)# h* i, f% A$ h# Q/ b p2 C. H, V1 g5 r' H
3 Y) h" Y$ Q. u; Y. e$ G7 }
;; determines if a given application is loaded...
8 I! a) t5 V/ O/ t. \' w;; general purpose: can ostensibly be used for appsets (arx) or (ads) or....; T3 f$ V2 o* n$ g. H1 ~. _2 Z- ~, y5 i
;;
4 J0 v; N0 U2 S( ]$ p) `;; app is the filename of the application to check (extension is required)( H) e$ V! @ @# S
;; appset is a list of applications, (such as (arx) or (ads)% H4 I/ A$ X' A) [
;;
' H" \* [: g" i% A9 D$ J. a4 F7 l+ d+ A;; returns T or nil, depending on whether app is present in the appset0 Y! Q% A2 c1 S3 h
;; indicated. Case is ignored in comparison, so "foo.arx" matches "FOO.ARX"5 ]* j7 D3 r. F5 C3 s
;; Also, if appset contains members that contain paths, app will right-match
! ]4 V+ Y6 w* o$ A;; against these members, so "bar.arx" matches "c:\\path\\bar.arx"; note that! v+ |* e0 O3 A3 r; D0 ^* U) j
;; "bar.arx" will *not* match "c:\\path\\foobar.arx."8 n4 V; ` k3 f8 s+ R2 a
(defun loadedp (app appset): I: K3 A y- f( j' O1 O- G* e
(cond (appset (or % Y) i1 t! e* `; S, i
;; exactly equal? (ignoring case)9 p% R( y$ [! \' F
(= (strcase (car appset))' ^( X5 r5 ^, P+ \8 t
(strcase app))
G f/ l2 E1 D. r1 ]" \) p( Z$ z3 s ;; right-matching? (ignoring case, but assuming that
) b c1 A7 }7 ^' Y7 I5 @ ;; it's a complete filename (with a backslash before it)
# W$ s/ X2 B, l+ c. {/ L( X (and
' o+ T9 z0 m2 A$ q (> (strlen (car appset)) (strlen app))
% v1 V% l+ t5 ]4 f- N; n' S v' E' p (= (strcase (substr (car appset) : J. x d4 S6 U0 A: c
(- (strlen (car appset)) ) U# j. M0 N5 A) }" d2 Z
(strlen app)
3 B6 D2 K. l5 r4 x ) 9 b% D9 ]% @& J
)
~% O1 n, x3 h3 r8 v& I+ p )
& r, |; P( Z6 Y2 h+ |( r (strcase (strcat "\\" app))6 z* {# P% R8 O: u# B m
)$ i; H: y1 A1 ~& Y0 i! s- y1 W
)
8 y6 N: |% ]5 P) ` ;; no match for this entry in appset, try next one....# ~( m# d3 i* X$ x
(loadedp app (cdr appset)) )))0 m5 f: c1 y6 ]9 U
)$ j7 K! B$ A( q" `4 ?
) i" ^% O+ i" l! U& Y+ r4 l
, w; h* i. ?" F2 {! T& k;;; ===== Single-line MText editor =====
* P$ d% w$ N- d8 o! F(defun LispEd (contents / fname dcl state)
' n" Y* {- h* E# g3 E) y (if (not (setq fname (getvar "program")))
% U/ z( ?: [; v6 k (setq fname "acad")
; ]8 P6 [3 U" P# o) ^ )
- S9 \' d* h/ o) `& L2 B4 a! ?$ d5 K (strcat fname ".dcl")
9 S: B1 H# x7 w (setq dcl (load_dialog fname))' k1 f4 }3 H% q5 z; y* g& o f
(if (not (new_dialog "LispEd" dcl)) (exit))
" Q' Y: K( u% O; j* F X- E: w (set_tile "contents" contents), f- J1 z) }1 h8 x$ u) ? ]( s
(mode_tile "contents" 2)5 w6 z* T2 I: k* m+ X8 s9 ], m
(action_tile "contents" "(setq contents $value)")2 c- Q k* Q4 Y6 A
(action_tile "accept" "(done_dialog 1)")
- }. v. }/ m5 T (action_tile "mtexted" "(done_dialog 2)" )) O2 c3 y- z/ k) Z
(setq state (start_dialog))
; ~' F9 p2 ?. C- g (unload_dialog dcl)
9 [. C0 A: n8 B! i: ~ (cond; P0 ~1 M( z( N8 z l- i F
((= state 1) contents)
2 ]8 D) N- R W; K ((= state 2) -1)
$ |+ [" r" e' ?+ s% }# J (t 0)
, o) u O2 ~) p( _+ t )
/ [# J O' F! y) H)7 P# |6 r/ h7 Z U/ \
# y5 H' t9 h4 B: H& {
;;; ===== Discontinued commands =====
3 D9 h) ]7 _3 Z(defun c:ddselect(/ cmdecho-save), I/ J' b! a8 Y" J
(setq cmdecho-save (getvar "CMDECHO"))0 |* S' R) y/ n/ j4 s
(setvar "CMDECHO" 0)8 o' C% a( ?/ Y; \: d& b
(command "._+options" 7)0 Q' Q# ?' n6 s( X( G% g7 H0 i% I
(setvar "CMDECHO" cmdecho-save)
5 [2 P* ^1 A8 ^( H (princ) N w- _+ n) i" B3 q
)
/ ~+ t% Q* F; B
$ s7 U5 ]" d6 f4 M(defun c:ddgrips(/ cmdecho-save)
8 S) R3 n+ v n3 e+ g$ K) P1 n+ X' { (setq cmdecho-save (getvar "CMDECHO")); I( w( e/ L' Q [( w3 q
(setvar "CMDECHO" 0)
! X& s7 @& k6 g9 j (command "._+options" 7)+ Z3 D* f% d! ~+ b1 n9 R
(setvar "CMDECHO" cmdecho-save)/ f3 f! a1 i& ^- ]" X
(princ)
' z- F; _# j+ h) }; Z6 f)
# H( m8 Q/ h! \1 V
/ Y# ]3 U3 ^& t+ |6 e+ Q9 V(defun c:gifin ()
% U t: Y* \# e1 @ (alert "\nThe GIFIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")4 B. l1 E3 }/ U7 X3 J' L
(princ)
6 ~1 P# e1 r2 M ?+ C* ?( j6 r)# t% ^, x7 R& G S. B
) v5 t. P4 Q4 T' }' Y
(defun c:pcxin ()
. p- r K3 e v0 N) P (alert "\nThe PCXIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n"). k- D4 L0 z$ `3 {
(princ)# _" w$ {( o) G* [# \9 F" R$ f
)
' A; Q0 i5 |( O6 S+ j9 ?- P* t3 e2 a
1 P+ J5 E0 ]1 h( D4 z(defun c:tiffin ()
+ p+ ^' s. u& C' v6 y2 K; X) d (alert "\nThe TIFFIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")
" k5 i+ @: H" \1 { (princ)+ H8 z( ?: Z2 Q! ^& s( M
)' c6 B. b5 L, Q
$ D) G' S! X' r9 O- Q
(defun c:ddemodes()
' Q" @& f2 D& v' O% A5 b/ Q9 q- W (alert "The Object Properties toolbar incorporates DDEMODES functionality. \nDDEMODES has been discontinued. \n\nFor more information, select \"Object Properties toolbar\" from the AutoCAD Help Index tab.")5 h0 t. k( t: u* j: G, |
(princ)* Y4 J2 ]" E& O- C: q
)
$ H0 z' s! t1 X1 p8 F v8 O( k4 n) V5 s
(defun c:ddrmodes(/ cmdecho-save)
5 o8 Q( u5 z# i3 l7 w (setq cmdecho-save (getvar "CMDECHO"))3 q& ^( s E( C
(setvar "CMDECHO" 0). l* {# T& P7 Q9 b+ ]. S- H
(command "._+dsettings" 0)
3 ~3 N3 e8 e) E9 g (setvar "CMDECHO" cmdecho-save)
9 v. K$ @4 l' E& I( i$ s1 g, w (princ); g2 f6 i S" h# F
)0 U; {# s, [4 f8 P$ M( }
3 z: {. W; f% L" ^( h
;; HPCONFIG
) j1 Z6 i' v2 d% D8 a(defun c:hpconfig (/ hlppath)
( E6 j1 o7 `/ d6 w (if (not (setq hlppath (findfile "acad.hlp")))3 N5 a9 {* x; i( K, r
(setq hlppath ""))
7 E/ c" ]$ m1 N$ N% l1 X8 N (help hlppath "hpconfig")
/ e Y0 c( d9 `7 a$ \ (princ)
! w+ D3 g7 G$ o0 P$ `# @)
3 f! V0 h, ~0 E8 [5 X! f, ]$ C
3 x+ I6 E3 A1 @;; OCECONFIG
1 ?+ H- { V* O- P5 r(defun c:oceconfig (/ hlppath)
1 d6 @6 X1 E; ` (if (not (setq hlppath (findfile "acad.hlp")))& g$ y7 {4 o& w
(setq hlppath ""))2 k6 |; ~6 f8 O% ~& x. t
(help hlppath "oceconfig")
$ J1 E! \' P) X, r (princ)
" b' h6 F3 E0 Q$ g" h)
, t8 N5 ?4 v' M( H9 A7 I" J& f$ t$ s v; C4 s+ y: v: a
;; CCONFIG
: [$ ^! x$ T, l2 ^8 W5 h(defun c:cconfig (/ hlppath)0 [7 Z9 V( F& Z+ O' f! Q+ W! u. |
(if (not (setq hlppath (findfile "acad.hlp")))! { K% y7 ~% f0 H
(setq hlppath ""))
: W& L- U9 o- l& E- Y0 Y( t (help hlppath "cconfig")
5 ^% g1 j e1 A, Q# ^% s7 Y8 r- p (princ)/ F5 i6 A2 P* g7 C5 p: F
)
, P" g+ ]0 _/ n Q1 M1 \8 z' M6 }: B1 M" T
;;; ===== AutoLoad =====
- H/ D% \- ^1 g; b& Z' f# Q6 b4 D+ H& d% e9 e/ ]
;;; Check list of loaded <apptype> applications ("ads" or "arx")4 {4 V0 E7 ~" Q
;;; for the name of a certain appplication <appname>.8 G) B/ m, b3 I0 {, E
;;; Returns T if <appname> is loaded.# ^3 {: L5 v3 d* t3 s! W
: \; }+ [% j e(defun ai_AppLoaded (appname apptype)
3 P9 Y( b4 F7 f5 o; ^9 X (apply 'or% Z# _9 l9 s$ `" z$ o& O; C( N
(mapcar / f) M. f8 {. S
'(lambda (j)" U1 u5 q. b9 ^5 h$ Q/ k
(wcmatch4 `0 f0 C2 W; z) y+ Y# D
(strcase j T)5 F' i8 q x |1 a
(strcase (strcat "*" appname "*") T)
' \. }% F: h4 @! r& j- Z )
9 O+ Y0 z& L$ P )
' o$ t! ]( j# U7 Y8 m2 k) p: |: a (eval (list (read apptype)))
- |' g/ n# A. S. H, `' q( `+ t" u! s )
' w9 z. \1 j8 t$ x* r0 p9 G: b7 S$ P ); `* a: g; X2 Q, d* k" m# v
)
+ h3 _8 b5 W" n( b& m7 y) O
% c" N/ ]2 p9 X) k: p6 l( C! W/ y' z;; 3 z$ l$ R, q1 @- _* b+ r
;; Native Rx commands cannot be called with the "C:" syntax. They must
+ g8 z' Y$ K3 D" T, g6 e;; be called via (command). Therefore they require their own autoload
9 T7 c. x" Y7 F, c9 A% X, l;; command.
* c! Y& `: j _, n
_% B/ i7 G, H8 U+ R3 f' x, }(defun autonativeload (app cmdliste / qapp)% z& ~; R( j- h, Y* _7 H
(setq qapp (strcat "\"" app "\""))6 ^7 L6 g: h: T6 G4 W+ {
(setq initstring "\nInitializing...")7 F! |! O: }/ a9 ^+ ^
(mapcar$ v" b+ }6 E. r# n
'(lambda (cmd / nom_cmd native_cmd), ~, Q+ }0 n# _+ B3 A
(progn; N* \! P h5 r! J; ?# `6 J
(setq nom_cmd (strcat "C:" cmd)) a- ~8 C2 a/ n8 g: p
(setq native_cmd (strcat "\"_" cmd "\""))
& `2 E; {6 ]7 { (if (not (eval (read nom_cmd)))# b7 O# s; C: G6 s, O0 ^* _7 P
(eval7 S" s7 ?( z& X% c& u1 r* z* X- o
(read (strcat& G. c. H! ^$ ^
"(defun " nom_cmd "()"
' |3 V8 g8 @/ T1 E) X "(setq m:err *error* *error* *merrmsg*)"
s! C& W- t) `5 r9 ^, n6 h "(if (ai_ffile " qapp ")"! p) o* l* u7 h: U& A: l: x$ l
"(progn (princ initstring)"' J' n/ o0 b; G" R( N( c3 d
"(_autoarxload " qapp ") (command " native_cmd "))"
1 A; h5 q( X2 U% P' r; c' u "(ai_nofile " qapp "))"
; U1 V9 `, N1 j9 D5 F8 k: q7 E% j4 { "(setq *error* m:err m:err nil))"
: i6 Q2 y/ Y, Q7 E' T )))))), b/ V: s0 @9 V
cmdliste)
& `, v! |' d3 @6 z nil9 W: [$ `7 v: X t
)3 S5 H! b- S1 ?4 p
t0 K$ Z$ p( T, b
(defun _autoqload (quoi app cmdliste / qapp symnam)7 k! \2 o+ [- [( W& o* H/ F
(setq qapp (strcat "\"" app "\""))9 V0 a1 x4 O* C: |8 k( D. W
(setq initstring "\nInitializing...")- N: d: z3 w/ L. Q7 D; K
(mapcar
5 l% ?' f9 {/ c, D; e b '(lambda (cmd / nom_cmd)" F8 r' C1 Z. i/ a" T& j) m
(progn
+ E# O# X7 o/ g* o (setq nom_cmd (strcat "C:" cmd))
; {4 S7 R% G" n$ _& Q (if (not (eval (read nom_cmd)))
" Q- H" j% S7 U7 p b, | (eval
% f' N9 m# W2 T; J7 y$ V$ j/ e' r (read (strcat
. F8 P+ Z( V6 \2 X/ j4 l "(defun " nom_cmd "( / rtn)"/ S N# Y, \' P5 g( ^2 r
"(setq m:err *error* *error* *merrmsg*)"7 y) {0 O" ^& ^
"(if (ai_ffile " qapp ")"
! |/ [; }- N4 X7 s) f" ]! r "(progn (princ initstring)"
* \/ d' D- B/ f" U0 P "(_auto" quoi "load " qapp ") (setq rtn (" nom_cmd ")))". Q @8 j' G; _6 z( ~6 [
"(ai_nofile " qapp "))"
5 E. g; g. w1 i1 t { "(setq *error* m:err m:err nil)"
# G# R" d, ?7 G "rtn)"8 x3 }) }* _, t+ B
))))))
7 W4 T! x) R9 }& D cmdliste)1 q b+ N: G0 o0 m$ M" s
nil" N( \- a! _: v/ @# s7 Q- V+ b' E
)% J3 p/ y3 a/ Y
9 ]4 C) a1 w# H( W; Y(defun autoload (app cmdliste); ^' X$ M0 d% }+ w6 z) _
(_autoqload "" app cmdliste); C& J: a7 W( \# x& ^
)
7 U8 m/ T, b+ v9 \% C9 k/ ^$ Q0 n* q8 H1 e+ u- r- G: u
(defun autoarxload (app cmdliste)
% ?3 k% Y$ ]; Y) Y7 \ (_autoqload "arx" app cmdliste). I: ?( _$ N. _) n. Y9 R" {9 t
)8 g& \/ {, \" E3 x. I- M' q* P" b( D
; [, d6 i7 c* f9 c D' M
(defun autoarxacedload (app cmdliste / qapp symnam)# _1 O9 l: s& ~) p4 y s
(setq qapp (strcat "\"" app "\""))
4 I$ M7 N0 y! m! L (setq initstring "\nInitializing...")5 e' ]) s: ~3 K4 D' w& p6 B2 r8 l t- O
(mapcar" `% }. J) ?7 Q+ {" |. \
'(lambda (cmd / nom_cmd)9 V2 f: ?; G; A [0 w R
(progn
/ V+ W& y7 N( O4 w/ H (setq nom_cmd (strcat "C:" cmd))' c1 f- n% T5 J: c1 W
(if (not (eval (read nom_cmd)))
/ }; z+ O% X( x, f' Z, ]2 p \ (eval
: f1 X0 \8 l' C5 [ (read (strcat
( m# M2 |( s8 j5 _, P( W "(defun " nom_cmd "( / oldcmdecho)"+ Y+ ^! e5 x. _9 d2 b
"(setq m:err *error* *error* *merrmsg*)"
' N9 p5 Q, L, A0 o& z "(if (ai_ffile " qapp ")"
1 ~ Q8 D2 y5 K "(progn (princ initstring)"
+ M8 _! s# T4 {: G# G* n" f2 v) C "(_autoarxload " qapp ")"
' P& k/ d8 H* `! K "(setq oldcmdecho (getvar \"CMDECHO\"))"
' s. L3 s, _3 A( t "(setvar \"CMDECHO\" 0)"
7 C v- }# l0 _" q g% E "(command " "\"_" cmd "\"" ")"4 N! Z$ O4 n. u% X
"(setvar \"CMDECHO\" oldcmdecho))"
; U" N& ]: S- ]& j9 K2 m( y$ j "(ai_nofile " qapp "))"
0 K) D$ w# B, l "(setq *error* m:err m:err nil)"
2 P: ^2 E/ V$ r4 Z' q "(princ))"- n' Z" F& s3 @4 b( `2 y' ~
))))))
! m% { z- T: W s! g6 R cmdliste)
9 @; q4 }0 ?5 ^2 Z9 o+ u9 U3 V9 Z( x8 G nil
- F+ ?6 V: B, Z6 [' h% a)1 g9 c6 S9 \# u2 z# U. Z
4 [$ m$ T9 C. {# \% P% ~(defun _autoload (app)9 v2 m2 _/ D4 v7 x1 R5 y! J
; (princ "Auto load ") (princ app) (princ ")") (terpri)
* u4 G( W7 S7 N9 e (load app)% c% d' N( y; G6 f% t$ o' ?
)" T6 r' F: w- O" w- X I
4 l8 D* r' [6 V' _(defun _autoarxload (app), _5 d1 w+ ^3 ?9 {
; (princ "Auto arxload ") (princ app) (princ ")") (terpri)
& Q3 y+ S1 [6 I2 F% e (arxload app)6 N5 q$ b8 q+ N# q
)9 x/ h5 N; J0 e2 e7 ]
& ~- d- w8 \; f/ T' o& y* }(defun ai_ffile (app)9 z8 }; e6 X' E8 B5 J
(or (findfile (strcat app ".lsp"))6 `7 V! U7 Q2 T; V+ n) H$ L* P. y
(findfile (strcat app ".exp")) N3 u4 W( H, @& j! ?
(findfile (strcat app ".exe"))
8 v5 a; C5 I" u u+ i4 V/ l (findfile (strcat app ".arx"))
8 U) E: o% U) w (findfile app)9 w$ S* k9 o9 e5 v
)
3 W2 a0 T4 |6 D9 z)
9 x9 Y1 E1 Z3 c! X3 v
@6 r7 p6 e; G, f3 ~" r$ v& w(defun ai_nofile (filename)7 x) c& ?( c8 _9 V) ~. ]( d0 S
(princ
* u+ }0 ?% ]# i( {! m% r (strcat "\nThe file "/ z1 y) d& \8 }2 O: K
filename2 Y" z' T1 Z' K- O
"(.lsp/.exe/.arx) was not found in your search path folders."$ R# Q$ B: ]3 Q. i0 s
)1 ~2 ?" \! a/ Y4 x9 F- X f
)
: Q" w1 U! j. y (princ "\nCheck the installation of the support files and try again.")
$ B" g: d# ]) N, E# }7 H8 m (princ)3 z7 z& q _, p! {6 ]7 q
)# |- ~2 T1 S7 W' o
' ~7 d2 K$ } [. |2 B f) {+ f( p3 c) x8 N4 f4 a1 l, Z; t% N
;;;===== AutoLoad LISP Applications =====
0 x" X8 l9 b' r/ W0 @9 L; Set help for those apps with a command line interface5 K2 }9 K' ]$ h* J5 D% U( M/ m( n
: i- q' v- P5 k2 u4 F; |6 u(autoload "edge" '("edge"))
) D! t/ | T9 t3 Z+ R" v8 f( e(setfunhelp "C:edge" "" "edge")# v: N3 m2 ^7 v% ]( O. Q/ F% r y$ I
; q4 A, N9 |, {4 q0 d$ k. ?
(autoload "filter" '("filter " "filter"))
6 k, n/ X6 `0 S6 Y6 [$ a/ ?; o) d" P7 }
(autoload "3d" '("3d" "3d" "ai_box" "ai_pyramid" "ai_wedge" "ai_dome"
$ r* A9 e' P* ^* | "ai_mesh" "ai_sphere" "ai_cone" "ai_torus" "ai_dish")
9 B: G4 U1 d! U) G)' a. N1 q, }% M
(setfunhelp "C:3d" "" "3d")
: T$ }) u+ e' e(setfunhelp "C:ai_box" "" "3d_box")
5 {2 p# u" i6 [(setfunhelp "C:ai_pyramid" "" "3d_pyramid")
2 A, x2 h$ ?# p4 y(setfunhelp "C:ai__wedge" "" "3d_wedge")4 ?0 U% J+ z0 k0 d5 S- a! S& G
(setfunhelp "C:ai_dome" "" "3d_dome")9 O7 B8 `0 u: g& `5 j
(setfunhelp "C:ai_mesh" "" "3d_mesh")
, I4 o* z& `6 I7 d6 T8 T+ s( z(setfunhelp "C:ai_sphere" "" "3d_sphere")
7 ^' d& v5 W3 ~! [, U8 l(setfunhelp "C:ai_cone" "" "3d_cone")
: I" a# R* D: \. n& f! Z! D( E$ A(setfunhelp "C:ai_torus" "" "3d_torus")6 T8 M3 b+ n9 V; B* i# I
(setfunhelp "C:ai_dish" "" "3d_dish")+ A4 @- E# {8 n
' o9 s3 F2 I* h% Z) n$ ?; w5 ](autoload "3darray" '("3darray"))2 t0 {7 e0 r" n Z6 A, S
(setfunhelp "C:3darray" "" "3darray")
* u* F. t4 }$ ^$ u V9 C+ _5 v5 G+ v7 {' x
(autoload "ddvpoint" '("ddvpoint"))/ ~+ T7 G% O: L4 Y
) B5 ]9 n& t0 p4 |(autoload "mvsetup" '("mvsetup"))" ?/ D$ j+ z+ Q# l: B) T& m
(setfunhelp "C:mvsetup" "" "mvsetup")' E. j; x# T; b
, \3 S2 |) e/ x, S; y(autoload "ddptype" '("ddptype"))& D3 |: f$ ?: {* Z6 |# S4 T+ W* V' e% m
" O, W% }, i( \
(autoload "attredef" '("attredef"))! l* s; f+ z5 W7 C0 K5 F
(setfunhelp "C:attredef" "" "attredef")
; a; |: U( }2 h& `$ N
k( q% D1 D: u: h(autoload "xplode" '("xp" "xplode"))
( a) z/ J! o# p5 g8 @7 P! J# D(setfunhelp "C:xplode" "" "xplode"). t/ o* K; Z# p4 |5 H6 s# L( S. D
5 F, ^# j4 @5 `" s0 H) r+ O" V- e(autoload "tutorial" '("tutdemo" "tutclear"
) T' f* L- w0 a, F "tutdemo"
# d3 e% }7 c, r. |) g "tutclear"))% k5 S2 R {9 o, i* `$ n% f, k+ H: c1 w' W0 A
3 W6 j. r$ }+ K6 W;;;===== AutoArxLoad Arx Applications =====
( T! D9 i# t9 o1 |# Y$ \5 t" I: L$ `
(autoarxload "geomcal" '("cal" "cal"))
! Y3 F. E6 n( ]! U/ H$ a1 d/ L- o5 i# \% j! Z% K
(autoarxload "geom3d" '("mirror3d" "rotate3d" "align"7 j! u3 I7 U' x+ J" |/ S! G
"mirror3d" "rotate3d" $ j) u- T R5 m
"align"))
) |8 ^) c/ W9 D0 Z. [3 Z
" [3 \# q j9 F1 ?8 |7 U% m$ v: T) \" z6 W
;;; ===== Double byte character handling functions =====0 w( \, n* d) F
4 V8 X7 a/ J# M0 [8 d M& x(defun is_lead_byte(code)3 ^7 r) }/ {; U7 Z
(setq asia_cd (getvar "dwgcodepage"))
* |) i X2 ^0 O4 Z% J- T (cond+ K, ^( z# `/ q1 W- M
( (or (= asia_cd "dos932")
' \8 `( L3 F) S (= asia_cd "ANSI_932")
A, S# U0 a: g! T )
% `* O8 P7 e, ]* `/ ^6 N% Q (or (and (<= 129 code) (<= code 159))4 W! N4 b0 o/ a
(and (<= 224 code) (<= code 252))$ _6 x4 K1 B# Q" q; w4 s- w
)/ W: `; ?& t& h2 b: Q
)
8 ]7 z- x$ {. q' A ( (or (= asia_cd "big5")
5 Z, O( @' n# f: J# k2 S (= asia_cd "ANSI_950")
9 B4 e: `* C7 q* S )7 y, o9 P% R$ w! m& t
(and (<= 129 code) (<= code 254))( w8 u# @0 }8 t1 N
)5 Y* X. A: L6 u3 W8 m
( (or (= asia_cd "gb2312")
# s8 M+ Y& V0 I+ v5 T (= asia_cd "ANSI_936")
+ X8 ]7 C3 u; r% a5 @) y) L) Y )
5 X* ]8 d' |6 a9 Y- X4 `. i (and (<= 161 code) (<= code 254))# ]) ?9 @. s' x# `0 G2 P9 P
)
. F1 _. } x& j8 f: C ( (or (= asia_cd "johab")9 E o( S" A5 [ D6 O
(= asia_cd "ANSI_1361")
2 P2 q8 t0 b5 z )
) ~5 F3 U e7 m C; B# N$ o( ? (and (<= 132 code) (<= code 211))6 r" V) t( \+ p H8 O( r) j- u
)1 ?' h, U, L* Z& j. f4 w3 `
( (or (= asia_cd "ksc5601")! a, f( A2 C- n9 H0 M7 i. U) e% L
(= asia_cd "ANSI_949")
& g: @+ N2 W4 K0 w4 H! X5 T )( k( @# {4 k: h/ W; K! q
(and (<= 129 code) (<= code 254))
/ L R( t2 I2 @% X7 ~5 s/ S+ Z( u) H8 ~ )7 g1 n, J) {! a2 ]4 \# p- u
)
8 |5 ?: o i* {" E% G)" Y) s! U% O# A6 g! Q7 H* g8 g( G
5 O5 |" @ _. n8 D, p* p# i* }: ~;;; ====================================================" g7 M& L+ ]3 W/ \0 T* c1 N6 U7 I3 }
2 L$ N) m% w, A8 [! W6 k) B; W& ]
9 c- O; g6 k% _ J) e; {;;;
) k1 n3 Z) Y0 g' R( Y;;; FITSTR2LEN3 I( n# B( S v+ ~ T# L g
;;;, c3 o! {+ v3 r+ W% |1 d
;;; Truncates the given string to the given length. 7 u( K/ L7 T% O
;;; This function should be used to fit symbol table names, that2 t* J, ^1 A# _2 ?7 e6 ~0 e
;;; may turn into \U+ sequences into a given size to be displayed' ?$ k9 b+ u; m, G( K
;;; inside a dialog box.( l2 M& \% s0 u h* _
;;;0 c \2 X, G, D5 T- w- T* e
;;; Ex: the following string:
, \% y4 o8 C1 M) V, K$ ^;;;
# J8 I2 h2 e& s- a# X;;; "This is a long string that will not fit into a 32 character static text box."
) t2 S! v, i/ B9 R; A;;;3 @/ K: N9 b7 G0 E3 _ H/ F L
;;; would display as a 32 character long string as follows:
0 C# [3 @1 `) K# k/ A: H;;;
9 }# Y K2 r9 X: X9 x;;; "This is a long...tatic text box."
U0 Y1 J3 _4 H; ]0 P# I; G% S;;;
; B- \& M; X7 Q4 a" u& k7 a
) u* m( i7 l3 |: {* ?! Q2 P(defun fitstr2len (str1 maxlen)! g- @" S: d) M5 l
, `( n4 e: ]& D- o( m' o8 r" a1 U% z# M ;;; initialize internals
) i; E2 n4 W$ x2 K" `6 L/ ? (setq tmpstr str1)
2 `# r3 E" v- c4 a: L3 z7 D (setq len (strlen tmpstr))
+ ], j, J1 {* s, k
5 X8 O$ F* N5 A; H7 E (if (> len maxlen) ) E' ]% x# _# `" O2 s5 o
(progn; I! s! }. p6 S( V% t& y
(setq maxlen2 (/ maxlen 2))
. X i( _0 N; J, C: j! L! K (if (> maxlen (* maxlen2 2))# O* _, B6 R0 f' [6 F* C1 Q
(setq maxlen2 (- maxlen2 1))3 H6 r' ~& u, t) f, S$ M( W4 i$ U
)2 J4 }( D n+ }) u& j, }; B" N; U
(if (is_lead_byte (substr tmpstr (- maxlen2 2) 1))
+ b+ B( B/ ]& ?' q9 J2 a& a (setq tmpstr1 (substr tmpstr 1 (- maxlen2 3)))
6 v1 ]3 i/ t5 o8 w2 m (setq tmpstr1 (substr tmpstr 1 (- maxlen2 2)))
( X9 ?0 }5 J! _6 B6 d- `, f )
% f: `! k8 l7 c (if (is_lead_byte (substr tmpstr (- len (- maxlen2 1)) 1))
/ Y# B1 r" ]/ ?7 J- a D7 F1 c (setq tmpstr2 (substr tmpstr (- len (- maxlen2 3))))* ~; C. I/ f- U6 f( l w
(setq tmpstr2 (substr tmpstr (- len (- maxlen2 2))))
9 O8 Y I3 q( w5 g# M7 P )
{/ _8 ^, |3 h, B0 X! C (setq str2 (strcat tmpstr1 "..." tmpstr2))
7 `& i0 x/ W* j! e) X( \! s! ] ) ;;; progn6 i# m B5 B9 ~0 `
(setq str2 (strcat tmpstr)), S# c- A8 k- j# j
) ;;; if
7 r+ Y6 x! o8 B9 x$ G4 p W9 |) ;;; defun% B0 E) U- t; I" X1 {, p) q% X
7 F) X) r8 i: m: g5 e+ B& w
$ z# h9 E1 b$ o- J0 t;;;
/ g6 m9 Z5 t9 e; J8 S( F$ `& n6 a;;; If the first object in a selection set has an attached URL+ M! ^" X( }" f- k7 K
;;; Then launch browser and point to the URL.
1 e! b4 T" m/ w7 f# l8 F;;; Called by the Grips Cursor Menu0 g- L, Z. }& q; i$ _7 _
;;;
) } c+ l1 L7 T1 M% O4 }1 z: ~, i: D0 x' X
(defun C:gotourl ( / ssurl url i)
* R! C6 K$ H( n1 a (setq m:err *error* *error* *merrmsg* i 0)* t& P7 ?! Q- m2 ?3 V6 \
, L, C# [7 n8 @" H
; if some objects are not already pickfirst selected,
0 H! s6 N9 K1 A9 Z* f; then allow objects to be selected
) i- ^$ e& k7 v& } B- n% M) b
! e$ Y' [# W, ~ (if (not (setq ssurl (ssget "_I")))0 G+ Q# q L1 N& i7 m
(setq ssurl (ssget)): @, m F7 k" t* U7 Q
)
: }5 Q/ y3 f. G$ L5 r4 C2 N# o
9 U) ]: P, c& f! Q6 \2 w; if geturl LISP command not found then load arx application3 a3 j# F2 n6 a
) M: ^" t2 Q3 X. v% T! A$ N
(if (/= (type geturl) 'EXRXSUBR)5 k0 R/ |. X) u; @0 ^% N5 _ ]2 }
(arxload "dwfout")2 p B8 O+ a2 l. k
)
2 i5 v _, k7 d2 u# l0 L. t% Y) `( A
; Search list for first object with an URL
# I# |' ^7 U1 h% k& y/ ^ (while (and (= url nil) (< i (sslength ssurl))). a0 V5 m4 ]/ A. Z. l4 m4 r
(setq url (geturl (ssname ssurl i))$ X' u5 f# O8 x& U3 @7 O( p
i (1+ i))3 Z# D- A, k! ^7 ?$ B. y
)
. ]5 @, W8 W2 I# N0 X- y9 f, |2 U* ~& x9 D ?" O6 i7 v
; If an URL has be found, open browser and point to URL w0 x' i. L( B* O0 s2 o
(if (= url nil)
0 X* o0 l: N& g. _3 \+ @ (alert "No Universal Resource Locator associated with the object."); X# F6 a, I0 m. P3 Y/ Y
(command "_.browser" url)# \4 a) P, G' C- h( r9 T! @+ B
)
6 X, F! X3 r- D% R6 P0 O5 l
2 |) Y" S0 z! j# t* q (setq *error* m:err m:err nil)2 H2 P( A: b2 P3 T5 N8 J
(princ)7 _/ |" X7 `" \) m8 h% Y
9 [# ]" ?+ I1 X; I8 ?$ Y
)% I% Z m3 E E
" P3 _" Y* G2 G) o' r& s) m! G
;; Used by the import dialog to silently load a 3ds file- F6 B. ]8 E2 k! R& n7 j* Y
(defun import3ds (filename / filedia_old render)
) E% X/ b7 y2 l7 c ;; Load Render if not loaded! Z2 }2 I) m: T" B9 d& h
(setq render (findfile "acRender.arx"))
# E8 K* w1 L" @( s6 G8 ^% D4 K (if render
' W% }+ E u* A2 @ (verify_arxapp_loaded render) 4 T3 K! B5 [% r7 L. ~! S) ^
(quit)# G1 m. C/ W; z3 O4 D* a9 x
)- f& Z8 c% P* f9 M' @4 q& g
6 h5 Y4 m: O% _; C* x% b
;; Save current filedia & cmdecho setting.
/ d& O: i9 N" Y# X0 l (setq filedia-save (getvar "FILEDIA"))
% e, X( ]' S! s2 ^/ L (setq cmdecho-save (getvar "CMDECHO"))
5 y+ Z0 f( j. L1 |' A2 f1 } (setvar "FILEDIA" 0)- l( S: d7 t& A% `! d
(setvar "CMDECHO" 0)% a( J' r; Z# T8 k' Y1 U, @
; }0 f# \' [2 }2 A
;; Call 3DSIN and pass in filename.0 Z3 H! f, H2 Z" P# X" F* ^: o
(c:3dsin 1 filename)
' d: y4 y9 m1 e" @# D6 ~$ j
& D4 C0 d4 ^. ^ Q ;; Reset filedia & cmdecho- R7 G% w6 F. [& F
(setvar "FILEDIA" filedia-save)
# _6 L% }- ^+ m3 k( m! Q (setvar "CMDECHO" cmdecho-save)' A: ^4 \* F% I: N$ e6 J6 {
(princ)
1 Q9 l2 D2 h( O" P8 y9 Z)
2 Y C( Z: X# z3 S5 L" k
+ K1 Q" M: W8 H5 h$ A ]& ]$ V6 v9 ?9 C' Q9 @- L) x8 q
;;;=== Menu Functions ======================================% c) B3 G/ b2 p
$ x4 d! p7 _; O$ i5 ~; o& j. ?(defun ai_rootmenus () J4 l6 n, t/ d) ?* C
(setq T_MENU 0)
" `' K5 q% ~9 z8 V. ^6 L) a (menucmd "S=S")2 `/ P3 [; ^ C o! L4 n6 }; \. C
(menucmd "S=ACAD.S"). Y b/ U1 C4 |8 I
(princ)) R( b* @% E: S( V1 b
)
6 h; L/ J* Y+ D! a
8 e. C) m" h# C1 N(defun c:ai_fms ( / fmsa fmsb): l$ Q2 _, l: Q( u$ z
(setq m:err *error* *error* *merr*)9 Y' E. _+ T# r, Z0 g& K! h7 V: e
(ai_undo_push)9 S3 l5 I9 h: W
(if (getvar "TILEMODE") (setvar "TILEMODE" 0)), v& S- k, v2 K( ?; ]- G7 V
(setq fmsa (vports) fmsb (nth 0 fmsa))6 ^9 R% C3 s _ X) {
(if (member 1 fmsb); ~! ^9 O' b. S& h
(if (> (length fmsa) 1)
~& O1 p; Y+ B0 J( \( u$ G, d/ R5 j (command "_.mspace")
# ?5 s* n; K5 x% V) S5 a: q1 o (progn- D5 N4 X/ d( q$ T H9 f
(ai_sysvar '("cmdecho" . 1)). m& G8 {) X' R. e: C" r8 E
(command "_.mview")8 i9 Q2 R+ ]7 D1 ^( J4 Q* |: \
(while (eq 1 (logand 1 (getvar "CMDACTIVE")))6 M+ ~) K- h6 ^" Y1 h
(command pause)
% o7 t: l& o6 ~2 K )' y& X/ [5 w Y' \. P
(ai_sysvar NIL)
" Z7 K' E' t( @7 R7 e6 \! B: s (command "_.mspace")
0 O& t1 d, i3 G- f C )7 V6 Y9 H$ }! V, T% j
)
~( D0 a( n+ {8 R$ E" p8 e+ } )
& [: \# B" R: s (ai_undo_pop)
: L) v. a1 @+ _! z1 w( a, p( N (setq *error* m:err m:err nil). L) t f. z4 B1 A, E
(princ)' F3 g3 R- W9 _9 K l
)- }0 f1 c4 p% Y5 G
5 ]9 ?2 r/ N& |7 d# b/ g& F(defun ai_onoff (var)& O( u; G5 u6 P& L
(setvar var (abs (1- (getvar var))))8 [) C$ z/ }+ r6 S9 ^' x2 @+ Z
(princ)/ q( w: {$ ^5 `6 K& B7 \6 f
)
, o; q" L$ z; g5 d3 f9 ^. i
/ O' E) b W% L7 _! j;;; go to paper space
7 i1 r4 d* d" n+ S% M! N(defun c:ai_pspace ()
5 ]/ F1 } C1 Y1 m/ n (ai_undo_push)& Y" h* A! L3 n" A1 F' q
(if (/= 0 (getvar "tilemode"))
# U' Z) X6 ~" }, a0 @4 C (command "_.tilemode" 0)9 J+ e. W; r; H( ~9 _
)
9 [# i. d. I$ Q7 N2 v0 |* R4 I1 k (if (/= 1 (getvar "cvport"))$ h/ C6 m# O7 m. T5 c% W
(command "_.pspace")
# O; S# O& d2 r3 _ )
4 s9 P8 b/ n$ J0 }" g7 O Q! M' v8 b (ai_undo_pop)
1 y% c, X9 m1 A/ L' D- U/ ` (princ)
; y* I1 k/ \! @7 K5 Y)3 M$ K5 r1 g8 e$ `( Z
- M, y$ c( `5 X* d w5 U5 t7 D;;; go to tilemode 1, S9 c6 [- b+ N+ C
(defun c:ai_tilemode1 ()7 I4 h" p) s- E# d/ V# k
(ai_undo_push)9 `- ?) v/ e5 g( U
(if (/= 1 (getvar "tilemode"))# T3 p2 N6 I# K
(command "_.tilemode" 1)
2 _' l( r* M$ C) T6 p% E )- @8 z) N8 ]( r6 r$ g6 x* G: j
(ai_undo_pop). J$ d# l/ G4 C7 V+ A0 a: Y
(princ)
0 J3 ` d; a: @9 \ X) ?$ {+ p4 y! o! b1 p+ ]( e
8 }! \ i6 k7 g, x+ Q+ _! s;;; Pop menu Draw/ Dim/ Align Text/ Centered
' b3 B- ?) O* e% o# u* G" r;;; Toolbar Dimensions/ Align Text/ Centered
& g' t+ v+ [1 a u/ f/ {
) J+ t- M7 k: Z1 J M' j(defun ai_dim_cen (/ ai_sysvar ai_dim_ss)
z' O2 ?% y: e (setq ai_sysvar (getvar "cmdecho"))
, N5 N! i6 n8 [0 N (setvar "cmdecho" 0)
- P" y+ Z* U+ x5 ^0 B* Y (cond
& x) t) A2 P- L: m( K& r ((setq ai_dim_ss (ssget "_P" '((0 . "DIMENSION")))): A, D4 _4 S8 y8 W: ~2 ?
(command "_.dimoverride" "_dimjust" 0 "" ai_dim_ss ""
) B5 o% b& [/ c- S: @9 j "_.dimtedit" ai_dim_ss "_h")1 E% h. ~# w* u& w! [
)2 k5 {( B! d+ R7 g6 V% g
(T nil)5 E( M5 p y1 |+ ^" Q! ^6 X
)* w' b* N4 C2 j% v$ t# V$ D) ]$ W
(setvar "cmdecho" ai_sysvar)
/ [2 G" H3 p$ r; t& e- O2 ~ (princ)
- J$ V# @- @3 C4 c) p) v0 w)2 x' n4 d5 p9 M. i
$ M7 \" I; K0 x* p
;;; Shortcut menu for Dimension Text Above % H9 f1 ^$ |" b0 E; M
9 _/ G. |# d% w* G: K(defun c:ai_dim_textabove (/ ss)
# v4 V: Q" d( L5 h' g: K0 P- } (ai_sysvar '("cmdecho" . 0))
2 d! f( L" E1 |/ Z (if (setq ss (ssget "_I"))
) X" f$ o; l) T6 G& t& ? (command "_.dimoverride" "_dimtad" 3 "" ss "")/ `! J! y7 R1 X" U
(if (setq ss (ssget))+ K# o$ k3 s' V% A* o+ d$ p) G. X
(command "_.dimoverride" "_dimtad" 3 "" ss "") , [. X# t- ]6 K
)2 y! Y8 w- X+ W2 m& H* O
)
) O' P4 ^* ]" R j9 a (ai_sysvar NIL); W0 B# B D$ {7 L0 `
(princ)& t* H d0 n+ t! X2 V7 ?4 i
)
w; m! w4 Z0 G G& ?: H5 n
+ y& `" _1 V6 M1 G+ i;;; Shortcut menu for Dimension Text Center $ D& b/ L: s- J
- O& b `0 N) S$ I6 [& F(defun c:ai_dim_textcenter (/ ss) I9 l" T* W9 R) n/ J( D$ t
(ai_sysvar '("cmdecho" . 0))
" {7 q. O( ~0 f, A/ \* Y u6 i (if (setq ss (ssget "_I")), T( U4 n: V4 \0 [
(command "_.dimoverride" "_dimtad" 0 "" ss ""); @! c7 g/ r9 ^0 F0 Q" Z0 N
(if (setq ss (ssget))
2 G ~2 w0 D6 M0 f G/ I2 w' ?0 h (command "_.dimoverride" "_dimtad" 0 "" ss "")
+ B+ u; F: k3 u- w* A' [ )% H; F: b2 ?- k3 D
)% Q0 N5 A! F$ h$ H8 B$ l( r
(ai_sysvar NIL)
. v& _8 |! r; t+ L. h (princ)
/ B }9 i" R1 D/ `)
6 M2 n% ?& s* d. O
5 m* A4 I/ v* A5 O; v3 b/ H;;; Shortcut menu for Dimension Text Home : j( L Q8 W; i4 N6 M- Q+ y* O; r7 I5 F
- T. Q! |; g' f" H! C5 \! x& n(defun c:ai_dim_texthome (/ ss)
. A2 r; C! o% A3 w- i* P4 d' } (ai_sysvar '("cmdecho" . 0)). H# u1 I/ \" r# p" m1 n' }; L5 T ?
(if (setq ss (ssget "_I"))
) A4 d+ D+ d% Q" P (command "_.dimedit" "_h")$ h! ]1 k: C* P' l$ {4 T
(if (setq ss (ssget))
; L1 m) k- [: B( |: ?0 Z0 _ (command "_.dimedit" "_h" ss)9 Q+ e+ B9 V l* H
)& n. C* {) z% t# ]
)
6 f3 C; y+ Y2 i2 p1 {, f# x5 x+ a" p (ai_sysvar NIL)
4 @' f! {3 i. Y& X (princ)$ J" H0 a: Q0 C' A
)
3 _' @, ^2 a6 |* X$ u- N2 v1 l# `2 f8 J4 ^
. b! \- j. h/ a$ J. b
;;; Screen menu item for CIRCLE TaTaTan option.2 l: x2 u! U8 G+ ~$ H
;;; first, get points on entities
7 K8 V- E+ ?' D' O5 A) C) c, w1 s(defun ai_circtanstart()
% A/ X/ S9 ~/ U- {) z (setq m:err *error* *error* *merr*)
! g' n$ L! f0 z0 ~. S2 ?; X (ai_sysvar
. d3 D3 ~3 r/ V) Y (list '("cmdecho" . 0)- e4 p: r& A3 F( ^
;; make sure _tan pick for CIRCLE gets same entity) Q) Q0 q& G( K# w( g0 g
(cons "aperture" (getvar "pickbox"))
, p# z6 g8 |& D; R- Q )
! N0 k4 f! L! A1 E6 R% D )% B% ~( j! d: J+ Z- D, N$ _/ n
;; prompts are the same as CIRCLE/TTR command option
$ ~) f& b. g! W& [0 X6 D, w. j (setq pt1 (ai_entsnap "\nEnter Tangent spec: " nil))6 [6 l( t4 n; j5 c
(setq pt2 (ai_entsnap "\nEnter second Tangent spec: " nil)) E2 Q+ y {5 T/ N! A
(setq pt3 (ai_entsnap "\nEnter third Tangent spec: " nil)), x/ j7 Z, _9 ]$ M: N: F& x4 q
)
* _ M) t& q3 U4 [8 \2 F% u;;; Command-line version; f5 w4 z' K9 |- D7 H; M, Q6 r+ p
(defun c:ai_circtan (/ pt1 pt2 pt3)3 _5 ~& c; W. \5 a9 N7 V
(ai_circtanstart)
. n7 d* `1 e4 o. j8 i* r0 u c
' D# o8 ` f1 r$ Y; Y2 b/ n (ai_sysvar '("osmode" . 256))
2 P& S: J4 D/ F; T (command "_.circle" "_3p" "_tan" pt1 "_tan" pt2 "_tan" pt3)
0 D* d! \, i0 o' y' l6 J+ g5 K4 k* C8 v1 D% \6 G
(ai_sysvar nil)
5 p; Y& }- X; C3 s (setq *error* m:err m:err nil)0 h% i" n; T" T: t+ L
(princ)8 Z5 p, ^# h# H0 w
)
5 w% `( x) T2 `+ T;;; Use this if CMDNAMES == CIRCLE3 k/ i4 T& y2 \, u( l/ Y8 y6 w
(defun ai_circtan (/ pt1 pt2 pt3)
/ L, v/ R6 t/ `) G% n/ l7 c6 p (ai_circtanstart)
6 o! |7 ` y; o- r' g0 o2 G' z
* ~0 U/ y5 [% g (ai_sysvar '("osmode" . 256))0 a; a7 X7 C4 H: t1 {" K
(command "_3p" pt1 pt2 pt3)3 q/ c6 Q+ Z( a
: O) P/ i+ s3 ]# {* n( V' D. C (ai_sysvar nil)5 C" M& }6 u9 D' O9 m; `
(setq *error* m:err m:err nil)' E5 S, p+ T4 m7 t) d; _
(princ): ]) Z4 \+ y; a0 `) |, E: w
)
! W5 x* i. l* v1 P/ ?4 ~ D( M& }+ N% ?: L* ]8 I, w! Y; r
# x9 n% Y- y8 z- U \0 v- [
8 j- ]0 J# t( R/ j8 Y+ _: `) C;;; Shortcut menu Deselect All item.
. h) Y' b. s. Y6 ]8 U5 o7 m1 q$ c/ o- m- O: Z
(defun ai_deselect ()
, U: D# _9 {+ V (if (= (getvar "cmdecho") 0) ;start if
. Y/ W5 U( x! g7 r6 P' A. J (command "_.select" "_r" "_all" ""); D$ J, E: j6 H' u$ g: h$ ?; Z2 f1 |
(progn ;start progn for cmdecho 1; q2 a, O k5 a& ^+ S: H- @
(setvar "cmdecho" 0)9 ]/ b% c Q4 Z
(command "_.select" "_r" "_all" "")* ?' I# u! |/ M) Q0 W
(setvar "cmdecho" 1)
1 t/ X' A" |7 z" B' V1 ]) @/ w% ~ ) ;end progn for cmdecho 1
/ n6 T k( h( o" Y% p ) ;end if
6 Z# `+ ^# `) S( M2 O* o3 R+ O (terpri)9 {; {7 G# ]. Y9 P
(prompt "Everything has been deselected")
: P1 p4 o& p" ]3 ^. z (princ)& v, F6 G& g! T! r+ N5 t# C
)3 I2 U: K' [* S# Q1 Y
+ H$ @4 F6 S; |, s& }, A$ h- G;;; Command version of ai_deselect to be called from the CUI5 h4 q$ W6 O) T+ W% b' Z0 T- e: h" {
;;; so it gets properly recorded by the Action Recorder
6 U- x8 z/ O- I2 q, P3 B, i5 f; t;;;: u; { E) l+ c% a
(defun c:ai_deselect ()
$ L- r$ }/ c7 f$ E9 I( o; u (ai_deselect)( A6 Z6 q1 B; U% Z
(princ)
' R4 `) V! ^! x0 v% j)
# R5 f* J- I2 k5 t* S2 H/ I. I: f: F2 z; i8 O% e$ _4 `
;;;# F' `+ P! C. L- n0 V6 T) x
;;; Enable Draworder to be called from a menu
% n5 [$ g5 U3 O;;; Checks for Pickfirst selected objects
& O" D9 v3 ?+ N9 z2 ~2 x7 n;;;
5 Z- V, t3 n4 `( {: I
4 ~ x! U6 N, z(defun ai_draworder (option / ss )
) g/ ~# k+ Y F9 h3 S) _
1 @. Z, \+ o8 X: l$ v (setq m:err *error* *error* *merr*)
0 `" l: }! p3 d: l2 G (ai_sysvar '("cmdecho" . 0))/ n$ k% m) X) V% z! h* x
+ c" n k& z# L, v
(if (setq ss (ssget "_I"))
1 W- w6 F7 \1 A& f2 Z (command "_.draworder" option)
( A; w1 y5 N1 Q- v) ], u (if (setq ss (ssget))2 [( F! U' v7 Y ^) g9 E
(command "_.draworder" ss "" option)
% r A1 q1 Q2 p% w8 X) y- p# @ )
& h K/ p' x9 ]; G" o" z' t ): e1 G2 A9 \1 C7 w0 r1 Q5 e
(ai_sysvar NIL)
# S/ c C8 q7 \( R1 V (setq *error* m:err m:err nil)
) P. ?: C# a, T2 d6 x$ j2 c
7 |2 a1 u. X$ i+ b+ U5 p (princ)
# b0 s: `0 {; N)
2 A8 W8 c0 L% g
+ r3 R: p- A R, ~! M;;; Command version of ai_draworder to be called from the CUI
. {# }0 ~& _* n1 u& L;;; so it gets properly recorded by the Action Recorder, }+ Z7 `0 r4 b1 v3 Q) f
;;;
; E) t6 ~# X; j2 P3 l2 h(defun c:ai_draworder ()- h. m# r2 N$ S( k! M
(initget "Above Under Front Back")
% h3 ?% @7 X8 M8 q (ai_draworder (strcat "_" (getkword)))- V+ ^3 P& y( ?
(princ)0 Q9 b; W, Q. k. s8 J2 ~
)2 [ @, Z, j/ D* U- a9 u( e4 [
+ f+ \+ C! T) o6 r6 e0 B0 D( X7 u% i(defun c:vlisp ()0 d3 T/ n8 L; n. u; u
(if (/= nil c:vlide) (c:vlide))% Z7 I: u" z1 [8 w/ e7 S- [
)* @& r* ]* ?; O: W' X. u. k
% @" B9 u+ E! O* O1 j
(princ "loaded.")' H) x% V* s& c% {* _% U
( s7 Q N7 s$ g& J: q5 {
;; Silent load.
# M" ]4 x3 d$ h4 K(princ)' W# G+ z. B0 F% J4 n6 u. e4 D* x
3 d) e8 |) Y; e. M. q
1 f% o x* r: e+ `1 Q* `! x
! d+ Q8 S, q$ h;;;----------------------------------------------------------------------------' ^( d/ H/ ^/ g/ G/ K3 k2 f
;;;
8 n, B% `, K) H6 U& N0 r;;; DDCHPROP.LSP Version 0.59 ]4 q+ t. i# r9 V* }
;;;$ B2 R4 x# h) U' ~5 X
;;; Copyright (C) 1991-1993 by Autodesk, Inc., t1 y" P8 l* p% |6 Z
;;;6 T: p1 Z5 a6 Y* s. [* o# M. D
;;; Permission to use, copy, modify, and distribute this software
( M8 a: f8 f' x3 `; l3 D;;; for any purpose and without fee is hereby granted, provided" r- {. H5 B% d1 Y5 L9 A9 c& W
;;; that the above copyright notice appears in all copies and that
3 F" P- Q2 L$ };;; both that copyright notice and this permission notice appear in* `+ ^" y9 t# |" }7 I4 d
;;; all supporting documentation.
# w9 l! T, [3 |0 E7 x- v0 m;;;
! A) K' j! l/ C) f j;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED) Y8 t2 V" j+ Z) J& w
;;; WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR! |% S \+ b) q7 E; S
;;; PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
: _; j6 D: X% r/ a3 z' K7 [;;;
7 } v0 g9 q0 R/ X, O;;; 2 February 1992
5 ^3 x$ ` Y$ O1 v. n2 x;;;
: ], v# a; l+ i3 U$ a3 r6 C2 n( I9 T;;;----------------------------------------------------------------------------) ~5 d: j; ?- w
;;; DESCRIPTION
% a2 H: l! h" E5 J) B5 O;;;----------------------------------------------------------------------------
; J- _$ c4 z1 J& f1 l @, ?, P! n3 _/ E;;; C:DDCHPROP is a dialogue interface for the CHPROP command.
" J9 _8 d) m+ {- O;;;
* B$ t! p6 |1 k+ c;;; The command looks similar to DDEMODES. The main dialogue has an image
* @8 X+ @; }( X+ k3 i;;; tile, 3 buttons (layer, color, linetype), and an editbox (thickness). $ r) H( X0 i* n. F" p q
;;; The 3 buttons each launch a sub-dialogue containing a list and edit box. 2 f; R0 g; Y, s8 c; |" f* a# x
;;; The dialogues are all defined in the DDCHPROP.DCL file.
2 J9 Q2 s( B8 O& [5 g% n4 X. R E;;;
/ j: k: b; a+ P- [0 S+ B;;;
: b+ M& {' a: M. F. H) ^- k- m;;;----------------------------------------------------------------------------
& |, \- t) F4 U' |# ]* i: C;;;----------------------------------------------------------------------------5 a. C: B: T3 V1 |8 [! A) o, L
;;; Prefixes in command and keyword strings: 7 D+ ?) R& D, [. _
;;; "." specifies the built-in AutoCAD command in case it has been
- ?" ^7 a: b1 h( X, _;;; redefined.# Q$ I2 l' q! M& e- E# N" O
;;; "_" denotes an AutoCAD command or keyword in the native language' }3 u* [5 T7 W, M7 B j' X: _
;;; version, English.5 [$ o* d& O# @% E+ b# e
;;;---------------------------------------------------------------------------- \! [- ?. {3 a- H/ f+ M. m0 n
;;;) M* z5 k( ^" G. _9 g: B, p% j
;;;# V/ z* [" n7 P( c" u! u/ M4 T- |
;;; ===========================================================================
% m. K3 _! \. d;;; ===================== load-time error checking ============================
" i; }- ~" @- y. D T;;;* g" K$ k0 P" w. A
* M* F9 J( S( j/ T& k6 I
(defun ai_abort (app msg); G. |5 Q9 X% ?4 U8 I
(defun *error* (s)
' [* O7 `: P, S: |. R: x6 E (if old_error (setq *error* old_error))1 B6 n# K7 K8 R2 h
(princ)& K4 [ f* @! i+ R
)
1 T4 h) r+ ^% z* o" U t (if msg
; x6 w7 W- T9 W( R (alert (strcat " Application error: "
' s" W( {% L5 D7 G$ `8 r app
2 k: H: s4 K$ F " \n\n "
: Z f% P# \3 O msg
/ v2 @5 R9 x8 Y " \n"1 [: S B* F2 H; L6 Y5 m
)
; ?- ]1 P) ]0 T: L/ o ) h% K( S' c' d8 }8 @
)
- j, [ C, W5 k (exit)4 i! b$ ^2 I0 E
)
. ^7 {2 N5 z/ T. X! Z; j2 e9 F: c$ B i3 N# R* f# C
;;; Check to see if AI_UTILS is loaded, If not, try to find it,
' d8 p8 \% M" \' c4 i;;; and then try to load it.% f! A! ^; l; @9 N( ^
;;;* V/ {: k! s" X. n" \( P
;;; If it can't be found or it can't be loaded, then abort the# s% h$ d# `6 D: ~$ d# X
;;; loading of this file immediately, preserving the (autoload)3 Q& y& g9 q' i6 K" i
;;; stub function.
0 q! @8 k8 O9 _9 j5 U' H/ G0 _) {8 X+ v2 ~& I' ?3 S: E
(cond
. E- p1 U2 Z5 h% |, h1 J; u1 y ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
" I, G( Z% s2 u/ H% e/ _2 ` Y5 `0 h, R
( (not (findfile "ai_utils.lsp")) ; find it, n( z7 t0 v& R+ |5 o
(ai_abort "DDCHPROP"1 r; y4 C0 S+ [. ^$ t
(strcat "Can't locate file AI_UTILS.LSP."
/ h' V6 U* H& a" I2 \ "\n Check support directory.")))
4 k: K5 ~! j- @" W8 a8 F' L
) H4 [& x5 D$ V8 H) P ( (eq "failed" (load "ai_utils" "failed")) ; load it
7 n$ ` l$ ~) a. w d; S (ai_abort "DDCHPROP" "Can't load file AI_UTILS.LSP"))( ]5 J* `# y4 u' H
)6 U1 G% p, }' X& p4 O: z9 B
2 ?$ ]* j \; D1 L
(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP( w9 @! h9 ?$ d' U3 g) L
(ai_abort "DDCHPROP" nil) ; a Nil <msg> supresses9 i6 K. Q/ f/ L# h2 p
) ; ai_abort's alert box dialog.
3 U0 Y' }/ `& l a6 d. I) s1 P1 l1 N; N. e+ B5 C& |5 _
;;; ==================== end load-time operations ===========================
' L' u3 R- {, y4 R
- G$ e& ], \* }9 p& S;;; Initialize program subroutines and variables.; ]+ [; M4 ~$ E l' \/ f8 S7 V
# V. r* ` |/ D4 D+ W
(defun ddchprop_init ()5 e) E S' w8 }& Q$ J% j
8 F, h1 b& F* V+ e/ E
;;
2 e4 {+ Z$ N7 t ;; Define buttons and set values in CHPROP dialogue box
& [5 t( l& z+ K ;;- ^8 S L) d7 | ]8 @, X
(defun call_chp ()$ N1 @* p. H' ~1 ~4 N0 A
(if (not (new_dialog "ch_prop" dcl_id)) (exit))
* S; i' g: w* D0 j (set_tile "error" "")
' X4 C* q. k5 V ;; Set initial dialogue tile values. V( s+ Q/ L( p x' W1 B; \2 K1 ^
(set_col_tile)
7 l; N0 M+ b6 b% j/ V/ y) a: ?) Y (if (= lay-idx nil)
6 K3 n+ Z8 d5 H; ? (set_tile "t_layer" "Varies")4 |/ ]' d1 K5 d/ K
(set_tile "t_layer" (nth lay-idx laynmlst)) A, M1 S0 W& `( l# Y; O a
)
8 T. u# q" q2 J, y* c6 \9 | (cond , z1 u' ?# |. K6 O
((= lt-idx nil)4 \. o5 f$ k; w" N A# n
(set_tile "t_ltype" "Varies")
8 j: y7 k$ a& i5 M. S6 M0 _0 V )
# r; O4 p( z: k3 e }. U ((= lt-idx 0) ; set tile "By layer & layer linetype"" T c$ k9 Z3 y& w7 _) X
(set_tile "t_ltype" (bylayer_lt))
& E4 a/ U, y% }/ v )6 V+ P* S1 F# _! z7 M
(T
! y* I& K1 s) w% r* n0 ?3 E (set_tile "t_ltype" (nth lt-idx ltnmlst))9 z1 Q2 V' n: L
)4 p/ F, A3 P6 n; ^3 T# ]
)8 c/ L6 k+ e) |: i
(if (or (= ethickness nil) (= ethickness "Varies"))
' n/ p- @1 D2 n (set_tile "eb_thickness" "Varies")1 I1 \9 n; R. r# S6 v
(set_tile "eb_thickness" (rtos ethickness))
$ G8 W- R" q! L; V6 J J )
* f+ e' ^% z$ X/ n7 C5 b: d& ~3 o ;; Define action for tiles
& o! j: q! J# L, V (action_tile "b_color" "(setq ecolor (getcolor))")- p" V7 ^) f& L& U: R- ^
(action_tile "show_image" "(setq ecolor (getcolor))")
: r7 i) S6 U0 k9 v+ y; ]: b (action_tile "b_name" "(setq elayer (getlayer))")
3 C; L. l" p% @+ r (action_tile "b_line" "(setq eltype (getltype))")
8 \1 V8 N+ O8 [! S8 M (action_tile "eb_thickness" "(getthickness $value)")- c$ B: y/ B7 a
(action_tile "help" "(acad_helpdlg \"acad.hlp\" \"ddchprop\")")
. u( Y3 g) R7 a3 H (action_tile "accept" "(test-ok)")% |$ c! f& ]$ N6 s* }
(if (= (start_dialog) 1)! q, Z9 p) V. ^) w* X, o
(progn
) O1 j a0 m; }6 {: _8 j2 ^, {6 _ (command "_.chprop" ss "")
, j! Z/ V2 K' J9 Y. e' W (if ecolor9 m6 t" p5 D8 }: O1 ~/ G D
(progn
+ p, k" I4 |3 _% A, ~ (if (= 0 ecolor ) (setq ecolor "BYBLOCK")): g1 T) m% q; z
(if (= 256 ecolor ) (setq ecolor "BYLAYER"))
! S+ r; O9 U8 Y9 b8 l (command "_c" ecolor)
& s6 z( ?- J0 X' J2 b) L )% c6 q, _# X( R
)
) A4 M- l0 V6 f+ g (if (and (/= eltype "Varies") lt-idx)' ?3 \1 F1 I& `- K+ `' h
(command "_lt" eltype)$ {0 q4 h% q: f) W4 g( s0 v
)2 X8 y) E& H3 c+ M& k
(if (and (/= elayer "Varies") lay-idx)
* b! E( s2 {2 z/ V (command "_la" elayer)
- T, ~( U2 w2 D8 m! ]' ]6 a )
. C. @0 }. q& ]1 }7 l" K (if (and (/= ethickness "Varies") ethickness)4 p- z3 v2 y+ @1 K+ @0 K
(command "_t" ethickness)
' z% b! q' S3 v; L W2 y2 _) S! k# i )* m- W( ^5 D$ r- M
(command "")
% o( x8 u6 p3 i0 M9 Z4 T )& {4 L3 o0 d# L
(princ "\nProperties unchanged")
2 t/ e* h% [" y& g% H' | )
/ p) v+ D( b7 B7 h0 D( B (princ)
; a9 }* d3 p5 O0 ] )# n$ r+ T: P1 u: K% \/ J5 `) K3 ?
;;
! e. i' S6 F( s3 | ;; Function to set the Color text tile and swab to the current color value.
% M! v; r0 G, ^) }( J J( R! ` ;;
$ Z: \: r) o8 l4 V+ |. C6 q" I (defun set_col_tile()6 N( Z1 q% S4 D& s
(cond
3 b' x7 H4 }) X4 t ((= ecolor nil)
! V: m! X& k* _7 }' V (set_tile "t_color" "Varies")
$ {. M f5 r$ i2 M (col_tile "show_image" 0 nil)
/ i4 ^) G0 W) ]% S* k )
8 Q' C, e/ W4 P' `% s ((= ecolor 0)- l$ I' \3 c! e6 o) O
(set_tile "t_color" "BYBLOCK")
; h# q) v8 g7 z0 S+ r (col_tile "show_image" 0 nil)
: `4 M4 ]& q; g& e6 Z )7 T: U; M. V4 n2 A( E
((= ecolor 1)' Q6 Z8 B# ], d9 v1 }- Q9 B# h
(set_tile "t_color" "1 red")% ^* F5 }6 {+ Y7 O
(col_tile "show_image" 1 nil)% c# h8 H0 a2 ~0 W& l2 Q6 q2 a
)8 N0 i1 U0 Q" R ?* C
((= ecolor 2)
3 i0 F! h/ E$ Q1 b% S) @& Q (set_tile "t_color" "2 yellow")
! K9 Y, I, ^$ ` (col_tile "show_image" 2 nil); Z2 ^& S5 t1 F3 G) k1 F
)
' l2 _6 b/ O: { G ((= ecolor 3)
4 w3 Y0 q$ q* S! w( _, J+ w (set_tile "t_color" "3 green")/ @+ q' j/ C L+ S p
(col_tile "show_image" 3 nil)) m% r8 o, ^% j
)
7 D" e! X' a$ c0 a* v ((= ecolor 4)5 n; R0 s! R: Q6 f5 p/ ~) i
(set_tile "t_color" "4 cyan")
3 I0 d6 u) q$ [9 |3 `4 I (col_tile "show_image" 4 nil)$ q. S0 K' D1 {0 E
)/ [2 R, {$ S7 l) o# H
((= ecolor 5)
6 C7 i- U) s% j+ Y2 \& K+ W (set_tile "t_color" "5 blue"). c* Q" w- I% K
(col_tile "show_image" 5 nil)
9 }6 k. k3 Q9 I6 b8 Q2 F% z )0 Y* r/ ]) Y: G- z/ G% e
((= ecolor 6)
/ _( R5 r- H1 h9 o5 I (set_tile "t_color" "6 magenta")
, I# \, w5 P8 n9 H (col_tile "show_image" 6 nil)
* }' O7 P) h& x0 t, V- Q' _6 g )
# @' M; u9 c! ]% h/ R ((= ecolor 7)8 ]+ s6 G# f, |: B. v
(set_tile "t_color" "7 white")
5 P7 k& ~# u( T: h (col_tile "show_image" 7 nil)/ o9 J6 H2 j; B$ {3 ^. B {
); z7 f: i# V" i/ I; ?' y$ F
;; If the color is "BYLAYER", then set the tile to
- b" E; m* ?3 l; s) {) m0 O ;; show it's set By layer, but also indicate the9 F4 n; X. D* Q
;; color of the layer - i.e. By layer (red)7 j# _- U7 s& V& v
((= ecolor 256)
% Y" N# y: Y6 |6 p7 N: g1 x5 G (set_tile "t_color" (bylayer_col))- F# y+ `7 k" R& e0 R$ B _
(col_tile "show_image" cn nil)
. ?- [1 w* w4 G3 v )
' {6 B: o7 K0 R+ H (T
) T z+ s) q# x ]0 I" L+ X" L3 d (set_tile "t_color" (itoa ecolor))
" S) J: H7 X8 g( E1 G/ v7 U (col_tile "show_image" ecolor nil)
: E6 M/ w. d# ^' X/ v )
% G% |+ w; q2 L )
j6 m1 u1 Q0 |) x2 R6 j* |1 Z1 ?9 @ )
z7 H6 s" _0 i$ Y! O B ;;# |4 F: _& I5 F, B
;; Function to put up the standard color dialogue.
- S, _1 T; ~# Y) o2 L- u! A9 U) [: z i ;;" C3 ^' a5 r' |: y, m7 F: ]
(defun getcolor(/ col_def lay_clr temp_color)1 I& q+ D G6 q, l
;; col_def is the default color used when rq_color is called. If ecolor . L" c& u3 U8 I8 D' T' I4 X+ z
;; is nil (varies) then set it to 1, else use the value of ecolor.
" Y: [7 Y: F7 v" c (if ecolor
! @5 l! |3 `- t' C) r, l (setq col_def ecolor)! E L/ |0 g$ Z9 j
(setq col_def 1) w3 |- q% N/ o+ ~8 Q
)- v, t5 G: ?1 b# y$ k( S
) t: T$ U0 ] ~/ L7 b$ c ;; If we're working with a single layer, get its color1 t. L1 x8 E/ C! W
;; for use in the color swatch if the user selects color BYLAYER.
, ~/ H' r- D$ C# z (if (/= elayer "Varies"); Q/ F& a2 X5 \$ g9 o
(setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer)))): _; d9 F% a" R, m
(setq lay_clr 0)" X" i, e/ j+ ]
)2 }& f8 A! i( v. e6 `
(if (numberp (setq temp_color (acad_colordlg col_def T lay_clr)))! {- f O7 s; A- r1 R
(progn9 s8 _/ R: F; f- W, r
(setq ecolor temp_color)
" a# d" p- S0 {% n& P6 M; @ (set_col_tile)1 W& L/ O8 [5 M" j0 Y. b% p
ecolor# {) Z# o( P% B& m; P3 _
)' n( i2 b# }9 H- V
ecolor
/ o4 y# g6 f$ b; H8 H ) , c6 u# G y# o% V
)# g1 b& O4 ~& d% M3 v; i* o/ X
;;
% p! J! S0 J) h# _: L ;; This function pops a dialogue box consisting of a list box, image tile, ' R' V3 t) ]# Y% v% u: }2 B
;; and edit box to allow the user to select or type a linetype. It returns , |5 p$ i p5 i$ Y
;; the linetype selected.
! l8 l3 l. K/ @( i# j ;;
9 N R; n: b: J$ F' X( h/ ~ (defun getltype (/ old-idx ltname)
* ?; ?2 b/ F) I6 S& P1 K+ ] ;; Initialize a dialogue from dialogue file) ]" ^' k# ~1 `1 v
(if (not (new_dialog "setltype" dcl_id)) (exit))
2 H* o4 a" l9 `/ Q" d$ Z (start_list "list_lt")
! W' ?* ?6 u& E; a6 v, G (mapcar 'add_list ltnmlst) ; initialize list box# l* s0 s2 C! K2 F% q8 G# V
(end_list). B+ v; z I' Y. C0 z8 L
(setq old-idx lt-idx)# A# ~7 n4 g0 L* O3 Z
;; Show initial ltype in image tile, list box, and edit box
( g' ]7 G9 P. @* X$ i (if (/= lt-idx nil)" |# k8 ~. l2 H* C4 H. }: |
(ltlist_act (itoa lt-idx))
1 K5 }& c. P, i' G9 ^' V# X2 { (progn9 i( ~# w/ t& F. a) J. w
(set_tile "edit_lt" "Varies")
1 Z: m* \ y2 ] k% W" x5 E6 h3 C& K (col_tile "show_image" 0 nil)
) |. F2 N* i3 Q+ p8 A' V )! q) D# o/ T/ m* S. V3 e, F
). R' l9 s t1 f# z s/ v/ b
(action_tile "list_lt" "(ltlist_act $value)")
/ ^* G* Q# `# O6 p5 S/ N" X (action_tile "edit_lt" "(ltedit_act $value)")
1 }$ @9 V6 K' B (action_tile "accept" "(test-ok)")7 t) x) N2 K0 ^4 h
(action_tile "cancel" "(reset-lt)")" s, G0 Q" }+ E8 I
(if (= (start_dialog) 1) ; User pressed OK, m: @" d9 l+ m5 p
(cond
# r; x( R0 p. O3 c ((= lt-idx nil)& s6 ]9 U1 `& X$ [: n o8 Z
(set_tile "t_ltype" "Varies")+ F' c3 S; p3 d/ s
"Varies"
) X& @; F- }3 @ }5 [ )1 ^; n+ \& B8 D, C& U( u% j; V
((= lt-idx 0)
) D" ^7 s) v# A) [ (set_tile "t_ltype" (bylayer_lt))
5 ^6 R, e5 K9 ?9 I# e "BYLAYER"2 e; x' g: C/ f a) [1 q9 h. M1 b
)
0 V. |: b: `5 l" b; P ((= lt-idx 1)7 A8 Y+ f' f0 H
(set_tile "t_ltype" "BYBLOCK")
( q& f$ c0 r! ~2 \5 X3 H8 F "BYBLOCK") r$ v) p* t$ e0 L
)0 r* |/ f( y6 p' i3 K& X4 ~
(T
) q3 y2 s/ T/ s+ H; u (set_tile "t_ltype" ltname)
- p' ?" _$ _7 l ltname/ _! {9 ]7 i) Y. K! M& q
)1 r, U. W; C# F K* O* B& u
)( b3 v4 s- t5 S* Z/ n( M
eltype
" h( u( i* ?, u! Y6 ~% t1 D6 B )
4 G* X) j, _3 D+ \; { )
& Q/ H. s0 n0 q4 B, H7 ^8 R; B ;;
1 u# T* L% o5 Z0 c; R ;; Edit box entries end up here
$ {+ m7 U" {* R1 W7 m ;;+ i8 o) ^6 k. E# a
(defun ltedit_act (ltvalue)4 S$ M/ B8 [) Q2 _, }
;; If linetype name,is valid, then clear error string,
3 x- D$ ^3 C6 z3 | ;; call ltlist_act function, and change focus to list box.
8 I" d* D5 ]: U3 R7 [, | ;; Else print error message.$ N% V6 i& V3 c; |1 d
(setq ltvalue (strcase ltvalue)), U1 R% q; h; ~* {
(if (or (= ltvalue "BYLAYER") (= ltvalue "BY LAYER"))9 H, h* g5 S$ `/ e5 k% K$ b1 A9 p
(setq ltvalue "BYLAYER")7 L* X6 Q! h8 N8 Y: c R) y) h1 v
); s+ w! [; S& A' w
(if (or (= ltvalue "BYBLOCK") (= ltvalue "BY BLOCK"))
# U% Y' ^, ]* @- W (setq ltvalue "BYBLOCK")
# W# y) S. r0 h9 k! d )
6 o, u4 V9 x( ]% l: R (if (setq lt-idx (getindex ltvalue ltnmlst))3 [6 K. H& c7 F% E) }2 D7 @
(progn
9 p/ o9 `. a' {& g1 J s$ ^7 Q5 _ (set_tile "error" "")
# D* a2 S9 v% ]4 t c (ltlist_act (itoa lt-idx)) q# ]# c: m$ v) A
(mode_tile "list_lt" 2)
" k# l5 f+ B! }# o )0 R5 f- D- ~. T5 d
(progn& M. K5 s" R2 z. x5 E- Q7 t
(if (/= ltvalue "VARIES")' ^5 G/ c; K: v
(set_tile "error" "Invalid linetype.")
9 g( q* q* |4 c) ^ l$ \ ); x9 o0 r3 v; x; J
(setq lt-idx old-idx)" C% j r7 f$ R4 K9 b% |
)
8 ?5 m4 ?2 ]; A: v* Q7 M ); v# m# A$ r) h! o: M @
): h9 x3 a8 D! m1 A4 B9 _. q% M
;;
- f: V& P' f" v" v' K, `- z ;; List selections end up here' ~; o7 f Q7 Y6 k, g ?* N% a; r
;;
8 E8 J7 I4 h9 L6 H; A (defun ltlist_act (index / dashdata)
( S& t) b1 u, y4 `; n9 o ;; Update the list box, edit box, and color tile
( V; I j& D. \8 E; n5 U (set_tile "error" "")
2 i/ s+ P9 V5 ^1 o# t (setq lt-idx (atoi index)); P% @) l0 f# w; D' w& m
(setq ltname (nth lt-idx ltnmlst))
. ~: ?3 t6 |. k: o5 {- f0 H& P (setq dashdata (nth lt-idx mdashlist))2 s7 G6 T D+ e& J# }% i
(col_tile "show_image" 0 dashdata)
+ I J; M5 }; K7 |9 ~; m ]# p; b (set_tile "list_lt" (itoa lt-idx))
9 @1 j( }2 K1 ] u% j. Z (set_tile "edit_lt" ltname)
, {6 V' \8 j- a; ?- {- f: T )2 @) D- k1 y* P2 L" c
;;
! A9 Z. W$ Y1 x/ n- q( O1 a ;; Reset to original linetype when cancel it selected
, w) v$ a1 o: c" B0 ?) ^ ;;0 \ t$ k) w7 T0 Z, { g
(defun reset-lt ()
% K: T. ]) i/ K/ H# c W% ~ T1 \ (setq lt-idx old-idx)
# e8 D. J R9 d8 y$ [, o (done_dialog 0)2 Q* s7 Z" ]0 j
)
: L6 O' M, U! }9 C1 N( ` ;;, s% K: c. s& q! s- |. ?2 `! Y
;; This function pops a dialogue box consisting of a list box and edit box to % @3 r$ i: {% [% H$ j' M5 o7 m$ L
;; allow the user to select or type a layer name. It returns the layer name
4 p. w8 A) M! l7 }7 m ;; selected. It also the status (On, Off, Frozen, etc.) of all layer in the 1 v8 x' o: a; Y$ C7 |- Y
;; drawing.
5 Z2 G% U* p- |5 w m ;;
% t) M, Z8 I0 e! d# C( N d6 D (defun getlayer (/ old-idx layname on off frozth linetype colname)2 i4 R0 s0 z, D8 z/ m3 w
;; Load a dialogue from dialogue file
) |) D$ C+ M/ p, g9 Y (if (not (new_dialog "setlayer" dcl_id)) (exit)). u1 c( u1 |' h/ f3 j
(start_list "list_lay")8 y. B4 e @' j( W
(mapcar 'add_list longlist) ; initialize list box, b* D! q, y# y2 L& R/ v
(end_list)8 ?% r0 i9 `' b8 o. r$ h
;; Display current layer, show initial layer name in edit / |7 N( l6 N% p4 ]. ~. X
;; box, and highlight list box.: x( O6 d' M: z3 @, _6 t
(setq old-idx lay-idx)
0 L- Z0 f2 _3 f8 G' A (if (/= lay-idx nil) (laylist_act (itoa lay-idx)))
4 ~+ F7 y+ G% l% g& P (set_tile "cur_layer" (getvar "clayer"))
/ h8 N" x) o' c% Z8 I (action_tile "list_lay" "(laylist_act $value)")
+ D8 z% [1 |' Q. ~) v (action_tile "edit_lay" "(layedit_act $value)")0 p, ]' R, l& s) y7 ]
(action_tile "accept" "(test-ok)")
, @( A+ p3 c2 u1 N' e+ ` (action_tile "cancel" "(reset-lay)")3 C: W) G. Y+ X' K' u6 K; ?
(if (= (start_dialog) 1) ; User pressed OK- f+ Q+ G9 H$ t7 Z
(progn
" r: R$ j4 i1 P$ Y# [# j6 _ (if (= lay-idx nil) (setq layname "Varies"))
7 A4 l' e9 K5 M" _# T (set_tile "t_layer" layname)
3 _4 H" x5 U, N0 r, o ; If layer or ltype equals bylayer reset their tiles
$ a+ d+ m1 ^6 L- H0 E4 Y (if (= lt-idx 0)
+ A5 J4 R- U; ?# R7 r! m (set_tile "t_ltype" (bylayer_lt))
& j3 B. _9 g% C* v; T+ N# | )
7 L+ Z2 [9 [/ r/ Y/ N5 t (if (= ecolor 256)3 l0 b B& h9 N$ x5 E g& p0 B
(progn- g1 H# |, b% r! z9 O) s7 O
(set_tile "t_color" (bylayer_col))5 i8 V1 Z3 _: P: R9 t& _) a
(col_tile "show_image" cn nil)9 m3 u4 j" q) h3 ^4 ]" S: C: D
)& f) [0 `+ B* F0 ?8 O1 M
)/ g% a: ~, j2 M$ f; x
layname
6 b. r! m+ o t, W% P )0 Z9 B/ W# `& @. j. M1 D
elayer7 O% O r+ K4 }8 K
)( b* D# X& T, J7 a) J2 Q
)& d) t- @/ b3 H8 M+ N3 w) x
;;
+ G4 o) F& _- ^. }; T/ f! F b2 w ;; Edit box selections end up here% E& n1 f1 L% U! }) D! ]
;;" {" N" P. W' @" o" ?
(defun layedit_act (layvalue)% H7 X- p' n& Q9 q
;; Convert layer entry to upper case. If layer name is
) G9 m( ?, G; f8 t ;; valid, clear error string, call (laylist_act) function,8 I U' F: F5 ^! o
;; and change focus to list box. Else print error message.9 W Q3 @9 ~7 L
(setq layvalue (strcase layvalue))
: c6 [) h# h1 P8 d+ H4 Y (if (setq lay-idx (getindex layvalue laynmlst))( s }$ T; q" F) U8 e
(progn
- v& u: n5 z7 G" c% Y, o& X (set_tile "error" "")
5 _$ P# h" c' j* Q3 Z (laylist_act (itoa lay-idx))& A3 t" C$ v. m
)
* y. g/ w! D" l (progn
9 T( {" |3 ]5 H! o (set_tile "error" "Invalid layer name.")7 @% S# n7 y( u7 k1 S4 D5 e' m
(setq lay-idx old-idx)" ?9 d% ?4 _/ D$ u
)$ A z! U- D4 b. e7 M
)* s) U& i* F. f7 [7 |3 _
)1 S# H* p9 |7 B ^" \
;;
1 C/ f9 n! n/ d- T1 C5 ^$ D ;; List entry selections end up here
+ N0 `* B |/ _' t: _9 V5 [) K ;;
: h' {' D( W, }" e5 j1 L (defun laylist_act (index / layinfo color dashdata)
0 [) W5 C6 Q. B5 \ ;; Update the list box, edit box, and color tile3 ]1 [) {% M6 V, t3 h
(set_tile "error" "")$ g& v9 J& M2 _2 P
(setq lay-idx (atoi index))4 i d+ {) i+ G% j0 E1 s8 R
(setq layname (nth lay-idx laynmlst))( I9 c; K/ e2 s2 T
(setq layinfo (tblsearch "layer" layname))
3 q: P% o$ c7 n4 Z (if (= (logand (cdr (assoc 70 layinfo)) 4) 4)
2 i& X2 |0 Z* [/ m (set_tile "error" "Cannot change entity to locked layer.")
+ _2 x; Q9 s/ B) G( I! d (progn- s$ U l/ l3 `+ y, {! j
(setq color (cdr (assoc 62 layinfo)))
3 ~; w7 B9 t% ^- r& B8 w& N E (setq color (abs color))
6 p9 U$ ^4 u) j$ f& w (setq colname (colorname color))" |8 z6 T8 i' \: J: c' }
(set_tile "list_lay" (itoa lay-idx))+ \2 U+ A9 U+ i& u# {
(set_tile "edit_lay" layname)
. I" _9 K1 L) S! L4 d (mode_tile "list_lay" 2): p- l5 M9 H, ?9 Q
)* x! a% R% Q+ Z1 R$ C
)% }2 Z) q5 A9 w' u/ z6 e
)
* \- d+ n7 b4 { ;;0 [' ?( k: ?. g. T% m' P
;; Reset to original layer when cancel is selected3 A# d3 f# m. g
;;
$ d& r1 p4 H* [% \' K5 _ (defun reset-lay ()
) k* r4 k. e p E (setq lay-idx old-idx)( L$ W! }1 U" E: R/ E; X7 n. h
(done_dialog 0): h+ P+ }* r5 h
)1 }4 Z' k- f. u' p- b# {
;;4 [ T, I/ H( P% Q1 C5 I# @" u2 R
;; Checks validity of thickness from edit box. Since (atof) returns 0 when a
' i0 {0 K' V0 Z+ y ;; string can't be converted to a real, this routine checks if the first
9 k* W* m% b8 }( e4 h3 z# A ;; character is "0". It also checks to see if the value equals "Varies".% S1 O( e4 w( S5 k+ b9 Q
;;, {0 D/ U4 `4 Q8 z& q
(defun getthickness (value) d$ \+ G/ m+ A1 b
(setq value (strcase value))
- |/ s; s, t5 u( A* l (if (or (= value "VARIES")
7 f$ h: W+ T$ ]0 e (distof value)+ u* N7 ]) f7 r) I/ l) \2 m3 i
)
4 @! b- I8 D: E+ k (progn
1 a5 g" d# P8 X: ]- u7 B6 S (set_tile "error" "")/ c3 i7 p& |8 p+ x' l
(if (= value "VARIES")
9 ]$ A8 f. e7 V- L (progn
9 m" v& c7 t% y (set_tile "eb_thickness" "Varies")
/ M2 |! y2 y$ m; ~5 S \- m (setq ethickness nil)+ i; g" a2 Y+ r0 N3 D2 a
): F- u1 C: H" b" a; O* S' V8 a: [
(progn
" v& _# s* z. M9 w& C% S (setq ethickness (distof value)): k Y( ?( R8 s, @ ?
(set_tile "eb_thickness" (rtos ethickness)): C. z* I: l/ k: R" f
ethickness
( `7 @! h3 T& `# @, ^; K )
: @: Q) c$ B) Y9 O+ k Z; M )
2 j& c# n; r2 T, Q3 H: w ), O! d6 Y4 T( e6 W
(progn7 A% N0 K. `& Z- O
(set_tile "error" "Invalid thickness.")
+ a n- n! \- V# A* } nil) u) F# ?0 H" V, @2 ?; Y
)( O0 [8 E9 C6 d$ M& f, A: c
)
( |& W5 R. C* l' C% c )
; v) g3 I, K# E ;;
, p G) G5 Z# i& M$ B/ l. z3 {' U ;; This function make a list called laynmlst which consists of all the layer % C) [8 r; l% F! U
;; names in the drawing. It also creates a list called longlist which 4 i) G: Y7 r' ?+ p- J# I/ A
;; consists of strings which contain the layer name, color, linetype, etc. 2 [3 p3 V, J! W4 N# ?2 ^7 W% \' H
;; Longlist is later mapped into the layer listbox. Both are ordered the 1 U; E: a/ W1 H( k" n7 P
;; same.
8 Q" T x# C$ L* T1 p ;;* T% C7 K; z; g9 v( [( S' Z: [* ^
(defun makelaylists (/ layname onoff frozth color linetype vpf vpn ss cvpname 0 f# \% |6 F8 k' G9 e
xdlist vpldata sortlist name templist bit-70
# H7 n0 i. V% l2 d& L )
% u( S6 q: k+ G% M1 v; O (if (= (setq tilemode (getvar "tilemode")) 0)
( N1 }. K! O+ } (progn
& K9 L- Q% t0 p! F3 A8 Z (setq ss (ssget "x" (list (cons 0 "VIEWPORT")
7 |2 F1 q% _/ L+ c& _3 N2 ? (cons 69 (getvar "CVPORT"))
2 v! j* d- p+ K. C0 N v )
1 S. P" n d2 l% N' ` )
$ Q+ C, h! }9 c9 V# v ) 6 I$ [) [9 T! B
(setq cvpname (ssname ss 0))
0 s+ U0 O5 r: F; e1 I, O& l (setq xdlist (assoc -3 (entget cvpname '("acad"))))
# n3 i7 r8 e! [. L# m2 G p (setq vpldata (cdadr xdlist))
; e6 ~+ I8 x# D1 D* @0 h m! O ). |) I. p" ^/ ^1 T+ y
)
$ {# G u, \5 e* ~8 C; j (setq sortlist nil)
5 X6 P6 _" B+ s' u3 `- B d; a (setq templist (tblnext "LAYER" T))( L' G% w: C$ o; J
(while templist) x% ?0 E# p* m" r0 @* |; D! D2 v
(setq name (cdr (assoc 2 templist)))
/ i' S4 J, _; B, Q4 Y+ Y (setq sortlist (cons name sortlist))
# ?# m* g9 o/ ` (setq templist (tblnext "LAYER"))" O" {' l3 D0 f2 K/ z8 I: x. k
)
* J" t2 {/ }1 Z( H" X& E (if (>= (getvar "maxsort") (length sortlist))
) q8 L" Z( W; G! X* V4 d; k (setq sortlist (acad_strlsort sortlist))
4 Q$ `0 r& X- C, n& E. D (setq sortlist (reverse sortlist))
w5 A. m0 j, m, ]3 k1 R )
8 v( `# d/ t* y5 ` o (setq laynmlst sortlist)
# _1 x! m3 k7 m# K, n) X (setq longlist nil)
4 B2 d `9 U* r, e (setq layname (car sortlist))( e3 }7 J" N0 g. k& e- ?
(while layname6 i1 y3 P: ~! N- n3 e
(setq laylist (tblsearch "LAYER" layname))( `( m# } ]/ i% i) G3 G
(setq color (cdr (assoc 62 laylist)))' F- K; f6 u4 z" b- ~( W
(if (minusp color)- z1 b& G/ l* K3 i8 z) i* E; V5 v
(setq onoff ".")
' l8 h! q" F K9 U8 f (setq onoff "On")
; o9 G* f7 Y4 J. J0 g* A4 G% A )
% V: Z* c" l7 d1 v (setq color (abs color))
" k7 }0 e+ O; A$ O; X (setq colname (colorname color))
8 y0 V$ B g1 ^* R+ H& y (setq bit-70 (cdr (assoc 70 laylist))); `* y) M( q( Q! g' s
(if (= (logand bit-70 1) 1)9 B0 f( A; m& S' M1 f2 f
(setq frozth "F" fchk laylist), B3 c1 ]8 Q5 K* d, `0 U
(setq frozth ".")
# q9 I) M4 p6 G1 X% a5 d )
- e6 Q& Z4 T8 i" P" o4 g (if (= (logand bit-70 2) 2)
: o( G o% ^% O7 P U5 ^- } (setq vpn "N")2 Z; B& k4 ^+ f4 V
(setq vpn ".")! } S7 _7 ]) P/ q- c
)
3 |4 @7 f o8 ~$ u- S+ h (if (= (logand bit-70 4) 4). ], Y8 M; D- P
(setq lock "L")
# [4 J6 M3 l% _ (setq lock ".")
" F/ A' b! |& K, T" N8 ^ )
- K, N, F/ K2 w. ^ (setq linetype (cdr (assoc 6 laylist)))
) u5 v- M; l8 Q+ N (setq layname (substr layname 1 31))
# v- `& E+ {* k5 |1 D6 C (if (= tilemode 0)7 f4 l/ r) Q- _: q. Y( ~+ H e
(progn F7 n0 ^5 S U: N4 V) E* z- f
(if (member (cons 1003 layname) vpldata)
9 `- \7 `1 V; @ (setq vpf "C")
, U1 h3 q! p! ^ (setq vpf ".")
. Y7 Z7 G( v U )3 _4 [1 a$ n; o& \" L! _# Q! X$ S
)
& r( i, p! v+ [0 r K (setq vpf ".")& a: Y$ @- w/ R4 f$ ?8 O% f# ?' x
)8 b, c; R0 P$ ?
(setq ltabstr (strcat layname "\t"
! r% M: V2 J: \6 \& g onoff "\t"
# v i# a3 u2 B, v! z3 N frozth "\t"( |- u, Z9 D0 o$ e
lock "\t"
2 u% T, s) s( w l3 [8 S vpf "\t"6 O2 ?1 l9 `5 z
vpn "\t"
) p! t W+ j' H- f# V4 M colname "\t"
, n' m% o( Z+ H0 h! v linetype' ~) b- B6 \% B( R3 x+ l
)
: j4 K2 g: G4 t )/ q7 [* H/ S$ F
(setq longlist (append longlist (list ltabstr)))$ f; w6 ^5 {. A' k+ ~* ?* c; j; y
(setq sortlist (cdr sortlist))/ l, b3 L; j. l, T. O
(setq layname (car sortlist)), e8 p2 M# P. I" Y. g; s
)
6 ^! k& ^; i, g ), A' R8 Y+ y2 w
;;* `$ x# {' N. f' s6 O# `/ X
;; This function makes 2 lists - ltnmlst & mdashlist. Ltnmlst is a list of
$ N: r# d n& i+ n ;; linetype names read from the symbol table. Mdashlist is list consisting
( B, n8 ?0 @3 o0 ~5 W+ v ;; of lists which define the linetype pattern - numbers that indicate dots,
6 n$ p- ^7 D) b. T( q1 z5 y2 S ;; dashes, and spaces taken from group code 49. The list corresponds to the 0 T( ]4 n% x+ D) m# K" z5 h
;; order of names in ltnmlst.
$ X! _2 z* s- I- w: E9 l4 C+ h ;;
) N2 R2 B1 Y* A0 I. s% }# d (defun makeltlists (/ ltlist ltname)
5 J+ N m2 v) ?# r5 d J (setq mdashlist nil)$ K4 q& Z P1 b* `( a5 T y3 m
(setq ltlist (tblnext "LTYPE" T))2 g% }$ O( n' n' Y, p# u+ ]% Z
(setq ltname (cdr (assoc 2 ltlist)))* j, o' _" h" ]8 \6 M% E. A
(setq ltnmlst (list ltname))! t2 V0 g5 \# b* ~$ `* n+ f
! K8 B5 f- r2 m* n) g! b/ @
(if (= ltname "CONTINUOUS")( R* U7 G0 O7 ?( d: J k* U
(setq mdashlist (list "CONT"))
5 X0 ~8 D* k% y; e* Q, l (setq mdashlist
. |: _" P0 F) w- ?0 u (append mdashlist (list (add-mdash ltlist)))) A( E' M1 i& j7 n* M) P
)
b; g* p( I. I/ E$ Y& B )
# l7 n4 M3 R3 Z) Y( D" E (while (setq ltlist (tblnext "LTYPE"))
; i3 R* g# U" i (setq ltname (cdr (assoc 2 ltlist))) ]' E# T/ K" B G# i) S8 |
(setq ltnmlst (append ltnmlst (list ltname)))
7 V7 ?: M, r5 U: H! \ (setq mdashlist
) Q2 k, s3 X. `7 ^7 _1 _& V: m (append mdashlist (list (add-mdash ltlist)))6 b" e2 j) D2 {$ j) |# I. Y
)
" B: @: N& M5 m3 j9 _ )
7 x" n# Z9 I; O3 m/ d (setq ltnmlst (cons "BYBLOCK" ltnmlst))+ n" l# Y& r; L6 B* H8 t" e
(setq mdashlist (cons nil mdashlist))
0 }* `: f( c* T8 D- g0 t: k/ Q (setq ltnmlst (cons "BYLAYER" ltnmlst))$ ~' A+ c# A a/ |5 w/ c
(setq mdashlist (cons nil mdashlist))
2 C& Q* U+ f0 {; C4 j+ x )/ @$ c& z& Z5 [" Y6 I
;;" G$ ^3 Z: u, R( ?* G( T
;; Get all the group code 49 values for a linetype and put them in a list . O; j \5 }/ _/ B# k8 x
;; (pen-up, pen-down info)3 r2 X) A) J% j
;;
" i+ l V/ m, O1 Y6 W2 E8 z4 ^ (defun add-mdash (ltlist1 / dashlist assoclist dashsize)
3 V" B; T, K/ J1 e Y (setq dashlist nil)& [7 t% g% ]8 O# L" k) c4 u
(while (setq assoclist (car ltlist1))
! g2 T& [2 U7 N6 n7 u7 D (if (= (car assoclist) 49)
9 ^1 {) X( E- H* ?1 H3 | (progn
' X/ c' U# q& r9 `/ H$ n (setq dashsize (cdr assoclist))
/ ^- K8 `; {, P$ c- ~+ {$ |- y r' g (setq dashlist (cons dashsize dashlist))* |- l* P& m0 X9 A- F2 _
)" s3 z& L% X$ I& n% l7 [
)
4 {' \' G9 h4 r* u4 [ (setq ltlist1 (cdr ltlist1))
" ?: g" z3 ]8 p& a" k9 Q- L )
j1 ~+ Z% v! V, r* | (setq dashlist (reverse dashlist))
1 o3 n/ z2 I# x0 ^5 `6 s0 [, C )) u% y4 e7 d/ F3 c* O
;;, G& g! b2 T, L1 G
;; Color a tile, draw linetype, and draw a border around it# j' g8 c8 X) w8 l2 q" e( v) T
;;
/ ~1 W6 h7 R7 U" } m4 [ (defun col_tile (tile color patlist / x y)
, \1 X% |; Z& [/ i( M* L% q (setq x (dimx_tile tile))1 y) v' ]! E+ r: N0 a c
(setq y (dimy_tile tile))
9 M; |1 u7 q. z- p7 V" s, C+ n (start_image tile); ~2 m7 [: A0 `0 w
(fill_image 0 0 x y color)6 \3 k' E( R+ D9 S% U
(if (= color 7)1 a7 r/ e; Y, u/ W- [7 s/ c
(progn
7 Y) V% {/ M' N# a2 K (if patlist (drawpattern x (/ y 2) patlist 0))! O, D/ i( Y* B0 C
(tile_rect 0 0 x y 0)9 P% D( f, h4 ]
)) a9 U6 O' P9 ^! ]1 [* C
(progn
' ^3 K1 z, m, A% r (if patlist (drawpattern x (/ y 2) patlist 7))
' I" k. v4 R' _$ H/ ~$ S (tile_rect 0 0 x y 7)
% v6 s% f, |6 t( h )
6 i8 J6 ~# x, f3 l% X ): n" ?# s$ H! f8 w' X
(end_image)3 F" p: G! X" M
)
4 F- _5 t+ [" Q0 B ;; f* j$ L" Y9 G7 T# N
;; Draw a border around a tile2 Y. W0 h; ]7 H; S0 O
;;9 n) m+ n3 [$ K
(defun tile_rect (x1 y1 x2 y2 color). m. f( k( H! L1 P' W
(setq x2 (- x2 1))
, H4 H! `% _/ r6 G. H* s5 b (setq y2 (- y2 1))# s/ C' m; }8 _% q! u
(vector_image x1 y1 x2 y1 color)
5 A: C; L M C4 _' S6 o' Z (vector_image x2 y1 x2 y2 color)' M5 q* Y1 b% B) r: t) F" K
(vector_image x2 y2 x1 y2 color)
5 G3 B+ K: Q e/ d& E M' k3 ] (vector_image x1 y2 x1 y1 color)
' {& i. R* E& l- r! v$ f% i6 s6 w )
+ `4 f$ g% o. K ;;
4 u/ ^& h0 J6 e ;; Draw the linetype pattern in a tile. Boxlength is the length of the image - T' [, W! x& w5 C. ]
;; tile, y2 is the midpoint of the height of the image tile, pattern is a - H- E/ i" r' ^. K
;; list of numbers that define the linetype, and color is the color of the ; x, M3 v0 K; g( A. ^. m5 e
;; tile.
( Y' k, K+ D( B% Q3 b ;;
V4 _9 ^- D7 c (defun drawpattern (boxlength y2 pattern color / x1 x2
$ q7 ^5 t k" f! H4 c patlist dash)5 a2 r6 k/ L4 V
(setq x1 0 x2 0) T$ X1 P3 f" F# Q4 } Y
(setq patlist pattern)
$ e: @) |2 b- S2 b( p (if (= patlist "CONT")! q/ W( {, P: R$ A2 }4 e
(progn
) c: { W! g- f1 L( l' s8 ~ (setq dash boxlength)) K! B6 O7 s6 Q3 y8 ]' r5 f
(vi)
2 z+ ~/ V) Z: _3 L (setq x1 boxlength)! T- O2 g4 s' x, e1 s
)
' b7 P$ D1 g( H4 z/ j )
1 {( q, L* S2 u8 h (while (< x1 boxlength)
& o; g; z+ |! r (if (setq dash (car patlist))
; o4 N) X9 i( I: S (progn y' \* n7 @' O
(setq dash (fix (* 30 dash)))
& [: Z( v# H! f (cond ! A: b& T! j( q% t9 Q: ^
((= dash 0)
$ \/ o0 U4 M3 t! { (setq dash 1)
, W4 g: E% e% _3 z2 I7 [4 n- H& o& l. k (vi)
! {) s* B j4 e: ^; y, C) l& f& a# r Z )* t, E$ B. f3 \
((> dash 0) . |' F4 `1 N/ ^5 A
(vi)% U n2 n, @# j4 l+ e
)- t5 h! v+ e: ]" ~
(T - s0 W7 ^7 R9 r; O p0 L- e/ V; Z
(if (< (abs dash) 2) (setq dash 2))
0 ?( V4 g( O: [4 P3 @. h1 T (setq x2 (+ x2 (abs dash)))
& E) @1 ]4 d; ?- M )
' P* y+ C* _) y2 Q+ D6 C )+ ]/ F- }# i$ J3 K" v5 T
(setq patlist (cdr patlist))+ T/ W9 T7 s3 x- ]7 z7 X W! [% ^
(setq x1 x2)
* l$ P& a0 w, T- w3 l" c )
2 `3 C, x1 @3 ~8 F, b9 n# v+ s* q (setq patlist pattern)
: J. b# e+ f: ?5 w1 P2 _ )1 D. l1 T7 l* v' k& f1 x& g
)8 ?9 r8 A5 q- |% z
)
- d" i: b1 O' W% z ;;0 W4 g" [. Q) f* j- _8 r
;; Draw a dash or dot in image tile
+ ^# N; N7 i1 t. ? ;;
! t: f" W0 V8 i( e m (defun vi ()5 t, N* K! K3 S7 H+ @
(setq x2 (+ x2 dash)), Y Z C- z9 S2 G! |: O1 ^
(vector_image x1 y2 x2 y2 color)
0 b' k+ S# S; C! w/ Y& k )
y ^/ f% Z c: Q# s1 v3 Z ;;, L [( I0 c8 e: b
;; This function takes a selection and returns a list of the color, linetype,
* K6 l( `% e4 x7 d! { ;; layer, and thickness properties that are common to every entities in the. p6 q2 b7 `3 g7 Z0 o( h* c p
;; selection set - (color linetype layer thickness). If all entities do not
5 b4 Q0 ^9 X o ;; share the same property value it returns "Varies" in place of the B) d9 \0 S+ R% H: N1 M; R
;; property value. i.e. ("BYLAYER" "DASHED" "Varies" 0)
* N) G& f# {- z+ ^& g# X( e ;; M' Y; y; g# K3 }$ E
(defun getprops (selset / sslen elist color ltype layer. G6 Y4 B7 Q6 M' S* Y5 ~0 H
thickness go chk-col chk-lt chk-lay chk-th ctr)0 o5 I7 m/ w) D
(setq sslen (sslength selset))
" X1 `; x! n3 y1 a (setq elist (entget (ssname selset 0)))
3 W! }5 [! J* B! j+ C' X! S8 U: r (setq color (cdr (assoc 62 elist)))
* `, y$ ?3 A' f) {" R9 C (if (not color) (setq color 256))% p6 V; N- [ c5 e) }
(setq ltype (cdr (assoc 6 elist)))
% M, P# W+ K* ~+ o4 N8 a4 O6 l0 p (if (not ltype) (setq ltype "BYLAYER"))
5 N2 b6 h. H E5 P (setq layer (cdr (assoc 8 elist)))+ j, r( {, r0 W% u. o# D7 l
(setq thickness (cdr (assoc 39 elist)))
# O: {! w$ ]+ x5 i) W (if (not thickness) (setq thickness 0))
% |# v; m3 V6 X7 R* A (setq go T chk-col T chk-lt T chk-lay T chk-th T ctr 1)
( x8 u2 S4 V! Q& C. p; |4 f* ?5 t. Z0 W; \
;; Page through the selection set. When a property
# {# m6 `% p' H ;; does not match, stop checking for that property. C. D/ C( T$ @. a
;; If all properties vary, stop paging.- F2 }/ T# o% t
; e- g& H) I- U (while (and (> sslen ctr) go)
( o+ d" F: o4 [) s4 [) _( w (setq elist (entget (setq en (ssname selset ctr))))
8 f5 z$ i+ O4 |/ d9 v6 o% K& q (if chk-col (match-col))/ ]2 i+ u- {- R$ {$ v
(if chk-lt (match-lt))9 q7 h9 Q) U I
(if chk-lay (match-lay))
O+ K& s$ N4 m, \4 d; b (if chk-th (match-th))
6 @3 N5 ^& t6 E( t. q; c (setq ctr (1+ ctr))
" K% y0 Y: h& b/ A( {+ }" w6 W; p (if (and (not chk-col) (not chk-lt) (not chk-lay) (not chk-th)). D: j) u0 J# R- _; Z$ @+ j
(setq go nil)% R' T9 v# j) W. g& o+ _
)6 A- W; C1 j& m. M. V' ^6 o
)8 k) H5 L5 ^# {
(list color ltype layer thickness)- P1 c$ P/ w9 P3 v( q O5 e' L1 C" b
)
) N& t: G- E0 O
# s3 F( X* @% \ (defun match-col (/ ncolor)
g @. {) i; ~) T7 { (setq ncolor (cdr (assoc 62 elist)))8 i! b) g6 O4 _$ d6 v3 I2 I
(if (not ncolor) (setq ncolor 256))1 a% n q3 m8 v. V4 Q% m5 F
(if (/= color ncolor)
4 E, W4 d8 J; t. ` (progn
$ k) S3 `- \/ V7 ~) r1 B" |/ v- h0 ~ (setq chk-col nil)
, b4 q* u& N- B0 b- y) y (setq color nil)* U! G# N3 T" y1 Q
)
! _9 b5 S B4 ]) c" o0 | )! u7 m5 l7 F) w! c# V4 \3 w' G
)
: R8 ~; `$ z" D: u6 O3 O
3 s2 B, C/ ~2 X1 q y (defun match-lt (/ nltype)1 n5 t( ` C( z* l
(setq nltype (cdr (assoc 6 elist)))3 A+ C4 L, S1 J% L% w+ K
(if (not nltype) (setq nltype "BYLAYER"))% x" U0 _- k& J0 C9 G u$ d
(if (/= ltype nltype)) O$ y: h+ }) p
(progn
0 A; m& t) i; X1 ?3 {& x8 V (setq chk-lt nil)% w4 Y! S* R& w$ r5 Z. ]3 i
(setq ltype "Varies"), Q) R- O' G& B. H
)
6 E% m1 m% }- s6 R- s )5 x( F' v2 m& L& i0 r$ V
)3 ?* v! R: Y( W- p$ J6 i8 r
1 C! H( ^4 P" | (defun match-lay (/ nlayer)
1 H- ]/ Q3 _7 Y1 P4 P (setq nlayer (cdr (assoc 8 elist))). J* a* {) w' F" M' d
(if (/= layer nlayer)
- ^+ S6 X) A$ x0 A a (progn& N5 M7 g, m+ H& C
(setq chk-lay nil)
9 d) l! D2 K5 ?$ @) [8 V (setq layer "Varies")
* n) _1 Z3 ^ ~' e8 V7 B: L o )
; P$ E$ @( V0 ^( a& c0 W: N- ^ )
6 K3 G5 n! P9 g# [7 h6 u3 K' b9 h )
' i8 r" p# [7 a+ e2 ]
: ]4 {' v) X" P8 F8 V1 y (defun match-th (/ nthickness)' ]3 V- X; T$ | P' Z! n
(setq nthickness (cdr (assoc 39 elist)))
: P* @: D. @- }$ ^# H (if (not nthickness) (setq nthickness 0))7 |! R1 E: o/ y7 ^$ }
(if (/= thickness nthickness)
& f+ d2 p; e6 j (progn# i4 R r/ a% Y G- l
(setq chk-th nil)
. M5 P) s4 a9 [- T0 m8 g (setq thickness "Varies")
1 k9 H0 [+ |7 O5 x4 w1 b1 K )' i) c% S* k6 q7 Q# t$ y7 n
)0 j% v5 e7 C- X! B. f8 D
)5 K- n9 L+ e1 |
0 s4 j4 C8 h7 }6 o: C/ ~1 u V
;;- Z* D$ M& S7 r. u
;; If an item is a member of the list, then return its index number, else " }' `5 } Y& o: r8 `
;; return nil.
. [3 f& d# f: |6 ?7 {, c; Q! i2 o H ;;
% v+ c. e6 K! I. L: P (defun getindex (item itemlist / m n)
; }" r# d: T( e (setq n (length itemlist))
. \" P( {) i B$ ^! U (if (> (setq m (length (member item itemlist))) 0)
8 N" e9 @! d ]2 I) N (- n m)8 L* x- |* i: j# v9 N4 G. w: n
nil
3 ~+ ?' U; z. t) M )0 n1 C8 G% Z' E& B
)
) m; \: |' A! G3 V K) y ;;
6 Q( T" A( p: P0 o ;; This function is called if the linetype is set "BYLAYER". It finds the
8 q; D* r+ h2 k9 Y' k$ J6 `7 I ;; ltype of the layer so it can be displayed beside the linetype button.
2 i2 h! y7 M2 ~- u9 n+ Q ;;8 s7 p& r1 A7 Z- ~- [
(defun bylayer_lt (/ layname layinfo ltype)5 j, t1 m5 a' ^8 \% \
(if lay-idx
' m: O" u# W5 @/ o L$ U (progn" _' `) R K8 J# `
(setq layname (nth lay-idx laynmlst))
1 d' q; c( ]! R C) h5 w. _# l (setq layinfo (tblsearch "layer" layname))
* q% P0 @: r S$ K" s# Y: X (setq ltype (cdr (assoc 6 layinfo)))' ]- ]5 v. c2 ~- y C7 P
(strcat "BYLAYER (" ltype ")")) e& h1 A6 ?: ?' d
). v8 l+ |1 k1 `/ C6 e# c, z
"BYLAYER"
" @" ?/ [* R, M8 T% U1 d! j" V. j )5 R+ Q' @$ D/ }( l/ G
): m; a+ m0 f2 U* b
;;" f8 q: D, _6 \
;; This function is called if the color is set "BYLAYER". It finds the " W. P6 Z" Y% l% `/ o
;; color of the layer so it can be displayed beside the color button.
0 p: F3 w& C6 ]- u0 B ;;
7 K. r, O: S, F (defun bylayer_col (/ layname layinfo color)
- a5 F7 s* G) r, P; C (if lay-idx
]+ Y d6 B/ v; g# e' X9 {6 V- N (progn! ?% R F4 b0 V* g8 M
(setq layname (nth lay-idx laynmlst))# Y3 j& p6 i& q* Z: G9 F e3 C
(setq layinfo (tblsearch "layer" layname))
! _) d9 o, ]' I. u, s8 X (setq color (abs (cdr (assoc 62 layinfo))))
+ l3 `8 }# z) R5 p2 i (setq cn color)
5 b2 Q. n9 R% R8 w! f; n (strcat "BYLAYER (" (colorname color) ")"): {7 ?. E/ P% K$ D+ P1 `! L! B
) q0 c2 f0 y9 B# e
(progn
" w& A. B% `% |3 t8 l (setq cn 0)
4 ]: p# N8 Y% x) t5 I; Q "BYLAYER"; x8 R$ i, _; d+ z; @
)
6 ~2 u' @# @' `0 f2 N b )- Z4 J. b$ ~2 n( j) l+ N, X1 |
)
9 k1 N2 p f8 z7 n ;;2 O9 L+ K! s! K: C5 V" m
;; If there is no error message, then close the dialogue! r% X9 Q5 K) ]2 R2 E/ \$ D4 O3 p G" D
;;
# u: L& ` A9 `2 A ;; If there is an error message, then set focus to the tile' Q/ G( }# z# U3 x0 i
;; that's associated with the error message.
# @0 R2 }3 V: s6 u1 \6 {5 z' D ;;6 Z/ w# Q! Y( J& [% i5 q9 w( {
(defun test-ok ( / errtile)
7 Q- H9 Z, r. T% V8 V0 [ (setq errtile (get_tile "error"))2 ~# y% s' j3 ^! E4 v5 I: R) h
(cond
- ^9 X" ~( ?( C& ~4 e ( (= errtile "")$ f& j Q2 A; F5 S. i$ k. y
(done_dialog 1))- j2 @0 J6 d: A9 v$ Y2 F7 Z
( (= errtile "Invalid thickness."): O. v, r2 ^/ z) l. X" L2 L
(mode_tile "eb_thickness" 2))
7 f6 c& E; i8 q' ` )
' X* w2 Y+ I% q [4 u )
+ O0 W; f" V9 r; N t, T ;;
& n! l3 `8 ^9 O! q1 i ;; A color function used by getlayer.
. g4 G7 s6 @1 Z* p; |; d ;;
1 X6 y% F) b" F6 m) N) C4 A (defun colorname (colnum)* M& K# q* f( t' T) q
(setq cn (abs colnum))5 |( I* \7 S* X t4 g# p
(cond ((= cn 1) "red")
, d5 |! y4 g9 ]9 U' c! L" ?& C1 a ((= cn 2) "yellow")) T! r4 {4 o+ {- O" L
((= cn 3) "green")
+ g7 q7 ^9 g" `; G' m ((= cn 4) "cyan")
/ u; E( _9 u' ?( l ((= cn 5) "blue")
; ]8 S7 w& g3 ^* P% K9 x ((= cn 6) "magenta")$ e# U( M# `' W. V6 Q7 i
((= cn 7) "white")% O' Q0 E9 m/ Y1 U$ s* R: x, H
(T (itoa cn))- v* t& ]4 {4 v2 n' V- N9 c
)
9 y. C4 M* A% Z) y7 `) s )
" n! x% @2 S4 G; r }/ ?5 a) e3 g# r/ j
;;; Construct layer and ltype lists and initialize all2 a1 i8 N2 a" M7 A+ a
;;; program variables:1 G) a5 X) ]; D7 d
c* A4 `5 Q9 k# R
(makelaylists) ; layer list - laynmlst/ k, n1 D$ d7 t v
(makeltlists) ; linetype lists - ltnmlst, mdashlist
9 L8 g/ e: B+ t$ J* p# z ;; Find the property values of the selection set.5 M" H: D! p$ y# v/ i
;; (getprops ss) returns a list of properties from' G, i/ |4 w N) C1 n6 r- Z
;; a selection set - (color ltype layer thickness).
, x/ Z: v0 N$ l; ]4 _* O* |+ o, h (setq proplist (getprops ss))
; A1 J8 b+ X- I/ j (setq ecolor (car proplist))
( V/ P5 X& Y! e( G5 @0 H (setq eltype (cadr proplist)), L& p2 C! n- G% q
(setq elayer (caddr proplist))$ y+ |% o" l+ z1 ?3 b1 m
(setq ethickness (cadddr proplist))
# W$ W9 n5 |6 H' y \+ | ;; Find index of linetype, and layer lists
j, D4 [7 |& }2 H; i$ e$ L5 { (cond7 m( e9 u8 R5 y5 V
((= eltype "Varies") (setq lt-idx nil))2 O9 i k$ N. Q! W2 u
; ((= eltype "BYLAYER") (setq lt-idx (getindex "BYLAYER" ltnmlst)))
+ @" a5 A: P0 g: k) g# z! |; ((= eltype "BYBLOCK") (setq lt-idx (getindex "BYBLOCK" ltnmlst)))8 e$ x+ U' n% r8 e+ l# S& C2 W
(T (setq lt-idx (getindex eltype ltnmlst)))
3 V( V3 g5 f6 Z; J }7 [' x )
, l# @6 p% C }0 p, Z& x) P (if (= elayer "Varies")
9 ^+ d& S- W: F, J (setq lay-idx nil)
; f6 a( d) t' _% j/ }2 Y6 U# \! g (setq lay-idx (getindex elayer laynmlst)), f% X& R) b. q3 D |4 ^2 M
) t5 u* F" v4 H* F# E
(if (= ethickness "Varies")
; \! C$ J+ h" V (setq ethickness nil)
9 N, ?, n5 @( W# g$ O& D; F' y )
. o" _$ }6 ]. m. p" K6 t. P1 _2 H9 \) ^! D4 z4 i3 R$ f
) ; end (ddchprop_init)
0 B. _& A* F m0 G' S6 Q* m0 A6 i; k1 Z* d
;;; (ddchprop_select)
3 B7 Q* q' r' y: ^4 W2 W( O;;;
0 r ?! V1 X1 j! Y; u3 n. o+ I! Z;;; Aquires selection set for DDCHPROP, in one of three ways:2 Q% W, @- G8 N% l. M
;;;8 Q1 U$ }" W+ B( ^* j
;;; 1 - Autoselected.
, L# R! _7 `; ~;;; 2 - Prompted for.- [: ?, ~5 Z) E( h" }) v9 e1 Z
;;; 3 - Passed as an argument in a call to (ddchprop <ss> )
$ m8 u( j( o: g;;;
5 v7 q! a4 k9 m% ~4 Q;;; The (ddchprop_select) function also sets the value of the' l' v y* Y1 l/ e: s) E
;;; global symbol AI_SELTYPE to one of the above three values to6 g: h2 t C9 I) ^8 W
;;; indicate the method thru which the entity was aquired.; z2 j( h5 j% ?4 X9 L8 M
w* R2 ^7 u2 g& M6 g, d
$ w5 L2 b0 C0 V; f7 ~(defun ddchprop_select ()4 K* e( }# A5 ^. @: i" M
(cond4 R" w6 c# ?7 T W( C1 e& z
( (and ss (eq (type ss) 'pickset)) ; selection set passed to* B; r( {" z% [$ p* M/ L
(cond ; (ddchprop) as argument
; x5 V2 @( r7 B$ f6 h/ O" B ( (not (zerop (sslength ss))) ; If not empty, then( X: ]% J3 |8 \# d0 \! ?
(setq ai_seltype 3) ; then return pickset.
1 v2 N/ |* A0 V& U4 E5 m (ai_return ss))))) S8 E4 E) h8 y% w8 W
* h6 t2 G- D: F9 ] ( (ai_aselect)) ; Use current selection
, r0 B4 b; z- `9 O ; set or prompt for objects: D1 z; [ D; Z* Z8 i4 |: L) Z
: ? |8 j* a9 ]4 B1 t- L (t (princ "\nNothing selected.")9 o) X0 T. x6 q; T& G! ]% Y3 \
(ai_return nil))
5 @: ? S$ A8 W7 O )
# m1 n3 D" u' `" X* o- `)! N" M8 C/ b3 Z5 G- q( M7 l4 B, N6 X
% B" t; f- h, X- K \. M# {;;; Define command function.& v, T6 e* `0 X
# O. z% ^6 |8 ?& M3 M
(defun C:CH ()& q) p. Y" B) `6 f
(ddchprop nil)
5 y8 x0 v. r" @! R3 D& F5 `0 ? (princ)8 W- b( M& E4 S2 h
)$ J T! E. u8 W+ J7 Z+ x
1 b% U' I$ E2 Y6 c# t d ]2 _. E! x/ b, N0 r* p$ Q* U
;;; Main program function - callable as a subroutine.4 u. `' N5 ?; @% s2 c( I4 X4 `
;;;- A3 [& U1 M+ M+ Z% c
;;; (ddchprop <pickset> )
) [/ j1 }+ O, r;;;
8 g) t" v9 Z& ^ h7 J;;; <pickset> is the selection set of objects to be changed.3 _4 V$ i+ J5 E, m+ g9 U
;;;
U4 g4 L' L, g2 t;;; If <pickset> is nil, then the current selection set is
" `- M3 U; D9 y;;; aquired, if one exists. Otherwise, the user is prompted: ?( }0 I0 y' o/ ^; q% @1 A Y
;;; to select the objects to be changed.
, z8 \$ c. s8 S1 K, F;;;
; z/ t, S7 \. e3 J) b; i;;; Before (ddchprop) can be called as a subroutine, it must
9 M, d. ~; }6 |;;; be loaded first. It is up to the calling application to
9 o6 ^- Z/ {4 x4 F3 b;;; first determine this, and load it if necessary./ `, d* q# `* e1 D+ d* ~4 r
6 l. a% n" _3 i1 t8 A, k8 E(defun ddchprop (ss /2 U1 t$ H+ B: H' m3 p3 b3 O" C" ^
q; J. Y9 a% m* h* w9 F) j
add-mdash ecolor ltedit_act s
# x7 x/ R' t& q- ~. f assoclist elayer ltidx selset
; l/ w) {6 N7 `& c1 v% h' k" A+ C bit-70 elist ltlist set_col_tile
7 ~) X* e& N/ e2 ~8 T1 C% W boxlength eltype ltlist1; k; T& V7 ?9 H5 ]5 k: i
bylayer-lt en ltlist_act sortlist
& y4 P0 L7 M% V$ o6 H7 J% A. x bylayer_col ethickness ltname
% ?4 m* U5 d3 d bylayer_lt fchk ltnmlst sslen
0 O3 y% `2 ~8 Z. B" ? call_chp frozth ltvalue templist
! n1 h5 [5 F) D- ~ chk-col getcolor ltype temp_color/ N; W) V K4 u. \) \; `8 R
chk-lay getindex m test-ok
. G7 l2 s% Q# ^3 V) O chk-lt getlayer makelaylists testidx
8 C* D+ e' s9 q; X- k chk-th getltype makeltlists testlay
1 _3 P! J! q$ z" J B( l cmd getprops match-col th-value' n3 d* X! I) S8 c G& W0 o
cmdecho getthickness match-in thickness
% ]0 ]# v; P# M6 O5 i) k4 q+ \7 j cn globals match-lay tile
# [% y2 j6 o. ]& \) ~ cnum go match-lt tilemode7 F( s; N4 L- B u! F7 r& i% [
col-idx index match-th tile_rect; W3 A- B+ O1 v2 u
colname item match_col vi
" ?$ _$ n* x5 t k colnum item1 mdashlist vpf
9 s! ?! u. r# Q% ?: I# B! A color item2 n vpldata
' [# C# n5 z* }# P colorname itemlist name vpn7 v) m) | m+ ^2 v$ g+ h
col_def lay-idx ncolor x
! G9 t# q" X0 R+ m( t+ ~0 U; \ col_tile layedit_act nlayer x1
/ S) W0 R# F: }% i ctr layer nltype x2& [( P5 N7 @$ Q6 f- ?3 I- j
cvpname layinfo nthickness xdlist+ R, n3 H- y& M3 A- X
dash laylist off y) ]0 L7 Y8 c2 @) e* T! T' n
dashdata laylist_act old-idx y1: o+ o: ^+ |# p# M6 C2 J+ |% L/ B7 \* ]0 a
dashlist layname olderr y2) c( U, ]! a' [) Q
dashsize laynmlst on undo_init
W$ Q+ t# N- r dcl_id layvalue onoff
5 a( T! H5 Y/ D+ l, a linetype patlist/ r8 S. p1 L: g
ddchprop-err list1 pattern
' r! B1 a1 t$ S7 Q6 S longlist proplist
9 i" c! a& z' P; ~- @5 h lt-idx reset-lay' S- j8 _2 c7 M: i
drawpattern ltabstr reset-lt
9 l; q i4 \. j! K# c )8 ]& o P/ o4 ]0 a ~$ a
0 X$ C$ n2 w3 m, z/ {6 g' p (setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho
4 C3 C8 q: {5 H8 Q8 ^. H old_error *error* ; save current error function
n0 {; N% `1 G: b *error* ai_error ; new error function y/ C0 p8 p" F: M
)" P) _9 W9 H# x" c4 y" B
% `! d0 o; p+ U- n! ~4 E
(setvar "cmdecho" 0)
7 X6 ]. i. O' N% r+ Y* |; C. E, {2 m$ C- Q2 U' L9 s: |( s
(cond, b& c+ Z0 N, }" |0 s5 w+ F
( (not (ai_notrans))) ; Not transparent?
( C- E' F! V `# u" | ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
r. l6 h$ O' V) {3 v" G ( (not (setq dcl_id (ai_dcl "ddchprop")))) ; is .DCL file loaded?
4 |* Q' |0 r' e2 g& i" ^ ( (not (setq ss (ddchprop_select)))) ; objects to modify?
8 B% @" v' v9 H8 k1 g" X0 H K2 v# M" h
(t (ai_undo_push)
* W! b2 _9 O0 H# T (ddchprop_init) ; Everything's cool,
, a4 X% A" b' L! A7 V( ]4 W (call_chp) ; so proceed!
6 v9 w, K: b/ m( G (ai_undo_pop)' z. p# C8 F/ T
)8 Q4 r- v8 Y2 I9 G& ]% M; `
)/ y) v' V& c4 _ e! V" |# _& J4 A
% f6 U% F6 i0 z) n/ o K
(setq *error* old_error) : E8 j- h/ z: p& m
(setvar "cmdecho" old_cmd)
- L% b& _2 }; e/ E6 [ @ (princ)
8 ^( q1 I8 O2 Q" x3 H( L)& T% j% e" ^$ l) M9 i- [
2 X- j A5 @# Z" l
;;;----------------------------------------------------------------------------
1 E- }: R. i" e8 f, q7 k
4 G% H* h( P# ^(princ " DDCHPROP loaded.")
' m! E; r$ I2 |4 O(princ) V' a* d6 q' X H+ m
/ i5 T! E- A4 C5 f d6 e;;;----------------------------------------------------------------------------
7 R S, r, s3 F: D4 |' [4 _8 f) J! i. s
;--------------------------------ddmodify.lsp----------------------------------! Z0 ^% o& n- c: m
; Next available MSG number is 1115 R& w2 z6 o8 t8 w( t/ i
; MODULE_ID DDMODIFY_LSP_
3 D; h! o5 Q# h9 q. E;;;----------------------------------------------------------------------------! Y& U$ a% l+ |3 Q6 K, K, ~: \) z
;;; DDMODIFY.LSP# l# Y. l" Z, s# G7 q4 y
;;;
' y7 Q( [/ i9 E;;; Copyright 1997 by Autodesk, Inc.
0 f' k" P& y/ D& ]% q;;;
" H2 e' ^" Z/ D: @$ G) n; Y;;; Permission to use, copy, modify, and distribute this software
2 v) R ~# H% B6 x9 W5 };;; for any purpose and without fee is hereby granted, provided
1 D3 z% T7 |& y5 w' [9 N;;; that the above copyright notice appears in all copies and
$ S9 W& {" L, T6 M. Q2 t! D! M6 `;;; that both that copyright notice and the limited warranty and
+ M/ {; e8 U* o! e" h+ C;;; restricted rights notice below appear in all supporting& u% {7 i( ^0 q) O: F
;;; documentation.
. j( L/ {- n" S$ S' N( I7 F;;;8 K, ~' X) {# c8 G* U/ V) j! O- V
;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.. D0 d( J6 G m U
;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
4 I( H( R2 ^$ F& X( X' D;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.9 P9 p! c' \: @
;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
# h& J- B3 m; g. \$ };;; UNINTERRUPTED OR ERROR FREE.8 u+ q2 ? _( ^' A3 O( o% Y
;;;
" g& M6 j/ T4 P) A;;; Use, duplication, or disclosure by the U.S. Government is subject to
5 G- m0 x' j Y$ `1 y;;; restrictions set forth in FAR 52.227-19 (Commercial Computer" j$ s* D3 f- g
;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
# P1 T" N) J& }/ W0 r;;; (Rights in Technical Data and Computer Software), as applicable.- I2 _0 E6 {6 ~4 _, [
;;;
1 D& T9 ]7 w+ `$ F' Q, s;;;.
8 C. {( m/ i% |7 N. |4 {;;;6 x% `5 W' D( q4 _ I/ E) ~
;;;----------------------------------------------------------------------------5 J0 x! Y; { r" f( M
;;; DESCRIPTION0 ]! z3 A4 |0 I1 v" O" t) E u
;;;+ ^& t2 U* {4 n+ l1 B; Z
;;; This function allows the user to get a listing comparable to the LIST
) B6 y* `7 t6 k5 ?8 I8 e;;; command for most objects. In addition, most object fields in the
1 q4 ?( D1 `, h9 C n. Q;;; dialogue box are editable. Points can be specified dynamically by
& \; A* q! @ K% t+ `7 u;;; temporarily dismissing the dialogue box. Each object has a unique$ O6 [2 b7 F) V! ?. t4 |
;;; dialogue.' f) w% n8 n# Y/ m* W
;;;
9 [/ |* Y0 W" X/ Q" X: I;;; Naming conventions2 a T8 M( l. p, d8 g) E
;;; Long function and widget names may use an underscore "_"
1 N z% a/ @$ X; x% {;;; in their names to make them easier to read, long variable
$ C) z3 T& I5 ?;;; names use a dash "-".
1 e# c2 {7 p2 L1 Y* ~! f7 M& ~;;;----------------------------------------------------------------------------
+ _" B" b' [& l;;;----------------------------------------------------------------------------
X; p' l" w& v( W$ X;;; Prefixes in command and keyword strings:
$ O. R; h/ \) Q S8 a;;; "." specifies the built-in AutoCAD command in case it has been
( h/ R$ y- Q$ c6 M y" }8 y;;; redefined.2 Z4 L8 ]) ^& I
;;; "_" denotes an AutoCAD command or keyword in the native language
4 ?# s" P8 N A8 f9 B;;; version, English.6 x/ u) Z3 [# t( `- N' N _& U
;;;----------------------------------------------------------------------------- U. e- r' U' Z# A3 C; x4 V2 E; x
;;;0 t, O/ U" W5 I9 c8 q0 |0 R' S5 r
;;; Avoid (gc)s on load to improve load time., }1 L; \ I& P( H% p# _
;;;
- E/ B& \& u$ J(defun do_alloc (/ old_allod new_alloc)
8 O/ {/ E" [3 r: Q v' Z. W (setq old_alloc (alloc 2000) new_alloc (alloc 2000))
! u( j$ k2 X2 P- V: r (expand (1+ (/ 17000 new_alloc)))7 L8 I3 s) W; ~$ o* }
(alloc old_alloc)
2 R7 \ M. O% v( k. `4 r)
% Z* r! j8 d, b# I(do_alloc)' P4 P) S0 d5 H, J1 H4 q1 t* Y/ a
(setq do_alloc nil)
* s1 p1 n0 v2 o d1 ^4 T) O% D
7 S+ Q. a" V; E( W7 C- C;;;! n2 Q' Z' d7 |! @
;;;
5 o/ _7 e$ t4 U5 u& \* L6 g;;; ===========================================================================
3 K: x7 }' j( M" n$ @; D;;; ===================== load-time error checking ============================3 W/ `' b) v0 N# }' A, j6 `
2 K N! O' F; ]: U$ ?
(defun ai_abort (app msg)
9 D9 F% t3 d4 H" C. @ (defun *error* (s)
1 e, K2 W& k2 H5 w (if old_error (setq *error* old_error))# k$ n. \# D$ ?! j* ?! C
(princ)) k9 u- F7 o) K; k
)
* i- {1 B ]2 |* ^+ t! s) O1 E (if msg
C) C/ P& U6 b1 n5 T (alert (strcat " Application error: "
2 U0 l* q2 \' P1 N1 `; } app0 i& u7 o6 B0 c$ S+ ^ _: F
" \n\n "
5 | M- d; R. g4 n9 F8 o# W msg8 _ h# h; S! C; {- \: O1 X
" \n". r7 Z6 g* P" Z/ m T
)) l& u" X( ?( ]1 z1 a
)
% h% ?2 X2 q) P+ H! q! C$ V5 e )
* ?$ h: K& E7 c# V) a (exit)
d/ i4 g G F )
s5 j6 H2 L4 h Q; O# e9 r$ k% ^
9 _: r3 `2 P! Q4 A0 u& b0 R$ H" e;;; Check to see if AI_UTILS is loaded, If not, try to find it,3 Q7 K$ U0 s g1 G$ N
;;; and then try to load it. If it can't be found or can't be. _5 c; K4 ^) H' }' @
;;; loaded, then abort the loading of this file immediately.* K2 q* X$ w% k2 N& q
5 j& g0 r$ y: Q8 P! c& z) z( A (cond
! @4 }( R% A% u0 i! b2 w$ k ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.1 q+ `% U. Z2 V
( H9 u% V# ^ [ ( (not (findfile "ai_utils.lsp")) ; find it
+ [8 [! L+ N$ ~2 D7 i/ O (ai_abort "DDMODIFY"7 S/ w+ f4 a U' D. a |
(strcat "Can't locate file AI_UTILS.LSP."6 W2 W0 U7 @* N
"\n Check support directory.")))
, E8 Q. M% R. n$ p2 o- U. r- c) m& D0 R# k0 r" |& H% a
( (eq "failed" (load "ai_utils" "failed")) ; load it
) F4 g$ M! C* T- z# K5 t (ai_abort "DDMODIFY" "Can't load file AI_UTILS.LSP"))
- V" Z& o) l. x; }. | )
' ?& t9 I# ^, o, S) A
; h) o) G* k, w; W2 T* j. T! ~;;; If we get this far, then AI_UTILS.LSP is loaded and it can
( ^4 U' D) I+ ?1 v5 g) E, o6 g;;; be assumed that all functions defined therein are available.
Z) ]8 w( i i& P4 W
; h) S+ Z8 n+ ]8 {: }" D" b" i* x+ N;;; Next, check to see if ACADAPP.EXP has been xloaded, and abort
* U1 E6 P- M+ L& J7 i;;; if the file can't be found or xloaded. Note that AI_ACADAPP
& q/ f% ^1 r9 q! D2 D;;; does not abort the running application itself (so that it can& @, w% K# u& Q' o8 O- f& r% n
;;; also be called from within the command without also stopping- }- E" ]+ G$ a+ t
;;; an AutoCAD command currently in progress).
9 J( }% K3 T+ f7 F- E" A0 T8 a8 c, `& `! w; {# v
(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP) ~1 {' M- e, C* y! U' I' ]
(ai_abort "DDMODIFY" nil) ; a Nil <msg> supresses
) o- g+ A) f. n, i, y) s2 Z! Z5 o ) ; ai_abort's alert box dialog.; Z& y; ` T% N, u2 |" z
5 j" x% ?6 x1 _ G
;;; ==================== end load-time operations ===========================+ b! ~0 r) `+ u! ?0 E' b/ S$ ]- n
9 C! m2 A$ A- h r;;; global variables N6 K1 t% q: }1 `
% g0 l3 a( F7 M: ^(setq hatch-elist nil)
% o4 {, d" Y6 m1 Q2 |. L9 j& O/ {
" U! S* W, B, c% r. D- Y;;; If we get this far, both ai_utils.lsp and acadapp.exp are. n7 z+ j8 Q" D4 @
;;; assumed to be available.
& L; U5 h% y: i7 I2 A7 T" C Z
% D) [2 n1 I# g- \) I;;; Define and encapsulate all subroutines that are declared' s# t/ {7 H4 ?1 W; W! G
;;; locals of the (ddmodify) function. z2 t3 w0 U; u5 n; P
) w( Y; |7 r$ I+ Y) R(defun ddmodify_init ()
" J) P0 v4 {/ y- Q9 Y1 h2 I1 y ;;
* [5 @4 C$ l6 K+ R: R+ h ;; These three functions modify the enitity list for common properties. Since
9 w! j& n- f9 v9 H7 [! k" ^ ;; color, ltype, and thickness are absent from the object list when they are
, g2 V& p4 }5 a$ g$ D ;; set to their defaults (i.e. color = bylayer), a simple substitution using
. k% C" G1 F" R# q+ x ;; SUBST is not possible.5 }% P9 h, K+ ^$ J) d7 x8 a8 V
;;
1 g6 \+ \9 M( o; C+ A, M (defun modify_properties ()
" k6 { T6 C- f; M: q- D! d* x (emod ecolor 62)
7 @" ]7 z! `6 F* z7 F: l. g" \ (emod eltype 6)
8 G0 n% k6 l. }8 x2 A+ C (emod ethickness 39)# l% ]3 I# s7 n" d2 L
(emod eltscale 48)8 ^6 h0 w$ d$ g! Q3 t: T2 A+ B
(tempmod elayer 8 nil)
- E3 M# S" T* P% a [) S )
( R1 j( r9 s8 A' g: Z/ Q" U* i- v ;;6 \' x' k8 g/ K. g! e& A8 `6 ^ O
;; This function is used for modifying common properties of the ACIS! [; V1 C3 }) F
;; based geometry objects. Thickness is not valid for these objects
0 ^! J9 v" F; g9 Y! b0 x4 V y ;; so it is left out.
( ~; Z- |+ D/ [7 @+ J ;;& k/ w+ F$ v2 D# s* A
(defun modify_prop_geom ()
' o6 B0 A/ j/ ^ (emod ecolor 62)
9 [' ^2 C# D5 S+ W (emod eltype 6)4 A) M" y4 n# B5 [& b4 `; e
(emod eltscale 48)
5 ?. \ h/ m; i o8 ]) @4 ?" M (tempmod elayer 8 nil)
8 {7 h: E; C5 I/ |% l4 y )
) b' i5 _! n' Q# H# A
# x: M. s3 X6 m1 |1 }/ i (defun emod (value bit)& \4 N5 `8 N% ]% O) @, j
(if (= bit 62)6 ^8 T0 s$ D" M" N
(progn" b. W$ ~2 t. u
(if (or (= value "BYLAYER")% X! s% R! C! r4 W3 g
(= value "BYLAYER")) (setq value 256)): ~0 `& W2 _. g! q* P4 `8 \
(if (or (= value "BYBLOCK")4 o+ L/ \$ x' X8 ?
(= value "BYBLOCK")) (setq value 0))2 P2 W- m" a: t7 W! q0 s2 y( o, u
)( D) X) {( q! i% \
)
' I4 D1 z% L( n- M& Y (if (setq oldlist (cdr (assoc bit elist)))
7 P2 ^" H$ B9 V. d6 \/ @/ ^* w (tempmod value bit nil)
$ `* i, Z6 v( ?9 r$ P: Q/ } q (setq elist (append elist (list (cons bit value))))
) [& H \. E: v, S& E) L. t& @* h% ~ )5 }- d+ ?. @' H8 q
)
& a$ O1 N* X& g2 B1 P ;;; d# U# q$ f, I3 T+ ?
;; Resets object list to original values. Called when the dialogue or
5 J- L8 |' m) c! }' B# G ;; function is cancelled.
+ a, z) J0 B( `* E# u8 O, ] ;;
6 B% S- r0 {# O (defun reset ()
6 l' ]% ]3 j- `% p4 M (setq elist old-elist) l) n$ T" n( F2 s* ]
ecolor (cdr (assoc 62 old-elist))8 @% J% g+ ^$ G" s' {7 {$ u: E$ O( R
ethickness (cdr (assoc 39 old-elist))
- Z; j7 A2 K7 J; c9 i3 T eltype (cdr (assoc 6 old-elist))
9 J+ e M" f9 N8 f elayer (cdr (assoc 8 old-elist))
, F4 A; m, R( X% T* M/ y eltscale (cdr (assoc 48 old-elist))1 C% v2 N2 A$ M u+ H# O
)
9 ]/ P) I5 G- |( O0 a% W (if (not ecolor) (setq ecolor "BYLAYER"))
* n6 Y3 T) D1 v C$ I (if (not eltype) (setq eltype "BYLAYER")) J; }; L# l% C7 }
(if (not ethickness) (setq ethickness 0))
7 o5 p4 h3 c2 O (if (not eltscale) (setq eltscale 1)) e7 {) z2 t+ k& C" A
(modify_properties)
1 B- z, M: n o3 k8 E: Y2 Z (setq reset_flag t)
7 v" |+ a5 U: w$ R+ D (entmod elist)0 x) C6 u. H7 k" A" q) @
): F: k9 I2 G' _+ X9 C/ a( r V( K* n
;;3 g3 C0 K A7 ?$ t3 o7 q: [
;; Modify object when dialogue is temporarily dismissed to reflect latest
. {: ]) n: ?8 W2 p9 M& Q3 ^$ F ;; settings of dialogue. It converts the point from current UCS coordinates to3 n* T4 [$ R# H' s5 ~& p2 q% r* G+ y
;; the proper object coordinates (world or object)., g/ }$ I; e* p
;;9 a+ ?2 o; d% w1 w
;; Arguments: value - in current UCS coordinates( P" ^, H! Z: S7 e; V, W/ e
;; bit - object code (i.e. 10 for start point)1 L* N' {$ u* n: t. ]) W
;; ptype - point type 0=world 1=planar1 n) M# i3 U/ F6 r9 d! ? X
;;( c% c1 f* s+ y* _4 {
(defun tempmod (value bit ptype / newpoint)' s2 t- N {6 q7 Y7 R) U
(cond8 }. c* p1 ?! R% g! @' R
((= ptype 1) (setq value (trans value 1 ename)))8 f# l1 z) q8 a8 g2 F
((= ptype 0) (setq value (trans value 1 0)))9 O+ }. L& @( s' G
)
+ D: }' C9 `8 r0 @$ m (setq elist (subst (cons bit value)5 w1 A' L" U5 A( i: |+ Q3 o& j
(assoc bit elist)7 n1 k# Y( N6 A
elist
8 T1 l! y. j8 S )
# x3 ~& r' B( Q* w$ D$ i )8 g3 K: f) G, ?9 t0 E
)
5 d! b* u, O7 s5 ` ;; T A0 D7 s7 t+ t/ U
;; The following functions are called after a dialogue has been temporarily5 {3 l6 I7 A* [' l$ k+ y3 I
;; dismissed and the user is selecting a point. If a point is selected the
) Q8 [, }: P2 l. H/ E% A ;; object list is modified and new X,Y,Z values set. If no point is selected
7 V. Q- i) D5 V3 I* q ;; (null response), then the point is reset back to its previous values.
* \7 U2 I7 ?* V ;;# E4 [1 {) _3 s E3 x7 i& i+ p
(defun ver_pt1 (ptype)% l8 d+ B, b/ P7 P, ?
(if pt1* y A& H9 d0 M" S0 h
(progn- @' l0 H7 P( R) l$ _
(tempmod pt1 10 ptype)+ R( ^- ~( ?: e& {) O1 Q* B. w1 j8 e
(entmod elist)5 H* e+ v8 n2 r/ M, N: O
)
8 f6 L2 M% B% f; _7 Y6 L, X! Q (setq pt1 (list x1 y1 z1))
) V. [! @6 p- V1 n )
; X8 e$ n1 V$ n1 M+ J )& ~/ F7 J0 ~+ ~. o9 t/ A% d; O0 C
7 t) r: ]& G% @% E. f ; (move_pt1 <ptype> )% ~& Z! o! R% e1 u) V6 ^
;9 Y# q& r: O1 N8 F( Y7 y% j
; Called in liew of (ver_pt1) to translate block insertions which( N) f8 L% e Y* Z
; might have variable attributes attached to them. If the distance
8 p8 {2 C; O6 J( `0 }- U9 q ; the block is to be moved is < 1e-6, the move is deferred.) ]+ `% j7 Y9 o5 [; m W5 h
. i {- j% p3 ?8 W (defun move_pt1 (ptype / basept hi)
, T2 L7 n' ~& d) u( B (setq basept (trans (cdr (assoc 10 (entget ename))) ename 1))
% V8 A. ?( P1 G. H/ } (cond
9 s6 @! ~7 ]; \ ( (not pt1)
+ v5 ] T2 W/ k Y (setq pt1 (list x1 y1 z1)))# L, V" ^# a9 N. v( o+ [
* s9 a7 o* v) W
( (> 1e-6 (distance pt1 basept)))& a- L) N9 ^$ T6 W% ?
3 d6 U& |3 }& d
(t (tempmod pt1 10 ptype)
: Z# `# u, ?% R8 ~& _& I! F- n8 | (setq hi (getvar "highlight")); U/ b4 r+ r" i% P! W+ C c
(setvar "highlight" 0)0 V: j# Q$ o2 j6 ]1 Q" H' _
(command "._move" ename "" basept pt1)2 u% X* {. ]8 \+ f9 \3 W+ Z
(setvar "highlight" hi))
# B) p1 o9 c& s+ H )$ }8 N' `1 f" U4 j3 ~, r
)
: ?0 f7 I$ Z, i* f9 x
: E. ~ W& b: J' r2 y, h (defun ver_pt2 (ptype)
) R: H2 \3 k1 `& }% @9 [7 y, Z (if pt2' Y. a+ i( i/ Z) F- e" o
(progn
3 V @1 K, M- E- R* D (tempmod pt2 11 ptype)2 f$ V/ B' ~: } T
(entmod elist)
+ Y. `( l2 @! T+ P/ h% g; J )
9 }2 n, o6 Y4 @ y: w0 [ (setq pt2 (list x2 y2 z2))
; D6 o K" c6 B& d; s E& E )
3 v7 {% V2 i9 O; h" K* K" u )
- x3 `6 N! X4 X# [/ ?" Z4 b4 B6 q- a+ e! M
(defun ver_pt3 (ptype), n+ c) q" W) z4 P, \4 w& W
(if pt3
" z! S" v1 q% Z' ^2 H: y C* i (progn6 K; d1 T* i' _/ D
(tempmod pt3 12 ptype)
u: I: p' H+ H( L (entmod elist)
3 c+ C8 A. b, J5 ]/ ^4 M) ]7 O )
9 {( P, I4 T3 h- J+ b5 _& J (setq pt3 (list x3 y3 z3))
0 }) c9 Z, D7 h7 i, a8 N* x# ~ )
& g+ t0 u1 Q3 t+ x4 J" L) M8 o )( X4 u/ y/ u& k* w
" h6 S: z3 R# L% C0 [' e
(defun ver_pt4 (ptype)
* ~4 L' Q3 {% a% Y (if pt4
1 O, V I0 s4 K& f (progn5 U( d: J0 e* M9 I
(tempmod pt4 13 ptype)) H n) W2 @0 R, ]1 \
(entmod elist)/ T+ H/ ], E/ e b2 O
)
+ I# [2 y$ a9 ?- t& y6 g8 Y" N (setq pt4 (list x4 y4 z4))2 s6 w. D: W$ r- l9 ^1 l
)
3 V2 ?+ `$ p [ )
+ ^" w; a& w: M ;; Xline/Ray4 Z6 v0 h2 G+ n: @
(defun ver_xline_pt1()
% G" R! |/ }; F# ^9 u j1 E1 y (if xline_pt1
0 R, K) m4 E4 M6 a4 C (progn, r( h1 M, i" ^1 R
;; convert to WCS.
* z+ U5 {2 B4 [* I+ b (setq value (trans xline_pt1 1 0))
+ @" k% C: ^# b (setq elist (subst (cons 10 value)0 f4 Y% C+ ?! M$ |( K% L8 y( q
(assoc 10 elist)
! U. i8 [7 o0 J E N8 p elist
- q0 O+ |! g+ ]0 X7 S )
( X- y6 {/ f" g, c )0 C0 }- L! e/ x1 [2 t$ I! M
): v& A$ m4 i" B- Y0 H9 @
(setq xline_pt1 (list xline_x1 xline_y1 xline_z1))
. M4 o1 ~3 f, ]8 y )7 \0 U+ C$ b& O7 ?5 K/ O# S+ Y
)
3 ~ p. z$ R/ B5 b& E/ F0 e: ]
/ T, f9 l' I8 F' i) @# O/ n (defun ver_xline_pt2()
' w8 Y8 \+ `! V# U" |( @ (if xline_pt2/ w; b$ A% J7 y6 a
(progn( d! L% W; H0 u5 x
;;
6 y% w _2 l l- u+ ] ;; Calculate new Direction Vector WCS) B( E, P% O6 c
;; x / (sqrt ( (x**2) + (y**2) + (z**2) ))
/ j& J U7 y' f/ K3 n (setq temp_dir (trans xline_pt2 1 0))
! J2 N6 |( R' o9 T6 ]* G n (setq temp_dir_x (car temp_dir))/ {6 V& o* N. R: B/ s* w# L4 j0 e5 a$ }
(setq temp_dir_y (cadr temp_dir))
1 T+ N9 w9 c. g' }- Z7 A; N8 o (setq temp_dir_z (caddr temp_dir))
: a) O6 j. i) i& I Z( }! w/ P, L& Z( ~6 f
(setq temp_xline_pt1 (trans xline_pt1 1 0))
3 n9 R5 h3 P+ J (setq temp_xline_x1 (car temp_xline_pt1))
8 K( ~- ~/ [6 q/ I0 W (setq temp_xline_y1 (cadr temp_xline_pt1))
" ?+ A0 A$ P. `5 x* Y9 k$ L (setq temp_xline_z1 (caddr temp_xline_pt1))0 w" k7 I3 l5 M
# \) Z2 b8 Y# Q5 q# M, _
(setq denom (sqrt (+ (expt (- temp_dir_x temp_xline_x1) 2)
$ B" F# s1 p1 W8 d8 ]6 m n (expt (- temp_dir_y temp_xline_y1) 2)
3 F: B2 ]; R1 Z4 t. e$ F (expt (- temp_dir_z temp_xline_z1) 2)* k* D4 P1 U; g/ g8 ?6 S
)))
T7 E4 S8 Y2 @0 j( b3 [$ x (setq temp_dir_x (/ (- temp_dir_x temp_xline_x1) denom))7 ]; ^* p7 [9 F7 d/ z4 ]
(setq temp_dir_y (/ (- temp_dir_y temp_xline_y1) denom)). _" Y* Y+ z& E9 t# p: t k
(setq temp_dir_z (/ (- temp_dir_z temp_xline_z1) denom))3 t r* W& R0 a$ H: M* Y# I
(setq elist (subst (cons 11 (list temp_dir_x temp_dir_y temp_dir_z))
' Q% S) M- k7 m& } (assoc 11 elist)8 s* {# Y! | @8 S
elist. Q& E- T8 r' Y4 w: x; S
)' G3 L+ _) q+ C+ A( v9 h4 P
)
+ q' v- l- A7 m, J# U- k8 l/ t% v" [ (entmod elist)+ X* R! G2 C4 U- n
(setq xline_x2 (car xline_pt2))( j* v8 T; K# T) ~- P/ P( i: \, u
(setq xline_y2 (cadr xline_pt2))
1 r8 Z0 o. U3 E% H4 s3 x) a0 N (setq xline_z2 (caddr xline_pt2))
% |: w) h! B3 L$ N- ]/ t* u
4 O) m; b6 A3 F8 w4 p. @3 ]; k
- X& q" Z3 u, d1 P$ R7 A )
+ w8 t' b1 g$ Z y' B (setq xline_pt2 (list xline_x2 xline_y2 xline_z2))
$ Z# ~- a, \$ \0 i2 l- Y# b ); @6 O) _1 B+ W% r
)
0 H& ^4 l; ` ]) G3 C2 D$ N' ~% v( A# V" U
;;
: j7 s% a* s# @6 t: z# M3 ] ;; Common properties for all objects; d* Z! U2 m. I) Y; G
;;
' x7 y! w( ^) v (defun set_tile_props ()* s. T+ p. ^! q: k q
(set_tile "error" "")6 C7 F, K& n/ ^; d/ s7 M, o
(setcolor) F& M5 P4 w2 D& D, [
(cond' `; c5 |. \, ^" e
((= eltype "BYLAYER")
. [; }" v' t6 M3 i( E (set_tile "t_ltype" (bylayer_lt)))
- w. ]2 j: g' Z% u- X- h ((= eltype "BYBLOCK")- T6 b+ a. i4 q$ d1 N' W' Q2 l
(set_tile "t_ltype" "BYBLOCK"))
# f. g7 p. J9 j: \7 T* a (T (set_tile "t_ltype" eltype))$ J, M: ?, N( U
)' T" r- V! e; a, C
(set_tile "t_layer" elayer)
. l8 g% n4 i& Y& c (set_tile "eb_thickness" (ai_rtos ethickness))
7 K! R0 d% T' [ h! m; \+ C (set_tile "eb_ltscale" (ai_rtos eltscale))8 {5 C# J/ e+ O# \
(setq which_tiles (ai_common_state etype))4 a$ W) I" ]$ N$ s& e+ B. |
;; Disable tiles if need be.... W6 I% e5 g" U# Q
# s# ~2 [+ L X+ z0 B ;; Layer Button and Text Field
& D" W5 a8 }$ W% T S9 _- ^ (if (/= 1 (logand 1 which_tiles))! j( {) W b+ v) i
(progn
/ T, {& P$ H K0 ^; ?$ e7 Q `* r (mode_tile "t_layer" 1)
" q) N7 }5 v/ ` (mode_tile "b_name" 1)
4 j b: K( L1 U! w# |8 ?" l" V )1 D2 p% |/ E+ [3 w5 ~; Q' P$ I" Q
)8 Q0 u# V' }/ z! ~! O
;; Color Button and Text Field
! L' R- F Y1 V8 L6 m (if (/= 2 (logand 2 which_tiles)). r5 p+ E O' F. e. [/ H- M. Q
(progn/ v% _( Q- z3 O
(mode_tile "t_color" 1)
" D9 I( [! v$ J- ` (mode_tile "b_color" 1)
1 v- p1 n* N! a2 y2 L4 Q$ ]+ q1 u3 ^ (mode_tile "show_image" 1)
" e8 E6 R9 ~6 j& c )( A8 H' f/ u3 K2 P% t9 d
)
7 m$ Q4 n6 y3 ~& u- X. t7 u2 { ;; Linetype Button and Text Field, ?- |. j# ^+ G, B0 `3 h. b; d
(if (/= 4 (logand 4 which_tiles))
' K5 a8 v4 ~! C5 x (progn
4 p6 U2 P$ a- b$ S7 F% j( G* | (mode_tile "t_ltype" 1)
2 o! B$ \( M* T* C2 X; ~ (mode_tile "b_line" 1)
O5 [% d' x5 A5 J; Z6 ~ )
+ S4 P$ m$ V; ^6 i6 p' C3 D7 Z )* R" s5 G" V1 Z
;; Linetype Scale Edit Field' t+ p0 V" |* S# e8 p- z
(if (/= 8 (logand 8 which_tiles))
2 ? x; m4 p6 I0 ]4 V1 K1 E7 [ (progn
# U. E; g$ Z. C! i (mode_tile "eb_ltscale" 1)1 m* ^% U; F3 B9 \: ?8 Z" ]) |( c9 P5 x
)# G4 e8 K0 T+ @
)- V' ^( j- |; w# V+ a$ c; f4 T
;; Thickness Edit Field.
( @3 M2 u `, V3 D (if (/= 16 (logand 16 which_tiles))" f" ~7 k$ H+ u" {, \* d
(progn
. D% d$ N% Z# k ~! [1 M9 c (mode_tile "eb_thickness" 1). K3 b5 N& v! ~8 ~1 ^
)
7 U+ k$ H3 Q2 W6 }! b1 O )* E! o/ e# I: K/ t" G5 E6 I
)
B* W: X- B, F: ?) W ;;
4 w; Y( V' n- g. v, {8 A& Y' t5 J& @ ;; XYZ Point values for all enitites
; [* Y7 _# F* D" \4 l! R ;;( U$ J, m+ t: h* P' i
(defun set_tile_pt1 (ptype)0 b1 w2 p+ Z6 X" Q$ z4 W
(if (= ptype 0)4 ?$ f: q$ T6 g$ r$ |) k) p. Y m5 J
(setq pt1 (trans (cdr (assoc 10 elist)) 0 1))3 N' A6 n7 Z9 S" S& q6 [
(setq pt1 (trans (cdr (assoc 10 elist)) ename 1))
$ y% m* S- ~& S4 @, \: o )$ R1 W; W; r, `' `
(set_tile "x1_pt" (ai_rtos (setq x1 (car pt1))))0 i: }' a+ o. M4 z1 m0 e
(set_tile "y1_pt" (ai_rtos (setq y1 (cadr pt1))))5 h! e8 H4 l- J- V/ R$ r- E, }
(set_tile "z1_pt" (ai_rtos (setq z1 (caddr pt1))))
4 e5 d9 ]/ {; A( O | )
! v) p$ q% f. d (defun set_tile_pt2 (ptype); ~! m2 G, k) }) p# T; `
(if (= ptype 0)9 b: ]' R" Q9 S n+ B. _/ W
(setq pt2 (trans (cdr (assoc 11 elist)) 0 1))
7 \) `) ?' e0 x& d5 N) q8 { (setq pt2 (trans (cdr (assoc 11 elist)) ename 1)) b$ F5 x+ t, \, S" |' v/ `
)
& @$ p5 S- s: s" k+ p* R (set_tile "x2_pt" (ai_rtos (setq x2 (car pt2))))/ ^( W% i; E5 |4 j! f
(set_tile "y2_pt" (ai_rtos (setq y2 (cadr pt2))))
6 T6 G3 O$ y7 L. `- a (set_tile "z2_pt" (ai_rtos (setq z2 (caddr pt2))))
0 |8 t- k$ A7 q7 \5 s9 h! S )
* A! x; R A* x5 j* P/ r% s (defun set_tile_pt3 (ptype)
/ Y' m) @2 r0 n, @1 v) {( ] (if (= ptype 0)
: `5 c0 C8 ^& R2 x. r6 V (setq pt3 (trans (cdr (assoc 12 elist)) 0 1))' m; A& r4 B9 b0 v; \8 j( Z+ L
(setq pt3 (trans (cdr (assoc 12 elist)) ename 1))
7 p3 S6 j) u* c' j p) E )' f; V, ]' A. r7 T. l8 d, Q3 B" [# q
(set_tile "x3_pt" (ai_rtos (setq x3 (car pt3))))
" h" K- `2 o* M" O- T (set_tile "y3_pt" (ai_rtos (setq y3 (cadr pt3))))
# X9 T' Q. q' x" E) r' z) Z (set_tile "z3_pt" (ai_rtos (setq z3 (caddr pt3))))
2 R5 O3 a2 n) e9 _5 u )
/ [! K+ b. O2 R; V# v6 S( v9 S5 V; y (defun set_tile_pt4 (ptype)
3 v; O! r S, J, N/ \- a& c (if (= ptype 0)
- _; u& o3 H) B J% e# r (setq pt4 (trans (cdr (assoc 13 elist)) 0 1))
: b h5 M# h/ O8 K+ ~4 s. ^; N (setq pt4 (trans (cdr (assoc 13 elist)) ename 1))9 }4 j9 q6 k1 L# m2 ^! s
)
; o8 S9 U, |. }- W# [. p0 V; T (set_tile "x4_pt" (ai_rtos (setq x4 (car pt4))))
& }# z+ W; [0 F- R (set_tile "y4_pt" (ai_rtos (setq y4 (cadr pt4))))" C1 E4 B( G$ d) z7 ^0 M) K9 ^
(set_tile "z4_pt" (ai_rtos (setq z4 (caddr pt4)))); _8 ^3 Z9 o& r
)
; V4 ~! u- B* Z8 E ;;1 |: ~3 p7 Z, b' W4 ]
;; Xline/Ray6 N6 M7 q: N6 c3 B) X2 P
;;) F5 V$ j6 ^( C% w4 t, e
(defun set_tile_xline_pt1 ()8 ^4 S0 _8 w! J+ [$ \- Z
/ O7 E4 ^( n! d. z% g8 } (setq xline_pt1 (trans (cdr (assoc 10 elist)) 0 1))
" w* d% X5 w4 U4 w" J( e, Y
+ B: y% R- N0 @+ k6 M2 A; S (set_tile "xline_x1" (ai_rtos (setq xline_x1 (car xline_pt1))))
" E: z! \; A" F9 S( E' N } (set_tile "xline_y1" (ai_rtos (setq xline_y1 (cadr xline_pt1))))
9 E* q4 ~. U5 W (set_tile "xline_z1" (ai_rtos (setq xline_z1 (caddr xline_pt1))))
! s9 p* I0 X" P )' L- d! |8 T' f, Y( G& a0 x& M
(defun set_tile_dirv ()% E1 J2 E9 m; |/ a
;; Convert 11 group to local UCS (displacement); |; ]+ I9 `% D1 ~
(setq dir_pt (trans (cdr (assoc 11 elist)) 0 1 1))" P+ y2 U4 Z' b* C1 ?) J7 p
3 V C: l, Z* D. ^0 J0 m (set_tile "dir_x" (rtos (setq dir_ptx (car dir_pt))))
( R* a& p( Y6 ~ ~4 {: G (set_tile "dir_y" (rtos (setq dir_pty (cadr dir_pt))))
# b0 |1 V6 n( F1 t' O (set_tile "dir_z" (rtos (setq dir_ptz (caddr dir_pt))))0 n3 g) q3 v2 U5 u
) r1 a* @$ ^0 \( p9 [
(defun set_tile_xline_pt2 ()
1 w, j* v" n c (if (not xline_pt2)
# D- }% l+ k" V( F0 R! G ;; Initial second point is Root Point + Direction Vector' P& @( L4 a4 |6 _
(setq xline_pt2 (mapcar '+ xline_pt1 dir_pt))
6 T" Z6 o P6 h( a2 l )
9 \5 `' p9 g$ m& i6 f7 ?3 B (set_tile "xline_x2" (ai_rtos (setq xline_x2 (car xline_pt2))))/ d3 l( C) c9 W$ [( x
(set_tile "xline_y2" (ai_rtos (setq xline_y2 (cadr xline_pt2))))
% @1 b* P% m1 E2 G (set_tile "xline_z2" (ai_rtos (setq xline_z2 (caddr xline_pt2))))) i D4 f( i' p0 N
)+ n: C2 V! ]0 Y& o a4 N* y0 T
/ t. h( b9 P) o
;;
, U. ~4 [4 P& ~* ?$ G ;; Handle for all objects9 ?6 @0 g/ r- J) p8 Q
;;
% L0 Y& N3 t; [% y: e. M (defun set_tile_handle (). T" F& v+ a+ g/ b+ n' T/ s
(if (setq hand (cdr (assoc 5 elist))) z- I5 b1 ?( q y7 o" ]# m" R+ y) J
(set_tile "Handle" hand) r1 B+ V. e% G9 a1 T) q$ z$ V
(set_tile "Handle" "None")
7 u: r1 ^1 _4 \* d; Z )
8 e! i8 o! D2 e6 G+ `! ^ )
7 ^& `% p7 C1 m ;;+ q( `5 }8 J5 r R" u% s- z
;; Radius for ARC and CIRCLE
6 z+ \5 M" k% ?, z ;;
7 g6 s$ e5 u$ r* S$ E8 m (defun set_tile_rad ()
, P: X' p3 q# C (setq radius (cdr (assoc 40 elist)))
6 E# a% G& {7 X5 |6 W5 T+ A, B/ Q (set_tile "radius" (ai_rtos radius))/ `2 u& Q3 X4 X! f
)
0 f! M b- X/ a0 o4 W% \6 I N ;;
3 P2 }- P8 ?+ E1 b ;; Start angle for ARC
, X7 c2 N* h5 I6 _9 M; F ;;- P1 S' n9 z9 t6 J/ x
(defun set_tile_stang ()% u: }* `; C, M/ t
(setq st_ang (cdr (assoc 50 elist)))
, s( V& g; }7 ?( k6 S( r5 ?/ Q (set_tile "st_ang" (ai_angtos st_ang))1 X- ~4 G3 J5 R8 U' m, @
)
/ X& ]9 @2 b- D( q' ^7 _, b' V) t ;;) h2 M( N m7 G7 N! Y$ Y4 N
;; End angle for ARC
7 L J! O; y9 Q9 c ;;
7 m$ A% B8 E/ f6 m1 n0 T (defun set_tile_endang ()$ Z& d0 N; x- S0 Y6 V
(setq end_ang (cdr (assoc 51 elist)))
# S) z! _6 V: ~. G7 l( z (set_tile "end_ang" (ai_angtos end_ang)). c+ }' t: V' s0 _% v$ R# Q0 k
)
8 l; j6 b& p4 A ;;3 V" H3 [- _3 i1 u9 t
;; Rotation Angle - Text, Attributes, Block insertions and Shapes
, V1 ?8 m2 [0 ]- Y' ]/ [% H ;; X$ t. a* j- s6 o0 U
(defun set_tile_rot ()
9 u5 v0 D7 Q9 l( t2 g o (setq rot (cdr (assoc 50 elist)))
3 [8 ]' A- B$ T* v (set_tile "rot" (ai_angtos rot))9 H5 w" {& M% a# y
)
1 G0 v2 k9 T7 v3 p ;;
. {% N$ z# ^0 ]/ q& r7 g ;; Height - Text, Attributes and Shapes6 g- n/ j4 U' O
;;7 {4 n% D8 N6 J% Q" R8 r' r# O
(defun set_tile_hght ()
$ N: {5 j( y) X1 }# r (setq hght (cdr (assoc 40 elist)))
5 T# C+ H" C# P' X1 s (set_tile "hght" (ai_rtos hght))
2 x" n* z) W8 K/ s+ U8 d" {3 I% `) z )
# {. f9 J( ]7 S1 ~+ u. }! G ;;
$ D3 y+ n2 ^" ^ ;; Width Factor - Text, Attributes and Shapes
; M t. o7 k- q% ^4 g ;;
7 e2 N. z5 i) Z% y% K3 @5 q (defun set_tile_wid ()
1 p7 R5 h1 L, f' J( q* j8 _ (setq wid (cdr (assoc 41 elist)))
6 g, o7 w8 f( y% { (set_tile "wid" (ai_rtos wid))% ? \; B& Y; c* z% Y, ^+ c1 C
) y8 j4 ]) B2 i) I. Y
;;/ k3 Y* z) S! F. d1 t+ w
;; Obliquing Angle - Text, Attributes and Shapes5 p& v' c2 U5 T8 o6 p# G$ [$ S
;;
! D9 D* B3 s4 e4 P# ]6 w (defun set_tile_obl ()0 f1 L( c9 a+ h- q' c
(setq obl (cdr (assoc 51 elist)))
" C. w, X3 W1 S _ (set_tile "obl" (ai_angtos obl))1 a7 X3 l$ D2 d' T) A2 e
). V n: B& t) Y" f' j2 q
;;9 p+ N1 d7 K# g' c9 _7 {
;; Text string
7 e9 P. _, g a ;;, N( z) z" t$ _
(defun set_tile_text ()
7 N2 ?, o5 _0 M7 [7 o2 k" H/ W0 `6 t (setq text (cdr (assoc 1 elist))) Q% u% b/ o9 t, @6 g2 D
(set_tile "t_string" text)
) ?, L% D3 e B$ c1 D, x* F )
' c& Q* x9 \' p$ E ;;
& ]+ R9 y0 U( E4 y3 e) [" l ;; Attribute Tag, J) L' d# @3 K& r0 r
;;9 l: ?4 Q, E; S9 p/ T# B9 D4 z3 ]& @
(defun set_tile_tag ()
5 B, u/ r1 `4 s9 P (if (= etype "ATTDEF")7 [3 k# I" L8 _
(progn4 C& z2 S& `2 B+ j1 s$ ?$ l. u
(setq attag (cdr (assoc 2 elist)))
1 b2 h9 u) e' _ `8 _* V (set_tile "tag" attag)
) z" f& i& J" ?$ z1 d) J/ n )1 C6 p; H, D9 S- `/ Y
)
. h9 w* G. u; j7 Y( H/ a* `7 m T )0 G# A! z' _7 G- d+ h, r Y; K/ ^, Q0 N
;;+ u* @ I% [: \3 J+ M2 G" i/ l
;; Attribute Definition, t8 P$ ^" n0 F4 m z! O
;;, D- _) `- m: B1 K$ V
(defun set_tile_prompt ()& I2 L& `; r/ A2 L: }3 T& l
(if (= etype "ATTDEF"), i5 o) \/ S/ E/ ?& o
(progn
3 ?8 j: D/ }- V: I& A- @ (setq atprompt (cdr (assoc 3 elist)))7 b: v! M, E m
(set_tile "prompt" atprompt)
" @" n" a' i$ K! J5 J )" f/ } Q) Y5 b! k5 S9 ~
)
) J7 L g1 Z1 N) x) X4 w8 e )! f9 ^' }9 q% E! L: p( u
;;- v6 A" N2 T9 V7 Y& X: c" b
;; Justification setting for Attributes and Text. Initializes7 y8 h& y/ e4 f% D' _/ Y
;; popup list box
! K! s" ]2 s | ;;$ V+ z* ?; e7 V3 Q! E& _
(defun set_tile_just ()
5 s8 O+ U: L3 w( Y9 g) Q& \+ [ (setq ha (cdr (assoc 72 elist))) ; horizontal alignment* u6 q) o/ {, o4 U2 l, D2 j
(setq va (cdr (assoc 73 elist))) ; vertical alignment) h) K( I. w# T9 {$ b, o1 W
(setq ha-prev ha)" f8 @7 G! X; x6 |* |$ f$ }
(if (= etype "ATTDEF")5 e1 I0 z4 x! R, u0 ~5 x$ o, p$ |
(setq va (cdr (assoc 74 elist))) ; vertical alignment" \- c: [4 `3 b, B& U/ i
) f. \' }% b# b5 Z1 p4 U1 C
(setq jlist
9 c, K6 W: b; d8 q$ ~ (list "Left" "Center" "Right"+ |2 z" u6 D+ r$ M
"Aligned" "Middle" "Fit"
7 X: f$ W% } b& @2 |: b "Top left" "Top center" "Top right") I$ m" @% m% }% L7 d. ~0 Q
"Middle left" "Middle center" "Middle right"
8 f; C9 P) M! F) T9 Y4 ^" G7 } "Bottom left" "Bottom center" "Bottom right"" U K K3 d3 Y% m
)0 g. G0 j/ a: t! |5 w8 w& i
)% O l5 |+ J( R9 u w
(start_list "popup_just")
) z" e' b! v. L (mapcar 'add_list jlist)( ^3 k1 S. v. i2 z. e' T
(end_list)( l( D' s# u5 Z3 h
(set_just_idx)
, ^. z \; ^3 w6 d2 H' Y3 K* O7 K6 ? (set_tile "popup_just" (jlist_act just-idx)), N( T. o* k7 e% p1 _$ m8 m
)+ K A. r* F# t5 `7 b
;;
" o* O7 @- t F$ w ;; Style setting for Attributes and Text. Reads symbol table for popup list0 T/ D j+ i, r4 u( Y" Z+ w
;; box.
8 d- x$ B6 P" z- d; Z- x6 r+ G! e- b ;;
1 u) k& O1 W/ n* g (defun set_tile_style (/ sname style-idx tlist)# k! y7 C( }; H& l/ M
(setq tlist (tblnext "STYLE" T)- K. t; [% t1 K$ x: z: D
slist nil)! G6 s5 R3 r+ d0 n1 l2 g! C% _# ~
(while tlist6 K$ r6 ^( w4 q. h2 p/ s
(setq sname (cdr (assoc 2 tlist)))
+ V* L0 E: U I$ }9 r; h$ ` (if (and (/= sname "")
" B8 o/ `+ }4 ^ ` (/= (logand 16 (cdr (assoc 70 tlist))) 16))4 K5 ]+ G+ ^) G: e$ o" u+ g
(setq slist (cons sname slist)))
* {0 K+ o Z- q( I/ e (setq tlist (tblnext "STYLE")))
& e/ W/ }$ J( S8 o a (if (>= (getvar "maxsort") (length slist))
1 u4 C+ O8 o$ L4 b6 v+ U( h/ p- r/ u (setq slist (acad_strlsort slist)) ; alphabetize style list
$ m$ x, s1 p( K, Y (setq slist (reverse slist))) ; or reverse it to put it in DB order
2 H4 a, ^4 U, |$ R- a. H6 A0 U4 X% Q9 e: g y( n1 W
(start_list "style")- ]5 i% F# Y) j1 b: u
(mapcar 'add_list slist)% Y2 ^7 Y7 s5 r
(end_list)+ C; \% s& b; i: D" \- W9 [
(setq tstyle (cdr (assoc 7 elist)))1 \0 V; \' J9 @4 u/ M& {
(setq style-idx (getindex tstyle slist))2 X4 h- L6 N+ v3 k
(set_tile "style" (itoa style-idx)): U" `. A. G" h5 L$ G
). ?4 J; J) o5 ^) I, D/ _( O* _
;;
! M, F- Q' j, F" y% c; a; B" V% [+ R ;; Text and Attribute setting - upside-down, backwards
: a8 y9 p0 q" a+ G j7 M ;;( m) h5 q: M" C& ]1 h* m
(defun set_tile_bk-up ()
( c: r9 J) Z( E. g* ]$ U; ` (setq bk-up (cdr (assoc 71 elist)))) L( k2 G0 \/ D4 o1 ?
(if (= (logand bk-up 2) 2)3 C) R$ H8 C3 P2 F- C ~7 p
(set_tile "bkwd" (itoa (setq bkwd 1)))
0 a2 A0 u' a; ~7 }. _ (set_tile "bkwd" (itoa (setq bkwd 0)))8 g* y( q8 X, V9 t' S; n
); c$ [) Y) @ Z- f) @4 a8 Z* L
(if (= (logand bk-up 4) 4)
8 _3 _* \- r, b. t7 S- S (set_tile "upsd" (itoa (setq upsd 1)))% \6 x% \7 _8 i6 Z" H2 T
(set_tile "upsd" (itoa (setq upsd 0)))/ D# y; c6 ]2 @
)
% I: J% g4 J J, @) H )6 b+ }9 m& H2 x3 w1 u5 ]
;;
$ o- R# t7 E2 q' G' c3 ^) G ;; Attribute setting - invisible, constant, verify, preset6 V+ Q$ K# [- @, U; j. D
;;
5 J( ?$ M) f" L p (defun set_tile_icvp ()
8 {' q$ Y- j0 Z b# F (if (not (setq icvp (cdr (assoc 70 elist))))
! I" |! E8 P! f6 g9 j2 U% Q (setq icvp 0)
0 n9 e- Y) C% e' Z )2 b/ z. m- _5 d' y5 w
(if (= (logand icvp 1) 1)- T; W- D* I/ z6 q3 ]
(set_tile "inv" (itoa (setq inv 1)))
3 E% H, L9 }+ Z% @6 I7 q (set_tile "inv" (itoa (setq inv 0)))
; k* v6 U# Z R9 C6 H )
# Y6 a$ U1 @. l O {! O$ ~+ J( R9 g( f (if (= (logand icvp 2) 2)
+ p: ?) ?5 v: o. ]6 d/ T0 t (set_tile "con" (itoa (setq con 1)))! ?1 l1 a1 O) m: N) y4 Q
(set_tile "con" (itoa (setq con 0))): ?3 ^2 O8 f9 }, v
)
Y M7 E f4 z, d$ J) j6 V (if (= (logand icvp 4) 4)9 c4 T4 b2 j7 M8 c/ S n8 P
(set_tile "ver" (itoa (setq vfy 1)))
7 d& f/ }! A* X! t. {" x% y (set_tile "ver" (itoa (setq vfy 0)))1 t5 s$ o7 Y1 }7 o. h! k' O
)
2 y1 l; n. b$ S; r S3 p' |( @ (if (= (logand icvp 8) 8)
6 O8 I3 ?3 ~: M+ j2 z; W (set_tile "pre" (itoa (setq pre 1)))/ r- M; V$ z4 F) \) W
(set_tile "pre" (itoa (setq pre 0)))
9 V* ]8 y7 m% _; ~3 O9 d: L )
* r# s0 e' h1 J5 z )
* y: d) |( ^6 X$ I# l# F1 A6 C ;;
' g% W- H$ z+ G4 O5 |4 d% r ;; Scale factors for block insertions5 T, @5 Q; {! ^7 e
;;) j" {# u% {- O3 R7 S7 N/ H9 J
(defun set_tile_scale (/ temp)7 h. m. G% Q' A( [8 n7 H* T
(setq temp (getvar "LUNITS"))* F* ^, h% G. z! V3 g
(setvar "LUNITS" 2)5 M% r( x6 {# J; Q" M, f! N
(setq xscale (cdr (assoc 41 elist))) d% ^, N' |& y; b# f8 o' L
(set_tile "xscale" (ai_rtos xscale))
P+ S. |9 w4 q/ t% N9 J (setq yscale (cdr (assoc 42 elist)))
) J% i5 y u! o7 |0 p (set_tile "yscale" (ai_rtos yscale))5 b" r& |( {/ H$ h7 K7 x( ^5 ^+ E
(setq zscale (cdr (assoc 43 elist)))
2 n, n( Q- J+ A! A6 V# X& w! f (set_tile "zscale" (ai_rtos zscale))2 S3 [2 o* j- X: Q( K; x2 k
(setvar "LUNITS" temp)
+ j9 J1 Z3 N. D. R6 _6 R( M Y )6 B: A( O2 f: M' d: s* X7 \
;;
* d( q4 F8 A+ w- ] ;; Rows and columns for block insertions3 v; o1 ~+ e d8 W! `( D/ A5 C
;;1 {! ?' A7 g9 Q$ V! f5 d/ S1 S
(defun set_tile_rc ()
U _7 s* d( C, b (setq columns (cdr (assoc 70 elist))) r7 q3 `! p, m+ y8 x% G, ~
(set_tile "columns" (itoa columns ))0 x$ }1 J5 j( c( l& k
(setq rows (cdr (assoc 71 elist)))% H9 h0 D& N8 s Q. y, S
(set_tile "rows" (itoa rows))
* q% p# d3 o+ X$ ~ ` (setq col-sp (cdr (assoc 44 elist)))2 a0 G9 u( a( X; J' A0 L1 s9 o j
(set_tile "col_sp" (ai_rtos col-sp))$ _6 `8 n5 w% q$ m. B! U
(setq row-sp (cdr (assoc 45 elist)))& [+ ?) f0 B5 Y$ @# g" {; |* W) V
(set_tile "row_sp" (ai_rtos row-sp))1 B2 q" m. z1 a( S- O
(if (/= hasclip T)
$ x, M" J$ T. n# i/ c% [ (mode_tile "xcliponoff" 1)
; H; ?5 F# K* W: P2 h (set_tile "xcliponoff" (itoa xcliponoff))
& ^* i* C4 q3 l/ o$ j( w ^ )
7 P: R2 l, _9 Y' _ e/ K9 W )
. f7 E: F7 Z/ V ;;
- f8 B/ F( z# r3 A4 n) O ;; Invisible edges for 3DFACE
2 Z; r% c/ t* |4 P" X! c ;;
& \3 I/ _) c% I8 l% j7 u8 Q3 ^5 D (defun set_tile_edges ()' b- E3 ~9 G: T( X
(setq f-vis (cdr (assoc 70 elist)))$ W, o2 Q6 G7 k+ ]4 n
(if (= (logand f-vis 1) 1)
* ]# F! i' n: M (set_tile "edge_1" (setq edge1 "0"))6 g" c% q4 G2 C! t. b( D h
(set_tile "edge_1" (setq edge1 "1"))" S! I& Z, ]9 S' O- j
)
4 R M- v6 M( Z5 q1 H+ c (if (= (logand f-vis 2) 2)
9 e8 A R: ^+ @" e (set_tile "edge_2" (setq edge2 "0"))% i1 u0 g% X4 K' r4 P
(set_tile "edge_2" (setq edge2 "1"))% W- I0 n4 x# w' N: d
)
$ ]( E. ?; [7 u3 |9 o- s (if (= (logand f-vis 4) 4)
7 g" \2 i! X( b% F3 W1 w G s9 a- z (set_tile "edge_3" (setq edge3 "0"))0 O' }2 h, y0 J# q% }
(set_tile "edge_3" (setq edge3 "1"))
1 h! W" ^3 @$ ~8 k6 T )0 D! i( l3 c2 ~2 R: p
(if (= (logand f-vis 8) 8)
: ]# U" w; J" Q& k4 I (set_tile "edge_4" (setq edge4 "0"))
% t3 h6 ~0 Y9 P! I" P$ ` q (set_tile "edge_4" (setq edge4 "1"))0 Z" ]) M9 `; c Z) P( ?# |
)
@. L+ H* ^% r/ l )' U5 f9 M1 b% n$ U- b" q
;;2 j: m. O" G! Y- M
;; XYZ Point values for polyline vertex
! W( n( r8 x: t ;;+ L3 ?- ?6 Y5 G$ t7 U1 q
(defun set_tile_vpt (ptype)& e" }8 ~5 y( k5 x, B/ v
(if (= (cdr (assoc 0 vlist)) "LWPOLYLINE")$ I% K7 y! p* F, B5 |# Z5 _
(progn
( E/ p2 d( S( \6 c( R ;; ctr is 1 based, vertices are zero based.
; F9 o: U$ V6 T! l+ ^, _ (setq vpt (cdr (getLwVert (- ctr 1))))8 b* h. y2 j" Z: S
(set_tile "xtext" (rtos (setq x1 (car vpt))))4 d" I, e/ P% Y" Q" l8 {" ]
(set_tile "ytext" (rtos (setq y1 (cadr vpt))))
" w8 \2 @0 M& m! _ (set_tile "ztext" (rtos (setq z1 (caddr vpt))))
p. y, c6 |9 j" { )
, F' n) r1 Q7 g (progn
; `/ a9 i* Y9 V6 U (if (= ptype 0)
$ A V8 C; {1 k7 |# }5 f (setq vpt (trans (cdr (assoc 10 vlist)) 0 1))
8 k2 ?& `( H, O9 w) j (setq vpt (trans (cdr (assoc 10 vlist)) ename 1))% u4 ]5 F K1 B9 h
)
% Z$ e, H. e1 [6 o( `5 G; x" a- Z- n, V. G5 ~+ ?! o
(set_tile "xtext" (rtos (setq x1 (car vpt))))3 o8 A' @1 ?- ?( U, z2 ^
(set_tile "ytext" (rtos (setq y1 (cadr vpt))))8 ^. G4 k, [5 h3 G( M; E( Q, n
(set_tile "ztext" (rtos (setq z1 (caddr vpt))))" v- A( Y4 O2 C
)
: n: t: S3 a% g% O" R+ A )
) g* [$ S! Z9 _8 ]. U$ n1 ~3 e! w0 I& u
)
$ V/ A) W% F/ b. D2 ] ;; This is the equivalent to doing an entnext on the heavy weight7 j3 c- k1 B Q$ x4 ]9 [# ?
;; polylines. The hard coded '4' below allow stepping over the. N/ Q! s6 }, T" j" a. F- ?: Q
;; 40 41 and 42 group code information. The while loop finds the
+ G* A, v; X+ d! W9 y" B4 Q ;; first vertex which will be used as the starting assoc in the
- ?6 {& @* F6 A2 ?- L4 } q ;; call to nth.: [' l# i# ^1 d3 Z) ^- m% x8 h. \
;;1 h0 O! s" ]; N) E5 w" y. o+ Z' d2 C
(defun getLwVert (tmpctr / count tmp)& e, }1 o: l$ j" }) ~+ U* F
(setq count 0)* K4 q* c# r# f% M/ n0 g5 Z" v
(while (/= (car (nth count vlist)) 10)8 \2 w4 d1 Y& r7 J; @) }( N
(setq count (+ count 1))
! X) I! c0 `1 F6 p {" y5 z )
Y$ f, b5 k6 ]6 z ;; If the counter reaches the number of vertices,
8 `% [4 P$ H8 L# T2 W9 H ;; reset ctr and tmpctr to zero again.) O1 {( F1 p4 A) I4 t* E
(if (= tmpctr (cdr (assoc 90 vlist)))7 V+ Q& A) j( y2 x. e- F& n% ~
(progn
9 b9 a* P/ b* d (setq ctr 0)
! k! w7 j+ I% `. q! P (setq tmpctr 0)1 H& X+ x! M* ]
)0 N' _9 F4 o# @! D( C3 j' x Z
)! k0 h# f/ K/ p% j4 T" y4 G
(setq tmp (nth (+ count (* tmpctr 4)) vlist)); H1 N, H% N5 `1 n- ^" m0 y
(setq tmp (append tmp (list(cdr (assoc 38 vlist)))))( b& z$ j1 l3 o
(setq pt1 (trans (cdr tmp) (cdr (assoc -1 vlist)) 1))
& \" g" T0 t: Z0 X7 H5 e (setq tmp (cons 10 pt1))9 I; [* `0 h9 {6 }) Y
(setq tmp tmp)! b5 i3 I) m* v+ X% V9 n$ m F
)
7 h) @0 F& Y2 ^! _* J* a ;;
7 w" d, c: k# h4 e Q; D ;; Set tiles for Spline properties. If the spline is rational then we/ |% A5 c7 a) x, C/ ~1 Q, B
;; need to display the weight values of the control points, so set
2 k0 I* f: Q- M) T! e5 n ;; flag to 1.
# ]% O7 D* p9 {! u4 b$ D7 L9 O4 v ;; 1 = rational spline
1 j9 f4 R* v6 b7 A( \ ;; 0 = non-rational spline4 `, u. E; b6 @* \# \. }
;;. c, R- b3 y6 O: n$ G3 V, J
(defun set_tile_spline_props ()& S7 |' q7 A; f7 D1 Q( K4 \
(setq rational_spl_flag 0) ;; initialize rational spline flag
2 N% K( c x1 r+ n* j- @ (set_tile "Degree" (itoa (cdr (assoc 71 elist))))
* `5 Y- z& l0 J$ n/ @. O6 U (setq bit70 (cdr (assoc 70 elist)))
; J) x9 D- |9 P, w (if (= (logand bit70 1) 1)2 S. U k. H( H$ }
(set_tile "SpProp4" "Closed")
+ ]4 b! D; f( t' O' G9 g/ f9 ~ (set_tile "SpProp4" " ")
& T" f% D6 }; Q, g7 k( y )5 `* b- k5 n! D$ Q3 F B& P
(if (= (logand bit70 2) 2)
. s W; [, @; r% d5 O0 t (set_tile "SpProp3" "Periodic")3 @$ Q e4 J6 t2 a3 Y; M- ]) D
(set_tile "SpProp3" "Non-Periodic"): i/ q7 s: l) N/ I' ^+ L
)* ~% f1 \, r" L( m! G7 _; e
(if (= (logand bit70 4) 4)% h* B, x) c0 d4 [9 x* x
(progn# s- l* @2 h6 E# y C
(set_tile "SpProp2" "Rational")& H' |" r, f) N% h7 v2 c+ S
(setq rational_spl_flag 1) ;; this is a rational spline, v; E* E o& _1 x! O( k6 J
)
4 u! ]$ C" {4 k+ @ (set_tile "SpProp2" "Non-Rational")
9 L8 W6 u7 K) a7 s8 S( ? )% {+ @3 p5 A+ ^+ |7 N
(if (= (logand bit70 8) 8). A! E$ D: _4 \) |. s
(set_tile "SpProp1" "Planar"). k3 [+ N Q& O! z- J. a
(set_tile "SpProp1" "Non-Planar")5 f) n# y0 Z* P. P
)2 v& E, j, a5 R& @* [! H
(if (= (logand bit70 16) 16)
- t7 D# o$ j# M- y4 x/ b (set_tile "SpProp5" "Linear")
k5 T2 H1 _! G. b (set_tile "SpProp5" " ")
6 l9 J8 Q# }. o2 `. ? ), `0 G4 I, g3 L9 J: K
)
( v1 N# q( V6 X1 `; J2 _ ;;- y2 C$ g* O1 y8 _) l( {
;; XYZ Point values for spline points% w. t6 }( T# v+ M6 F% M
;; Need to account for WCS/UCS }- V& m" Y9 {! ] A& Y J) P
;;
4 U+ k8 B, e, R( I8 ]7 K% `4 n (defun set_tile_cntl_pt ()/ o- G1 b7 n# |$ h1 i' n
(setq cntl-pt (cdr (assoc 10 elist)))
" i- m( g; R; R- ]: k (set_tile "xtext" (rtos (setq x1 (car cntl-pt))))6 P- l6 m7 R0 t; u
(set_tile "ytext" (rtos (setq y1 (cadr cntl-pt))))
2 y( o! K4 ]/ _9 z1 e (set_tile "ztext" (rtos (setq z1 (caddr cntl-pt))))
s0 _& r( O& E1 P9 i% A (if (= rational_spl_flag 1) ;; if rational spline
' {/ p$ v* t! [( }$ N (progn ;; show weight* M1 P& p5 P* }% R
(setq weight (cdr (assoc 41 elist)))- m4 N% u$ D) Z8 C1 S ^
(set_tile "weight" (rtos weight))
( V" z6 s8 p2 H5 {: G" e. } ) ;; else
5 c4 T% Z& }$ I) o (mode_tile "weight_text" 1) ;; disable weight field
' k) V9 L0 i, _6 t )
: m1 Y" y3 S& T8 [ )
# P/ I3 a; H2 Q4 B ;;
: z+ w5 c6 D9 z& N8 H1 z4 A+ \ ;; XYZ Point values for spline points0 J5 Q3 i1 u& Z. k" a# }+ M: g
;; Need to account for WCS/UCS, G% N, W ]0 n) Q
;;% T& ~% S' ^$ l& ]* Z& r; T7 t
(defun set_tile_data_pt ()1 r5 u% @9 J0 a4 [
(if (not (assoc 11 elist))' z. C, o: M/ ~; s% q+ ^
(mode_tile "data_pts" 1)0 [; y( u! S8 R
(progn
7 }5 Z6 c' m* Z1 p- O (setq data-pt (cdr (assoc 11 elist)))
# x3 U" L1 \/ N) B Q ;; display points with current precision.
4 x5 g# j% J: ? _2 m2 w, q8 v (set_tile "dxtext" (rtos (setq x1 (car data-pt))))
5 \7 e, ?1 M ~: `, B+ ^8 g (set_tile "dytext" (rtos (setq y1 (cadr data-pt))))
! t/ }" |$ w6 U (set_tile "dztext" (rtos (setq z1 (caddr data-pt))))+ q. D! g9 K6 i
)7 R0 |7 K7 m8 U( Q% E% _$ X
): `( u+ k( X( f
)
5 a4 n- J9 K" m- U! ]) E ;;
" Z7 l1 n9 V0 f X. K! c8 V/ n ;; Fit curve, fit spline, or smooth spline surface setting0 k6 \/ u: o' X. Z
;;% O# H* F) z! ?" h
(defun set_tile_fitsmooth (), \4 W# h3 d& S# \- C! m
(cond5 O. K r* H% A6 R8 b s* F
((= (cdr (assoc 0 elist)) "LWPOLYLINE")- F$ K8 ~! O/ t5 j
(set_tile "none" "1")
: ^2 _3 R" K3 Z \; r )
1 N2 a. E0 p- { L ((= (logand bit70 4) 4)
* J0 E+ @5 w9 a. F6 r6 h# X E (cond1 h. [5 h* U: ]7 k4 j
((= bit75 0)0 {% B1 i' o X6 C- j
(set_tile "none" "1")
% z+ t$ I- U$ Q( r* Y (setq spltype 0)
8 G/ E# C+ g; y; e )" w% @1 @2 a4 J8 e2 L5 W1 G7 p7 B9 s2 w
((= bit75 5)
0 w2 ?- A, |$ h' m. j- M (set_tile "quad" "1")& ^/ {) G& p! i% G7 I! ?& ^
(setq spltype 5). ?* v& B& L L) n5 n
)3 N/ s0 ~& i6 `3 p! O
((= bit75 6)# Y+ n5 L2 b. `% o3 K4 a" W5 T7 N
(set_tile "cubic" "1")1 t( w5 A _% u, A! y2 h }, A! | X" c9 N
(setq spltype 6)
$ P$ m: c! i( z )
; c' u- }7 C4 h ((= bit75 8)
& U N U6 M6 D2 S6 c' V (set_tile "bezier" "1")- E( R7 P9 d; P7 _* Y D9 Z1 m
(setq spltype 8)5 x( [# u; t, s
)
- ~& j3 [6 C3 u# r: f )! r. ^* O9 j) }
)5 B0 h, T+ e) l, p" X) z+ a _
((= (logand bit70 2) 2)
) R! c1 S( \1 G1 A1 o- C (set_tile "fit" "1")
! T" S9 J; U( }5 X, f (setq spltype 1)
) J9 F( h! l' }: u, w) R. ~7 u+ t )
/ |: X0 \$ O+ h6 H$ F! e (T (set_tile "none" "1"))
/ A( ]6 @6 @$ G- ]5 ?, L8 h/ E& j )) v+ k6 A& E3 O+ X3 Z0 P
)
. p% ~4 D7 O! @- Z( h ;;1 h& E/ @9 s6 q; H
;; Closed or Open mesh and polyline setting
! m- N' t+ ?! T3 A. v8 Y/ U ;;; R" A& G; Y! V$ B* T
(defun set_tile_closed () n( x( |" ]) A( ]% K! e
(if (= pltype "3D mesh")
9 Z* G% C1 A9 T4 W; B (progn
3 A; h1 s: i2 ^+ L (if (= (logand bit70 32) 32)
( f3 Y9 |9 V1 H5 b. j& n (set_tile "closedn" (setq closedn "1"))5 E3 o, s: f' A0 O- s
(set_tile "closedn" (setq closedn "0"))( z+ \+ s6 D# t: w
)
: `) v5 e* D0 X! m5 {3 n, d# S+ D (if (= (logand bit70 1) 1)8 d/ d- u9 W; ?5 v/ h+ o
(set_tile "closedm" (setq closed "1"))
9 n2 @. I4 O! T0 N& i7 U (set_tile "closedm" (setq closed "0"))
" P1 Y, ?( M6 ?5 x( B" y )
. P3 a- f2 |% g; ?! K# ^ (setq old-closedm closedm old-closedn closedn). @/ x2 F) v, M7 m; q3 Y5 y( M; Z
)) B/ |) D3 H) W( q) C
)
$ f! C6 i$ C2 E8 y- C D& l (if (or (= pltype "2D polyline")
9 K. V0 g" I7 c6 @& ~' S (= pltype "3D polyline")
" t- S( P6 _7 E/ Q )
: _5 l/ L( q0 r/ X (progn
" c: `8 f7 x1 P (if (= (logand bit70 1) 1)
: ]0 W+ V4 M p! l2 f& E (set_tile "closed" (setq closed "1"))9 q! \0 @6 Y' ]& t1 Z
(set_tile "closed" (setq closed "0")). {* j) R+ H6 A! O, [; r( w# X
)
" u0 v2 Z" q9 u! F, T7 c (setq old-closed closed)* R/ p5 q' d8 W
)
/ V1 T0 I) |$ x* |7 D: }$ R )
: @; j# T! |! A' e1 R! e )
9 K0 |& T) ?' V' g, t3 B' n ;; Set common action tiles- J V" \- |2 U8 ~' U! H2 a, j
;;
0 C2 r4 d G+ e/ t; R' ?* {' u3 `; g ;; Defines action to be taken when pressing various widgets. It is called/ \& M- J& K' x" T; x) [+ L# A
;; for every object dialogue. Not all widgets exist for each object dialogue,8 K# a' x( n( t2 `8 b0 g K
;; but defining an action for a non-existent widget does no harm.
, Q0 D% c. \$ o4 H/ M (defun set_action_tiles ()
! E! _' S) O/ V1 x8 ?" R* u (action_tile "cancel" "(dismiss_dialog 0)")) K- b3 j# d5 w
(action_tile "accept" "(dismiss_dialog 1)")
/ C% F8 H$ Q, {/ z( _7 T9 j3 T; h" y (action_tile "help" "(help \"\" help_entry)")
; E5 k, |8 A c! k (action_tile "b_color" "(getcolor)")7 m& u, w+ R" W1 x" E0 U& D8 v- q. X
(action_tile "show_image" "(getcolor)")
1 ]+ k! P/ x9 B5 p (action_tile "b_name" "(setq elayer (getlayer))")/ d' _* S# m" h; |0 K; `
(action_tile "b_line" "(setq eltype (getltype))")
3 Z- C' F8 V v3 ? (action_tile "eb_thickness" "(getthickness $value)")
) J- g; N' @' y (action_tile "eb_ltscale" "(getltscale $value)")
7 Q+ _; N6 a& C; J& b
h/ r: H0 p3 d (action_tile "pick_1" "(dismiss_dialog 3)")
9 n& D2 O3 i2 Y/ N (action_tile "pick_2" "(dismiss_dialog 4)")1 a8 A8 \) l- r. D7 q5 q0 p/ b
(action_tile "pick_3" "(dismiss_dialog 5)")
" M- v A8 \/ T- G3 X# j, W (action_tile "pick_4" "(dismiss_dialog 6)")* M0 C5 c1 s" _
(action_tile "x1_pt" "(ver_x1 $value)")- g0 w- j5 D& q* ~6 `; N2 T- F5 N
(action_tile "y1_pt" "(ver_y1 $value)")! N, o, `$ \- [2 d
(action_tile "z1_pt" "(ver_z1 $value)")
; _6 ^9 v# m7 e4 D0 [2 ` (action_tile "x2_pt" "(ver_x2 $value)")
8 R6 [2 H d$ j& o# i (action_tile "y2_pt" "(ver_y2 $value)")
2 i/ }3 `; k4 t- Z7 o (action_tile "z2_pt" "(ver_z2 $value)"); I/ x) Z3 B C* P
(action_tile "x3_pt" "(ver_x3 $value)")
# f% ^, {5 T9 [7 k (action_tile "y3_pt" "(ver_y3 $value)")
; Y' Z" m- m- l# ^2 D1 x: o! z: Q (action_tile "z3_pt" "(ver_z3 $value)")
g. \7 y) Y) A (action_tile "x4_pt" "(ver_x4 $value)")
! U9 }# Z; t# H/ G% S4 A (action_tile "y4_pt" "(ver_y4 $value)")$ h" n: J7 n& E" P
(action_tile "z4_pt" "(ver_4 $value)")) l8 \8 A2 l$ Y2 ^, ]) Z
0 V5 f1 o1 w4 o0 r3 ]1 q% u' {* S
;; Action tiles for Xline & Ray k& N+ J/ L) U# S
(action_tile "xline_x1" "(ver_xline_x1 $value)")
2 z9 y8 J: N6 z. e, G: k4 w; t* m (action_tile "xline_y1" "(ver_xline_y1 $value)") H! X8 f" p- |4 s e6 b) E* `
(action_tile "xline_z1" "(ver_xline_z1 $value)")0 H3 z: {* h3 Y: c% Y
(action_tile "xline_x2" "(ver_xline_x2 $value)"); z2 v& P k6 m* ]# {4 `1 }& }
(action_tile "xline_y2" "(ver_xline_y2 $value)")( c3 [& I. y- |$ o p. T0 Y
(action_tile "xline_z2" "(ver_xline_z2 $value)")
% o5 J2 L; z& K/ t' j2 N8 X! k& e$ C+ |
(action_tile "edge_1" "(setq edge1 $value)"). N6 b0 z) I9 D' S$ R& s5 w; a
(action_tile "edge_2" "(setq edge2 $value)")
( t& S+ ~9 G+ J (action_tile "edge_3" "(setq edge3 $value)")$ p% |; S# t5 |: l1 b
(action_tile "edge_4" "(setq edge4 $value)")
$ o" X/ k6 H3 g K/ \( h9 H7 g* B4 L9 h, N4 w: g7 P2 |8 P
(action_tile "radius" "(ver_rad $value)")
3 k' `/ i1 f( x$ F4 i (action_tile "st_ang" "(ver_ang1 $value)")' \" J' b2 E9 d5 ~: l i% J
(action_tile "end_ang" "(ver_ang2 $value)")
+ F. y- m3 ?; @( }! |& c- d (action_tile "end_eang" "(ver_eang $value)"). o1 w1 P$ R; z) [7 n
(action_tile "minrad" "(ver_minrad $value)")+ }6 V# [' a4 {
(action_tile "majrad" "(ver_majrad $value)")
6 H3 G; O: F# k5 d/ i
7 C" H5 P) s* @$ e3 ?+ i+ v (action_tile "xscale" "(ver_xscl $value)"); C, W: C8 E% x! p8 m
(action_tile "yscale" "(ver_yscl $value)")) Z: O* [+ m& [8 S8 v
(action_tile "zscale" "(ver_zscl $value)")
: f8 e, E9 r: a, g+ h( k5 s (action_tile "rot" "(ver_rot $value)")
. v( ^0 a/ Y) n: ^: K. k (action_tile "columns" "(ver_col $value)")# G" Z/ o; \* ^: Y s
(action_tile "rows" "(ver_row $value)")4 D6 B; Q3 Z. a& Y- `
(action_tile "col_sp" "(ver_colsp $value)")- q# N- D4 j" w1 S
(action_tile "row_sp" "(ver_rowsp $value)")
+ L2 [+ [# Q; N6 ?! E( q' C" T8 H; T" D4 f; @- ~
(action_tile "hght" "(ver_hght $value)")
& U& R' n0 r# C2 b' A" @ (action_tile "wid" "(ver_wid $value)")
* t- H7 p/ W5 D/ P& T5 v (action_tile "obl" "(ver_obl $value)")! O. b- h% Q2 l# d
(action_tile "style" "(style_act $value)")
$ D/ g5 ?! a! c( F8 N2 M$ W, a
' p' G& u' B, w' v) ^+ n. H6 O" q0 q3 h2 O (action_tile "t_string" "(ddgettext)")
; t8 m7 X# k/ O3 k (action_tile "tag" "(ver_tag)") N& a- X' w/ S/ q* w6 M
(action_tile "prompt" "(ddgetprompt)")2 F/ ?3 g: [6 s" n/ M. A; k4 V/ u
(action_tile "bkwd" "(setq bkwd (atoi $value))")
1 Q! i/ j/ A$ U (action_tile "upsd" "(setq upsd (atoi $value))")1 J% }4 [7 }/ R) o' C: [1 U: `
(action_tile "inv" "(setq inv (atoi $value))")
" J$ v# E, [/ T- i/ y (action_tile "con" "(setq con (atoi $value))")6 N$ ^5 k0 F$ a5 H
(action_tile "ver" "(setq vfy (atoi $value))"): f& I" u# k, H
(action_tile "pre" "(setq pre (atoi $value))")5 R, j" U0 i2 l" O+ r0 D% ^
(action_tile "popup_just" "(jlist_act $value)")
. O, n- r0 N9 F( q: ]% l! r, n5 d
(action_tile "closed" "(setq closed $value)")
1 P) x# r9 @0 A- z& L1 S8 K (action_tile "ltgen" "(setq ltgen $value)")
: V# R0 R2 F% T+ |: S (action_tile "closedm" "(setq closedm $value)")
4 l2 W/ V: h1 j N (action_tile "closedn" "(setq closedn $value)")
" }' t+ }3 V; K# e# a (action_tile "next_v" "(next_vertex)")
2 L1 ~) d4 ~0 b0 n6 v1 `; h: r (action_tile "xcliponoff" "(setq xcliponoff $value)")
+ p; w# d* y9 B$ [! w; G, u6 j0 L( m, G: X7 a& @
(action_tile "next_cntlpt" "(next_cntl_pt)")3 k- A& Y% @+ u0 f# |+ S F
(action_tile "next_datapt" "(next_data_pt)")2 d7 T# }5 I3 s
6 P* q2 C! L7 Z# z- J( B5 }" v- U
(action_tile "none" "(if (radio_gaga \"none\")(set_uv 0))")+ j* ^% j5 O) O7 ]% _
(action_tile "fit" "(if (radio_gaga \"fit\")(set_uv 1))")3 A" ~! A2 K* P3 P8 y
(action_tile "quad" "(if (radio_gaga \"quad\")(set_uv 5))"), S, {3 }' j+ J& ~ Z
(action_tile "cubic" "(if (radio_gaga \"cubic\")(set_uv 6))")
0 c# ~: f$ e! | (action_tile "bezier" "(if (radio_gaga \"bezier\")(set_uv 8))")6 f s3 U+ U. k4 a6 X2 C H/ U
: [% M/ U) X$ {$ ~+ w3 w
(action_tile "u" "(ver_u $value)")9 ~& h4 ~! F# l z- m1 e
(action_tile "v" "(ver_v $value)")
/ |! n) t2 V' Z- R$ ] )1 r$ e* q+ I9 |
2 m5 s; b& B% B; G1 |% c; A# ?" @& e
(defun ddgettext()" F% s: m1 k/ g" v1 _
(setq text (get_tile "t_string"))
k0 D3 T" z0 W/ ~; [4 c )
4 c2 M( W4 ^8 j2 ]% i! ~ d7 d7 A& e4 L1 d) `; C# h- L0 T/ B
(defun ddgetprompt()
5 A! n$ S. m: {2 H& k (setq atprompt (get_tile "prompt"))
" {. y1 l6 M0 J8 T )
& A6 ^9 v1 g. x! F" {% K5 t$ p2 f/ x
;; As OW doesn't support disabling of individual radio buttons within
" H( b% A4 k/ w; H( M+ q, J ;; clusters, a check must be performed as to the legitimacy of the4 E0 M' c3 p( W+ h" U' h
;; button pushed and reset if necessary.2 z% u- S6 d' b) }$ n
(defun radio_gaga (pushed)
9 ^6 f# A( ~2 H) H) z (cond" G$ B9 l G: E x
((and (= pltype "3D polyline")
. ^) G3 L a& S9 z; G6 R (or (= pushed "fit")
* P6 O( V) E5 C" f' i6 I, t) ^; _ (= pushed "bezier")
$ b' C8 J% e+ C7 j9 ~' A$ a )( r- Q A$ F) W4 S
)1 R5 @, B; H; K, M: y- a2 S E
(set_tile "none" "1")' }& W% z4 C& U6 u8 t3 q
nil
- y7 i0 t! V( }' f& I: G/ e )) s, u( [( @2 O2 _: G7 [$ N
((and (= pltype "3D mesh")$ ~" r7 a' d3 k( X6 t/ \/ L1 {# F8 G
(= "fit" pushed)
0 k: q9 U9 D% T. l, t- ^3 n/ I/ M )5 g/ z- X5 `8 E8 @0 S `
(set_tile "none" "1")
9 G6 U) ]4 m/ ^ nil
: o$ Q' }0 u) D+ i )
' N" F, b4 z* e# g ((= pltype "Polyface mesh")
' f# k9 B* I7 b- c* ^% ~2 n (set_tile "none" "1")
9 B* v0 N4 n$ T3 {$ ] nil
2 G) _' W2 h3 i: v, {; j )
2 {0 ?0 f) G7 w# S* p. V$ D- v ((and (= pltype "2D polyline")
3 R2 a5 P2 i) E8 _" S (= "bezier" pushed)
$ ?& N$ N4 B; t' f* O )3 O6 t3 \) o4 m9 l9 _% [/ ?, o; P# I
(set_tile "none" "1")& G& \2 U( E7 V$ n. h" p2 `% `% E% I
nil
; O7 p H$ @, j ): @7 P6 J9 m: M3 |: K( g# `2 T) I
(T)
/ i7 ]: u2 R3 w6 } )
4 F) @; J1 b# {" b P: W4 E4 z: D )8 b0 ~* l+ X" |
;; t4 k5 O2 x5 c$ P1 R- a
(defun set_uv (type_n)+ l) y7 G% W% q: K
(setq spltype type_n)' o4 M9 V i. t; a
(if (= pltype "3D mesh")
! p" A0 Z) `& m& ^ (if (= spltype 0)" s2 E n1 H) ?% P5 t; Q
(progn6 O! i& b) ?; A6 y
(set_tile "u" (itoa (setq u 0)))
: k" @5 t/ v3 v- e5 T; x- Y (set_tile "v" (itoa (setq v 0)))
$ e# Z1 d/ k" N5 A, V H# P )( q( \$ n" B( M4 s x
(progn) K7 X5 \! m. Y
(if (= u 0)3 m) q* S0 i" w' [- _
(set_tile "u" (itoa (setq u (getvar "surfu"))))
( E0 N$ z# r% y H6 |$ J3 _ )
+ S6 ~$ G! h) \, g8 O2 T, l (if (= v 0)
- v. V/ Y' v4 C (set_tile "v" (itoa (setq v (getvar "surfv"))))
: t' m& H& ^$ ]) O )9 Z- B1 F" m: r) v
)
6 j4 R) w$ w! B- T$ z! q )
1 J+ ~5 }% X" ?1 L )) S4 ]. R0 W- i4 G9 g. C$ ]
)) Z- @+ R1 ~; Q6 L% S0 M X% W
: G( ?, u9 d i# a- f2 Y+ n$ j7 _! o% b
;;
8 F4 |0 v! I, c9 x: q# k w0 P ;; Verification functions
+ h6 }( f) K! h0 H* p ;;
% q* r l) H8 N& f' a ;; Verify distance function. This takes a new X, Y, or Z coordinate or
+ N9 k3 ~& N& Q ;; distance value, the tile name, and the previous value as arguments.. m* c% ]3 H; o
;; If the distance is valid, it returns the distance and resets the tile. X/ d; r2 o( T6 M
;; Otherwise, it returns the previous value, sets the error tile and keeps
2 ]6 I; }5 O V1 F& a+ D ;; focus on the tile. Shifting focus to the tile with invalid value can
6 z' p9 _8 S f0 O ;; trigger a callback from another tile whose value is valid. In order
1 g- x9 ?; e/ F) s ;; to keep the error message from being cleared by this secondary callback,* ?5 J+ U1 R. |( S
;; the variable errchk is set and checked. The last-tile variable is set, P) A) T4 V! X; L) v
;; and checked to ensure the error message is properly cleared when the) P0 k% g( @& ^
;; user corrects the value and hits return.
% l' l; w1 a6 k4 D ;;6 w# ` e% a$ u
(defun verify_d (tile value old-value / coord valid errmsg)
% i2 Y& l- i# d4 ] (setq valid nil errmsg "Invalid input value.")4 M/ N9 Y. u2 V) \4 y
(if (setq coord (distof value))8 v5 d& c" {2 z8 j# ^# N
(progn, j2 i7 m1 O* E
(cond5 d0 f/ [9 o& a4 ~7 z8 R$ e
((or (= tile "radius")
( l1 H3 N* @& R$ R* H (= tile "hght"). y# L2 @- N9 Q' M# c$ \
(= tile "wid")# Q: \: ^8 `: ]3 W ~2 c
(= tile "majrad")
# c* E2 X& ^5 ]+ S/ ~' U1 K (= tile "minrad")) G$ M6 p* E& P# M7 x
(= tile "eb_ltscale"): R2 @# o2 D8 N) q4 l7 R; x# N
)9 t4 o. H% E0 J! w' z5 M
(if (> coord 0)
; ^1 J& {8 i7 i) k) Z (setq valid T)
4 G; _: X3 I9 @* |/ [" f (setq errmsg "Value must be positive and nonzero.")
4 l2 c+ ^& P/ ^ z! R# n. m6 C )4 X8 Y% w: }3 N4 {+ s
), b& X' `0 C9 R9 s/ x) u; T$ M* b
((or (= tile "xscale")
5 G( m) {; J, h8 e (= tile "yscale")
3 i! q$ ^$ q+ n! q7 e (= tile "zscale")
9 Z% b B6 [( v" t )
! P6 H' G' J5 _2 l (if (/= coord 0)
W2 z! u3 x. b& \ (setq valid T)
- V0 B+ \) X+ Q (setq errmsg "Value must be nonzero.")
+ ]0 P1 t' T6 Z4 k, y )/ Z5 h( N' A4 r- y, Q$ o( U
)
8 p4 V% f& V' K) s$ e+ E2 y- s) l5 U (T (setq valid T)) L) p- D% P+ \" a
)
3 E! e# ^; `7 U5 S$ X& p )
, @) F5 G/ E( a" q; N4 m (setq valid nil)0 y. d& E. T3 a! w9 L1 p; {
)* D& g, T: A, L9 i1 \+ w- F3 j
(if valid/ e, P7 l2 J$ f0 Q
(progn
$ G0 J8 A! U2 B& [) f$ @ (if (or (= errchk 0) (= tile last-tile))
' W' g. A) E z1 w# [ (set_tile "error" "")7 ~6 d7 o6 g: U3 A
)
9 f4 v9 L. a- ?8 d% M (set_tile tile (ai_rtos coord)): a8 h! l6 J. T) k! R1 g4 @
(setq errchk 0)) R8 m: J" q5 k2 M
(setq last-tile tile): a# R9 n: n9 A: W0 U5 T
coord
3 l' C+ m$ v) B j )& ~0 _: ~; h4 @8 p( ^4 f) Y' [1 l
(progn7 e+ V+ [9 R W# i1 Y/ c
(mode_tile tile 2) ; Move focus to offending field4 s( Z( p" y1 I9 u; Q' U" ^' }
(mode_tile tile 3) ; Select offending text4 u, v* ?1 i( z6 ]8 o
(set_tile "error" errmsg)9 m5 E, K# k$ A/ \( x; m/ i
(setq errchk 1)' j4 L" ]3 O4 w. m& T' P8 P0 w
(setq last-tile tile): f- O1 S2 h1 v6 O
old-value
/ Q3 r' O1 _- ?: Q* }% T$ Z )
# w( A8 m3 r E2 G1 ^1 _ )
( {) V! r8 G b# g9 ] )2 ` @) g1 M7 P( D5 H8 E
;; Function for Xline coord edit box checking.
2 `, [( v+ e* \4 r8 W5 k! m (defun verify_xline (tile value old-value / coord valid errmsg)2 [1 S. _( w" s
(setq valid nil errmsg "Invalid input value.")/ \- z8 V+ U. L" R
(if (setq coord (distof value))8 ?; o, {. v* }6 F9 g$ q* E
(setq valid T)
: K/ R4 j$ `0 G6 O (setq valid nil)
& t2 D/ Y% x5 N) X )
% Q Z4 c7 T& k5 w9 ]4 q- N (if (and coord
4 ~- ]7 M( @; F9 Z2 s5 H (and (= (atof (get_tile "xline_x1")) (atof (get_tile "xline_x2")) )* e5 n' I& U5 _
(= (atof (get_tile "xline_y1")) (atof (get_tile "xline_y2")) )
s, |6 Z$ A) }% ] (= (atof (get_tile "xline_z1")) (atof (get_tile "xline_z2")) )
& w3 ^* x h' u6 e( C )
2 p. N- K# u! k+ y )
+ T& ~1 A: W4 g* w# T: M# ^ (progn
, ?& L H$ y& ?: I- m# n (setq errmsg7 P0 U% o/ {7 @5 [
"The Root point and the Second point cannot be equal.")9 s& G; g2 L+ K$ I' X
(setq valid nil)) s2 D% k& \" N0 N. h0 s
)
: }; f! \) B' T )
3 B% r0 [' O* v7 n9 c6 y (if valid
+ q6 \1 R$ c ]& }4 |* Y# Y (progn
# m4 Z p- Q; M/ H5 ^! O (if (or (= errchk 0) (= tile last-tile))- J6 H1 j0 g$ Y3 z
(set_tile "error" "")* h6 d* m! m, L) G4 _
)( r! N6 D7 y- `. X) M8 f
(set_tile tile (ai_rtos coord))
4 u1 u- n9 l: K* r6 p& h+ B' C (setq errchk 0)
9 P, }( i; w& w% }3 R (setq last-tile tile)
; b' y: `: G9 D( f. D8 f: a coord
' N9 N) T$ l. }2 ~0 w )/ J1 f5 }) U4 A) V+ T5 X5 E* l" V: ]
(progn
, L3 J1 P! d7 D* i5 J (mode_tile tile 2) ; Move focus to offending field
4 S# A+ n9 X) b% i (mode_tile tile 3) ; Select offending text i3 U- J" _, x0 L+ Q# t
(set_tile "error" errmsg)
, {) z3 ?' t2 G: G6 m) L8 o (setq errchk 1)0 ~2 E' E( {9 H7 W7 l2 U
(setq last-tile tile)
3 G v: E& ^' C7 @- [" o" p! E) X( e6 D) ` old-value. u( O7 \: I( y1 y4 T+ f+ b
)
* u' D0 i$ _" h6 w )
+ T8 [7 B( R) D. u- [; R3 R. ^ )
/ I! ?& V, J M P J) Q5 K9 m% ]! v3 C; L( c
;;
: d2 t% ?/ ]. J4 v2 ], ~8 a8 E ;; Verify angle function. This takes an angle and a tile name as arguments.% C! i6 ] q2 A
;; If the angle is valid, it returns the angle and resets the tile.% ]& {3 b4 s9 \% u
;; Otherwise, it sets the error tile and keeps focus on the tile.
( ?8 L6 z( p9 V$ }$ c ;;3 q. t) R3 n1 i3 w1 F, M v, x
(defun verify_a (tile value old-value / ang valid errmsg oblqmax)! V) }" ^0 c, h9 q- Z3 L$ S( P( @! ~; q
(setq valid nil
) m7 `1 F+ Y1 P9 y) t1 `( W. S# ~ errmsg "Illegal input value.", g$ W9 h' \3 E/ E0 q
)& q$ q% e$ c, X2 E3 L; P: d$ S
(if (setq ang (angtof value))
( v) _ k3 S8 p5 M: } ` (cond
% _# ~6 ~3 g9 @ ((= tile "obl") ; Restrict obliquing angle% q( A- {' c& `+ V3 e
(setq oblqmax (+ (* (/ PI 2.0) (/ 85.0 90.0)) 0.000001))
1 l7 c( _( u. E2 N. j9 T: o (if (or (<= ang oblqmax)
$ m4 @% y0 p3 J. A$ ^; T (>= ang (- (* 2.0 PI) oblqmax))
# G/ w. _1 u: t$ ]% J2 K2 R )
E! G; {5 m7 _) W7 F (setq valid T)
/ G" Y/ e6 B& n% z" o- N (setq errmsg
c5 C+ Q- V# z4 i "Value must be between -85 and +85 degrees.")$ C7 u3 K' m+ q, d- f
)
/ B/ z5 t# q# j3 e* g* y )! `7 e8 l& q% r6 |7 ?
(T (setq valid T)) ; Other angles not restricted$ l( M5 {& k/ U% S* L, a
)5 i) X, S% x. x* T" j9 d
(setq valid nil) ; Invalid angle input
" d7 a( }$ f' D; R# X )
; n `. _0 e6 u (if valid
) Y+ }3 H+ a9 ~6 F ] (progn
, ^; m6 b2 I* Z3 K% b# |4 i (if (or (= errchk 0) (= tile last-tile))( E& ?/ W. p ]1 }$ h
(set_tile "error" "")
3 L0 I$ q5 T' U )2 } [$ H9 K3 v* I$ L
(set_tile tile (ai_angtos ang))
1 _2 @ P3 N3 `! X; m+ l (setq errchk 0)" F9 [4 g5 q( } S8 u/ Q# B5 ?. m
(setq last-tile tile)
0 D& S* {$ M1 ~$ J, I! H ang+ Y7 s+ S- b2 ]; |* e3 U9 t; Y
)
" K% d' H: @$ K8 D4 ]' r. w. T (progn$ K1 t1 E5 l* r
(mode_tile tile 2) ; Move focus to offending field2 \) F* t* I0 V( M
(mode_tile tile 3) ; Select offending text5 Q5 I* P1 G4 d/ R/ ]$ e5 D6 @
(setq last-tile tile)
( y- Z2 H# S: b7 k& f7 D$ N$ c- H (setq errchk 1)+ U" J% X8 S- p! V# ]7 x) F
(set_tile "error" errmsg)
/ V$ h! Q: Q: T old-value: L2 {7 f7 h% ~+ R" x2 h
)7 n& L7 v. d' S- M
)1 V3 s& d. B; E( [0 i
)- Q) ^& {9 W& ]( c% e1 S
;;, s4 s( e& v& Y
;; Verify angle function. This takes an angle and a tile name as arguments.
c" ^1 b8 c1 |5 m, U$ R/ {6 q ;; If the angle is valid, it returns the angle and resets the tile.
, ^5 i4 m' w; t ;; Otherwise, it sets the error tile and keeps focus on the tile.
/ e9 e" Y- ^, b. P+ p- Z4 G ;; This function is specifically for the end angle of the ellipse object. If- P/ u+ k% ]" ]5 E: i4 [0 U
;; the end angle resolves to zero then we want to display it as 360.' q' i. G5 J9 f! T. b
;;
( \2 |8 f8 m0 d$ K (defun verify_ae (tile value old-value / ang tempend)5 V$ B5 _+ Q& H6 ?( Y! {) |) r
(if (setq ang (angtof value))( G: _# G+ w8 F# E
(progn
% g5 E2 ^ v+ [7 o (if (or (= errchk 0) (= tile last-tile))
* Q3 t; e; e1 Q6 D, D (set_tile "error" "")
% s8 O0 W; r/ w1 q: k/ Y+ E4 t+ ] )3 t5 i6 }/ b+ V, h! M: W; ~
(setq tempend (ai_angtos ang))5 Y; A) k! w8 ~$ Q
(if (= tempend "0")( P5 L# n0 i9 G' D% n/ u. \
(set_tile tile "360")
8 M* ^; I) `/ T (set_tile tile tempend)
4 P4 @. H( q" i7 E0 w& S )7 v, Y( z1 r1 T6 {6 f' R" }1 L
(setq errchk 0)
. H H, o5 `3 ^/ \ (setq last-tile tile)5 W+ [3 ]/ i3 v1 j
ang& v5 u7 W9 }. i3 e9 o# p6 I- g9 m+ W7 b
)! ]1 M! O1 [" U/ J' Z& I$ `
(progn
. M, f+ b0 d. p' v5 `9 U (mode_tile tile 2) ; Move focus to offending field
8 t1 J5 q" @7 V- P: u' ] Q (mode_tile tile 3) ; Select offending text
q& Q- r g: V7 f. v6 K" x (setq last-tile tile)! n/ T6 b C( H
(setq errchk 1)& J; E4 h* z4 b! M' O
(set_tile "error" "Illegal input value.")6 B% _% K$ h/ [/ T7 N9 j
old-value
5 k* o: j) x3 W0 x5 w" f )
. @! f* n1 _/ f )
# z4 ~# d$ ^# d0 _5 F8 w ); ?& T! U* Z7 |% D
;;% _2 s" a1 r/ o1 a1 M1 ]2 H" v
;; Verify integer function. This takes an integer and a tile name as
7 A# E! E' x; ^7 ]$ o! z ;; arguments. If the integer is valid, it returns the integer and resets the& u: u9 F, I, x8 m
;; tile. Otherwise, it sets the error tile and keeps focus on the tile.% ^' ?5 Y) g, k$ B3 R: D
;;5 c; E7 K& H# S3 n4 `
(defun verify_i (tile value old-value / int valid errmsg)3 d7 j0 Q0 G; `2 n
(setq valid nil). X$ c. ]' Y% V7 _: ^* o
(setq errmsg "Value must be an integer."). o- L: X% y9 V A7 O
(setq int (atoi value))
" j) a$ x% R& @& u" G4 o (if (setq intchk (distof value))
/ J& i: s/ C* `; i3 K (cond0 u: d) j2 g- k# C8 A3 `( @/ _
((or (= tile "columns") (= tile "rows"))
. m' K7 K2 w! U% R (if (and (= int intchk)
! m5 X( L: P0 k (>= int 0)
/ d3 M0 y, a- o5 q8 o; E (<= int 32767)
$ y2 U: e5 I, L( d5 V )
" M1 Z; z# h2 w1 M! U; R' v& x (setq valid T)
! O4 m/ e, `, g# r (setq errmsg "Value must be an integer between 0 and 32767.")
8 u P6 H1 _: W4 { ): k* t% S3 u Z* E9 W& D1 |$ W
)
. O, V# f( F* n ((and (or (= tile "u") (= tile "v")))
$ P* I% H$ R0 Y# J* s! s% \ (if (and (= int intchk)1 |4 L w- ^* U) S% O6 j2 U# O$ P
(>= int 0)
/ {, a# } y7 ~$ J9 Z/ U" A+ S (< int 201), }; c4 ?- @( p6 i6 f: w, D9 |8 r
)
3 m0 D' O! [" f1 G s! c (setq valid T)
{. ~- w1 y+ D/ j (setq errmsg "Value must be an integer between 0 and 200.")% @' h& h% V7 S( |. F8 r& ~' O
)- S! n% t. z; _! ? @5 Z% T
)$ e: @6 d1 c1 `" l' P) N; b6 U
)
" W- _4 d6 r1 P$ p4 g) j )
1 U2 }, F3 q) ?: D: W) k0 O; s (if valid7 g" t' a$ S, W' A! L( `* ~, q
(progn
' ~1 h7 }( Q7 v& i! T+ y" Y (if (or (= errchk 0) (= tile last-tile))
! ~3 o4 y# F9 V/ A; i+ ^. w (set_tile "error" "")* B& k1 _! \$ r+ e2 ~: |
)
% x3 z* L0 ?6 ~0 ?/ X" Q% @# l (set_tile tile (itoa int))
6 d9 m* f- a# b% J9 x7 f+ v; G; @8 y (setq errchk 0). j. Y: `0 L B, ~% b% d) q) P6 V
(setq last-tile tile)
& l% t/ p2 l, Z& z% n2 {7 ?9 v. X int
4 t; b' N; k z* T* U ), |$ u$ X6 W9 r# A
(progn) k# j0 D2 i- m3 `/ g4 Z& k# ~
(mode_tile tile 2) ; Move focus to offending field+ Q8 ~; I# e7 e z2 A1 F
(mode_tile tile 3) ; Select offending text1 J/ x: ^8 [; R
(set_tile "error" errmsg)
5 N8 X d. n: J7 S+ T (setq errchk 1)5 H9 w5 E h n: F+ O/ X
(setq last-tile tile)
: L+ J* }. b- B: l( x old-value
+ `% ]0 X2 o+ \ )3 J( q* q( x( B+ J2 |; K8 u
)
7 H! {. p& l L y! _ ) r; Q5 p- c8 h
;;- o1 M8 e `+ S* H, i0 I
;; Functions that verify tile values for integers. ]" h3 [4 Y4 ^( \) q
;;) V' {4 E l- r0 p
(defun ver_col (value): R, S: c# j+ y/ m, }( [
(setq columns (verify_i "columns" value columns))
# Z# j) a6 F* x+ c# m% A, F )- q, ?$ F; |5 ? L. {. G# I
(defun ver_row (value)
6 r2 u& H% R7 p, U (setq rows (verify_i "rows" value rows))
. a! M% G6 d& Z% g, W7 f )( P/ L0 [8 n+ C/ K# R- y6 P( q- |
(defun ver_u (value)
$ b& C1 h: x0 i9 m9 `! r% Z* H (setq u (verify_i "u" value u))% x6 Y% [3 J% Z2 ~( Z& Z. ^
)/ W- {" p8 W! ?
(defun ver_v (value)
% k, Q( Y6 I7 D" N (setq v (verify_i "v" value v))
# h, E$ x: ~' C! D: }* N2 ^) D )
' x6 r6 Q2 Q% M ;;6 x- v% l9 u& o" k* |% p
;; Functions that verify tile values for reals6 B8 [8 k1 I7 p3 D/ K8 u" Q% A( [
;;
- l$ N1 V; k. P6 u7 I (defun ver_x1 (value)
8 Q. j! J) W( l3 w" |) I5 Y (if (setq x1 (verify_d "x1_pt" value x1)) (calc))
! C e; y0 g1 M- g+ v )2 w; e; y1 _( x7 W9 I0 ~6 S: k1 g
(defun ver_y1 (value)
7 I `1 n, K5 ]1 o6 B. _5 g (if (setq y1 (verify_d "y1_pt" value y1)) (calc))/ ^5 K0 [! C) \9 g8 F- S
)
( {. p' P/ h" z* Q! } (defun ver_z1 (value)
: T; I# O/ A# M5 b2 w7 O0 C0 I (if (setq z1 (verify_d "z1_pt" value z1)) (calc))3 b5 K, o+ A" h$ A# M
)
* ^4 S7 z0 S+ B (defun ver_x2 (value)2 w" r# f( o0 t0 ]- \$ q+ a
(if (setq x2 (verify_d "x2_pt" value x2)) (calc))
! M/ \* b0 |2 m% } )
+ Z8 ]# }' R( A; \+ F2 g (defun ver_y2 (value)
: P+ c, j+ j- }. Y# X (if (setq y2 (verify_d "y2_pt" value y2)) (calc))9 q2 i7 g& _! B- s8 f' C: \" ?
)
9 y# ]1 H2 N2 s2 \: [; h& o (defun ver_z2 (value). F, b# F3 U0 U: s
(if (setq z2 (verify_d "z2_pt" value z2)) (calc))
, ^, K- i2 _4 g4 S )
0 @( M1 p) D% W0 q6 H: r (defun ver_x3 (value)
7 I; p3 |% S$ P; X (setq x3 (verify_d "x3_pt" value x3))- x8 S7 ]! Z% ?9 `& v% |3 m' t
)
) M, }- N( b, u9 W (defun ver_y3 (value)
3 W8 W; C6 c3 e9 p, s) S% l9 K' O (setq y3 (verify_d "y3_pt" value y3))8 W' d- T4 G& {/ I8 y* y9 |
)
& Y( n" ]' x# E (defun ver_z3 (value)
9 ^8 x. o) i0 h) J v3 f (setq z3 (verify_d "z3_pt" value z3))
0 w' o/ N0 X/ ]1 Z, m( h )+ ?6 p$ z' V4 O7 @ _- C1 S# h
(defun ver_x4 (value)& d% Z1 [0 ~; \( y. L& d
(setq x4 (verify_d "x4_pt" value x4))$ m: H0 q7 a2 J7 I
)
6 Q& i' ~9 r, J* }# \ (defun ver_y4 (value)
7 C d( t. b" B/ {2 Y. G" s. h& T0 E (setq y4 (verify_d "y4_pt" value y4))
' g# O* ~7 ~/ M# ~3 o, T3 M )
+ i4 w/ m3 W2 \; L9 W- e0 [" d! o9 c4 E (defun ver_4 (value)( Y' e/ D# j9 \& P4 ]2 V. V, h
(setq z4 (verify_d "z4_pt" value z4))
* ^) ~9 d _6 d0 V* E )1 h" R" T) \8 `# c+ i
(defun ver_xscl (value)/ Z" f* n+ u; v* b
(setq xscale (verify_d "xscale" value xscale))5 S' U# s) j: d
)
% R' Z0 ^" N8 C$ q0 L* _ (defun ver_yscl (value)# g7 O+ D% z% [$ Z- q" U7 w7 B
(setq yscale (verify_d "yscale" value yscale))
6 A& R0 Z9 P3 f )! O. v+ S2 @; ^2 _
(defun ver_zscl (value)3 M1 ^8 F. _$ |6 j7 q% s
(setq zscale (verify_d "zscale" value zscale))
8 m5 b: Q: {; K0 G% J/ v )
6 K9 m4 E" g {! ^; } (defun ver_colsp (value)
, G. v p) ^4 k A8 U9 U (setq col-sp (verify_d "col_sp" value col-sp))
9 z: N. z5 \1 X7 e )& a( ?, l6 i9 t3 ~
(defun ver_rowsp (value)/ {4 j B* b9 }
(setq row-sp (verify_d "row_sp" value row-sp))0 q7 v7 V( r( ^8 O4 Y; g3 e
)" d; ]. @- |. _4 w6 l+ Z! r
(defun xclip ()
+ E+ f3 Y6 E8 q- W; S (setq xclipmode t)
" Q9 |$ L0 g: g* G (if (= xcliponoff "1")
6 }( X; F, X% [% S |6 ? (command "_.xclip" (cdr(assoc -1 elist)) "" "_on")! r4 C- Z6 y- y* S7 }/ |( t2 t
(command "_.xclip" (cdr(assoc -1 elist)) "" "_off")
. v( x8 ~5 u: b q. k2 f2 W0 ^, V+ M )
2 q* t% G r/ E& `1 N! T )5 s+ f+ i% o- T7 i
(defun ver_rad (value)
s9 `8 Y% p6 s, V; }8 m" A (if (setq radius (verify_d "radius" value radius))
' |" w& J5 N" k4 L( G0 r (calc): c4 u; B& c' S3 g. M l
)
; B& a: P9 _. ~% Y )* ?1 h! }8 \' ~6 q; M1 w4 I
(defun ver_majrad (value)$ Y, K. r' v4 A @, U
(if (setq majrad (verify_d "majrad" value majrad))
' K. Q& s+ x$ @) D% G (ell_calc_newval "majrad")! d8 X: Y3 ^+ t+ n! P' m
)
7 ]* z2 V. A. S, Q )- A: Q. \( G0 ]% r
(defun ver_minrad (value)5 U9 F- f; i9 f0 C
(if (setq minrad (verify_d "minrad" value minrad))
4 M2 g& T3 F1 U (ell_calc_newval "minrad")
. V* c6 ~! s2 t )
/ @5 s* S! y6 ^$ j# X7 N )
" s; E) I! I% V, _0 y# S/ r! A8 N( } (defun ver_hght (value)
. Q$ D" j3 F( w3 N (setq hght (verify_d "hght" value hght))
: R! `: {1 q. p& n8 G$ n( O: v0 q: {/ C )
b4 w; K% D1 ^5 ~8 _# X1 r (defun ver_wid (value), I! M% u% A3 f# c& C& e
(setq wid (verify_d "wid" value wid))6 n1 P" B- p7 ~$ t6 {# t
)
+ w3 K5 Q* K1 ~ (defun ver_xline_x1 (value / temp)1 K; K( i* C; W3 I+ z
(setq temp xline_x1)
Y8 D7 a" |0 g: i B (setq xline_x1 (verify_xline "xline_x1" value xline_x1))8 [! Y# W6 C, O5 A
(if (/= temp xline_x1)
z. B0 }, r/ l (progn (modify_xline 0) (set_tile_dirv) )
8 O5 K ^$ ]4 Q8 w- Z; I5 u )
% Z* A! K9 \4 C9 \6 u )- }4 q8 f, U# a. j* T' z
(defun ver_xline_y1 (value / temp)$ }4 [: E5 V% ]; m7 m1 H! C
(setq temp xline_y1)! l4 N ^# {- A0 ]! _, u
(setq xline_y1 (verify_xline "xline_y1" value xline_y1))
4 E4 y# R, ^: _$ F" j (if (/= temp xline_y1)9 Q. X3 ~; x3 o3 }4 ?
(progn (modify_xline 0) (set_tile_dirv) )
/ p3 Z) m" I, c) ` )4 \6 o. L0 d! L0 m# m2 M! U! a* T3 q6 h
)
7 ~) K( q" d* e7 K3 U$ e7 S (defun ver_xline_z1 (value / temp)
* k7 h b& r2 O (setq temp xline_z1)5 z1 O v! a2 g8 t* V
(setq xline_z1 (verify_xline "xline_z1" value xline_z1))
+ n( z; _ f3 N( T9 E (if (/= temp xline_z1)
' g" `/ _8 O& T1 R9 H, h) y (progn (modify_xline 0) (set_tile_dirv) )
, n# U) @ t( z2 Y+ V& R% I- p& h& Z )" r$ f5 X) G K3 z% [. M
)- i1 g j) {( C9 m! Z. G q
(defun ver_xline_x2 (value / temp)
/ l6 M% [; Q" ?* N (setq temp xline_x2)9 D! t* T; h0 c: D# \$ i
(setq xline_x2 (verify_xline "xline_x2" value xline_x2))3 y w+ _; W5 k. k
(if (/= temp xline_x2)
* h+ J( [; c/ F) a (progn (modify_xline 0) (set_tile_dirv))
7 M$ N8 w" s" J3 A3 v8 n )
% v5 W* P- F" X! _5 ` )! I7 v' [9 w8 e- r6 ]$ u2 @
(defun ver_xline_y2 (value / temp); o% T8 X- X! g9 N3 [; u
(setq temp xline_y2)
. D8 O. g8 T3 o, c# U% Z, g/ [( {. K (setq xline_y2 (verify_xline "xline_y2" value xline_y2))6 l5 S8 r% A% I' T
(if (/= temp xline_y2)
2 @( g# J" X; @4 O0 Y (progn (modify_xline 0) (set_tile_dirv) )3 J( R. }+ |6 [0 q( r
)
. I" D$ P7 G( d+ @" K3 Q )
R Z- p" X9 o, \' W0 @ (defun ver_xline_z2 (value / temp)& s0 k: m6 A4 D4 O
(setq temp xline_z2): D% B+ q3 _( _7 x$ Y, d: d
(setq xline_z2 (verify_xline "xline_z2" value xline_z2)): k; i6 h% V% Q0 s/ d7 ]6 W
(if (/= temp xline_z2)
& R/ N6 ?; a6 H( _( ]0 t# p7 p7 ?- K (progn (modify_xline 0) (set_tile_dirv) )$ S+ u% [ J' A5 s
)
! ~3 H% `: a0 n) K8 w/ t+ K ) u7 V0 l2 L, Y$ k" H
;;" e6 a& Y+ d: d+ E+ g: Y
;; Functions that verify tile values for angles
2 U, e0 }& J9 v n3 z" w, f! e4 W ;;
! @5 @8 c6 k3 f8 \ (defun ver_ang1 (value)
' }# q3 X, V$ r9 P( L: q& M (if (setq st_ang (verify_a "st_ang" value st_ang))
# e7 w/ w2 t. |* s) H+ l (calc): e- n+ g% s/ [
)
" _$ K5 a9 u, u+ A4 Q$ {: v: J )7 X: _ R' {# U& q/ O- O& E
(defun ver_ang2 (value)
: ~( b* r# E8 z/ ^ (if (setq end_ang (verify_a "end_ang" value end_ang))
! W2 q- q e% ?" Y& J0 C- q% C% t (calc)3 S0 @9 M1 o1 V$ `' _
)
3 |) b3 u+ [* \* t )
" ^1 T2 G3 V3 K5 k6 p2 t3 Y! o ;;
9 q; |! ? i, V0 @ ;; Verify tile value for ellipse end angle. Handled slightly
: H+ Z7 D6 R: b7 }; K& l5 }" ] ;; differently than the other angles.
/ g6 c7 v# \5 V6 i# @4 U ;;' A2 A1 b$ U$ ]3 ]
(defun ver_eang (value)
" I+ c& _9 f0 ]1 r6 U( C$ F! o0 E (setq end_eang (verify_ae "end_eang" value end_eang))
) U& @ k2 C" H8 S- t; c )" S ] Y6 @3 Z4 v5 x+ S
(defun ver_rot (value)# ~) S3 J7 _# h7 T9 r/ U- V3 R
(setq rot (verify_a "rot" value rot))7 g- D5 L4 \; n% W( K
)9 a, `1 }6 |% f8 N+ n
(defun ver_obl (value)( j9 f( \% F& a2 P! g5 q; [
(setq obl (verify_a "obl" value obl))1 S: K4 M6 j# [5 Y) L
)5 ~, A6 E4 d5 K) W' R# y: c: g% V
;;5 D3 i/ _5 A& {- v1 C
;; Function that verifies attribute tag field for null string,% {# [9 u4 v0 r. L; \7 c! S
;; or a string that contains one or more spaces. Tile value% V- u% a: s" Q* n6 N; z
;; is also converted to upper-case as well.2 L: n+ _* z9 a/ [ I) B+ e
;;5 |3 w) {0 D `3 P) K
;;3 ~* n) n7 t% T
(defun ver_tag ( / tval)
$ T1 a9 `$ r. C2 `; O (setq tagval (get_tile "tag"))
6 b5 c" ^# g9 v5 a (set_tile "error" "")
3 O# R" Y7 v8 p9 S9 D% K (cond9 n# b! T- C# |4 S$ Y, z
( (or (eq "" (setq tval (strcase (ai_strtrim tagval)))): h$ R t$ a+ o* ?6 G M/ ~5 W I% g* ?
(wcmatch tval "* *"))2 u% S& a1 G1 T0 [
(set_tile "error" "Invalid attribute tag.")
5 n3 _& d( X, q- W5 ` (mode_tile "tag" 2)
% U1 c7 `3 a. D( u5 J& G (mode_tile "tag" 3))
: n$ k# @: J/ B- A (t (set_tile "error" "")
8 A, ?; t6 ^ w2 w! g2 z (set_tile "tag" tval)
. X1 A& y4 ]0 | (setq attag tval)))
- ~! v: o+ O: E) i8 L6 c! O )
+ F K( A# Y& ^1 F& v0 @0 {* r ;;
% V; B! v' y" X0 o ;; Calculation functions# }3 P, g- R4 P+ ]2 T6 T' L# E
;;
3 z6 T. t" x4 x" c3 _) ~1 e/ R (defun calc ()
4 o* r/ d4 ?! v* O1 o1 [& Q (if (= etype "LINE") (line_calc))
* b/ V: k$ x8 j5 e/ u; `; Z1 h9 }% Y (if (= etype "ARC") (arc_calc))
# P5 u9 ?& b, Y: O2 o (if (= etype "CIRCLE") (cir_calc))
. `& s% g9 y, f )8 j0 ]2 E/ n- h3 X
;;
. F' W* y; E' Y! r0 [. o ;; Calculation functions for lines, arcs, and circles5 F" _4 E% S. Z7 b0 U* _; l
;;
4 ` p8 }5 v5 J& K (defun line_calc ()( v1 X$ ~7 R9 U' r
(setq stpt (list x1 y1 z1))
% S1 \7 W$ T! f" {( N (setq endpt (list x2 y2 z2))8 N2 p( S$ N8 R
(set_tile "delta_x" (rtos (- x2 x1)))
) r, |) G3 s$ M) l (set_tile "delta_y" (rtos (- y2 y1)))+ v1 c# a' w. y4 t6 f
(set_tile "delta_z" (rtos (- z2 z1)))
% O6 _! ]8 b) m4 f (set_tile "l_length" (rtos (distance stpt endpt)))
; e* `4 U7 l5 s (set_tile "l_angle" (angtos (angle stpt endpt)))- F/ y( z+ T2 @0 H% {6 V% [8 P
)& W2 T: |# l% h
1 T/ s) @$ C: L% {* Z
(defun cir_calc ( / area units)+ G+ r1 k- S$ H$ V9 N T7 v/ H+ r
(setq radtest radius)
O- [6 O# _; P# Q1 `/ i (set_tile "Dia" (rtos (* 2 radius)))
/ E! ~$ P7 l/ A9 P' |- c: M (set_tile "Circum" (rtos (* 2 pi radius)))4 }8 p0 q2 `5 w- }* `& A' k
(setq area (* pi (* radius radius)))2 T: a% Z/ N/ G5 u' J" T4 u, G
(setq units (getvar "LUNITS")) \1 o& R Y. a' m) I7 I5 a L7 A
(if (or (= units 3) (= units 4))- ^) O) I9 I& a; \" B- a
(progn
4 s" `2 \8 S" C1 e. m2 f (setq area (/ area 144.0))
2 ?0 ~3 y# d" Y+ p/ v (set_tile "Area" (strcat (rtos area 2) " square ft"))
6 D' A, v0 s% f )2 p* W6 ]& n, a# g0 j- G9 W
(set_tile "Area" (rtos area))
$ G1 T* H! {! A" t2 U0 }: g ) \7 p- G1 A+ Z" @, u5 |
)
) R9 H# j7 u+ M0 B& V/ z, D/ o: E5 f/ C! u! f6 N; ?
(defun arc_calc ()# l! g& _5 h. J7 m. d- Q
(setq totang (- end_ang st_ang))! y: ?. `" I* Z4 ]0 p" W
(while (< totang 0)
1 x: c: s; Y9 K0 Z A9 E, @& d (setq totang (+ totang (* 2 pi)))
5 L9 @( ?1 X- I0 Y0 V8 `3 B )4 ]; z. V6 J9 k$ G# O6 m; \
(while (> totang (* 2 pi))
0 O }+ _! N' Q" ?* R2 ~3 X (setq totang (- totang (* 2 pi)))
7 i, e3 l3 g& O+ N: l5 J! [ )
" M4 u Z7 j9 g+ u G (set_tile "tot_angle" (angtos totang))+ _+ ?/ [/ x+ `5 u, |' C
(setq arclen (* (* 2 pi radius) (/ totang (* 2 pi))))& C# F, I/ W% e* W, K- O7 z, m
(set_tile "arclen" (rtos arclen)); b5 q q3 e1 b2 l$ e2 @6 h. B
)2 f1 w) u2 ~* q) A- i( J
;;
: m7 [ s1 v1 P& U) c ;; Calculate the major radius, minor radius, major axis direction.( D+ X, {' w. w
;; Get radius ratio. Convert Start, end parameters to start and end
: [2 G5 C, l7 ~ ;; angles. Save Major Radius value in "old_majrad" in case the user; v+ C' e' B' I& H( [7 S
;; chooses to input a new Major Radius value later. It's needed to
( R* `+ ]# y3 ^5 F ;; calculate a new Major Axis Vector value. [/ F- y( B& n
;;' k% b: a' W2 t$ _: S
(defun ell_calc (). q* O! m- m1 o5 E0 P% V
;; Get major radius from the major axis vector.
. s2 }2 N6 c* s/ j9 X, N (setq majaxis (cdr (assoc 11 elist)))8 B, R4 P" S* e* v3 e
(setq xx (car majaxis))
, O) q, ?6 ~2 u' Z (setq yy (cadr majaxis))0 K d5 {; g/ v: E( Q7 i
(setq zz (caddr majaxis))4 |. c8 a2 G, Q2 V& t+ Q7 \
(setq majrad (sqrt (+ (* xx xx) (* yy yy) (* zz zz) )))
% ]- n: O& i+ @9 ~2 X- L H (set_tile "majrad" (ai_rtos majrad))( l' M) ]1 v. q$ }; m) g0 f" }
(setq old_majrad majrad)! t: J, A- d4 F9 f$ s# ^
;; Get radius ratio
: b5 h& O T2 e0 ]/ ~4 K (setq rrat (cdr (assoc 40 elist)))
H, M; ?5 O! s" `3 {. s- V4 Y (set_tile "rratio" (rtos rrat))* D1 e* A% m0 { P4 a2 F# y
;; Calculate minor radius! ^/ B0 o. d4 \, j' |! |9 l
(setq minrad (* majrad rrat)), O2 L9 x( a: Y( {
(set_tile "minrad" (ai_rtos minrad))
7 g; t6 E# Q$ u+ Q2 _9 N2 @' Q4 E5 R ;; display major axis vector
7 J! ~ f d j6 G( T (set_tile "Majraddirx" (rtos xx))/ E" F/ S+ H/ s0 j
(set_tile "Majraddiry" (rtos yy)); G* Y7 [6 D1 B) ~
(set_tile "Majraddirz" (rtos zz))
; e9 I! a7 H. J3 C( B
7 T4 a3 w% p2 P% k0 W/ F ;; Convert start parm to start angle
1 B' g! a# M9 I% h3 A (setq stparm (cdr (assoc 41 elist)))3 N' o! Z/ X* e+ a9 x
(setq vecx (cos stparm))0 u% i6 R+ v. [6 p; P
(setq vecy (sin stparm))+ u' v8 h% a; ~8 Y2 }
(setq st_ang (atan (* rrat vecy) vecx))
# ^$ f6 H3 |8 a9 W/ W (setq tempst_ang (ai_angtos st_ang))
% x# S) G, C5 U s( G (set_tile "st_ang" tempst_ang)* d6 ], S# S' R: X2 ~
;; Convert end parm to end angle. If end angle evaluates to 04 u7 [( N/ K' ~
;; degrees then display it as 360 degrees.# W7 L7 a8 V7 ]# v! u3 j3 f( U
(setq endparm (cdr (assoc 42 elist)))0 z% `2 E) T- [: k5 p
(setq evecx (cos endparm))5 s1 y8 k! A# i- S9 N
(setq evecy (sin endparm))& Q1 E" D2 ~$ e+ a: W# a0 ]
(setq end_eang (atan (* rrat evecy) evecx))
z2 a4 J) {( s' N" ^6 p (setq tempend_eang (ai_angtos end_eang))& c8 A& L! Y0 y1 w& N
(if (= tempend_eang "0")
9 y+ w, k7 D2 A: T" q* \; b# J( } (set_tile "end_eang" "360")
1 |$ n3 c: W; g (set_tile "end_eang" tempend_eang)
- S' l8 H9 ^/ h0 m )
0 u, Z1 t, S o2 f; w( b, _ ;; Get area of the ellipse.: I& t7 A. l [$ q0 @# c: e, _" c" a
(ell_calc_area)
. B8 v7 N5 x* W. \1 g )) `" {4 j- e2 g% L
;; Calculate area of ellipse. If it is an arc then
5 C- _: f: w; [; l ;; grey out area display., t" E# o( V& S7 e* v, {- n) f6 S
;;
4 A* W4 `' @. m) X% z6 B8 C (defun ell_calc_area ( / area units)
! {6 g% X: ]! W4 ~% j9 N3 T (if (and (= tempst_ang "0") (= tempend_eang "0"))
" U$ W2 t! O. k' } (progn" U9 u& x4 w1 k9 C: c4 Z) [0 U
(setq area (* pi majrad minrad))
' H8 d( U. z! { (setq units (getvar "LUNITS"))" t1 F5 }6 u4 g, ?' v9 ]3 u
(if (or (= units 3) (= units 4))
- [! d& ?* C4 H (progn4 E4 c% z$ ~) J G( H. s1 W& r
(setq area (/ area 144.0))7 h# k# o2 F0 X2 m) X4 T( A
(set_tile "Area" (strcat (rtos area 2)" square ft"))7 H; M$ y6 p( K3 x1 H* y. w
)
8 j$ R+ Q1 g" o) f& z- n% u- r/ ~ (set_tile "Area" (rtos area))
7 h7 J: p5 f6 a, u8 h )
. m9 q$ y$ B3 ]; d )
/ ^$ l) z# Y3 \* r/ c% w$ y (mode_tile "Area_text" 1)
5 U2 B! A# J0 J& l )
, M2 i- D% m1 K' f )
; A, u5 t- X* H, Y5 Q ;;1 o4 Y1 c$ w4 }2 R9 G6 l7 X
;; Calculate new values for ELLIPSE
" n* {. g; k8 B" W7 g ;; Minor Radius, Area! A$ t( O% x2 _! B# e0 ^% q' L
;;
' ?, v. j: n, u. x5 {+ r; e& O (defun ell_calc_newval (ell_tile) L+ E2 V ~! P6 U
(if (= ell_tile "majrad")
" h/ @1 G8 f, N (progn% K' A9 \! k; L$ s
(setq rrat (/ minrad majrad))
0 \+ z- W! M5 k: j (set_tile "rratio" (rtos rrat))
, [( |- q3 y# m5 f+ H' @+ |! r (ell_calc_area)
2 T/ X/ [" G/ K0 \1 w; d )
/ U4 f! `" Q& V1 R0 t: G )% a; ]/ C3 d' w( w( f" B6 F
(if (= ell_tile "minrad")) J9 s' c$ @1 p, Q0 L
(progn
k; R, O# H# ^ (setq rrat (/ minrad majrad))
$ f* N7 ]4 M9 c; c) q# } (set_tile "rratio" (rtos rrat))/ f$ p/ e, Y0 r9 I8 J
(ell_calc_area)
5 w! T+ P5 X: ?% b3 h; K- K )
+ o+ C; [7 L0 \" D/ Y )6 \7 i* v5 e! l8 G2 A4 B
)# n% I7 c4 }# V1 x" [
+ Z5 e8 X" l2 j (defun set_dimen_props (/ loop a stl txstyname)( j% A9 c, {' {; u$ ~% A. ?' h1 D3 P
) [# Q3 }2 P' s) h- d( ] (setq stname (cdr (assoc 3 elist)) ; get style name: `2 w9 @/ R H9 Q" P5 n
stl (tblnext "DIMSTYLE" T)
4 s8 F+ |5 X: l% Z( r6 Q stlist nil)8 u7 \8 p9 G, d) U) _. z
;; Get all style names and list them in alphabetical order
$ s6 |( n# i1 b4 ^3 u* m (while stl
& T8 K3 g0 p* W8 K (setq sname (cdr (assoc 2 stl)))7 R5 b- Q0 t: M( h) E4 g
(if (/= (logand 16 (cdr (assoc 70 stl))) 16)
8 \5 Q( L5 H4 ^& s8 S2 }, K (setq stlist (cons sname stlist)))
9 C \5 m4 ]0 D (setq stl (tblnext "DIMSTYLE")))7 m# B, \" E9 {- Q: s5 l
. d9 x& x+ w& K
(setq len (length stlist)
' s! Q1 I3 r, b3 U3 S loop 0
0 w9 Z E1 a/ Q) U dimsty stname
! t; B. o% S7 r; B4 A2 h4 {. [ )" W- j9 @2 q/ @
1 k2 n/ s) x( |( E5 i ;; alphabetize style list, depending on maxsort
: p% E+ n" h6 k! d1 o, R) w* ~& f (if (>= (getvar "maxsort") len)
7 e. E/ T, |/ ~2 k2 d" t& \ (setq stlist (acad_strlsort stlist))
/ ^0 B& R {+ V# k' X (setq stlist (reverse stlist)))# y/ R3 }; z$ Z: R6 @
8 a2 i3 V; x0 }
; *UNNAMED style (dimsty = nil at this point) is replaced with
9 Q/ t' q o4 i- `! h' A1 C- ` ; the current style. After R13, we require dimensiosn to have a: k* v8 n. X* z+ T& A& W9 h
; dimstyle, so we plug any holes where we find them.7 m8 |3 V H; e; ~$ A6 j) z
(if (null dimsty)
+ u7 m( O2 n- \2 a. x O' F; N4 z! Y (setq dimsty (getvar "dimstyle"))
5 n% O& A+ B; z$ \5 v! g )
/ A/ b, d9 F/ x9 t: p; C ; Show the styles in combo box1 C; H/ O+ n) s) Z
(start_list "mod_style" 2)0 N+ e6 I! M9 v* t3 P% N
(while (< loop len)
, o( E# S9 c" t0 O; V (add_list (nth loop stlist))# E1 G& R# `+ b) g, o, @
(setq loop (1+ loop))# ^* `' c* J, T, \! M
)
) C% P4 }4 Q7 J/ @$ K9 d$ p6 R; q% E1 G0 P2 C: _0 U
(end_list)
# J" ~# x- ?- P3 C( `1 ]9 |) R; z: C, c. E _9 V" ^+ y1 l
; Hilight the style name of the selected entity3 K8 `" p- c, D
(while (and (< 0 loop) (/= dimsty (nth loop stlist)))" J" Q0 T2 p# |% v
(setq loop (1- loop))' _ y: z$ M0 x4 }+ A. |
)
8 K, E2 z. Q6 Q- H6 z. @, E& S (set_tile "mod_style" (itoa loop))9 W! P7 ~% e1 ]" }6 J
7 J) j; H6 g8 s- a ; The following is the list dimvars. It must be sorted in the same
8 @+ u6 n$ l/ T7 |' n ; order as the resfub returned from DDIM (ADS module).' J9 {% c' L* v
6 Y% f: ?6 z& @3 a* ?5 g5 [ (setq dimtbl (list "DIMSTYLE" "Style name" "Standard flag values"
; b9 ?- o' ^: F7 a% p8 d "dimpost" "dimapost" "dimblk" "dimblk1" "dimblk2"
5 c4 Q* F0 C/ j, P3 r! ~ T! P "dimscale" "dimasz" "dimexo" "dimdli" "dimexe"/ c. m( X6 B3 @7 l4 a3 e2 f" U
"dimrnd" "dimdle" "dimtp" "dimtm" "dimtxt"
' g7 G! A z9 D1 x* t "dimcen" "dimtsz" "dimaltf" "dimlfac" "dimtvp"2 s- t* q8 E8 Z1 G% C
"dimtfac" "dimgap" "dimtol" "dimlim" "dimtih"2 s! J7 C( v. j, o: P
"dimtoh" "dimse1" "dimse2" "dimtad" "dimzin"% e7 a+ B Q u3 B
"dimalt" "dimaltd" "dimtofl" "dimsah" "dimtix"
Y2 z+ \; t- e. U/ H "dimsoxd" "dimclrd" "dimclre" "dimclrt" "dimunit"% v7 M; [5 U0 t* ?) o
"dimdec" "dimtdec" "dimaltu" "dimalttd"8 K8 M7 N/ _7 A1 G# i' H5 i$ \
"dimaunit" "dimjust" "dimsd1" "dimsd2" "dimtolj"
/ {+ O. ?0 g! @( U- w "dimtzin" "dimaltz" "dimalttz" "dimfit" "dimupt"0 k/ ~( |% a# s( M$ s2 E
"dimtxsty". [1 c v; o2 A* b3 n+ y
))) N( ~" L0 x* t* r Q3 i; C
(progn+ E: H" a9 ~; p' N. k1 q0 e4 l
(setq sv_dvlist (ddimen_getostate dimsty)
* `) o. o, ` e4 |3 i txstyname (assoc 340 sv_dvlist)
9 R+ v0 N9 u1 Q! W8 u9 s5 O7 n sv_dvlist (subst (cons 340 (tblobjname "STYLE" (cdr txstyname)))3 X/ o# w F5 d6 @) r' V% J
txstyname sv_dvlist)0 E3 M5 S8 |" U! A: Z- }+ `
dimlist sv_dvlist
9 D7 S6 }& l( G8 l' s8 p0 N% e )
4 ?8 m0 G0 Q; t3 w! [& ~8 S )
8 ] x& @4 e# p% n) _/ N (if (= dimtype "DDLEADER")
0 B$ B9 j' W" X- }. g0 v. G* Q8 @( B. F (mode_tile "mod_format" 1)
1 [* W* H/ G( t )
R E) l6 z4 P$ X" Q6 } (action_tile "mod_style" "(setq dimsty (ddimen_style))")
3 T6 N* L2 Z- A# { (action_tile "mod_text" "(done_dialog 4)")
! J" m% O) A# V+ X) J- A3 Q- C (action_tile "mod_geom" "(setq dimlist (ddimen_dlg dimtype 11 dimsty dimlist))")1 h% S1 }6 ` F3 g1 ~
(action_tile "mod_format" "(setq dimlist (ddimen_dlg dimtype 12 dimsty dimlist))")
% z; y |* B; T3 [. D (action_tile "mod_annot" "(setq dimlist (ddimen_dlg dimtype 13 dimsty dimlist))") N& l# s! J8 s/ j S! ?7 M
(action_tile "accept" "(done_dialog 1)")- J8 m& X' e. V8 C8 E2 z0 H) M+ ]5 N
)
7 |# K0 C3 ?* }3 r ;;7 T/ y9 J* T: w
;; Get dimvars that have been restored.
. A- R9 Q; ]8 c; c ;;
5 s: d; O6 O" L. [- b8 P (defun ddimen_getvars (/ elm dvlist dv i)' K5 ?7 O3 [8 w
(setq i 3: I2 B" i. K7 m8 p1 t
dvlist (list (cons 0 "DIMSTYLE")
D; B* \7 I, Y+ v& H (cons 2 (getvar "dimstyle")) (cons 70 0))( {" X) U, J1 ?8 F
)+ o' H) q# L# M2 ]* i- b" S# _7 t+ K# _
(while (setq dv (nth i dimtbl))
* h- F- d$ q* x6 [5 Y( L" t (setq elm (getvar dv)8 K" U- H1 F: X8 D6 U- h- z
dvlist (append dvlist (list (cons dv elm)))
8 Y- `* A! r) ` i (1+ i)
, i0 ]; d- U& O )8 i Q9 b' T3 H- |
)& D' w. l4 a" c
dvlist
( \/ W: w& U1 q2 [ )/ S: l$ @4 s. Z" e2 J. u+ ? r
. }0 U3 F! @8 e4 A% ^$ `" [7 P
;;
5 I$ y1 t: Q: M+ N; D" x6 S ;; Get the original states of dimvars. This is for DIMENSION entities.$ `2 H' ] B, |- X4 G/ N$ i
;;
" e. X# j" s. k% a (defun ddimen_getostate (dimsty / dvlist elm i dvvars)
% o4 `, S8 s! x; r2 R t (setq dvlist (tblnext "dimstyle" T) ; Get a skelton list0 r6 H% Q8 a( p) i4 p( x# g
dvvars (ddimen_getvars) ; Get dimvars for that entity
# K6 q/ U- q( y$ A$ s+ m) C& g: m i 1: t' J' _/ A: H
)
( Y H) a& C5 d1 n4 h2 ~) u- U) ~/ k: Q7 s( q4 j. C
; Create a list that contains values of the selected entity.# D1 F* b% d7 f9 a9 f
* t! q' u* |5 K$ p: ^4 c, ?6 E4 O (while (setq elm (nth i dvlist))( T) K# h5 T/ {& |& I& l/ \
(setq dvlist (subst (cons (car elm) (cdr (nth i dvvars))) elm dvlist)
6 j2 s: c) N. f9 r( M i (1+ i)$ {! W9 O) w H' E7 U; @1 z
)
& A1 [( j8 K! {: u+ s )
/ Y1 b2 A' `3 h j6 k dvlist
5 k* T/ c1 d8 ]3 W& n- }. v )3 t$ k2 o$ i* t: { `& p1 b6 c% k! Z
5 M$ u) H+ h5 R! X
;;! x# s+ }. ~) g, w1 q0 j
;; Restores dimvars of the selected enity., u p! P5 p* a; Q
;;
" f, k( X1 N* {. m8 C (defun ddimen_dimsty_restore(/ dimtbl dimsvcurset en)
" \- v% X/ P! \; o (setq dimtbl (list "DIMSTYLE" "Style name" "Standard flag values"
' e) h0 [3 h7 P2 I* q7 h# { "dimpost" "dimapost" "dimblk" "dimblk1" "dimblk2"
- b( t3 q' V/ n7 X" r0 h9 B7 E "dimscale" "dimasz" "dimexo" "dimdli" "dimexe"6 @( @! ?6 W& u3 `$ F, H) t0 Z
"dimrnd" "dimdle" "dimtp" "dimtm" "dimtxt"0 w2 N) L/ F3 s: D: e% y3 ? f
"dimcen" "dimtsz" "dimaltf" "dimlfac" "dimtvp"
" N% I% H$ E6 s' D# U "dimtfac" "dimgap" "dimtol" "dimlim" "dimtih"
0 D9 H& H, G u1 Y. s+ ~/ N "dimtoh" "dimse1" "dimse2" "dimtad" "dimzin"
- k% f- u3 p& U! f: @3 o "dimalt" "dimaltd" "dimtofl" "dimsah" "dimtix"# _$ Y) P. x( H1 t/ m/ _6 s
"dimsoxd" "dimclrd" "dimclre" "dimclrt" "dimunit"; E& _/ v8 b, b% a4 {& S4 F
"dimdec" "dimtdec" "dimaltu" "dimalttd"
7 S" z* E, S0 g3 C. `5 y "dimaunit" "dimjust" "dimsd1" "dimsd2" "dimtolj"
5 b# L5 D7 F6 ?7 p1 _. k, _ "dimtzin" "dimaltz" "dimalttz" "dimfit" "dimupt"" A {4 {/ z. @/ S& G
"dimtxsty"- ~% P3 w* m( C4 g1 A
))
o0 b$ s( H5 q9 y! p- B3 ~ (setq dimsvcurset (ddimen_getvars)) ; Save current variable settings
, a3 [3 |4 F- L P# t) p (progn5 U D9 \: L9 \( ~2 B# v7 D
(setq en (cdr (assoc -1 elist)))
1 q! o! y+ A+ a- s$ i7 i, ^ (command "_.dimstyle" "" "" en)
3 W4 k. o9 d8 u( b9 B4 }+ f' _ )2 d- M0 W: y6 z( ^3 M8 q, L
dimsvcurset+ x( A& E7 s8 L: `) w# Y) }
)
2 ?% G4 L2 ?1 m: U; r0 v1 o- j# [% l ;;: m% r. q1 V, z
;; Modify Leader9 }8 j: _0 w8 M1 X% E# R1 O
;;+ H+ E/ @0 _+ l( X
(defun ddleader (/ dtypebit blkname bename sublist a stname n dimtbl ^* U. y4 ]2 T
dimsty dimlist dimtext svtext dimovr sv_dvlist stlist+ A7 i) F/ m1 K2 v
dimtype dimsvcurset)
7 |) I' R+ U7 e1 i4 e6 F (setq dimtype "DDLEADER" S1 G1 R! g |7 }! a, Y/ g( ?
dimsvcurset (ddimen_dimsty_restore)
+ E0 @/ S# B9 q: E) {# u$ V& a" Q )# i( K) T5 f* P6 X r
(if (not (new_dialog "ddleader" dcl_id)) (exit))
! F7 N! i8 S1 N! l; O/ _ ;; Set initial tile values4 G" u4 r: U/ P" a6 |' G
(set_tile_props)% Q* y; z* [$ N* [5 X- Z: j1 r
(set_dimen_props)5 q3 t& H( { G: _' o a! {4 n) ~; u# t
(set_tile_handle)
; `5 R% p8 F ^: u3 e! c ;; Define action for tiles& m9 R; t$ e- \( |+ @5 E# f
(set_action_tiles)
+ w' S5 a( F! q, n1 Q6 { (mode_tile "mod_text" 1)0 w# w$ D& `$ ~- F' ]* f9 d* o
* }: q4 f( F, A& h( n (action_tile "mod_style" "(setq dimsty (ddimen_style))"), y5 K" y9 Z# X4 ?3 i- `
(action_tile "accept" "(setq leadtype (get_tile \"s-s\"))(setq arrow (get_tile \"arrow\"))(done_dialog 1)")5 x0 O0 C% M5 l; M- i" W
;; Get ARROW and TYPE.
# w" O: w @0 N. t, ~3 } (if (= 1 (logand (cdr (assoc '71 elist)))) (set_tile "arrow" "1"))) K& s0 W) x s2 K# ~. _
(if (= 1 (logand (cdr (assoc '72 elist))))
* Z% h/ o7 O) K# E0 P8 j" i0 L4 Q (set_tile "s-s" "spline")
# M& v- e h+ B1 G7 G" V- v) a' ^ (set_tile "s-s" "straight")
0 D& U; p$ k2 p5 T4 P* t )
3 K# b2 O+ u/ v- h4 Z ;; Start the dialogue.
9 s" |5 E' ?4 z1 z# F: U (setq dialog-state (start_dialog))' t- I( G7 F6 B# Y
(if (= dialog-state 1)
: y' u/ ]/ |* w. ]+ @ (progn
& J7 T' Z/ |/ U& E( f/ c9 c3 _# ]+ N ;; update the style1 j* v9 p$ _ m% i# S5 C0 H* ~) R
(if (/= dimsty stname)
^0 |- l8 f" A2 T (progn
# B) {' M( c' K9 x, `6 W ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case- _0 G& J$ A8 v& i5 b* Z9 z8 d" t2 u
; doesn't have it.
3 L: X0 f. ]& \- @; t1 a1 c s (if (null (assoc 3 elist))7 K. L" \- r* I/ Q
(setq elist (append elist (list (cons 3 dimsty))))
: T0 H# [4 \8 K# k ; else just replace it.
5 h- x9 {* e' L) n& U) l (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
' c$ R& H) k8 @2 s* F/ C! `7 a )
: H" v+ t- G% z3 W ; refresh sv_dvlist with new dimstyle.
! w8 L. a8 j" `; P" A0 X (setq sv_dvlist (tblsearch "dimstyle" dimsty))
~( a6 o9 e2 j7 b )0 w6 R/ Q/ d6 X2 @2 t
)
2 }, h' B: B, |- R; M% I (if (not (null dimlist)) ; attempted to change dimvars; Y, [3 |. u T
(ddimen_complist sv_dvlist dimlist dimtbl)
7 R6 T3 [. o; _ )
) j) N) O, d% O9 Q. d( Y ;; update for ARROW.3 h' e4 i( Z9 @) w' e. Z- v
(if (= "1" arrow)
5 Q: S) o( Z) k) E0 R0 e (setq elist (subst (cons 71 (logior 1 (cdr (assoc 71 elist)))) (assoc 71 elist) elist))% u5 ~; r3 b5 j/ I; a
(setq elist (subst (cons 71 (logand (~ 1) (cdr (assoc 71 elist)))) (assoc 71 elist) elist))9 m3 [7 f2 {# j1 c' s$ @# J
)
4 D( k: X& G3 S. o ;; update the TYPE.7 ^) z7 D( _1 e) r- S* K- [6 C2 H
(if (= "spline" leadtype), u& P# ?2 a U
(setq elist (subst (cons 72 (logior 1 (cdr (assoc 72 elist)))) (assoc 72 elist) elist)) Y* K& L* @& J3 c; i5 M1 E
(setq elist (subst (cons 72 (logand (~ 1) (cdr (assoc 72 elist)))) (assoc 72 elist) elist))
- A0 f/ V. }) J: t )+ l6 T* J M0 P, B P0 J
(modify_prop_geom)0 O* r \# e9 H5 G* f4 o( G3 W
;; update the Color' x, \( M( @# k& I7 P' j5 h& V
(setq elist (subst (cons 77 ecolor) (assoc 77 elist) elist)). s( t8 C7 M" D
(entmod elist)0 {6 _" l# N( m% s4 _ B
)6 G' h6 O' T% y: u8 e5 ^* G; _7 M
)
, c. V x" m/ e9 f: o (ddimen_setvars dimsvcurset) ; Prepare to exit8 G) h1 `5 S% X5 R {" _3 E4 n
)
6 `' i5 ]. K; E6 {& A) {) V8 R: @& O$ L2 G1 n- w
;;% E0 ~% {# Y# D. T% t5 p) Z( V' t7 L
;; Get dimvars of a dimstyle with overrides.
4 M# y1 T* p; f" s- c ;;
8 o' P7 B u6 [0 P+ w
$ _5 X5 ?6 I4 A" ^" ? (defun ddimen_getdimvars (dimsty / dimovr dvlist elm i) Y+ M6 `7 M, k2 Z; ?+ D
6 e m' R" \& }% V) Y% \' N, A/ A3 i ;; Get override information for the specified entity.
$ f( x: z9 u t& X1 X9 l. U8 M ;; Leader/Tolerance cannot be restored by DIMSTYLE command, so we
; {; @- s' B8 ]# o* n" V, x ;; must obtain override information through this tedious operation.
* k. x, q9 m% h9 \( a* ?' d (setq dimovr (car (cdr (assoc -3 (entget (cdr (assoc -1 elist)) (list "*")))))) b5 f3 l6 C* s! ~
dvlist (tblsearch "dimstyle" dimsty)
9 x5 \8 Q: B2 Y# B i 2( O) \3 n9 {0 _8 W/ y; S* w
)
' {! l* S* {0 Z; O/ G. ]9 O" V* h. B" m! h9 _5 ^2 A' p1 m( c6 ^/ D5 m
; Update the list with overrides if overrides exist.
1 P2 @! Q2 b3 x* r0 F) S) u) X" D7 Y: I7 f9 {& k; R i! A* C4 V; H
(if (and dimovr (= "DSTYLE" (cdr (nth 1 dimovr))))! k, R4 b8 S1 s5 w6 e+ c9 l0 v' W
(progn
$ l# g x+ x0 h* m! a* _- d (while (setq elm (cdr (nth i dimovr)))8 O- a4 m9 b! `" t% b3 b2 L
(progn
3 O$ @$ I, t7 X; i9 \" l (if (or (= elm "{") (= elm "}"))
; B/ }) A( N& `' U- e; @ (setq i (1+ i)) z, x. j: p0 R! F5 B2 O
(progn
7 P0 u6 ~3 t" V/ z1 m5 p (if (or (and (< 180 elm)
- q' E2 T5 a+ G2 k0 ] (< elm 190)0 O5 d3 R" H: y. w0 }
)
6 ?) ]6 H. ~8 }2 o; J7 m (and (< 80 elm)
9 F$ W g" [/ P P (< elm 90)0 K! H$ k" a# s" o; p
)6 J7 \4 {& g: @2 M) h6 y& V
)- Q4 g2 u% q- x) e% C6 W
(setq elm (- elm 10))
6 c6 S6 ?4 B& N )* y. e* o! ~' y0 b3 V& x; e( E
(setq i (1+ i)
v8 R. _% d& p* O4 k elm (cons elm (cdr (nth i dimovr))), o8 d5 Q2 c: P4 T( L* ? ~
dvlist (subst elm (assoc (car elm) dvlist) dvlist)
! p% V0 }6 ~, V* R6 N i (1+ i)! w( q6 I+ N2 @. E7 ^
)
+ f' {2 A. {1 l' i, B" w+ G, z )
7 }" }7 c: U' O! p )
; v9 i: Y) I- }1 }8 T )
6 f6 u2 L# N2 U )
* O U) @8 w$ D o6 L )
& a( z4 Y j! G: B, b* P )% {% ]6 I! N/ ?2 N
dvlist" _4 V- p8 j# S8 ?- o. q
)1 D" P3 Q% q L0 d, ~3 }6 h
3 {7 Y$ R5 [# B5 ~& H2 N+ p
;;
4 ^4 L" M1 q b1 x1 S0 c ;; Modify POINT
. p+ I( V) A2 B) P( o ;;6 O- p3 }4 Y. j8 l6 }0 V: h& T
(defun modify_point ()
: }: r/ w! _, y) J4 c7 P- m (modify_properties)
, B$ w9 _ E w) \( ~( Q( ^2 y (setq pt1 (list x1 y1 z1))- s0 I7 L0 W, a4 l
(tempmod pt1 10 0)- L4 U0 g4 ^- Q" S
(entmod elist) F, u/ Q7 j3 t- t- {
)- ?; l) H* D. |/ u
: G6 V, Q- p- [# L! F. x: a \
(defun ddpoint ()
, F: W; s' E g! c. f1 Q (if (not (new_dialog "ddpoint" dcl_id)) (exit))6 K) q! t+ o* {; _8 C( R
;; Set initial tile values
3 q: Q: i. `& p7 N% ?) L (set_tile_props)% O6 B" x) _9 `% v
(set_tile_handle)7 k+ G/ g( z# c- ^! I
(set_tile_pt1 0)7 b$ N( z0 d$ v* ]
;; Define action for tiles$ d5 ?/ h7 J* w( S* l' G, U$ }
(set_action_tiles)7 N8 X/ g% n: c( M
(setq dialog-state (start_dialog))- x2 P' y) t+ Y3 }! }3 Q$ [: t
(if (= dialog-state 0)& o: N; R& e' [& c0 d! p- [
(reset)& P, e. A1 N" S3 Y" H% m. J3 \6 W4 q
)0 p5 d$ i8 G" e x* k
(if (= dialog-state 3)7 v) K0 g* [ c1 F
(progn1 |; i, p9 I$ g- G
(modify_point)8 ~9 Z* |( w% |* `# ?9 o
(setq pt1 (getpoint (list x1 y1 z1) "\nPoint: "))" {& D% A: l" O. O& |6 ?
(ver_pt1 0)) G* Z4 X6 R) \3 m! h" j& m
(ddpoint)! ?1 X6 a3 ^& m; ^9 t6 ^
)$ d4 ^; o, U h2 {5 }
)
. A0 ?# I6 i! g% z. a) v (if (= dialog-state 1)
+ F6 Z2 u* a7 ?% I (modify_point)
5 P' }' D5 F( \0 `4 Y )
" y4 j/ g" M+ C( Y )$ |/ C( B5 Y: b0 n! i
;;0 B3 k7 l3 z8 _ ^. ^' R
;; Modify LINE
8 S" k4 k; J: Q/ s ;;6 C( G+ ?/ u0 t" d* z
(defun modify_line (). ?% S# C5 O: ^7 W; }
(modify_properties)- h& n3 p8 M% v. ~9 R
(setq pt1 (list x1 y1 z1))
1 J2 ], x+ y9 O3 f (setq pt2 (list x2 y2 z2))0 ], N3 U; b- |- X- y
(tempmod pt1 10 0)- J+ v# Q# d8 Z9 B a
(tempmod pt2 11 0)) z' K& D2 o# X# F( f, m$ y8 d& y
(entmod elist)# c! q- x! t& d$ E
)
& I4 X5 L" `) ?$ @! @ (defun ddline ()$ k$ G% v# p* k. Z6 ]5 @4 j
(if (not (new_dialog "ddline" dcl_id)) (exit))
T5 ^ A" o; K9 s+ i% q ;; Set initial tile values) P G: i$ e8 G8 P z8 ]
(set_tile_props)
( F2 u ]$ E# }1 ?8 J/ S (set_tile_handle)
9 [9 H3 Q- c$ v3 A. I (set_tile_pt1 0)
( @1 W% I; O" p" | (set_tile_pt2 0)7 o& m. e+ W) s, l
(line_calc). Z5 } ^; v |3 ?& s
;; Define action for tiles
" E/ Q" K/ s& v" K. V& ] (set_action_tiles)4 {( `: o3 N" v4 M+ g) l; s
(setq dialog-state (start_dialog))
: D9 {- V9 x7 e- o1 e (if (= dialog-state 0)5 ~ \5 |, e( Q9 J
(reset)" `1 B0 r6 c% I4 }, h W+ i
)4 [, L0 U# \" {7 L( M
(if (= dialog-state 3)
* H" A: ]' g( C' q1 V& M; k (progn6 U/ @) a8 q" n9 V4 h( c3 ^2 Z
(modify_line)
2 m! V7 U% D- J3 }3 A2 e (setq pt1 (getpoint (list x2 y2 z2) "\nFrom point: "))
2 ?! i v- o! F$ l% {, y7 u (ver_pt1 0)
8 U) t* V0 s0 c7 p (ddline); K/ ^7 R( \0 ]) U
)' b6 b; N; Q! v- p1 o
)
- m9 n7 _6 H" W- p" v/ g# _ Q (if (= dialog-state 4)+ _( B8 e0 [) [
(progn$ p1 ?" e! V* w8 D
(modify_line)/ i- O. Q N. p3 i
(setq pt2 (getpoint (list x1 y1 z1) "\nTo point: "))2 Q/ W% a& v5 b. H9 ^% Y i
(ver_pt2 0) J- T9 s, U! e7 k; T) o1 b
(ddline)3 w+ P) ]- V6 _7 S4 [' G$ |
)& y- }6 g0 y. k
)
0 X8 K3 ]4 }" G (if (= dialog-state 1)" ]7 v( j: K0 c3 Y+ H
(modify_line)
% v5 @4 f: p7 Z4 n7 C. E1 ~! ] )- R9 T* W7 g3 A2 e0 D1 |
)$ M8 l% u- u F
;;; P& ^) ?3 m$ A# G5 z9 Z
;; Modify MLine
1 o, I8 u D6 C9 y2 C* d3 y ;;$ n2 n0 E( H2 X5 P5 F
(defun modify_mline ()
5 m* G2 N' `3 y% T+ U (modify_properties): f! G' }7 k7 ?0 x
(entmod elist)
! R+ k2 `: V) r )
7 N$ o0 \7 f+ H1 V/ E# { (defun ddmline ()
2 `6 |5 ~: e1 `6 t, e$ U% G (if (not (new_dialog "ddmline" dcl_id)) (exit))
+ }, l; U' o1 y. w7 D ;; Set initial tile values
6 U$ P1 P; o- d" M (set_tile_props)
; F9 {' U3 G6 ~; `- c1 v, D' r4 r9 @ (set_tile_handle)
# ?- ~- N' _% W& t& X# M ;; Set mline style text field.
# B0 w7 \( I9 p5 v# n! e# m (set_tile "ml_style" (cdr (assoc '2 elist))). x0 ]& ?/ y* H
0 n# r, b- m9 ], T6 {
;; Define action for tiles% V0 E3 b, t0 n; E
(set_action_tiles)7 z* |6 Q9 ?1 ]' K
(action_tile "ml_edit" "(done_dialog 3)")
; v) D7 j' ^( E. H# n3 O (setq dialog-state (start_dialog))
; t$ ?: R% |# R- j, p ;; Dialog cancelled, reset to original values.
4 E# i: T- s) K" T) ^' G) J (if (= dialog-state 0)
1 a* n3 n6 P- J (reset)4 B2 }; P! H1 N- n$ }" R% S
)* n, i' i2 a5 C0 O+ h" \, O- D
;; Dialog OKed, update the mline.2 S Z/ D4 }8 \% f
(if (= dialog-state 1)8 k) K2 ?2 E- o& S# S' u( ]
(modify_mline)3 G w+ W7 l! Y
)5 C4 F6 c: s5 z5 c2 ]9 V
;; Edit Mline, call MLEDIT.
) Q$ Q6 x) Q9 `$ s+ o (if (= dialog-state 3)
& K3 ]8 p9 e! J; y. T (progn
& l3 V+ f3 Q' Q/ L4 \ u (modify_mline)
4 n: I8 P2 o; Q0 B/ _* ~$ s (command "_mledit")' r7 G o- i" f, m; Z
(ddmline)
( Q; T8 O! I. I; I9 I )# b# V, i# H, n8 f
), I2 ^- r; l7 ?
)9 R+ |/ v: M# ~- F& o2 v
;;1 a8 g5 D* g v( d+ y, e& J4 x
;; Modify Xline9 `) ` e0 O% {
;;
" T. V. _( t% f( n1 {8 i% U (defun modify_xline (flag) }7 g: ~( I0 ^' n# k5 l/ t. q
(modify_prop_geom) U& j2 J- z' j" V6 ~: \0 a8 }, J
(setq xline_pt1 (list xline_x1 xline_y1 xline_z1))
0 o- \+ s- ]8 v: t (setq xline_pt2 (list xline_x2 xline_y2 xline_z2))1 k r" C4 K5 [4 Q+ q0 P
;; Update the Root point.
* Y6 R$ q( W; h7 \% f4 f; q (setq elist (subst (cons 10 (trans xline_pt1 1 0))
8 D7 E3 ?' F5 W W (assoc 10 elist)
6 \3 j& D( }# U: I elist
+ p5 O: R5 D q. E, t P1 g )5 z) ?5 ~( T) S6 E: D8 K
)0 s* ~. O2 ]$ v2 W$ B) T( V
;;
7 {( M1 K+ n/ A) E. V- I2 u ;; Calculate new Direction Vector WCS) h" q8 V' ~; b
;; x / (sqrt ( (x**2) + (y**2) + (z**2) ))
8 G! _1 ^- z. ?3 l6 M2 D
4 n0 ^& b) v4 T/ R, Z+ M (setq temp_dir (trans xline_pt2 1 0))7 m; P m J D" X* ^% U8 O
(setq temp_dir_x (car temp_dir))" P, W( ]' j8 d# ?2 P3 F
(setq temp_dir_y (cadr temp_dir))
9 ]' X" P, W$ p3 ~3 H+ _, }5 I (setq temp_dir_z (caddr temp_dir))7 R7 U$ D2 ^( h; l
Z* L, @/ d9 C9 H1 n8 i (setq temp_xline_pt1 (trans xline_pt1 1 0))& U, P5 h H4 f8 g8 u
(setq temp_xline_x1 (car temp_xline_pt1))
0 g4 n4 ?! ~- r9 e0 ] (setq temp_xline_y1 (cadr temp_xline_pt1))- p- i g3 `1 X
(setq temp_xline_z1 (caddr temp_xline_pt1))
/ y3 o" D" C5 H* e7 l2 r, Z: K+ q: l3 I# C) A+ e c) J
(setq denom (sqrt (+ (expt (- temp_dir_x temp_xline_x1) 2)
& p/ `" h5 `$ W (expt (- temp_dir_y temp_xline_y1) 2), u7 V9 H( A! S( w: R# o' {4 b2 j
(expt (- temp_dir_z temp_xline_z1) 2)! u u3 t4 _5 x
)))/ e5 C; q: u5 N1 K) Q7 o
(setq temp_dir_x (/ (- temp_dir_x temp_xline_x1) denom))1 X# j, }- P; f7 O, u+ T
(setq temp_dir_y (/ (- temp_dir_y temp_xline_y1) denom))5 Z2 D. s+ i1 z! I
(setq temp_dir_z (/ (- temp_dir_z temp_xline_z1) denom))' O1 e L) k5 {4 ^9 o4 n, B' q
(setq elist (subst (cons 11 (list temp_dir_x temp_dir_y temp_dir_z))
5 C1 C9 r/ p1 N (assoc 11 elist)
7 a0 [0 J* M( F: h elist/ q3 B8 s6 y' ~' l
)" }- H$ S2 V( [' ^" @) Y: B* o
)! W3 B' _6 x' F0 W' ~ w7 ^
(if (= 1 flag)
' B$ S# f# o+ T5 L: q$ o7 k (entmod elist)
: N0 [8 n. X' S% X )+ v! `: z! i0 E# f
)
( L7 K7 P. f% Y$ h+ G: ]) e( Q s* t% |5 ~) l n( N
(defun ddxline ()
5 B+ m L. e/ C6 B (if (= etype "XLINE")
0 x5 A. b+ u4 H/ { (if (not (new_dialog "ddxline" dcl_id)) (exit))
5 N; W' ?- ?( U: y# t (if (not (new_dialog "ddray" dcl_id)) (exit))' o* e x! r0 K- M
)% w* ^& C+ d' \, L
;; Set initial tile values* k# o3 L( _+ s5 G( v0 o
(set_tile_props)! O" Z+ G5 @; I
(set_tile_handle)' O5 y$ J) |$ @4 O+ m z
(set_tile_xline_pt1)& U2 c. h, X+ Q9 R) g/ O! L
;; Convert to UCS and post Direction vector.& g& I, j, s& n( p' m
(set_tile_dirv)
6 V3 O& j8 A9 \* o ;; Calculate second point by adding Root Point + Direction Vector.; L0 e, e) F5 T$ o$ m0 \9 H
(set_tile_xline_pt2)
5 A5 T, a& }# u% g ;; Define action for tiles% o$ p2 Y. F+ f- `6 ` b
(set_action_tiles)/ [- f$ ]# Q. O' ~1 _- Y
(setq dialog-state (start_dialog))" \6 E" ]- Z& p; v. E" l9 l
(if (= dialog-state 0)4 F7 D. N5 L7 s5 R
(reset) B7 z7 W/ h* N. j7 s- W: } L
)
/ O# F( N: F x& C4 ? (if (= dialog-state 3)
# Y2 x Z: @2 P (progn
) E% R% b" a) ~. s+ z (modify_xline 1)
) M( L1 |9 p/ E5 g8 j (while (equal xline_pt23 |7 _9 B0 N7 d; y2 Z$ y
(setq xline_pt1 (getpoint xline_pt2 "\nRoot point: ")) 0.000001)& S: H5 F: t7 h( H. u
(princ "The Root point cannot equal the Second point.")& o* ], f1 y \9 N1 x% \ v
)
+ Q: s) x& z" f7 v (ver_xline_pt1)
+ i7 u& G+ E7 O' O2 r+ `* ]! v (ver_xline_pt2)4 c: [/ F) W" u7 ~9 U: d$ F- z
(princ)/ B/ p, O+ I2 R9 K8 x" ~
(ddxline)! ^/ d5 o* {0 Y+ h6 ]* O# E
)
9 x9 {. i: ^4 w7 @/ a2 o: ~ )
* }1 S0 {; F; k: v (if (= dialog-state 4)
# I; l7 y2 e9 h% c y$ w (progn
# ?5 d6 b' w; [% | (modify_xline 1)
/ C* U5 R W7 x, x (while (equal xline_pt1
- r5 i" @7 I% w& g# v! F6 L7 K (setq xline_pt2 (getpoint xline_pt1 "\nSecond point: ")) 0.000001)
9 L+ e' l3 [% R! U: n$ E& N (princ "The Second point cannot equal the Root point.")" c/ y" q8 H W9 Z3 v5 }& j
)
) o7 }. D1 Z# B- u6 x; e9 p* ?0 j (ver_xline_pt2)* s, Y$ B* n: `/ {& I
(princ)* i8 F6 ^% l6 E8 }1 d$ G
(ddxline)
C6 v4 F9 I2 u2 U& h$ j- [: w )
* m; W2 M4 O# |' K )) I [4 k c* \$ J) w2 `7 _
(if (= dialog-state 1)0 l9 x0 k: m% V! h9 d2 s$ [9 u
(modify_xline 1)! R" Q8 l9 o1 S8 f) Y
)! t# ?- O, f- X
)
+ I, n: [& B1 b* q5 b; } ;;
2 o$ J( E2 N( o" {6 v* A ;; Modify ELLIPSE
$ p o2 X7 U+ B0 d9 J* g( n ;;
1 p; {/ R: Y: r$ T$ e- A' J2 Y (defun modify_ellipse ()
% m% e) q5 v/ R8 U# E (modify_prop_geom)
* M2 ~% v" {% t. `9 h O4 V ;; Update Ellipse Center Point value.
$ B7 D( d7 D* A8 X& Y (setq pt1 (list x1 y1 z1))
0 ], P! O$ I# W: i6 [- [ (tempmod pt1 10 1)
2 W- {* `% s+ N+ m* g ;; Update Start Parameter value.
0 w4 Y5 D3 V# [& w# T0 F (setq y_val (sin st_ang))2 S) l: x a4 h0 a& Q
(setq x_val (* rrat (cos st_ang)))" S6 H1 {) U. ]0 Z5 Q( g1 ?# R" [
(setq stparm (atan y_val x_val))
- Y* c+ E+ u P2 U! i (setq elist (subst (cons 41 stparm) (assoc 41 elist) elist ))' p( o& f6 l1 o# K7 V
;; Update End Parameter value. Normalize it, if it's less than" j4 W# ?7 B6 F8 Y4 y4 _
;; the start parameter.& I! H: b- @# v7 u
(setq y_eval (sin end_eang))
! ]# d1 E/ L0 c: Y (setq x_eval (* rrat (cos end_eang)))* O7 T. a1 o4 p
(setq endparm (atan y_eval x_eval))" e. _8 S; Q6 a# q1 V1 S' D; ~# ~
(setq diffparm (- endparm stparm))
0 U. p: w& S0 r t, ~, T# L5 V ;; Epsilon of 1.0e-6 radians for checking a zero length arc.
. I) c* O& D& M& i& J ;; Since zero length arcs are not allowed - construct the full
( q+ y2 C; M/ @ _/ L ;; ellipse in this case.
2 ]( n" P; R* _ [; H* ]$ H (if (<= (* diffparm diffparm) 1.0e-12)9 l( e( P |5 v$ {2 p" L$ b
(setq endparm (+ stparm (* 2 pi))), r* h3 B/ @ N- B$ p
)0 a0 h3 C% V$ `* M) Q. i
(if (<= endparm stparm)
) p/ ]+ L+ [ P8 \, Z$ r (setq endparm (+ endparm (* 2 pi)))9 Z8 z% f: a7 j. C, S
)
5 Y$ K6 `9 A* D) r! J; U9 ^/ ^: \ (setq elist (subst (cons 42 endparm) (assoc 42 elist) elist ))( x2 r$ q- U3 ~7 ~( r* @- _
;; Calculate the Major Axis Vector by first calculating
7 H$ w7 i: s$ W, @/ z% M/ V' g ;; a unit vector using the old Major Radius value. Then v5 Q$ @4 s* o5 \9 u9 K1 m
;; Multiplying that by the (possibly) new Major Radius8 `% d- G: A4 f( C
;; value to get the new Major Axis Vector value.
3 P. j5 t% q* `' ]4 x3 j8 x1 e (setq unitxx (/ xx old_majrad))) v- D5 {. \& Q
(setq unityy (/ yy old_majrad)): C8 `' o% D- `5 g5 d3 R
(setq unitzz (/ zz old_majrad))
5 `- d& n/ C1 w* t! M (setq newvecxx (* unitxx majrad))+ a, {0 C8 \* Q* E0 O8 ~
(setq newvecyy (* unityy majrad))
: k. M! N6 |( b# y8 c! z' y' Y( B8 | (setq newveczz (* unitzz majrad))( S/ M$ B7 f' j* X; p
(setq newmajaxis (list newvecxx newvecyy newveczz))2 A' S/ I. n; ]; w+ k
;; Update Major Axis Vector value7 Y* O9 I/ D6 d8 ?: b0 O# Q7 t* N
(setq elist (subst (cons 11 newmajaxis) (assoc 11 elist) elist ))6 m# ~" r' D4 A
;; Update Radius Ratio value! e+ c! x9 M& J
(setq elist (subst (cons 40 rrat) (assoc 40 elist) elist )) Z- i3 T4 o9 i+ ?; f% C+ v8 b
(entmod elist)5 o& c4 }) w( d. E' W+ R6 e& R S V
)2 u& m8 a% z( A- c$ E6 ^
: X+ Z; P2 C- J$ }6 E% M
(defun ddellipse ()# s# u0 [1 P6 M7 x& F a9 i
(if (not (new_dialog "ddellipse" dcl_id)) (exit))1 o1 g* ]9 o6 s9 D) }0 i
;; Set initial tile values: f( A* ~: R& v' Z! c( l, x
(set_tile_props)3 ?7 [3 h" d% a P. u# q$ i' r
(set_tile_handle)
# d, t7 g% `3 s (set_tile_pt1 1)# S' Q7 j; U$ ]
(ell_calc)( e0 G( ~/ r6 @& X2 U0 Z- x
;; Define action for tiles
* z- y9 |( e4 c7 B& O$ l (set_action_tiles)
& {6 ~8 w& p' J/ I7 x4 e/ J8 J (setq dialog-state (start_dialog))$ D/ o/ y$ }( s$ h, I+ o3 t0 p- D
(if (= dialog-state 0)9 V4 ?8 B# K4 H9 q- n+ w
(reset)
$ z7 ~0 Y3 c( k' E )
; ^' {$ W! r/ ?5 d. p- {5 i/ S (if (= dialog-state 1)
9 k4 z1 b3 v: O (modify_ellipse)" u9 @ U! G5 R9 N' S
)
9 X6 y5 n# |6 s" i& q: J (if (= dialog-state 3)
! ~3 u5 D" D7 B (progn$ ]7 p5 C+ ?3 x$ e$ h9 R. Y
(modify_ellipse)8 f9 \# U8 T2 c) n
(setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))
7 d( K \; A9 g: ~6 y/ Z (ver_pt1 1)4 j D( z& K8 i0 p) X7 s' D, P
(ddellipse)& e: U; S( {1 a
)1 e6 {4 K2 c% k7 E& @2 f" G# }
)
9 n+ s9 T$ _* Y% U* Y )
) O" B& d4 d q7 O0 \$ v/ d ;;
) r" Q3 O7 ~. }- T6 P- Q: K E ;; Modify REGION
; P% A! a' e- h/ T0 H4 s0 X ;;2 }5 C& f: @; ` f6 G7 H
(defun modify_region ()
4 i" W6 s1 `& h; j; n/ i' [ (modify_prop_geom), x- A/ y% v: r+ Y! y( E4 f7 G4 @
(entmod elist)1 L2 Z: G5 D" x) ?5 w0 {9 z1 N; p8 `
)
- L0 J$ B; B6 b# x% Y% d, A2 e6 F; ?! _2 [4 W3 h1 h
(defun ddregion ()5 I0 s6 v2 E$ e7 ?% x/ C( y
(if (not (new_dialog "ddregion" dcl_id)) (exit))
+ E- C5 P3 g' ?9 S$ [% N ;; Set initial tile values) s3 o1 S. h+ [
(set_tile_props)' W6 C6 W1 l/ }1 d. {( |0 [. `8 e
(set_tile_handle). F# q1 W# u; X) x# C+ }
;; Define action for tiles: o2 q7 e6 b, E; s
(set_action_tiles)
Y$ |3 g! R A! O, z0 d (setq dialog-state (start_dialog))
5 ]8 {8 W, A5 _* I (if (= dialog-state 0) Z f0 Z- z, T2 p! |0 V
(reset)
- I/ i. f& d- y$ s ), E: p4 r% | m
(if (= dialog-state 1)( P: |3 p$ J( L
(modify_region)' v: Q# x/ n e0 f
)% k5 x1 D- P2 `' T- q+ @* T: k) z% R+ g
)
q# ~9 R+ a1 M5 h6 v ;;6 [8 @* ]6 W: x2 p" W
;; Modify 3DSOLID" I5 S, g+ b) h! Y+ W# _; `" `2 s+ u# [6 g
;;
4 C8 p- m- i; K. ^% P2 T (defun modify_3dsolid ()$ h. U; x. B& `+ V/ p) {: a- c% f
(modify_prop_geom), u3 j& _. D: f8 ~( @$ S4 I
(entmod elist)$ F# |, ]/ L) F5 `- |" v
)
, j" U; k4 P6 b
8 G* ]$ g/ e0 k- V$ a' z. e- E (defun dd3dsolid ()
1 L5 [6 B! {+ R (if (not (new_dialog "dd3dsolid" dcl_id)) (exit))- r2 }2 C9 \& I9 @+ X
;; Set initial tile values% h. Z" W" y8 s1 G' b' q8 l
(set_tile_props)
9 J9 F3 \4 M- I9 H) @; l/ P (set_tile_handle)
- [0 ]# o& T6 m9 |! } ;; Define action for tiles6 E, s3 [2 { t
(set_action_tiles)# Z. U0 E1 n: D" Z1 S" V! Q) I
(setq dialog-state (start_dialog))
+ `- y1 w. n: `. V (if (= dialog-state 0)
6 e% A, H- Q: H6 t# I5 j (reset)# u8 L* G+ F, p4 P0 ^, f3 E% G
): n! D) w; [- I
(if (= dialog-state 1)! j0 l* @1 W) X6 ~+ I% ?( d
(modify_3dsolid)
- N0 t) Z8 J0 m8 l( e: \7 V* A )' O9 H+ e* v" N* w& N6 F
)) l1 l5 ?, J( [* x# B# [& W5 {
;;' o8 R( p1 ?7 y0 q
;; Modify AcDbHatch
1 z4 X/ Y4 ~% S ;;+ E. N) j; S5 \/ E- G9 r
(defun modify_hatch ()8 Y8 A+ j/ f! }$ D% x( E; n7 H) a
(modify_prop_geom)* T+ i' T6 J$ e
(entmod elist)
3 T1 N7 W3 ?7 R% L )
. R6 \7 X3 y; r, {- C7 d
7 b$ I% [1 O" t- a( h0 `: w' h (defun ddnewhatch ()- R; L$ z( g. [7 ^3 Y' P
(if (equal hatch-elist nil)" L0 y' h6 A2 `! r' I! I! f8 D
(setq hatch-elist old-elist)
1 _& \- ]" K# W" v )
- F( |$ Z6 e, N5 \3 x
% L: i3 Q8 d% c (if (not (new_dialog "ddnewhatch" dcl_id)) (exit))
; j5 F" V$ ]; Q4 n T: a% N$ L7 ~4 Y; S- J# i2 ^6 c" k
;; disable the thickness tile: h0 R' Z& A4 H. ]1 N1 e* N8 K: _! \
(mode_tile "eb_thickness" 1)
4 c0 |- Q" {& S (mode_tile "e_thickness" 1)
" I A8 ?1 F+ U G- t9 G1 u1 P1 s0 T" a) a
(setq help_entry "modify_associative_hatch_dialog")
# ?9 ^ f* P* D: A8 ? (set_tile_props)
?6 X1 [3 O# o, e/ t) {3 |9 g (set_tile_handle)/ y7 X0 d4 \7 F
' q% I6 }5 l$ v9 T' f9 x3 d& n4 d
;; Define action for tiles {4 }( d; f4 _, z
(set_action_tiles)# I* t. C6 `+ _7 i+ Z
(action_tile "b_hatch" "(done_dialog 2)")4 c6 d4 _1 G* d m! X0 p- {
(setq dialog-state (start_dialog))
) G2 F4 Z7 y) h( P5 a& H. b (cond# c( V( [( k$ e
( (eq dialog-state 0)
3 B( h* g# _7 S' `) x (setq old-elist hatch-elist) Q+ v# ]- O+ [" B0 F3 @) h
(setq hatch-elist nil)$ N/ x; W% D! e9 g6 A2 j2 d* u
(if (= (checkforlockedlayer ename) nil)
& m7 W* { ?5 X+ C (reset)
/ R$ F9 g% u- g5 F# B (progn ;;; special handling for locked layer reset9 k9 n6 I6 E* i: j! e" \
;; unlock the layer: V! |0 Y7 H8 C' e* g
(setq layername (cdr (assoc 8 (cdr (entget ename)))))) b3 E9 c2 x8 |, W* Y+ m% [9 C4 ^
(command "_.-LAYER" "_Unlock" layername "")
- V# X: M3 Q* j' ?3 a' X* l$ t ;; reset modifiction# n. q& s+ B/ ~! p% n9 k0 g
(reset)" k5 U# d, a T2 `
;; lock the layer again
7 f1 L u/ e' u/ m2 L3 w. q (command "_.-LAYER" "_Lock" layername "")( r- u, w5 ]2 K5 p" P7 |
)
1 \1 X) E. g+ c- ~ )" d+ o4 g, U& V) d
nil ;;; makes (ddnewhatch) return nil for Cancel
( i# ] |% |. g3 U w& d )
! _% j6 C; o x5 _$ @8 V, R ( (eq dialog-state 1)
; V: e4 m/ D) l @, \0 R7 \7 v (setq hatch-elist nil)
- B* L! W: @, q3 _3 L9 | (modify_hatch)
; U! ~* J- U, o5 v T ;;; makes (ddnewhatch) return T for Ok& D$ w2 Z& j7 T j8 G R4 ?3 P
)5 ~& G3 a* y" d- e( O4 U( t
( (eq dialog-state 2)
1 y+ M( I; |/ `; E) M. y" i- w1 a' ?8 e; `* T! M$ G
(if (= (cdr (assoc 70 (tblsearch "LAYER" elayer)))4 H1 `' A4 U- m2 _
4
1 Q! c! A$ k9 M" n ) 4 X: e; k- x/ c" ]! e" r& N
;;; new selected layer is on a locked layer+ o! p1 V" y$ ~9 t; v
;;; we can simply modify the hatch properties
# T' ~4 q6 V8 p" _5 d (modify_hatch)
( ~3 m2 I x! p- } (progn
, b" \2 p' V( ]* m& E- B1 x. T (if (= (cdr (assoc 70 (tblsearch "LAYER" (cdr (assoc 8 (cdr elist))))))
) U, i2 B9 I. @ 4
- K' I& @$ n. b9 e3 |1 a) r8 a ) 0 p8 C* e. ~4 b/ a' y5 I/ e( K
;;; We changed the layer previously and now the hatch lies on a locked layer.
& N( k) a4 ] f* y6 _, [3 ]; l% x8 F+ n3 ] ;;; We have to unlock the layer forethat we can update the hatch properties./ z8 Y6 s4 [' m
;;; If we don't do that (entmod) fails to update to the new layer.* z% \2 G \# i* K9 V" v3 u
(progn
" G0 d" f6 k( z/ e (setq layername (cdr (assoc 8 (cdr elist))))3 V1 _% m* c# w
(command "_.-LAYER" "_Unlock" layername "") ;;; unlock the layer
) l8 w, E$ X6 T+ h (modify_hatch) ;;; update the properties
; u: ~) L- Q2 Z2 x (command "_.-LAYER" "_Lock" layername "") ;;; lock the layer again' K2 h$ x0 }7 z4 S0 K# u/ R
)% z& u' x% E" l! J3 G, x. B
;;; All other cases we simply update the properties
' H" q5 z2 p: V& r8 r H$ Y (modify_hatch)
3 w' Z) X- R* j- I+ d. _, }! ` )- o: i: d) n' P4 F: l- F, `
)5 F- N2 V% c# T; P; j! c
) 8 @& v- |3 h+ z: h% n
(if (= (checkforlockedlayer ename) nil): _" Q" ?6 ^0 u; ]- ]& @) {) Q8 c: }
(command "_hatchedit" ename)! U: d% r+ T3 n- L! S
(alert ;|MSG111|;"The hatch object is on a locked layer.")+ R1 k8 k& ]$ A. h* e8 H- L
)% p& O+ e0 S7 C# t9 E
(ddmodify ename); [7 x& }4 }- _! m) o
)' @/ |& R/ e9 d/ d- i1 g) ?; e
)
* B0 T: ]5 q. Y2 p l )
3 K" z+ {' A* g; y& A. e; [1 z C+ [ ;;* F4 j: ]+ H5 u
;; Modify BODY
3 ~& i4 f3 K( J' b2 Q6 k- J, U! Y ;;
7 {- U3 M! U# J7 Y" y" I* {+ P5 A' I" K (defun modify_body ()1 W" C4 c- g& _9 u- m
(modify_prop_geom)
# n6 _- v5 }8 _/ n& \, _- g2 U) W (entmod elist)
" ]4 I* E, a2 o# w5 J& Y r )! S! p' n8 V3 F/ |* r9 F% B
4 u6 B% n8 ?4 n5 d (defun ddbody ()0 C7 ?8 w }4 _
(if (not (new_dialog "ddbody" dcl_id)) (exit))" c6 |: a. b$ V& G: p
;; Set initial tile values- ^9 e# v/ Y3 l) Y
(set_tile_props)* h5 V8 @ b$ g8 x7 E) ]3 d4 \
(set_tile_handle)0 M2 b# ?4 v6 e
;; Define action for tiles
" Q/ n+ l- \4 f& L$ w8 A (set_action_tiles)
0 J5 b2 M5 h, T7 u! I (setq dialog-state (start_dialog))1 b+ q7 t- W; o _2 M3 K; s- A
(if (= dialog-state 0)
8 N/ W3 ?$ c* C, f (reset)- ^* ^+ S4 U; z* Q
)
2 | `$ y. R/ P. k( h (if (= dialog-state 1)
9 ~. j2 Y; ^. `( t( r/ b+ R6 Q" C (modify_body)
@) G' N' P8 ?+ h: _* V )( K) U' m+ z" J/ [2 L8 K
)
; u I6 P$ F% |, k. t ;;9 P" e% \# g* K+ n- e3 T+ R3 L
;; Modify CIRCLE0 N3 {3 O9 h4 C7 _6 |0 |
;;7 U8 h, S( _( m* R8 o
(defun modify_circle ()( R% q5 y5 q, b5 R: g# `- E& F. E
(modify_properties)
6 o) F# a( Y/ ] (setq pt1 (list x1 y1 z1))5 c) F# L' S6 D9 ^( z5 m
(tempmod pt1 10 1)% E' t1 C- C" Y( C, r" }
(tempmod radius 40 nil)! s, a& i7 V$ C6 Z
(entmod elist)
2 o! Y* R8 U* F8 n3 T )
; U! X8 d0 N8 e2 Y
8 y/ h8 m) S. ^# f (defun ddcircle ()
/ v( S( m$ e6 o6 ]3 g2 ~ (if (not (new_dialog "ddcircle" dcl_id)) (exit))
/ e1 N' ~' K/ ]( u ;; Set initial tile values- F) ^) w4 H4 V9 I! c8 y
(set_tile_props)
' y7 P4 v9 u0 ^( `. l% d# y (set_tile_handle)
# `) a1 @7 [' w (set_tile_pt1 1)1 B v. i9 t& g4 G
(set_tile_rad)
& I4 f& }- m t! y7 |6 l (cir_calc)( v$ p1 a2 b R+ l3 V
;; Define action for tiles
6 O. p- q* E* Q; I. z (set_action_tiles)# Z2 r' n& ~6 b" J- Z
(set_tile_pt1 1)
o6 O# a; C3 S5 Y/ Q (setq dialog-state (start_dialog))$ W* S$ t" h! Q
(if (= dialog-state 0)# p: l( F8 Z3 T* @" c- s- R
(reset)) [0 E' Q) i& I
)8 U% W2 P& F5 r8 P) A# T, Z3 K
(if (= dialog-state 1)
. O) H. _3 G" q3 _7 ^ (modify_circle)9 q' V8 G4 p0 S% N
)
$ ~4 Y9 j( K% r3 d) g (if (= dialog-state 3)
% k3 l/ z! [; E5 M4 P5 u$ s% @ (progn
( m4 P! c% R6 e5 E, E. @ (modify_circle)4 T2 A% L& J( {1 ~) ]& y% S& Q
(setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))
/ A7 n8 |" [4 U e; U9 I+ f# L+ N (ver_pt1 1)* m9 Q X2 j5 ?1 K
(ddcircle)
) m$ F1 z; \8 i; t5 \( i' c )( C( Y ^% y+ w k4 o- o3 C# z
)
7 H% {( R# v5 [2 i3 ] ), C) f- J# _6 V
;;" K8 T6 e) H; Z! [: |- h) E# K
;; Modify ARC
8 o& y7 K7 h* v0 S! O: G8 A R1 P. J ;;
, e6 m% ~/ ~# I% f5 e6 R9 K# R: v (defun modify_arc ()
+ s, H/ G8 A% G7 [9 | (modify_properties)0 Z0 W0 E( i, N& b
(setq pt1 (list x1 y1 z1))4 f' H% L1 _1 h
(tempmod pt1 10 1)
2 \) z- ~( u) p x (tempmod radius 40 nil)
% M+ L$ O9 \% P( A (tempmod st_ang 50 nil)
0 H g1 S5 U% n! b (tempmod end_ang 51 nil)
5 ?8 O7 w- i: q5 ~* @ (entmod elist)( T* l; ?: `! j$ U" O
)
2 S" J; k$ @' L0 a (defun ddarc ()' N9 K) \4 \: I
(if (not (new_dialog "ddarc" dcl_id)) (exit)); Z0 k4 `5 n+ W" N x( @1 l
;; Set initial tile values
" w% ]3 |$ B3 P6 ~9 G" c (set_tile_props)
! B3 \) H' u( ~. j, V8 O (set_tile_handle)3 N% \* l- `) f; _" A0 s
(set_tile_pt1 1)
2 k' G. l& f5 j+ S. L/ S (set_tile_rad)9 j# T" |" \5 ~4 M3 l% u* v
(set_tile_stang)
% z0 c$ B4 K- h/ G4 P (set_tile_endang)3 i# ?2 o. L& o/ M9 p
(arc_calc), p" d) O1 ^) Q+ `4 T
;; Define action for tiles: W" E1 H3 X& S6 ?
(set_action_tiles)
, J7 I4 M* N4 Y$ z. G# r (setq dialog-state (start_dialog))" l4 z2 g: y/ B' k3 x
(if (= dialog-state 0)
# d2 x. l% I# O$ @ (reset)
# R5 \" g1 ?+ [. k )
$ g$ Q9 ^9 y: }- v (if (= dialog-state 1)4 x6 N, ?1 [" H+ w! I7 p
(modify_arc)( Y, @! L& N3 i, U6 `8 i
)5 C4 U" X' d' `1 n/ ] q7 U3 [
(if (= dialog-state 3)9 C& W- g* r0 A* A' \6 T$ r
(progn5 \+ O3 t/ f% G" C
(modify_arc)
- p! F7 y+ N+ p" i& i: N1 G (setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))
1 _0 C0 T* ]/ E3 s) ?0 d5 } (ver_pt1 1)! X. d0 m: N" q. q) n
(ddarc)
* z" }! J0 ^& t! R4 G )) v+ U3 Q0 h6 y, e& V8 Y) w
)
1 G7 J. ]* z# l' m1 ^. Y1 B ): Y5 H0 i3 d6 g' a8 t" S: ^0 Z- i
;;
. y6 {" t$ j, C: ^ ;; Modify SOLID or TRACE7 p* N3 D |7 K% O0 W
;; Note the Z value of the object is determined by the Z value of the fourth
! }5 [# D3 r& [7 i2 |4 g ;; point - code 13. Changing the point values of a solid or trace from a UCS% A& m; p" u u# w' z p' }
;; that is nonplanar to the UCS the object was created may confuse the user.+ \& H5 A4 P, V4 F k
(defun modify_solid ()$ O; W y: N6 ~6 W
(modify_properties)# @& l# I) o3 ]
(setq pt1 (list x1 y1 z4))
/ j" o3 B: g. M/ e& A7 m (setq pt2 (list x2 y2 z4))! D, y" J% [! | a1 d! h6 h9 ~
(setq pt3 (list x3 y3 z4))
( b5 T) r+ u! Z, k (setq pt4 (list x4 y4 z4))
~1 C' Z7 u- q9 ^! w4 ] (tempmod pt1 10 1)
2 H0 ]3 g5 ~1 R0 z, r (tempmod pt2 11 1)
. p! s5 a( P! I& {! I (tempmod pt3 12 1). q% d2 q; T. k% t$ \2 y" }
(tempmod pt4 13 1) p/ s. V r+ s" n# ^, p
(entmod elist)
; M' J- _) j$ }$ i )0 ^" c# J2 p7 c# G& T$ f: B; w
. v+ B* b0 Y0 J4 Q (defun ddsolid ()
; B+ o; b+ j; a9 O* z (if (= etype "SOLID")
7 j/ n; U8 {1 ~# }1 m (if (not (new_dialog "ddsolid" dcl_id)) (exit))
: ^* H1 S. o- r (if (not (new_dialog "ddtrace" dcl_id)) (exit))
, H" m6 P. I4 J+ Q$ M* G )* n4 q+ g/ f& X+ U
;; Set initial tile values) p& l( T* F6 n# P7 Z$ p
(set_tile_props)
% U2 U* ]$ I" u0 p (set_tile_handle)
6 p' j3 k" D" ^9 E (set_tile_pt1 1)
7 J) c5 l j3 F( M& H% x$ P (set_tile_pt2 1)3 U/ j; B' O6 T: r- y0 a `- g
(set_tile_pt3 1)
9 P' f& H4 R" O9 u (set_tile_pt4 1): b# Y/ J0 J6 _' ~, I7 ?9 a
;; Define action for tiles! G+ d8 ?$ P7 E; C9 Q
(set_action_tiles)( ^+ I5 R" s; `9 g N4 t
(setq dialog-state (start_dialog))
2 ] F8 R, b$ K (if (= dialog-state 0)* {7 p9 \/ d" n2 _
(reset)
8 R5 s2 k6 y# m, T" d- I )0 P3 S Z/ G' T2 D, t- Q, G( ^: f
(if (= dialog-state 1)
0 y1 v3 c, n' j- r; W% I0 q (modify_solid)2 t% T$ |: e* r* o- G9 `0 g, C @' f: ]
)3 m. k/ K1 \# G' P! j
(if (= dialog-state 3)/ d# C ?6 i, v b' }7 } E7 z
(progn
4 z& m$ q4 J; `8 u; _ (modify_solid)
* g1 M1 C1 u5 ] (setq pt1 (getpoint (list x1 y1 z1) "\nFirst point: "))5 e* Y: v# f* ^0 C/ g! L
(ver_pt1 1)! W% `2 K) }" `) i
(ddsolid)
6 B( q! C7 _$ C6 J. s2 U: U )
1 n. F# @6 p4 Q& @8 J )
$ G, l& P, {$ y6 D2 I, U (if (= dialog-state 4)
- P K3 {! u, V1 k. p (progn! A7 ?0 w2 B' G' Y: q6 a
(modify_solid)
, Q d- o& V; f0 N8 u (entmod elist)1 O3 `7 e3 G9 v
(setq pt2 (getpoint (list x2 y2 z2) "\nSecond point: ")) r( W: X. p8 Q4 d7 Q3 w( A* T
(ver_pt2 1)
/ Z3 H$ E% a( A% V (ddsolid)
; O4 ?2 Z P9 @ a9 T )8 p9 g% V: G7 M9 S* v7 r
)4 n( Z+ Q- A/ ^" R
(if (= dialog-state 5)3 X2 d- q+ {; L# v
(progn# D% y% Y) R% {+ _, {; y9 ]% S! ~5 o
(modify_solid)
: J& D/ S$ j; F$ B: N (setq pt3 (getpoint (list x3 y3 z3) "\nThird point: "))& h4 k4 W @& N5 T4 j4 R* t: ?
(ver_pt3 1): \. v3 H( V! u6 c2 S, n
(ddsolid), F& \1 Q: t5 {
)
) H+ y8 D q3 G. _+ w4 } ): h0 x; H5 u8 p9 @; C
(if (= dialog-state 6)
) _) R3 Y @. m r! Q8 J' U (progn
1 W" v: C9 d4 h1 ?# W1 ^1 X (modify_solid)! P* l! Y U9 @/ O( d, A! k
(setq pt4 (getpoint (list x4 y4 z4) "\nFourth point: "))# L/ F' J8 J9 ^( q( f
(ver_pt4 1)
3 M/ l' p& ^+ O; M" x o (ddsolid)& Q+ m* G" S1 O% P; o
)) z j7 f& t- p' g, p+ V
)) u- q' X$ [+ L& O8 S, @$ s
)& | K9 X% s' i* m
;;
1 d: ^6 G. N" J& W2 x ;; Modify 3DFACE9 T! x5 B0 S! C# H5 b3 D
;;" o& B8 |& v6 H: V3 i$ w1 ~# i* u
;; Check visibility of edges
' _7 _ d6 T3 e ;;. F# A A3 r0 i" z, C! |
(defun edgetest (/ bit1 bit2 bit3 bit4)
- |# |6 [2 T* T4 A# X p! X (if (= edge1 "1") (setq bit1 0) (setq bit1 1))
# U9 n% o* m6 z* a% X% H, b (if (= edge2 "1") (setq bit2 0) (setq bit2 2))1 {7 }. D; f9 d- ?0 ?7 b s: `4 [2 [$ U
(if (= edge3 "1") (setq bit3 0) (setq bit3 4))) s7 b( r+ C4 o2 ]4 q. j
(if (= edge4 "1") (setq bit4 0) (setq bit4 8))
. K0 l( M$ W3 ]. O9 p. j5 k (+ bit1 bit2 bit3 bit4)8 O( m/ r2 @/ N. K6 V
)
! e8 \7 V E9 K/ f& _8 B5 y4 ?8 s" x# @- b9 ~& w1 t
(defun modify_3dface ()
* `/ g9 V" \' {& H, d4 y (modify_properties) ~1 l# i( }* ~; h: N ^+ B. s7 a
(setq pt1 (list x1 y1 z1))
' Y) y# H$ Y# F; M (setq pt2 (list x2 y2 z2))
# q0 Z- M7 {5 G- k1 N (setq pt3 (list x3 y3 z3))
; k! o" R9 s, n+ i (setq pt4 (list x4 y4 z4))0 K8 n! `/ @7 k9 h$ F
(tempmod pt1 10 0)
+ A& f! G5 U M- F% S (tempmod pt2 11 0)( m8 Y& a2 \3 M' |, {
(tempmod pt3 12 0)
) z3 I$ ]2 A* R: c (tempmod pt4 13 0)
9 u* R1 c! |4 R& x+ D0 ^- m (tempmod (edgetest) 70 nil)
* ~- ~: c1 S3 r9 J, V3 l! |" D (entmod elist)8 J4 g3 b' R$ K! z
). k0 u* g/ ~ Q, r" N- b
8 b* C4 Y/ n |4 `8 k
(defun dd3dface ()
4 y2 _' a5 K" n5 o (if (not (new_dialog "dd3dface" dcl_id)) (exit))
4 Q+ L+ A; q! W' E9 k) A1 X (set_tile_props)
X" E9 O3 v8 i! b% K (set_tile_handle)4 R E/ u6 {% T& z
(set_tile_pt1 0)
5 ~4 v4 ?, `+ S2 u4 K (set_tile_pt2 0)+ x9 d! \% p! H" v
(set_tile_pt3 0)
( x( } O3 C* f) V S1 ^( \# n) a (set_tile_pt4 0)
( I: N3 i3 u8 o9 i6 m4 ` (set_tile_edges)) k- l0 F) V* X6 h2 S
;; Define action for tiles* R- I/ I, x/ G$ E3 v
(set_action_tiles)
8 C' ?9 n7 }' j( M (setq dialog-state (start_dialog))
) S# d+ s5 R0 Q7 K4 \ (if (= dialog-state 0)
: ]5 z' Z. f' n7 D6 [% G" u! d8 f" V (reset)
z8 [6 X# f! x) h: j1 H )
' s' a3 _) ?0 \7 W, |! Q: ` (if (= dialog-state 1)" m4 t" d$ k( M5 a, a
(modify_3dface)( M/ X0 J) `: Q1 C; c, ?! m
)
+ G5 W- A' f) {$ F- I, c6 D (if (= dialog-state 3)
+ v4 N, ^2 k, N% O (progn
0 I& E' \& X: I; ?" M# w, p# S (modify_3dface)( s; W3 V# R" K$ E6 A2 S
(setq pt1 (getpoint (list x1 y1 z1) "\nFirst pt: "))3 B- `4 Y5 d, s8 T1 N. c3 R( ^
(ver_pt1 0)
) j8 G4 E& e+ }3 `5 ^# g( [+ f (dd3dface)
6 b* }) b2 i% X# E/ N. b1 V9 F. q )
( A" L% `3 {* u& A, V ) |8 @5 J! U3 O9 P8 o4 `0 {6 T/ X
(if (= dialog-state 4)
# A) W P2 u7 n s$ ]- x (progn7 O; Y& d$ n, S5 C" a! s& [& K
(modify_3dface)
0 d( O {9 h) f! q (setq pt2 (getpoint (list x2 y2 z2) "\nSecond point: "))
' r0 z& M) |( O2 \ (ver_pt2 0)
6 |) m% ^& [# _' b (dd3dface)0 k/ }$ K) V8 f2 [9 Y+ L
)3 k" \8 A& P# g4 f
)
, W( _/ U9 N2 ? (if (= dialog-state 5)" H8 N) k2 w0 Y/ L: }7 \8 B
(progn
* H: k" V, g) T4 Z/ Y A; K7 r (modify_3dface)
4 h$ Q3 L7 L( g4 L+ ?* _ |! ] (setq pt3 (getpoint (list x3 y3 z3) "\nThird point: "))
/ [/ D. c, e0 E+ T2 [! z& B (ver_pt3 0)
/ Y% I" [# X! Y( \" m6 `& l" F; t (dd3dface)) z* ^- p }( v. o# `+ J+ J
)
2 G7 E% a& e# W )
* A& S# s9 y# S+ B+ } (if (= dialog-state 6) J. J: r! X, R- u5 p6 ?2 J
(progn/ U. k. P- Q$ C3 X% h
(modify_3dface)
/ ]4 l; v3 r% P2 @& [ (setq pt4 (getpoint (list x4 y4 z4) "\nFourth point: "))( m B( [) k. w/ _' A
(ver_pt4 0)
, A U2 X9 z" S! F/ L2 P' V8 w (dd3dface)- ^; z# j( R/ S# P0 r
)' @$ }: s$ ?" ~" J1 i: E8 u, F
)4 F( [ Q- u! H1 ~3 h3 y5 C- K
)
" ?. h+ q1 n9 r! O+ B& U! E( M9 y/ C1 O
;;7 f8 _1 [ M3 p
;; Image functions
9 _& {6 C2 i/ }3 z' O$ I ;;
3 e) l+ B. m, W% }% c: X9 { (defun image_scale (/ upixel en n userscale temp)
5 ~/ `. T) Y7 @. W, G ;; Calculate the size of an image pixel in AutoCAD units
' L0 H7 j* a# U (setq upixel (distance '(0 0 0) (cdr (assoc 11 elist))))& ~( {# i! a) J2 u/ H+ w c
6 |2 N- f( _! `7 ^- a, v h; i+ g ;; Retrieve the user scale
3 Z0 _7 w( {$ E (setq en (dictsearch (namedobjdict) "ACAD_IMAGE_VARS"))8 F& a$ Z* d7 e& }
, F" q/ G3 A9 D) C, H& W9 _. H ;; Next, extract the image units and pixel resolution1 _9 O: ?# {4 o
(if (or (= 0 (cdr (assoc 281 image:olist))) (= 0 (cdr (assoc 72 en))))! X' N: o/ R& a1 o
(setq image:scale (* (cadr (assoc 13 elist)) upixel))
4 P( u- e: F) g' Y (progn
4 C' J9 Y7 A3 x x" ^& z1 T ;; Convert the user scale to the proper word
; P; m* |& e$ ]* y1 V3 V, W (setq n (cdr (assoc 72 en)))
0 C; ]% [( U' k7 U' H' E (setq temp (getvar "LUNITS")), m! e6 ?/ D, M, w- q( t. b L
(if (and (/= n 0) (or (= temp 3) (= temp 4))) (setq n 5))
. \9 e0 [0 M, i0 V# J (if (= n 1) (setq userscale "Millimeter"))3 Y# [* J9 ^4 d5 m* W5 K) V W
(if (= n 2) (setq userscale "Centimeter"))
! i7 B. f$ i( L1 h9 m0 C (if (= n 3) (setq userscale "Meter"))
( j6 Y+ g/ |- `. b" u (if (= n 4) (setq userscale "Kilometer"))" t5 G- f* ?* r1 t/ ]- N! O1 O' Y
(if (= n 5) (setq userscale "Inch"))
6 e; C* J8 a% G. V/ d( U (if (= n 6) (setq userscale "Foot"))& s: B; A3 u5 _+ m- C$ u/ l- s C
(if (= n 7) (setq userscale "Yard"))
/ @1 S, t1 P% I. `* I+ y# S (if (= n 8) (setq userscale "Mile"))- ^+ X1 K# h6 c; p1 T
(setq image:scale (/ upixel (cvunit 1 "Millimeter" userscale) (cadr (assoc 11 image:olist))))9 l! Y, ~# W; B! _4 o2 z9 L
)7 ~8 j# a9 j6 ~& M- S* y! q
)' y5 n1 }# o$ e `9 j
)
! R0 R( D9 Y3 q0 y! G' `5 v
+ }: Z8 S# X, }$ ~ ;;0 K9 k8 u7 s/ j. ?+ L
;; Scale factors for block insertions
2 P4 ?" s' |4 t" H% [) O7 n ;;: B# ~. E. g; P2 B
(defun image_set_tile_scale (/ temp)+ f+ X7 L- ~! p8 \
(setq temp (getvar "LUNITS"))+ i6 T" g3 y q! A" v
(setvar "LUNITS" 2)
8 B, Y- u* Q3 G/ a4 d (set_tile "xscale" (ai_rtos (* image:scale image:mult)))# C; K6 R" g8 Y3 O$ q+ o8 y- f, [! b
(set_tile "wid" (ai_rtos (* image:width image:mult)))& G) J$ T& F% P
(set_tile "hght" (ai_rtos (* image:height image:mult)))5 n. t/ [! R6 n- I7 I
(setvar "LUNITS" temp)2 H8 m: R5 Y8 G% [! e/ z0 z! G
), `" O, V' T! M" d" Q: g' @6 Z
# W) b/ t! u O$ C3 K h ;;
- o' X. A# @9 z1 K) { ;; Set the scale, width and height values appropriately.
" i) i. p% _. [4 V& D ;;
) ^) G) ~6 U7 |! s; }' q (defun image_update (field value / orig_value new_value mult)6 R: v& p) {0 d8 x% X* q
(if (= field "xscale")
, Y8 |% e v4 D9 q9 f/ m1 x (setq orig_value image:scale)
6 E. }$ i/ C) P5 r! o4 I; B )' P# F; C I- J, e
(if (= field "wid")+ C& A7 w" m s; g$ G6 H( R0 y7 x
(setq orig_value image:width)
- o( a7 ]8 ?4 P( F% a! R ); E2 Y" H. Y% P$ u! K. K& t; I
(if (= field "hght")
) n3 t# V* m7 a8 n (setq orig_value image:height)
* a G. l8 c" \6 Q" H% a )6 @5 L F: h! u% D' }* L# b1 ]$ g
(setq new_value (verify_d field value (* image:mult orig_value)))6 V2 w" A4 [( Z; w& M! V
(if (/= new_value old_value)5 w! n( P9 ?& s
;; Make sure the user has entered a sufficiently large value( K! ~ ^! T) y) w# S- L; T
(if new_value
$ B+ j! p) ~. O) }3 H% s3 c (progn0 X! W) ~. f4 V0 p# B
(if (< new_value 1e-8)
. p9 K5 ^5 U/ h2 F0 j (setq mult image:mult)
" n+ H$ ?& V' C# m% X8 W (setq mult (/ new_value orig_value))
6 d$ n$ O! o3 j* B* f U )
' Q" y2 u6 w* S (setq image:mult mult)
: W" b* Y( i% @4 ], T. X' p (image_set_tile_scale)
& W. W' x) R9 a- d& d )
) H5 x3 @2 d; \( C6 N; | @/ |1 V )
) [0 ^0 b/ D2 w5 T6 H )9 V1 }& v7 x# S" D7 `) j2 h
)
; }4 b8 e0 L! x- a
/ s, X& r; h6 h3 l (defun image_disp_opt (bit)
7 a8 k' \6 k$ G/ D6 l (setq image:options (Boole 6 image:options bit))
' O4 ]/ N% ^5 ~$ A9 c* V" a8 H6 K8 _/ m6 O )
% L8 _! O& X. w8 _# B! Q: C ?, s8 q: Y2 ?. \
(defun image_modify ()
6 o/ f; y o, w% Y0 u E (modify_properties)
% v! e0 k* S+ L* r (setq pt1 (list x1 y1 z1))& f K* B1 q5 A! e9 a/ H; R
(tempmod pt1 10 0)
: y' O( L7 _3 T0 J (entmod elist)' N. w! K$ E6 h8 ?
)
S: g+ S, Z+ R+ l: L: Z8 t; D/ W: ^
(defun image_clean_variables ()
0 i* x; X0 ]3 N6 x J' b ;; Clean up global variables used here0 O! i) r6 u4 @6 ]4 k
(setq image:scale nil)' q0 ~9 \+ A0 m5 Y& `7 m
(setq image:angle nil)- S4 L+ U, ?, [& f" c4 C
(setq image:width nil)$ h5 s3 |4 p" h& f
(setq image:height nil)
8 L* N5 I8 k, f0 P* v# _$ m" V (setq image:options nil)' n0 y: k' ]: [* K4 `5 X4 _4 b3 s9 b" [
(setq image:oname nil)
- F) A; m" `& E& E- d K; z (setq image:olist nil)" x# W/ K# J& I. E
(setq image:mult nil)! B* `5 e: g5 T
(setq st_ang nil)
! d' d3 i6 J( F' p0 R3 O) w0 G )
. }" i: N& J: y, j. o2 P' M( S- m Z( O4 E, x6 r; h
(defun image_scale_vector (v1 value)) C" q3 e. t1 R% Z
(list (* (car v1) value) (* (cadr v1) value) (* (last v1) value))$ B4 G! O b% b' f C* v
)1 P4 ^( H* L- @& O
, [+ y- ^2 W4 x4 X. k" `) ]
(defun image_cross_product (v1 v2 / vx vy vz)0 z8 a/ k+ T, }2 @( |
(setq vx (- (* (cadr v1) (last v2)) (* (cadr v2) (last v1))))( O# S+ _ V3 X9 N: p9 N
(setq vy (- (* (car v2) (last v1)) (* (car v1) (last v2))))
# Y2 c! j+ L, G5 E, |) }# b4 e (setq vz (- (* (car v1) (cadr v2)) (* (car v2) (cadr v1))))" |( P- F$ L, P' g. @8 l: b8 j, ?
(list vx vy vz)
: }2 D o9 D- L, {$ ?( R- c )3 c$ S1 J7 m- i6 e5 Y
9 _+ _. u& f% o( x: n- c1 O
(defun image_dot_product (v1 v2)5 y( } l6 c+ P: g" u! t1 W5 B
(+ (* (car v1) (car v2)) (* (cadr v1) (cadr v2)) (* (last v1) (last v2)))
2 |& k6 w3 u6 A# _9 U6 L8 n% k )
3 ~# p, s) j5 K( |3 V# C1 z' p& j1 n! S4 ^. E; D
(defun image_add_vector (v1 v2)
# A: m' J' J. i5 `; Z9 S (list (+ (car v1) (car v2)) (+ (cadr v1) (cadr v2)) (+ (last v1) (last v2)))
; P+ P3 j- G: [7 P& `" F6 u% A )
7 e% R) t: F t, w' _, }4 a2 o) q* i! g0 X0 w, a$ t7 A
(defun image_subtract_vector (v1 v2)+ n9 V+ A7 I' S; @8 C: c5 R
(list (- (car v1) (car v2)) (- (cadr v1) (cadr v2)) (- (last v1) (last v2)))
6 n# l: ^* c" f; ?& f5 }4 z )( |! I; ]3 V4 n7 z- P2 R
' S' B" I1 X! ~4 y; | (defun image_normalize_vector (v1)
& ~) K7 g. t3 z) ^: n( ^ (image_scale_vector v1 (/ 1. (sqrt (image_dot_product v1 v1)))), M, { O- O$ {
)
: m: P2 O. U- h' r) W! i
: w9 v$ X+ z4 V, j D4 _ (defun image_rotate_vector (vector angle axis / along_axis axis_x_in_rot_plane axis_y_in_rot_plane in_rot_plane)$ `" J$ s k, c: J: ?
;; Normalize the axis, s' N7 L, i7 c
(setq axis (image_normalize_vector axis))' _) A/ J+ A' b: Y& U" K+ s4 c
(setq along_axis (image_scale_vector axis (image_dot_product vector axis)))
9 g/ E9 s) ]& z' Y% k (setq axis_x_in_rot_plane (image_subtract_vector vector along_axis))
3 {* ^& C& N6 M, b (setq axis_y_in_rot_plane (image_cross_product axis axis_x_in_rot_plane))
; _! F! e$ t9 q# P ?8 Q, f( V& q0 T! u (setq in_rot_plane) w# k$ P; [7 B N# L# @
(image_add_vector, a4 w% ]& L2 M. j5 K8 K$ y
(image_scale_vector axis_x_in_rot_plane (cos angle))8 P& e9 ?4 n3 O0 G" A. O
(image_scale_vector axis_y_in_rot_plane (sin angle))
8 i8 X( k; V; b7 E7 ~1 N5 Q+ g )- @) J+ [! Z0 I0 h$ J R( i
)6 g2 H4 d* B# m% w4 o
(image_add_vector along_axis in_rot_plane)
# ?* a2 F+ l. o+ ^* D )
0 K) f( B$ N" i; O9 ~2 q$ H4 v# @( v( d( f. g' G4 a$ i' @
;;
0 L$ y2 M( G, M6 g. z ;; Calculate current rotation angle if appropriate.
/ ?3 h& f z9 q5 g z% ]' u* Y ;; If not, grey out the rotation field.
! U" y9 r, D6 P& q& s3 w! T ;;$ \$ u Z1 {7 Y$ N
(defun image_rotation (/ normal rlength zlength sqrt_tolerance)/ A. C9 R/ U; Q5 ^6 M. l: m$ p
;; Determine if image normal is codirectional with* u; s6 c% s2 a1 [" q7 Q3 V
;; the current UCS Z-vector.9 L! A3 ^: m4 F
;;
0 ~$ H% r2 x4 i' g/ P, m (setq normal (trans (image_normalize_vector (image_cross_product (cdr (assoc 11 elist)) (cdr (assoc 12 elist)))) 0 1 1))
$ Z9 a- D3 O% q# ]4 N (setq rlength (+ (* (car normal) (car normal)) (* (cadr normal) (cadr normal))))& [4 Q. b! _, C$ }7 R' n
(setq zlength (* (last normal) (last normal)))* H; g9 S0 |- e2 P) Z) e2 u( w
;; Note that the value .0001 in the radians is approximately 0.0057 degrees.3 j( s; v5 e/ h& B
;;
Q& m$ C( i9 b3 u/ }( U ;; cos(.0001)^24 N/ t+ d3 E6 g' V( `, l
;; Tolerance = --------------
* P! x) ?+ t8 T2 i) H" @ ;; sin(.0001)^2
2 p* ]. ?$ ]5 e6 |: [ ;;; k1 D1 N( q9 h
(setq sqrt_tolerance (/ (cos 0.0001) (sin 0.0001)))1 J5 X2 @' r5 a0 b1 ]1 a4 s
(if (and (< (* rlength sqrt_tolerance sqrt_tolerance) zlength) (> (last normal) 0))
; p. p9 c h" A) {2 L (setq image:angle (angle '(0 0 0) (trans (cdr (assoc 11 elist)) 0 1 1)))
0 D, O$ u+ `5 V9 K( [4 R (progn
, `1 J! `6 P( N$ \6 r& l8 B (mode_tile "st_ang" 1)# \2 E' \6 U. O1 Q
(setq image:angle 0), G8 [& a( P$ h v0 R
)2 b- ^6 e6 C N8 {) I B2 [+ w9 r
)
# ~0 t5 ]9 K5 X1 v ); Z; s2 n, W! m6 V) v: f: p: ^0 U* w
+ i' a9 k9 S* n
;;7 {5 v; L' Q ^$ { p8 Z
;; Modify Image5 d. x' n) G6 \% `: S
;;
. e9 B4 k( c5 B/ P/ V (defun modify_image (/ u_vector v_vector z_vector)
6 y( @$ S) g$ N, R; m (modify_properties)& i0 \ Q1 U( D& u* O7 k |$ e
(setq pt1 (list x1 y1 z1))
9 e! q Z% `- w (tempmod pt1 10 0)
6 g* k3 K. Q, N1 O7 n; ? ;; Make display option changes to image
/ o4 }* k7 \0 ~- B- _ (emod image:options 70)
: A: |% s; r- T1 c* N ;; Get the u and v vectors- ^. V2 Z5 k% ]& ?) z. q
(setq u_vector (cdr (assoc 11 elist)))/ B( M! @' O3 Q5 a
(setq v_vector (cdr (assoc 12 elist)))6 e% i6 v; ^9 A+ f
0 {/ S. z+ `3 }0 f
;; Make scale changes to the vectors
3 s. }( @4 R% H, a5 w4 y* _8 j (if (/= image:mult 1)
8 e& v6 \6 e' z (progn
# h7 P0 L, P8 d (setq u_vector (image_scale_vector u_vector image:mult)): x7 J! C) [7 Z% `! y+ F* a, T
(setq v_vector (image_scale_vector v_vector image:mult))
* k/ i3 \6 A; q$ V% X )
# S. j: ]# q2 W; T: X9 ?5 c )
7 |/ H* D% S0 I& A ;; Rotate the vectors/ ^- Y) g' k: j: B7 _
(setq st_ang (- st_ang image:angle))9 {& K! @* J8 Q! k+ H4 h
(if (/= st_ang 0)
5 s* y! C# f1 L7 I (progn; c' k i' [% p9 I+ Z. \, t
(setq z_vector" z4 ~* K: Q9 c) R) P: k
(image_cross_product( e3 T' w% ]( h! U8 B g" B
(image_normalize_vector u_vector)0 ~$ n$ N. R7 a
(image_normalize_vector v_vector)5 B; F2 t& d, s C
)
" R' U* g8 o" T( U t )$ r+ u, z8 _5 y5 p6 R. j
(setq u_vector (image_rotate_vector u_vector st_ang z_vector))% ?% m9 Y; d7 l3 P
(setq v_vector (image_rotate_vector v_vector st_ang z_vector))7 d z3 `+ H3 E. y% q
)$ A% Q. E- L( n! j: p% K, `
)3 R- u- E; S) B3 {- b! q
(emod u_vector 11)
- N% _8 z1 i6 c) ?6 c7 e$ E& z- r (emod v_vector 12)
: h1 \) [/ }2 ? (entmod elist)" E* q! K9 H k* G' |( e$ u; {+ _
)0 w/ o: m6 w1 F2 P5 W/ N; v
6 _. O3 O, \9 L" K
;;
. r6 f% K" b! O' l) H ;; Run imageadjust on given entity, working around possible9 A, `+ D) n X( C& ], e, i3 `
;; re-entrancy problems
1 J8 o% h1 O4 [4 ^% K6 U' h ;;: c9 ^! c8 b- [# v0 D
(defun image_adjust (ename)3 Q& m6 y6 m( C
(verify_arxapp_loaded "ism.arx") ;; make sure it's loaded...
& d: O! a+ D( `' j; y: |! T' g (imageadjust ename)$ Y% x6 ~* R! @6 E, T# H
)% G/ u% m! z9 x f
, P7 S' }; ?- z7 d. ^4 W, c
(defun ddimage ()
) U# r% }1 F: I (if (not (new_dialog "ddimage" dcl_id)) (exit))8 O$ r' F% {0 E$ _5 ?% h" y
6 L9 F5 F2 ]" c2 |5 @* l' ?8 ]9 _
;; Grey out the thickness field.
9 U; h( g+ ]2 `" _2 {7 y (mode_tile "b_thickness" 1)$ w6 j! @8 t0 P6 A" V, ?
(mode_tile "eb_thickness" 1)+ M% O/ l' R6 M: O. e4 @
8 [0 D" F v; S* B( P
;; Get the associated def object.# B7 I0 {! M% l2 w0 z' b8 b
(setq image:oname (cdr (assoc 340 elist)))
' h- r% t, @4 X$ n& B: z4 Y (setq image:olist (entget image:oname))
y) s0 G& {9 x6 z/ J
5 M- z) V4 I+ J1 u/ f" e! E ;; Set initial tile values" q* T% K S1 K: ^& e
(set_tile_props)5 X1 B' Z9 ^: q8 g8 l0 E
(set_tile_handle)
% N" `. j" e }8 U! ~3 T4 I (set_tile_pt1 0) W0 [; _' l# f' w% ^/ ~; @
(setq image:scale (image_scale))/ e' ?9 |- [ k% V l
(setq st_ang (image_rotation))% a; B) R4 w3 t* s
(setq image:width (* (distance '(0 0 0) (cdr (assoc 11 elist))) (cadr (assoc 13 elist))))
3 k& F; t% W. w. g& u (setq image:height (* (distance '(0 0 0) (cdr (assoc 12 elist))) (caddr (assoc 13 elist)))); p$ Q' u" G! p% }3 J
(setq image:options (cdr (assoc 70 elist)))
8 o. l; T& _: ]& [( U, E. ~) l8 S7 J. I5 k0 l! G# f
;; Record the last multiplier for use in image_update function) o0 W8 O) f7 _( p
(setq image:mult 1)& W: w1 u/ W+ @7 I" I. j2 i4 O& Y
2 ^0 ^1 E: d1 y0 Y: x
;; Retrieve the image name. |# _2 k. H+ p( t7 R, _" O
(setq fn (reverse (dictsearch (namedobjdict) "ACAD_IMAGE_DICT")))# O9 h+ q$ _& H/ p
(setq flag 0)& a4 \, `3 s" l
(foreach n fn
* ?( y/ X4 m$ j( F (if (= flag 1)
$ G! G. f8 c. P ^2 L (progn
9 R* h- h. S! _* t6 P+ z ;; Display the image name }- \" p8 R" C' @
(set_tile "image_name" (cdr n)); Y9 L. c7 C- \: K; x
(setq flag 2)
2 a) `8 }" j, \: R) c )* U) u: i4 j, x: N5 K' @5 P
)7 _6 P1 I* O4 k- [
(if (= flag 0)
# h& I4 b$ q9 U' q (if (equal (cdr n) image:oname) (setq flag 1))! S/ U" d9 _$ w. ^
)$ U& l3 c4 l9 ]6 Q/ S% f# e: N+ C
)
r$ d* K1 B) W' e
0 n1 @9 ?( [1 h( }0 F# y% U (set_tile "image_path" (cdr (assoc 1 image:olist)))
: b5 p+ e$ l1 {- |- |2 D; v C4 r (set_tile "st_ang" (ai_angtos image:angle))2 V% F5 `5 B- g
(image_set_tile_scale)9 a/ M- L h; u! f$ N) R
/ {5 I) w+ X2 q D8 p; @+ V1 J
;; Check the appropriate boxes
7 P6 b5 Q# F# G) X (if (/= (Boole 1 image:options 1) 0) (set_tile "image_show" "1"))
: l/ \, k& k7 U2 b0 j (if (/= (Boole 1 image:options 2) 0) (set_tile "image_non_ortho" "1"))1 n9 ^- j1 }5 {; Y
(if (/= (Boole 1 image:options 4) 0) (set_tile "image_clipped" "1"))
+ w# t$ Q/ E! y4 b0 } (if (/= (Boole 1 image:options 8) 0) (set_tile "image_transparency" "1")); u+ w9 K, k7 F, |0 Q) h# R
% u+ M! ^. T) X$ K. P
;; Define action for tiles5 E9 ~( v. a9 {, N8 F) p
(set_action_tiles)# w* b1 j) w* z9 o. ^" _* Z' P- u
(action_tile "xscale" "(image_update \"xscale\" $value)")2 d ~) C K# s4 M
(action_tile "st_ang" "(ver_ang1 $value)")! E7 r8 f0 J( K7 Z, N: \
(action_tile "wid" "(image_update \"wid\" $value)")7 a! e4 [( G i: I) ~8 U0 r
(action_tile "hght" "(image_update \"hght\" $value)")7 [* u9 i8 A& f0 k9 K
(action_tile "image_show" "(image_disp_opt 1)")
, y. G+ i# B$ P: W3 d (action_tile "image_non_ortho" "(image_disp_opt 2)")
- ^& j- o5 t+ ?- e( o+ x (action_tile "image_clipped" "(image_disp_opt 4)")5 ~1 L4 q M0 V( \
(action_tile "image_transparency" "(image_disp_opt 8)")( d7 L5 y B$ P( P0 A$ }/ L
(action_tile "image_adjust" "(done_dialog 4)")$ Y: E9 I! W8 c; [, J# ?
) R+ K$ G0 L- X+ s! _
(setq dialog-state (start_dialog))
6 b% `. |/ ~+ O (if (= dialog-state 0)
7 C4 f) [/ e# j' @9 H8 _5 ` (progn
0 _$ ] X3 G0 F8 ~$ A2 G; g8 m5 R (reset)
5 A/ r3 c6 t0 u- W$ G l: W$ Y) s! t (image_clean_variables)) Z3 {% W. q- E+ ?" L+ l
) i/ m+ q/ d, v6 X0 f8 ?
)( ~7 g& M! U4 r& ~1 P* x, x* E) W
(if (= dialog-state 1): c1 A1 n. e! H# q' j8 v' f5 x! o
(progn
- y9 }- V. w8 f6 P4 h( j% \0 f% ] (modify_image)/ G9 }$ L n# v1 R7 J
(image_clean_variables)
; _" a, w3 m3 r0 l& ^% k )
$ _2 g3 V) ?0 N( {& M0 L8 W )
) |9 b2 T; I4 z2 n$ H8 V (if (= dialog-state 3)( f# ^ p# S- Y; z; m7 r8 @4 t
(progn8 o: x) h- c2 M! C2 a
(modify_image)
! u) o; A, K: E- q4 V- [ (image_clean_variables)% ^ ?- L" R- T/ d: \$ w
(setq pt1 (getpoint (list x1 y1 z1) "\nNew Insertion Point: "))
6 R" Q' F9 t0 C7 P; w3 | (ver_pt1 0)
% O% X" a, a6 q (ddimage)$ K& n; \; C: B) ^9 t4 b l5 M
)/ \; p! X! S- u" H
)
- Y# ~/ ?- X0 d/ f (if (= dialog-state 4)
4 V. o% D3 W g/ F* k; A (progn% Q3 |" `5 @: N* E) V0 K
(modify_image): {: _* a( ~2 f
(image_adjust ename) ^- V& T0 X2 y
(setq elist (entget ename))9 R. J1 `. p( e3 o* q! N; x8 T9 X9 J
(ddimage)9 u0 M4 `8 y5 }+ r% w! V" h
)) E- Z& m V# i4 g/ w
)& u( d1 Q6 S3 P8 _8 v
)& \( k3 c, g* |& V) Z: p9 K. s
& L1 S! l0 K3 Z0 i8 z) l/ @/ r' h
;;- f; @0 m1 B+ T; K
;; Modify BLOCK (and its Attributes, if any)
* u* s \' q# G9 T6 R" b- o9 w ;;
( X2 u% d$ z8 @( I# i (defun modify_block ( / el en2 p1 p2 oldp1 oldp2 new_hgt old_hgt attr
0 @2 b: x. Z* d1 `6 Z L new_wid old_wid old_rot scaling old_scale
; e. Z. h2 v2 q xdelta ydelta zdelta xbase ybase zbase ipos)% ^2 y9 _5 j! H3 F- b$ m, m5 o
(modify_properties); X1 _! }% j2 c& B- }
, ?/ O& D6 V2 n+ o% ?/ O( e! Q. o
;; First, translate and scale the Attributes, if there are any., S8 g8 A0 |& F1 W
(setq old_rot (cdr (assoc 50 elist))
2 x1 {# j) M- r3 X$ l" _ old_scale (list (cdr (assoc 41 elist))( O$ s/ T2 L+ y; V/ ?1 B" k3 L0 W
(cdr (assoc 42 elist))/ s; p& e6 J ^# v6 {
(cdr (assoc 43 elist))
0 P$ g, K \* w- A5 N6 v2 Y )
& S5 p! R2 e& k0 V; X+ t* ~9 M: v scaling (or (/= xscale (car old_scale))5 }) m1 I, a" r. u% N
(/= yscale (cadr old_scale))! f- q8 Q2 d, h. H9 G
(/= zscale (caddr old_scale))
) y } t; A, f1 [$ g3 l# z ), t5 ^4 |7 {) e7 o4 m j
attr nil ; No Attributes modified yet: M- h% o2 o$ j5 F$ D. o9 S
)
# V* ~3 O9 b, e! L( b (if scaling
0 t/ i% K6 _, e3 h! u- Y7 ? (progn v' ~ R1 Y! q2 T, T) F# e8 y% v* n
(setq xdelta (/ xscale (car old_scale))
9 \3 u( j! s/ @: V1 ^& w! S ydelta (/ yscale (cadr old_scale))
# A5 _# l* p+ m( x d( z* n- Q zdelta (/ zscale (caddr old_scale))
3 D/ `( |4 u7 s ipos (cdr (assoc 10 elist))! x/ N$ Q: r( R4 E
xbase (car ipos)1 R# c- A" p% \
ybase (cadr ipos)
( `: y8 r+ O: q h( j) C$ U: c zbase (caddr ipos)2 s+ T( W9 }% }
en2 (entnext ename) ; First Attribute
* c* C) G( M; {1 y2 a4 m )
8 z! [# P! |1 X- O v" K v$ k0 O, V( g" Y
; If the Block is rotated, temporarily un-rotate it, along
. {5 l7 \7 o4 ^* [ ; with all its Attributes, so the scaling/translation of the
/ w0 z0 z4 N$ `; v8 d ; Attributes won't have to take the Block rotation into account.( }- G. n+ p( N: ?; J8 ^
(if (/= old_rot 0.0)
6 O0 s. X/ c& I4 R K" v (progn
" h: u" n+ Y' V& A4 S (command "_rotate" ename "" pt1 (ai_angtos (- old_rot))). F/ j7 M) ?9 h: n! X
(setq old_rot 0.0
. u& q0 F, i* A" h6 I9 ? elist (subst (cons 50 0.0) (assoc 50 elist) elist)6 N7 I! _; Y6 ?* S% E
)
7 l1 j- ^1 H0 \. L) A )4 B' i3 \8 M+ n1 W( k! \7 x: f
)
7 l/ s6 j* J, O% c! H" {# ?* }+ Z, _3 [3 Z# ]# Y
(while en28 s* M% e, Q- V# u" {; G
(setq el (entget en2))5 C. P) G( d% r! E
(if (= (cdr (assoc 0 el)) "ATTRIB")1 ?* h- P% d. V4 _8 U, O k
(progn
/ C' m3 T1 @- F7 q (setq old_hgt (cdr (assoc 40 el)) ; Height
" v$ n6 m% f+ S old_wid (cdr (assoc 41 el)) ; Width-factor+ U' B3 i& M2 a) S
oldp1 (cdr (assoc 10 el)) ; Generation start point
, b: s4 A- B: a# s oldp2 (cdr (assoc 11 el)) ; Optional alignment pt
& w. G9 ?# A8 w ha (cdr (assoc 72 el)) ; Horizontal alignment! `9 t3 T9 E! t( b' z& v
va (cdr (assoc 74 el)) ; Vertical alignment1 m0 `: b. h+ _$ v
0 W& M/ @$ w! Y5 E
; Translate gen. start point( }% t# P, ?# S/ _4 N M" d8 L
p1 (list (+ xbase (* xdelta (- (car oldp1) xbase)))
5 `6 w* x. N. ]+ @ (+ ybase (* ydelta (- (cadr oldp1) ybase)))
- I3 V3 i' E4 L# F+ M (+ zbase (* zdelta (- (caddr oldp1) zbase)))
& S+ }4 i0 w" j" ~% O )" ^- b$ C5 X* `$ h. j
el (subst (cons 10 p1) (assoc 10 el) el)1 j$ Z' q2 p: i" O0 d- ?2 Q9 N
)
/ r1 w3 y3 {( K2 P4 J( o2 ]( F6 l% K8 h D9 e" d4 S! d5 p6 j" b
; Translate alignment pt similarly, if present and applicable2 I. Q: ^( ?$ M- W
(if (and oldp2 (or (/= ha 0)8 x$ A0 z; f9 |: z6 {. I7 {; p
(/= va 0)1 `8 m* n/ w) f0 `& v
)
; c5 Q1 L7 g$ S6 ~ )
. d/ T9 F/ W0 v* y' d7 @( p (setq p2 (list (+ xbase (* xdelta (- (car oldp2) xbase)))+ o7 S! m2 x \
(+ ybase (* ydelta (- (cadr oldp2) ybase)))
- N- \# A* ]: w# k# h* J5 W" V (+ zbase (* zdelta (- (caddr oldp2) zbase)))! B; y2 J6 z; b$ P
)( @; v3 ~9 A. j1 a$ a& T3 G
el (subst (cons 11 p2) (assoc 11 el) el)' Y% O4 Z) z+ ~$ u
)6 N( }$ a3 `& u0 d' ~/ f
)
% X: I+ O9 q2 h8 k* g" d
) a8 Q& \2 t; _6 Q$ v- C ; Each Attribute's height and width-factor were computed
( Y% o+ e2 P3 J' X ; based on the Block's scale factors. Adjust them now,4 _6 H( [8 l- S
; by first reducing to values for 1x1 scale...9 w4 w3 e' C0 Z$ g2 h9 A) v# Z$ A5 M
(setq new_hgt (/ old_hgt (cadr old_scale))
z" K: T1 G8 S9 u0 s, ^ new_wid (/ old_wid (/ (car old_scale) (cadr old_scale)))
- ]0 n7 i) O9 e* P V& _7 D )( t2 p( T/ o8 e# g
; ...and then rescaling.
" E4 t- R% \- ^ (setq new_hgt (* new_hgt yscale)9 v# [) s0 Y9 J1 B3 Q% D
new_wid (* new_wid (/ xscale yscale))' [" r y' L% X( @
)' N& n3 m: N1 ?: d4 D
(if (/= new_hgt old_hgt)
1 k" z) b6 c5 p* h (setq el (subst (cons 40 new_hgt) (assoc 40 el) el)), X6 p3 G; P& M6 U
)1 R1 }4 _& |& G- t0 `* G3 g
(if (/= new_wid old_wid)
, y8 ]% s7 [+ q9 E6 e (setq el (subst (cons 41 new_wid) (assoc 41 el) el))8 |- H' ]7 B+ t
)
9 X' _( Z: P. o6 i (entmod el)4 s# M5 S( S+ o
(setq attr T ; At least one Attribute modified2 C M$ @! S& m1 `' T4 e8 k9 {4 l
en2 (entnext en2) ; Next Attribute
. ^5 K9 M( r3 E& f F, c )
5 V6 f2 q$ d% E" j( ^3 t7 v )4 H n! R$ M# U3 M* o" |/ }' p- h
(setq en2 nil) ; No more attributes" i4 P1 X4 a0 O$ t/ [$ g+ W
)
4 m8 ?; Z9 G4 K9 I9 z ]: M4 } )7 ?( h3 ?1 {+ m& H
)
: C, l1 v7 V' X2 w3 h )
" Z# V& f! `2 h0 J/ e- s: U/ [
8 w# x E6 w0 y- i& T (setq pt1 (list x1 y1 z1))" d# L) Y6 O# t( t/ ]& L2 A
(tempmod xscale 41 nil). `- ]3 l- {. d6 {# i: s% I# H
(tempmod yscale 42 nil)) H* L6 e. G9 u- f5 o/ U. W h E
(tempmod zscale 43 nil)! g; D8 c+ `; A) i: K
(tempmod col-sp 44 nil). {3 d* ^' H: H( x" F# [6 L/ |- ]
(tempmod row-sp 45 nil)( Z3 b: R* O9 z6 a
(tempmod columns 70 nil)
. g+ Z3 X6 R+ P* B (tempmod rows 71 nil)
0 s6 {. v5 e+ M8 ~ (if (= xclipmode nil)% Q+ ^$ u- |" @5 K1 W5 v/ C
(entmod elist)6 o; p% a" }* t5 B4 ^
(setq xclipmode nil)
" x; G6 G( h; g )- K3 o0 w; ^1 u6 {( W) h0 V' _% J2 j
(move_pt1 1)
/ N6 ?, i6 W. f5 s& i0 t" R. `, e8 x) g. p% x; |5 g9 Q7 u
;; Now do the rotation with the ROTATE command.6 w) z1 g, D0 s5 i' z: N
(if (/= old_rot rot)1 Q" l* m2 ^# V7 {0 {9 I
(command "_rotate" ename "" pt1 (ai_angtos (- rot old_rot)))
1 S) J) S0 ^" ~% \. ?, o5 R (if attr ; Else, if attributes were modified,
+ Z+ T4 J0 z0 \* P2 N (entupd ename) ; just regen to force attrib display" x) h: F+ e( J8 v. P; I$ g4 ?
)
1 ? c! V0 b0 _ )! J/ |9 L7 d. `! W5 D
(setq elist (entget ename))
u, [) k$ @9 A5 K+ t( z$ d9 a )* A" a' {. i) k, r5 ~7 }5 q6 y0 z
(defun ddblock (/ temp temp_xclip newhatch blkname blklist blktype program xrefpath)( s9 V' n% g2 f8 S; c2 M
(setq newhatch 0)! c1 D) i8 K& _6 B
(setq blkname (cdr (assoc 2 elist)))
4 u, e) Q$ ]! R, n (setq blklist (tblsearch "block" blkname))9 x$ ^! d" x! c4 \ ?
(setq blktype (cdr (assoc 70 blklist)))8 `; ^# d$ P A2 N
(setq xcliponoff 0)
5 n, ^9 K1 q6 K: N: P ^1 T- k (if (or (= blktype 0)(= blktype 36)). F: b* L0 H8 G& M
(progn
$ k0 r* \& ?, j5 p' f8 E (setq xcliponoff (xclipon elist))- ?. P& o G% _1 q9 `+ w
(setq temp_xclip xcliponoff)
$ \5 _% Q, l% I& _4 X$ z* ]5 O )6 I, \( G0 h- F# R2 f1 t, T/ Y
) i- L% V$ j# u2 i' m
(if (= (logand blktype 4) 4)/ k* w$ u' e, K5 f8 z# y
(progn& w4 f* z% N$ Z5 |; L
(setq xrefpath (cdr (assoc 1 blklist)))
) p; D" z- W& x& p: | (setq help_entry "modify_External_Reference_dialog")5 d; g1 j4 ]1 `8 S$ c4 ]
(if (not (new_dialog "ddxref" dcl_id)) (exit))) R2 m7 i1 [2 d/ j- w
(set_tile "Bl_name" blkname)
9 }. ]/ w" @. S' m* W0 n+ H4 X2 H5 I (set_tile "path" xrefpath)
) i1 n3 h( T8 e4 `& S! d )
, t1 m9 N1 O o$ z6 h (progn4 t6 ?$ w3 G, U1 Z6 o
;; Get program name for use as Xdata app name6 t2 n; M2 S- J
(if (not (setq program (getvar "program")))9 g- n- Z* a7 z- X k; B$ {+ {$ d
(setq program "acad") G, B9 ]9 S* Q! u) H6 A& P
)
* b5 v5 v! }, {: I( s1 c (if (and (setq temp (assoc -3 (entget ename (list program))))
8 Y9 X+ M# j# l5 V& O (= (cdr (assoc 1000 (cdadr temp))) "HATCH")
' @6 Y1 p/ r0 S) q+ W$ z (assoc 1005 (cdadr temp)). |. |: L, c- X! _. ?' q
)- S: R3 F% h# C7 f. u
(progn
- E7 v3 \! k# I! M: ~4 j9 ~, }3 s (setq newhatch 1)
0 ~5 h; I6 [6 I( w% A5 A% k0 k! E (setq help_entry "modify_Hatch_dialog")/ F+ J; b( l& P( c* G# N3 `2 }
;;; convert the object into a new hatch" X7 b u+ c6 v3 ^4 w
(ai_undo_on) ;; enable undo v: N1 V& @- P& u
(COMMAND "_.UNDO" "_Mark")% H6 g' w* \/ K% D# O% k
(COMMAND "_.CONVERT" "_Hatch" "_Select" (cdr (assoc -1 elist)) "")
4 X0 @; U; X) w9 P8 t; b! k ;;; suppress nasty message from convert command, @ f2 J; W$ {% w/ U
(princ "\r \r")& N0 X( x' p9 }, V# C
(setq elist (entget (setq ename (cdr (assoc -1 elist)))))2 e! T9 m# z. w5 b
(setq old-elist elist)
! M# p" g- ~" Z' G" C( o ;;; If we have cancelled ddmodify
. _; x4 K% R" h1 U (if (not (ddnewhatch)) ;;; (ddnewhatch) returns nil for Cancel or T for Ok
9 @8 A c- c' n7 N2 F: I8 `! Y (command "_.UNDO" "_Back")
5 m. t3 E4 E, a4 @; g )
K; D6 A& A4 _2 a/ t4 [$ M (ai_undo_off) ;; restore undo state9 D" e$ i. ]4 b5 i& H
)' E5 D3 B4 r% ], W; }# g8 o
(progn
: M/ E. [5 L/ j( ?3 l# S (if (not (new_dialog "ddblock" dcl_id)) (exit))
0 i1 l% G) P: F, o: R" H (if ( = "*" (substr blkname 1 1))$ ^/ O+ ^7 S% v0 z. Y
(set_tile "Bl_name" (strcat blkname " - Anonymous block"))
7 s* B3 I" x5 Q* _ (set_tile "Bl_name" blkname)" i: d# }( G. m
)
% k1 b( Z% o1 ^9 q! ^ (setq help_entry "modify_Block_Insertion_dialog")
0 B+ k% s7 V1 {. o1 B )
6 _# m& d# K, p )
6 ~3 D( j6 o+ a. q' c, H5 T$ e- c )
/ g/ ^+ o; N1 L5 p )
6 m* x2 @* R' O# i) [: W* y7 p (if (= newhatch 0)( n2 q- k7 S& j
(progn! b K/ ~4 C& `
(set_tile_props)
9 P u0 d# `. g0 ~3 D (set_tile_handle)
# |* v$ D) [8 g) _7 E/ {( A$ S (set_tile_pt1 1)+ p2 }/ O+ y" n
(set_tile_rot)
) M3 L- {- j8 e& W9 R$ V, c (set_tile_scale)
7 B& z* n/ Q: Q8 p2 `- d7 B (set_tile_rc)
5 t; G, _) ^' Z" O) z (if (= (logand blktype 1) 1)5 F3 g4 w& P6 k% m2 j2 J
(progn
8 z9 E6 u2 A4 v5 Q x' v# R5 B (mode_tile "xscale" 1)
/ @: t+ o5 a% e" p& ?$ G) r' ? (mode_tile "yscale" 1)3 \7 a5 Q0 v* w& _0 h5 ?* n
(mode_tile "zscale" 1)
3 z: e$ E+ _9 {- ?* ]7 Z (mode_tile "rot" 1)
# I* I2 N% \4 H* s- i% X (mode_tile "columns" 1)7 q# L+ B6 [1 V9 [+ d# |# k
(mode_tile "rows" 1)' x/ y' D) N8 R7 u6 _" @* U
(mode_tile "col_sp" 1)2 _2 q2 o, w# \3 x R5 x) i
(mode_tile "row_sp" 1)5 [! S! i0 k4 R7 m% \, V
); l+ r0 T; A# S% I8 N/ d+ [6 N
)
2 K" n9 ?4 m- P# D& H. G; u ;; Define action for tiles
' P) I* \; M0 O- Z (set_action_tiles)* u- P/ I- D p9 h! Q4 e7 ?9 ?
(setq dialog-state (start_dialog))" s7 j9 o6 }4 ^ O* b% U4 H4 z- E
(cond
- ?* k& W e1 _2 K. [# k% ~+ _8 [/ D ( (eq dialog-state 0)+ \9 D; W: K* j+ ?* z( T
(setq pt1 (trans (cdr (assoc 10 old-elist)) ename 1))
- B3 u! {* G9 B$ ^! y& L: a (move_pt1 1)
8 n9 P: ~6 ?% O$ s (reset))
0 d6 r9 M0 ~# h ( (eq dialog-state 1)) |7 l2 C8 d5 Q% ~6 L$ T
(if (and (/= temp_xclip xcliponoff) (or (= blktype 0)(= blktype 36)))
4 O {/ r$ e0 F2 Z. f8 N8 l (xclip)- g, S1 }4 b! u9 e
)# e" q9 w0 J. |; \1 h: U$ d
(modify_block))
4 j1 k* F' }7 Q8 q, N$ ] ( (eq dialog-state 3)
2 v0 g& r; t' z" e; Y; h3 U (modify_block)
! _6 t% a2 Z; n" l& z (setq pt1 (getpoint (list x1 y1 z1) "\nInsertion point: ")) A% ~# V' M r! _! t
(move_pt1 1)
1 y5 h. P( i' F$ i- w (ddblock))9 o5 w: }7 _" Y4 Q r- m
( (eq dialog-state 4), l4 f4 m2 c( }$ T! o) a0 v6 P
(modify_block)
) P% a$ S0 N4 Q$ J ;; Get current handle.
8 _) P4 n7 i' p5 S1 ]; D (setq hand (cdr (assoc 5 elist)))$ U! H* }& F; l" E3 o% v* P' x
(command "_hatchedit" ename)# C) A9 `5 m( p
;; If OK in hatchedit, a *new* entity is created and the old one
$ J2 U# B3 A9 o; y ;; is deleted. So if the old one exists, it must have been a' W/ L& r+ q, V
;; so rest the entity.+ |, `7 o0 C$ i7 H0 G G3 y
(if (entget (handent hand)) (reset))
( f1 ~7 A) I( A2 G' l& k4 k& O( x% l5 d, P+ K ) [8 s2 C8 N( { T$ r2 {, ?7 l
)
; u/ _$ A4 Z7 Z# {# I )
( i: V( k6 F! Y# I6 C2 w )" {4 f8 c9 E" m1 z. {" \
)
- U9 i' Z& t: m+ r n6 m$ `, ?/ N ;;3 F+ K! R* i# R& C- d/ g
;; Modify SHAPE j% n ~/ e; Q- \- U
;;# z; _' C- m5 G! E c8 |
(defun modify_shape ()5 s; h, o$ }5 |$ v. L" o
(modify_properties)" s) p k8 I" ~! P" b8 N* X$ n; _
(setq pt1 (list x1 y1 z1))
' I: s5 g4 b4 c (tempmod pt1 10 1)/ i5 g7 f- [" X# ]$ ~- }- W
(tempmod hght 40 nil)
) P9 i6 D: F) W9 e$ s (tempmod wid 41 nil)
# W9 g, S4 t5 T- F4 S (tempmod rot 50 nil)
V( c1 [; \- L" S (tempmod obl 51 nil)5 Y! Z8 H% h# ~' }& o& @
(entmod elist)6 s8 n) q: I" E5 o5 r
)
4 E3 O+ S; l* |6 m+ E9 [+ E* z: V A7 h& V
(defun ddshape ()
* G `6 ^% M* Y (if (not (new_dialog "ddshape" dcl_id)) (exit))
4 O7 K3 q4 B" Q& A (set_tile_props)) ?* [1 B0 v f! l6 }2 X8 l
(set_tile_handle)
" e0 n2 u, U$ j; Y, ^# u v (set_tile_pt1 1)
* p+ v+ M: o! c1 g1 c5 c' F7 | (set_tile_rot)
+ G5 ?# p. t% J3 x1 S4 L (set_tile_hght)0 H) [& M2 W( ?. T( v, c2 J
(set_tile_wid)
: T# @ b# @$ ^: L (set_tile_obl)4 R# m! E# d- C a! b
(set_tile "sh_name" (cdr (assoc 2 elist)))
- F2 X# @9 c) b! G7 l7 _% m- _" u ;; Define action for tiles9 C/ N4 x& j: s6 d
(set_action_tiles)
- e: U4 M; `' P4 l (setq dialog-state (start_dialog))
0 w. d! u' q! D/ s: T0 s (if (= dialog-state 0)0 h6 E! m: a, N( d4 `, c: i" R
(reset)& @ _6 t% ]; n# U7 M
)! s2 v, k8 H# X0 U \+ M
(if (= dialog-state 1)
2 |0 ~7 |1 ?6 q3 s2 |( a (modify_shape)# a5 \: k* \1 o% G* [* b
)8 P% N1 I! c, N6 s& s8 \
(if (= dialog-state 3)4 H" K( ^5 O3 c0 L' @. C4 B0 F
(progn
6 P5 ?$ @. M$ g7 G# K0 g! g; F (modify_shape)
; F0 u: Q) A, O9 ~6 F' M$ H (setq pt1 (getpoint (list x1 y1 z1) "\nInsertion point: "))
+ C1 h( T$ }. Q' _; q (ver_pt1 1)
, V: r- Z# h* {, B3 I (ddshape)! P. |7 x0 u: y
)
( ]) b: e8 H$ t3 _2 y! K ): \. f$ k8 w- b: b/ A
)
, v+ ?! Z& n2 g7 [. [) T ;;9 V- q, E5 o/ K* \! `/ Y4 i+ X& g# Z
;; Modify TEXT or ATTDEF
7 T a% D/ z% J0 {0 E ;;
% q Z$ i3 L5 U5 i; p- ]" h ;; Set bit code for upside-down and backwards setting+ \2 m( F- z. R* Z
;;
8 u. D* n! }7 y7 J- ` (defun code_71 ()+ S7 X6 T* s( ?" s4 `* v8 h4 e
(cond ((and (= bkwd "0") (= upsd "0")) 0)
5 A2 c+ J) F7 M! V' y ((and (= bkwd "1") (= upsd "0")) 2)6 J# \ s* S' C, \& F* v
((and (= bkwd "0") (= upsd "1")) 4)+ E; o8 J9 N! {" S' O L
((and (= bkwd "1") (= upsd "1")) 6)0 E; d- r2 L9 E7 k% w7 {8 g8 n: \
)
5 j' r9 i! T" b' ] )
, e: Z% H) s W9 g2 d3 Y' }# S( w ;;1 _& p0 f# v$ @. w
;; Style action. Reset widget values to style defaults# r" u7 p9 N; U- G0 G# i- \7 H& a
;;, Q" H/ X$ C0 \6 r
(defun style_act (index / style-list)' b4 J! W8 B9 a- V G \9 W
(setq style-idx (atoi index))# N# o% W0 R# f5 z; N4 J. {* X% d
(setq tstyle (nth style-idx slist))2 y) Q7 [* M0 t
(setq style-idx (itoa style-idx))
) L" I5 e/ F4 Q. d (set_tile "style" style-idx), I4 O- i% V2 @/ X3 G- M2 J
(setq style-list (tblsearch "style" tstyle))
' x+ A; b- E' l- |- a; |9 h (setq shght (cdr (assoc 40 style-list)))( _, D( Z! c% A/ v8 u
(if (/= shght 0)5 }1 `( Z4 y! q( G/ w, v* i. f
(progn9 v! ]2 C) C0 E# D
(setq hght shght)
- g+ t0 A" K/ ]: ]/ [/ p. b (set_tile "hght" (ai_rtos hght))
) \9 z, \4 K- p% H ). S! A0 S- c1 b8 E0 W
)
! s4 y d3 B1 [3 [1 d' z: W9 S (setq wid (cdr (assoc 41 style-list)))/ S& B2 ?7 e: v' r% ?
(set_tile "wid" (ai_rtos wid))
) B2 Z* Y; V- D, g1 I (setq obl (cdr (assoc 50 style-list))): I0 o" ]/ L) q, G+ O: [. p
(set_tile "obl" (ai_angtos obl))
' ?# U) i2 U8 o: G9 |; x8 | (setq bk-up (cdr (assoc 71 style-list)))( s1 {9 n4 t% y" A- \, [. _; w& I
(if (= (logand bk-up 2) 2)
% h6 b7 y1 e8 R8 g8 h (set_tile "bkwd" (itoa (setq bkwd 1)))
" _! u4 U5 a6 N- S! b" Y [: A (set_tile "bkwd" (itoa (setq bkwd 0)))
8 ]5 @' C8 Z! ?* v1 z# H/ r )7 i" V. |5 V9 x0 ~& y+ S
(if (= (logand bk-up 4) 4)4 I) j3 k7 ~6 A6 R/ P; R: b6 g
(set_tile "upsd" (itoa (setq upsd 1)))0 Z' m, w; D2 F( @; q
(set_tile "upsd" (itoa (setq upsd 0)))
* t5 p* V( _. ?, ]- m9 j )
9 K/ k `: `; t, ] )8 j% w/ W" Q) L d+ ]8 z
;;( W3 P! S* C) u: S
;; Justification action. Set vertical and horizontal alignment variables,
5 X' z* U/ R# ~- m- i0 n( D! K7 e ;; grey out rotation and height if alignment = "aligned", grey out rotation2 Y3 Z8 s# H4 l- s1 S+ R; i7 m
;; if alignment = "fit". q2 s4 D/ P5 o" a2 q3 B
;;3 j* h6 a& q* Z
(defun jlist_act (index / templist)- _+ X! C4 a$ _
(setq just-idx (atoi index))
: z$ `# X3 u4 q5 _/ F7 J (cond6 C ^/ t8 F" M! ~# Z h7 R
((= just-idx 0) (setq va 0 ha 0))
$ {: z/ k0 W% J, q0 ] ((= just-idx 1) (setq va 0 ha 1))
! w9 }; h3 h `& Z2 ?' ] ((= just-idx 2) (setq va 0 ha 2))
7 ^. @7 ^+ a) L+ Y0 g/ M b ((= just-idx 3) (setq va 0 ha 3))
) e( {8 Q. N3 i# f9 I$ s5 O ((= just-idx 4) (setq va 0 ha 4))) V) J" n$ j+ I, K3 B
((= just-idx 5) (setq va 0 ha 5))
9 ^$ k$ }- @2 \" S) h ((= just-idx 6) (setq va 3 ha 0))5 {1 R9 P- c* a8 j! I l# R! n
((= just-idx 7) (setq va 3 ha 1)), a: m; G& G- Q H
((= just-idx 8) (setq va 3 ha 2))
" ?& \1 F) ]( ^) ?0 _# \7 w ((= just-idx 9) (setq va 2 ha 0))
( u4 r: K& @# L @! m! Y8 L) ] ((= just-idx 10) (setq va 2 ha 1))
" t @5 B' O5 s4 l9 ?9 W* L ((= just-idx 11) (setq va 2 ha 2))6 P3 G0 T/ `% T/ y9 y' {
((= just-idx 12) (setq va 1 ha 0))9 V. Y6 M! v" h9 u" K6 f% o
((= just-idx 13) (setq va 1 ha 1))9 e/ r5 F; g) D0 H! ?& W
((= just-idx 14) (setq va 1 ha 2))$ o, F- _% K5 A2 G
)* K3 a. }# b7 H ^% N: n
(if (or (= ha 3) (= ha 5)) ; If Aligned or Fit text
& o7 k: ^( e3 i5 I* O( s5 r (mode_tile "rot" 1) `/ z B( s4 o; P" }" A
(mode_tile "rot" 0)
3 \7 v" r7 \$ l, `, ?! k )/ v* X I7 b7 [' [2 v1 l7 |( y
(if (= ha 3) ; If Aligned text4 [, t" S7 o$ w
(mode_tile "hght" 1)
1 |# l- V" z) x# B% Y0 y$ u (mode_tile "hght" 0)
, D; `5 g0 v/ l# A1 {0 Q0 M# Q9 n' l$ z7 @ )
: R7 H; r$ Q! \ (if (= ha 5) ; If Fit text: P2 q u7 e" {
(mode_tile "wid" 1)
5 O' T, E& b; ^4 z (mode_tile "wid" 0)' p7 S6 z& e6 ]2 l8 Q
)# Q& S5 @. O7 I$ b! h
;; Reset rotation and height if changing from aligned.& [7 U+ a4 T- M/ N! Y
(if (and (= ha-prev 3) (/= ha 3))$ f' S+ {' [% ?4 J5 [: D3 H( k; u+ C4 r
(progn$ G7 B+ x! r5 u
(set_tile "rot" (ai_angtos (setq rot 0.0)))" X/ ^9 g5 `; m4 S
(set_tile "hght" (ai_rtos (setq hght 1.0)))+ t* _5 U1 b9 ?# h
) I8 a+ ~/ I. Z8 f' Z2 \8 j- H
)
' {' l, X4 s% Y! w6 U) Z8 ^
5 G, X8 r: y$ b- ] ;; Reset rotation and width if changing from fit.
; I6 S0 W) w' K ]8 {9 x/ y (if (and (= ha-prev 5) (/= ha 5))# J: R. y4 u/ N/ B
(progn
# _: Y, O, U/ W/ p9 U (set_tile "rot" (ai_angtos (setq rot 0.0)))
# |+ e+ b- T3 Z) H# P (set_tile "wid" (ai_rtos (setq wid 1.0)))1 |; N1 o* n% o2 W% E6 C4 g
)) G; K6 l2 ~& L! ?% S& f: W
)
$ `" E( a, ?& `
! C9 ~; D4 _; W5 n0 q$ @" E (setq ha-prev ha) ; update ha-prev for next time/ o# ]0 |: N4 m8 F# A
(setq just-idx (itoa just-idx)): M f. ]- C5 ]
)5 |% E* g' g$ b8 [* E3 f' F
;;
/ a1 R1 {, I, i; N ;; Set intitial alignment setting based on vertical and horizontal alignment
( I6 `0 w! a) F" |$ i4 D2 _ ;; bit codes.3 o2 L2 G( Q, a/ N) u1 S
;;
. u/ p. n, H4 Z y, V (defun set_just_idx ()
3 M+ E* k/ t/ o- T. y, ~, q9 A (cond
' X9 {& z" S9 c$ j9 w) w! v: W6 g ((= ha 0) ; Horiz alignment = Left
* s+ r! _8 Q- U+ }4 h (cond
/ k, @/ u: E) O# V& ` ((= va 0) (setq just-idx "0"))
$ P0 u, f9 N: P* ~, l# }5 |/ G ((= va 1) (setq just-idx "12"))0 x/ P$ W+ C1 B% M
((= va 2) (setq just-idx "9"))
' z6 Q- r# j8 Z8 C+ w2 a' [2 U1 G ((= va 3) (setq just-idx "6")). L4 {% p- i4 y# X
)
# Q- T" F" d" p. z5 Z4 ?, L1 V )4 t& e( ~9 x' M3 j: C. ^" E
((= ha 1) ; Horiz alignment = Center* U" H- R' v, F2 P# Q
(cond' C0 r" {$ o: C, W/ }
((= va 0) (setq just-idx "1"))- ]! `8 i4 }' z0 b1 [
((= va 1) (setq just-idx "13"))
9 w& k$ T- W1 x& C+ \. s' \9 q% m3 H" ] ((= va 2) (setq just-idx "10"))8 K9 k0 t; R5 M
((= va 3) (setq just-idx "7"))
2 T. z4 }& l7 c- ^ )
8 p1 G/ X6 T5 T0 z j8 a: w )2 D: Z9 _# V5 D
((= ha 2) ; Horiz alignment = Right, {! g+ y2 y9 E; [
(cond
; a7 Q; u( W& d2 K; k* T; I ((= va 0) (setq just-idx "2"))
, s' q: y! w8 q ((= va 1) (setq just-idx "14"))% e4 A/ w3 b; ]( K9 W; y$ l: s
((= va 2) (setq just-idx "11"))
5 a6 f3 a( d% c- |5 K- \! F ((= va 3) (setq just-idx "8"))
+ X& r& N3 P, r6 `- }: j( P" e )" g/ V+ _5 `" y" d: P4 s0 M% ]
)
5 I* f: \# L* P6 ]& `# V" h( c ((= ha 3) (setq just-idx "3")) ; Aligned ?8 b- _. R7 k% n$ E" }: b% l# S8 m- T
((= ha 4) (setq just-idx "4")) ; Middle
3 X" X2 X( q& U- |4 H+ A ((= ha 5) (setq just-idx "5")) ; Fit) b1 s: a: x- ~ g3 n
(T (setq just-idx "0"))7 S* j3 X; g4 s; v; ~
)
; U/ v9 m) x' {6 g* J7 o just-idx/ U' p* k Z' A9 i8 U
)1 S$ r( c$ ^5 H: _) m R3 [
) }# j+ J8 j. ~& U: ~, x+ P (defun modify_text ()! N! P2 \$ o8 M& c/ v
;; insertion point* @9 [. D) B: K( H
(setq showpt (list x1 y1 z1))
/ L% ~* n3 E: X5 S0 x: B# w2 a (setq bit-10 (trans showpt 1 ename))
/ @. w1 ]* z; n2 p8 W) N ;; alignment point& D& B' _7 w3 [, S
;; for 'Aligned' or 'Fit', alignment point must be different' ?% H+ G8 J' W* r7 e. y3 y8 [
;; for all others, use insertion point
$ {1 ?6 ~# x/ V1 \# Y, P ;; (ACAD will recompute insertion point)1 V+ v- c4 T1 n
(if (or (= ha 3) (= ha 5)). x8 Q5 a) L# o M
(progn
; N9 Q! F) Q4 b' ?& ?2 S$ p ;; if no alignment point, fabricate one1 B6 `. F+ |% \2 Z) D
(if (not alipt)- M( G6 N- @9 H p, x' J& }- g* W0 ^
;; add text width to insertion point
+ z+ v/ y; k! r& y2 e (setq alipt
' b: G# i$ B* O (list (+ (car showpt) (car (cadr (textbox elist))))& J; s3 E7 q N8 u6 M
(cadr showpt)
! t G9 J( n- y$ T; F7 B: }' Z" `8 R (caddr showpt)3 E$ A/ v% Q4 b7 n
)6 j$ b& J, j" o2 |
)
+ O( D& A. H9 b% } )
! ~8 ^1 X6 D8 M8 [8 l% y- e+ O2 f* R (setq bit-11 (trans alipt 1 ename))7 o3 W- a+ I. z5 j( J/ k
)
8 u k. v, [5 Y. [+ [ (setq bit-11 bit-10)
1 ?) w/ ?6 _ ^* {, U )
; J& v! k" o8 W (modify_properties)+ r8 _: ~% [" ~7 B% Q
(tempmod tstyle 7 nil)
1 U$ W8 w/ r4 Y8 p. W* E; c# c (tempmod bit-10 10 nil)
% ?! R- I! z9 M E% ^" W) w (tempmod bit-11 11 nil)
+ c. ]! J' T. a; @ (tempmod text 1 nil)
2 P [1 v8 r, K5 T1 h (tempmod hght 40 nil)4 c" e. \/ O& f5 V- L4 f) v0 K7 b5 I9 @
(tempmod wid 41 nil)# W# a# K; z" m, {
(tempmod rot 50 nil)
0 W' ?# {0 Q, n (tempmod obl 51 nil)5 @) S! _0 o6 t$ p l9 `- L
(setq bk-up (+ (* bkwd 2) (* upsd 4)))! c8 m& a ~' u% h5 r
(tempmod bk-up 71 nil)
. H! f% R% a! d# I: w7 O+ | (tempmod ha 72 nil)
) W& x; [1 k: x+ k$ G0 U ;; Attdefs use 74, text 73# i+ Q$ g6 a, H/ _6 S$ r2 f- o% B6 A% v
(if (= etype "ATTDEF")8 |( m; d) s; b& `! J% X; o. ~- m
(progn1 z% j6 E! o E! ? n$ a0 ~, [
(tempmod attag 2 nil): S4 ^ O& q! D, d6 n
(tempmod atprompt 3 nil)
( l8 D' Z( F6 y( j, [ (setq icvp (+ inv (* 2 con) (* 4 vfy) (* 8 pre)))
0 U. p2 F8 y0 Q3 Q. X (tempmod icvp 70 nil)
. d' |( N4 u' v: J- r( {6 A6 M (tempmod va 74 nil)# |9 z; i3 @5 E
)
4 S( A- y9 B( k% n3 U: ]- C (tempmod va 73 nil)* d* E3 V5 [. \4 W$ t9 N2 d
)
8 r8 ~5 e* Y" k$ q3 L$ n1 d (entmod elist)9 w* O6 a' {2 i" d" h9 F$ u
). n, V8 z! o9 F* Z
8 T$ L9 l2 R& T, q+ \2 B' v
(defun ddtext (/ 2ndpt slist i)
( C7 a9 E5 C. v7 M# ^! U (if (= etype "TEXT")4 C8 o1 M: R% t: U: k$ p* n) v
(if (not (new_dialog "ddtext" dcl_id)) (exit)) A: }! z3 _% j- ]3 m, K
(if (not (new_dialog "ddattdef" dcl_id)) (exit))+ \$ i8 b7 I* ?; ?3 ?- {
)6 d- ]( H5 `/ S
(set_tile_props)& u/ m- T" J- G/ l; ], I
(set_tile_handle)
& I$ [! L# s' ^, s- P; C$ J, T6 J: C (set_tile_text)
' h8 M6 a& o2 o0 ]2 T/ }: a- \ (set_tile_tag)
! H: p. s9 ?- X0 Q7 X9 @3 S( | (set_tile_prompt). x. H& x( X& a0 \; k0 [
(set_tile_hght)
+ M' S, b7 X+ y3 k (set_tile_wid)
. E7 q/ d/ w8 n7 @% o. E" X (set_tile_rot)+ t, b, E+ C3 ]
(set_tile_obl)
) @& q1 f, i- T4 F (set_tile_bk-up)
4 W4 y* Y) @6 Y$ S( ` (set_tile_icvp)
% ?$ G0 o8 o* d* G1 m (set_tile_style)
0 Y- H/ r. n1 j, g" E3 { (set_tile_just)
, ~0 }: V- Q4 R0 G (setq pt1 (trans (cdr (assoc 10 elist)) ename 1))
% H6 y. \& G9 y1 N& T2 m (if (not (assoc 11 elist))3 U) n1 |% c3 U; Y7 I. L: k
(progn (setq pt2 pt1)
( C+ x0 C: U6 d2 p (setq elist (cons (cons '11 (cdr (assoc 10 elist))) elist ))
9 l7 \, Q( Y. Q- T5 n% R ) m8 g7 W! k7 n& m
;;(trans '(0.0 0.0 0.0) ename 1))
/ O9 F5 D3 K- @6 T; r7 t (setq pt2 (trans (cdr (assoc 11 elist)) ename 1))8 G. M- E' E$ w
)$ x/ |, q+ ?0 c- T [% @+ g
(if (or (and (= ha 0) (= va 0))9 k5 i: O1 \& O5 D3 a8 c
(= ha 3)4 n ~3 z8 F8 @! Q2 u
(= ha 5)
" p+ [1 e' A' j9 w% c* h )- y( w' B) A6 `+ ?
(setq showpt pt1)
~1 ]' x! V7 |) G( j# ?3 q/ g! u (setq showpt pt2)
* T W3 W" g% U; k% T; } )
' G" O0 g( n* R! O; Y (if (or (= ha 3) (= ha 5))
* a9 X0 v* }6 u6 x$ \ (setq alipt pt2)/ e- R+ B9 _0 C/ j7 U% H' {0 k
(setq alipt nil)* R' o2 v& l( x* q5 _
)
% D2 @5 i4 b, P' b- \% Q1 j
/ \2 w& B! ^ e) j0 n7 G$ V; v (set_tile "x1_pt" (ai_rtos (setq x1 (car showpt)))) n: A v. w0 U' N+ i
(set_tile "y1_pt" (ai_rtos (setq y1 (cadr showpt))))3 l! _4 {* X. Q3 M$ K/ X3 l
(set_tile "z1_pt" (ai_rtos (setq z1 (caddr showpt))))' S1 h) Z, B T9 y: s# i3 A5 ~
' r" W+ r$ Z1 F/ z0 }) i( c" L ;; Define action for tiles7 @, L4 R+ ?8 S9 t
(set_action_tiles)
. n9 L* S/ A, V0 w# w7 v- r ;; Set focus initially to the text edit box.8 L1 Z; @; \5 r3 R& X( p
(if (not i) (progn (mode_tile "t_string" 2)(setq i 1)))5 J+ Q6 j' Y$ \ v4 X1 I
(setq dialog-state (start_dialog)), ?8 X4 A6 [1 y9 c% ]2 R
(if (= dialog-state 0)( y/ s3 v6 x3 X# T) H" j6 \
(reset)
1 u" e ^& ?+ V8 s3 `' ] )7 u; h( H0 X3 g. Y
(if (= dialog-state 1)$ U0 O9 i8 m7 q
(modify_text)
9 V1 _$ d9 F* c! w )
* F8 K& P" R G% T. K (if (= dialog-state 3)
9 p7 m& H% ~4 H; H4 N( b (progn# I2 H( g6 n% Z: u# f
(modify_text). p$ \1 w0 @- i" f6 ?7 }. g8 C
(if (or (= ha 3) (= ha 5))0 \, T# {8 Q- r4 ]7 W
(progn, O! w- a4 H( s ] F5 @
(setq showpt (getpoint (list x1 y1 z1) "\nFirst point: "))3 u2 H" w# G G- p4 N3 ^
(if (not showpt)
. W$ g) u! i6 r* d% x (setq showpt (list x1 y1 z1))
" J$ l8 @! c/ e& E6 U; |% ^ )
3 s$ D- C- x$ t! b4 H& V* X (setq 2ndpt (getpoint showpt "\nSecond point: "))& ]* J9 D: x; z4 J5 \+ `& V
(if 2ndpt8 j" r. ~0 E# N# k% b! u( k
(progn
2 W) L" j9 ^; Y" N9 w$ d (setq alipt 2ndpt); m7 G/ [* P, Z$ B
(tempmod showpt 10 1)
# U& j& F! r7 i$ c (tempmod alipt 11 1)
) j" k' N. p! j7 G, m (entmod elist)- Q# ^3 E9 X& O [& Z# y
): Z* ^2 m! M3 V+ l7 W
)7 d( j& \$ S% N: t
(setq elist (entget ename))
) j) R0 J2 Z! O* T% m )4 ]0 F! ]7 {- D) V+ V
(progn
, X( y9 b @% f! r1 D0 M, D (setq showpt (getpoint (list x1 y1 z1) "\nInsertion point: ")). V3 v. z/ s9 j, K k$ |
(if showpt9 ?1 R& A& d' T0 A3 [
(progn
- f. E. I: a8 s2 y$ k% r (if (and (= ha 0) (= va 0))
- f; H1 s( R, {3 G (tempmod showpt 10 1)
$ w2 u1 Q5 w) A9 p7 e! }. [5 o (tempmod showpt 11 1)
/ g- r3 X9 K; `. t7 @ )
3 ?1 _# i6 {/ e/ b+ B$ g (entmod elist)( o5 U% P7 O- E
)% g% ]* H( o6 a" F" R
(setq showpt (list x1 y1 z1))
2 c0 [' T3 ~, A( q! e) @ )/ {. E/ C& V7 o! K! v
)
. P' z7 e5 L) Z" G5 ?& J )4 j+ U5 b8 U# I) e- u) Q) f
(ddtext)$ @1 R- `. Q- ?% F/ Q
)6 E; K! w! y7 g5 ]" ?- D
)
" _0 k% k0 l; ~& ]7 J. q8 ?8 W5 { )
3 u! v7 ~: O* Y5 o/ X7 `1 i! w& P
;;6 N" j/ s9 p: Y. j2 D1 E: G
;; Modify MTEXT1 y) s& N/ S1 b& o
;;
1 q1 K- F* l; Q" }. @: x1 B (defun modify_mtext ()( ?! N& ]' @, Q8 \ H) j
(modify_properties)
, r6 b! J6 e* \0 u0 }# L' P* ]2 V (setq pt1 (list x1 y1 z1))
+ `3 o0 b0 A9 t% w5 x (tempmod pt1 10 0): R9 a/ V; b% A* d* ~4 ?; s3 i
(tempmod text 1 nil)) @4 _1 `7 g. z ]
(tempmod tstyle 7 nil)
4 }0 v- t2 e0 C4 }; D& m (tempmod just-idx 71 nil)( V; L" S/ |; T+ y. z6 M# d
(cond
5 ?. ?+ b4 d4 n' p3 U) r6 q% W ((= dir-idx 0) (setq dir-idx 1))" o5 n+ w: R4 ?6 h- X7 {
((= dir-idx 1) (setq dir-idx 3))
$ ~+ @1 x/ E+ u- p ((= dir-idx 2) (setq dir-idx 5))
, z. _$ R, C7 K (T (setq dir-idx 1))
2 u7 m0 \( E/ x, X, _ )
8 n: q( K8 S1 r0 G- Q5 `3 M (tempmod dir-idx 72 nil)
, D* k% j# s% z3 M) o! l ~ (tempmod hght 40 nil)5 `2 a% P& z; G7 P2 _6 F7 D3 d" I1 F% h
(tempmod wid 41 nil)
: N7 \3 J2 G1 m( l (tempmod rot 50 nil)% C& S* G. [3 c5 N5 t, C
(entmod elist)& \) q& y/ O+ L, v! M$ J- R7 Y
)
% H1 P# K; p5 ]- V( e: F+ h$ o; \) L3 c+ P6 A
;; Set MText text style
; f! E3 S/ z! g. f3 P2 U (defun MText_style (index / style-list)0 G, `: D4 w/ B- J ]0 }0 G
(setq style-idx (atoi index))
2 L3 D) Z8 W1 B0 T1 s (setq tstyle (nth style-idx slist))
: g+ y! s7 ]1 w (setq style-idx (itoa style-idx))
! @. Z2 P" I, _0 L6 D' N (set_tile "style" style-idx)1 p+ k; i9 Z" V* N* u3 \. C
(setq style-list (tblsearch "style" tstyle))# E2 c! [4 s7 m6 S: S5 I% ]
(setq shght (cdr (assoc 40 style-list)))( n0 b, W( l/ O2 w9 A% j
(if (/= shght 0)
+ L5 J# M! X3 Z (progn% o& d- [8 F2 R! c; I; ?$ W
(setq hght shght)9 ]% j6 ~1 {! h1 O- G, D
(set_tile "hght" (ai_rtos hght))
9 G" A# a! p9 x) |3 n* j; f )0 D( D5 e& T1 Y3 f8 ]. u
). |& R; J2 ^' a/ a
)
2 j8 ]3 Q* p' m {- ^
7 o8 {, ]/ z, c& T0 R- e ;; Run DDEDIT on given entity, working around possible re-entrancy @" i+ e3 g2 x+ Q$ W/ n. m! m K: ^' D
;; problems with MTEXTED# f; e+ J9 {; f' |
(defun safe_ddedit (ename / orgMTextEd work)
' k0 }9 `7 Q6 y! \9 @: M2 z (setq orgMTextEd (getvar "MTEXTED"))
6 Y; j& U j: ] (setq work orgMTextEd)$ L+ c% t) R* i. s; R0 q0 A
(if (= ":" (substr work 1 1))" w# F. _5 ~, d/ g9 ~: M" N+ n
(progn& q* {5 R. m: o; {: W% I
(while (and (< 0 (strlen work)) (/= "#" (substr work 1 1)))( v0 O9 W7 R& p$ g; }3 g
(setq work (substr work 2))
$ P, U1 X: e4 o: _% y( P- M )
# L; G- H* r% {9 e# M (if (= "#" (substr work 1 1))" z" J% m* D. l2 u: O* L
(setq work (substr work 2)): |# V6 U' u, o3 c
)
5 j [/ c# ^( z& U& e$ K (setvar "MTEXTED" work)
* B9 [0 C E# N# R1 T6 U& C )# L! P& A' m( o2 f e
)
+ N3 M( n1 ^4 f (verify_arxapp_loaded "acmted.arx") ;; make sure it's loaded...
; h8 Z* Q b! ^2 R% c2 ` (command "_DDEDIT" ename "")% w) T1 ]6 A0 I6 X J/ M
(setvar "MTEXTED" orgMTextEd)( ]0 V0 R& Q" N6 ~
)
( Y/ o3 R- C' x/ k8 C6 B: ?: g% B+ e3 _: Y" g6 z! g' {* R
;; Verify MText object width
8 v! x4 {' C: t, k (defun ver_MtextWidth (value)
& C8 m- q" E/ D% } (setq value (distof value))& X% D; e+ A0 B3 L) w c4 M
(set_tile "MTextWidth" (ai_rtos value))
. c! z" C6 R: r& y. u7 k5 N- f+ t, f (set_tile "error" "")
# Z% `5 I9 Y7 R. P (if (< value 0.0)5 ` L0 {0 H# I9 Q
(set_tile "error" "Value must be zero or positive.")7 z% V+ n% n. V @
(setq wid value)
2 Y$ s W3 K1 l% j4 l6 s )
g( h0 Z4 F9 U, y7 C5 F, q( ~ )
8 g. a$ i8 Y: t1 K# P
5 L$ i O2 O( S0 E( P (defun ddmtext ( / gc3)! q* L! M1 d# l
;; Get dialog! C& U3 ?. L8 [) p+ W" ^6 M1 C
(if (not (new_dialog "ddmtext" dcl_id)) (exit))$ F1 `6 X, m' y
. |, V& J) A2 _# l7 j
;; Load list boxes: O+ r: e$ D" M$ U6 _
(start_list "MTextJustify")
5 x1 t! V) {3 ]. S; g" P (mapcar 'add_list '(
" B$ C3 F* G! t "Top Left"
. L. i- D% Z j$ @8 U "Top Center"
& Z1 y6 u* q# O0 p "Top Right"! z ~5 w' j9 x
"Middle Left"; b8 e" W1 t _# l
"Middle Center"' E- D. i3 e# u
"Middle Right"
! U3 r* m6 `; D, s& i- J: s! A "Bottom Left" A8 ~5 x5 ` \ _
"Bottom Center"3 l1 }+ s6 m! v
"Bottom Right"8 g: L7 U0 h) r. w6 m
)
$ O' M' E' A1 C2 G )
, J5 u k1 T, x" Q+ p | (end_list)
9 {0 Y; g( h; W8 v& r, v3 S+ c
1 r. \. _: i4 _2 N (start_list "MTextDirection")9 ]$ y' e/ b+ v4 w1 p
(mapcar 'add_list '(
3 |* U& D5 Z5 Q4 j5 a0 r2 x "Horizontal"4 @ S( q" u F9 a6 W' Y# U
"Vertical"; K( F" F* Z1 Z; I$ c4 y. s
"By Style"
( G; Q! A% F% @1 L+ m6 f ): W% L* O, P2 I: g- Z _$ _
)" W/ w( m/ l6 Y2 }7 R
(end_list): T5 g* Q8 ]; D! i) m
; @: b6 L9 X6 T" y9 X `$ }9 R ;; Set initial tile values
5 ?: {4 X+ F, X, F+ ^ (set_tile_props)
' a' E7 J/ C' t" A e) O7 V1 P1 b (set_tile_handle)
- D- Y9 L" R: l* F1 `' r# e (set_tile_pt1 0)& w/ A& |9 {( u L) U, C, S
(set_tile_style), x7 i( A) X* P; L" ~3 ^
(setq just-idx (cdr (assoc 71 elist)))
; H6 _0 ^5 ]9 X2 ] (set_tile "MTextJustify" (itoa (1- just-idx)))# C% [/ `0 x2 m9 z
(setq dir-idx (cdr (assoc 72 elist)))
$ J7 |- p% k+ |, D* M! { (cond, S# a- l; \+ F7 d( ]9 A. P
((= dir-idx 1) (setq dir-idx 0))0 ^, v+ _, w' w# F
((= dir-idx 2) (setq dir-idx 0))
2 Y' h7 G9 P9 u0 {2 a- d ((= dir-idx 3) (setq dir-idx 1))
) k' m7 C5 v3 \- p7 B ((= dir-idx 4) (setq dir-idx 1))
3 n& R4 c. f% c) p' a# P0 F0 J! J ((= dir-idx 5) (setq dir-idx 2))& H2 w6 E* Z# j8 T
(T (setq dir-idx 0))
# V; Z) m. J$ v+ t1 e )% y, ]( m F/ W) D/ i6 P
(set_tile "MTextDirection" (itoa dir-idx))
; U7 L9 w0 d0 Y' m! p (set_tile "MTextWidth" (ai_rtos (setq wid (cdr (assoc 41 elist)))))
& G" D' ]/ D9 T9 i (set_tile_hght)& k, P" J- g: h
(set_tile_rot)0 x# Z2 n0 O" X8 t4 H. I
0 m) T& S: t) O1 \
;; Set edit box, disable if too long
. R1 \# _$ ~( b4 X2 s (setq gc3 (cdr (assoc 3 elist))( S; q" X! I4 ~, P, R8 ?+ a6 V
text (cdr (assoc 1 elist)))
/ T7 \% c1 {& [ (if gc3
# @7 M3 G1 o4 y' Z" D (progn ;; Text is over 250 chars, disable edit tile
; Z5 v7 l! g, R+ l4 m) Z+ D; X (set_tile "t_string" (strcat (substr gc3 1 25) " ..."))
. q8 d$ \2 k8 ~( T$ P8 L( k. V. u7 ^ (mode_tile "t_string" 1)
+ G! W% ?1 N( n- ?6 c )
. Y, t. g4 r {8 U' U/ j# I (if (> (strlen text) 80)
! H% G: a2 b- B" R7 `$ Y (progn ;; Still too big5 E( V& c g* V) C: {
(set_tile "t_string" (strcat (substr text 1 25) " ..."))
" @& _( |% }* P! P/ d (mode_tile "t_string" 1)9 R5 B' g6 V7 A9 Z4 k& s% D
)
; h1 s5 a1 X) M1 O& c# z& P; p2 U& g (set_tile "t_string" text)2 \, Q% z+ t' n2 l7 M6 T
)
8 T1 w0 q& X' F" U7 @3 u )
* c5 b, D9 p+ a, m+ X1 a: j R( ~& F c1 f7 \( y3 J
;; Define action for tiles% c: U- N8 t) U; E" g4 e |
(set_action_tiles)
" R$ S/ p- c' H& { (action_tile "style" "(MText_style $value)")
! Q4 c' z6 K& k: v: P" j (action_tile "MTextWidth" "(ver_MtextWidth $value)")6 p) T! Z7 n: j; v/ \
(action_tile "MTextEdit" "(done_dialog 4)")
: w) H$ q6 Q5 }# q3 [ (action_tile "MTextJustify" "(setq just-idx (1+ (atoi $value)))"): ^! z8 D! I. P' y. q
(action_tile "MTextDirection" "(setq dir-idx (atoi $value))")
7 P% Q2 J- k# u- {8 Y
( g$ R1 `" }, u) a6 N; L ;; Set initial focus to text edit box.
5 D j$ R \5 ^7 l, B1 s) Q" G (mode_tile "t_string" 2)
: Q( i$ K5 Q @/ s
/ A" d2 x7 I9 f1 M4 s( A* z ;; Run the dialog9 D2 Y, H! K) m
(setq dialog-state (start_dialog))
3 u$ e5 g: D: x/ ^, E" ^% p2 ] (cond
9 S: f0 {+ ?7 H8 x$ O! O ;; Cancelled - restore saved data6 c2 [# m6 ]' i/ Y
((= dialog-state 0) (reset))( x9 Z5 F" k, y& C% D9 z
;; OK - save new data+ O; D7 n1 ~$ C7 D( g: P% {
((= dialog-state 1) (modify_mtext))( L* Z, h1 R1 d8 i( ?6 `6 c
;; Pick new insertion point
7 g j( a3 k; w ((= dialog-state 3)
% u \6 @$ S, X. s (modify_mtext)
: C* z1 L) L, y, M; \) r5 F (setq pt1 (getpoint (list x1 y1 z1) "\nNew Insertion Point: "))9 h7 W9 J" w. v) {2 R4 V
(ver_pt1 0)
6 _7 E& }$ w7 x" | (ddmtext)# o T& Y# ?: X) H3 s. |/ {
)
$ \2 V7 E/ l6 Y. h ;; Run full editor5 e6 h7 G% X3 G ^
((= dialog-state 4)
) q; \ O6 c* ] (modify_mtext)
' o! X$ t& U0 ?, E' d+ w1 X (safe_ddedit ename)8 Z5 k; U6 `1 m5 b" z/ R
(setq elist (entget ename))0 [# f7 ]+ t2 r2 B
(ddmtext)
( S5 Z' y' m/ M3 y8 {2 y2 Z9 k )+ c) f8 b! p: T M3 m$ g9 i, P
(T nil)
& p' M3 V* S: t9 u- X$ K2 I# h )
9 k+ L7 P$ J) f5 L" s0 N )9 [, I2 K9 \0 x' n* W$ N
6 m' w. `# u& V0 q; ]" M
;;1 c+ p5 F7 P) Y/ b( }* l' q. w
;; Modify VIEWPORT8 t* G9 R0 b( P
;;" r I% ?9 L1 x
+ O& X" H1 r* L6 y% a (defun ddvport ()
; C- R4 s, h! I5 K (if (not (new_dialog "ddvport" dcl_id)) (exit))+ F. _1 C# r% M( S; ]% q% G
(set_tile_props)" V% P/ v1 m# ^
(set_tile_handle)
1 H) u6 d# o1 D! W$ c# w (setq vpt (cdr (assoc 10 elist)))
7 {. x3 Q6 f3 z ] (set_tile "xtext" (rtos (setq x1 (car vpt))))8 @& x3 p8 a# W! f0 ~3 q) e
(set_tile "ytext" (rtos (setq y1 (cadr vpt)))): L& V- ~% O9 c/ l8 P. b ~# V
(set_tile "ztext" (rtos (setq z1 (caddr vpt))))
; Y, [; |5 _! e! D* ^/ }3 R* b (setq wid (cdr (assoc 40 elist)))
7 J, g+ A% H0 Q) i3 n# U (set_tile "wid" (rtos wid))
% q2 v% b7 V. \; Y( u (setq hght (cdr (assoc 41 elist)))
6 I3 V7 a2 x c* s- f9 Y (set_tile "hght" (rtos hght))
3 c$ w, y3 C, \ (setq vpid (cdr (assoc 69 elist)))2 Z3 a$ c4 i7 ^+ R7 q5 h
(set_tile "vpid" (itoa vpid))' A" `/ K' f9 b [ c: ]
(setq on-off (cdr (assoc 68 elist)))
: W3 k# ^7 P* N( `& S- } (cond" X- n( C5 [4 a5 @% G- z4 X
((= on-off 0) (set_tile "on-off" "OFF"))
1 E. {% w. ^, |4 |+ A8 _& l1 H6 K ((> on-off 0) (set_tile "on-off" "ON and Active"))! }7 ?3 _; L4 {
(T (set_tile "on-off" "ON and Inactive"))# Z, T. h( D2 r+ D3 K' T( @1 b
)
& ~7 m4 [8 g1 e3 }) D1 o
# l/ U- R" B1 z; k4 A' f9 A. r( @ ;; Define action for tiles
, f( |$ l) F' D3 P4 w9 n (set_action_tiles)
3 _* w1 v$ k! O" m
' R" l3 a2 u+ d9 j% n2 A6 u (setq dialog-state (start_dialog))
1 {% ]5 ~4 |1 R( Y2 A5 x& F* q (if (= dialog-state 0)
0 b2 m0 B- z( E: m. B (reset)
" O' j* l4 m6 h, P( {5 m ); r! j! l5 @% q }6 A
(if (= dialog-state 1)
# y, `& O5 I5 H (progn
+ ^8 P( N6 |, w( s (if (= ecolor 0) (setq ecolor "BYBLOCK"))
) D1 Z ]4 ?' n5 ]) f (if (= ecolor 256) (setq ecolor "BYLAYER"))
4 z5 K# J# Y9 o" v W4 c (command "_.chprop" ename ""
) E" ]0 R v1 f. ? }' U' P "_la" elayer+ w1 x+ i- m1 A3 D" Y) n" {
"_c" ecolor ""8 n- f, m/ \5 T
)8 ^; c; S( m- f, w
)& _! r% F) [5 i
)* @ ^5 c& X3 V' G4 o/ v& b! ~
)" x9 D5 |' O* K x' R
;;
9 c1 L# s1 u L7 t1 K ;; Modify POLYLINE( `$ O3 I# @/ x- D5 X9 ~
;;
9 p3 T2 F3 g9 D; K8 d" N (defun modify_polyline ()" F" g% d$ ]1 Z3 G2 L' c" x
(modify_properties)
* t; J' {' o% Q) ^) @ (if (= ltgen "1")
' d6 u) T# P) N: c! } (if (/= (logand bit70 128) 128)
5 C: x# n) T$ K' Z (setq bit70 (+ bit70 128))
) Y4 B/ M, q1 A )" i1 D3 ?+ j# ^4 S/ r* B4 |/ U
). L5 z; h, X: m8 W2 F \* G5 s, h
(if (= ltgen "0")
% b W3 x9 g6 Q6 w0 `* o0 X! H (if (= (logand bit70 128) 128). a! f1 y( `* V
(setq bit70 (- bit70 128))' M' B( R; l; o5 F2 ~
), J7 k8 r+ _/ Y; B2 @2 v
)' E M' H8 U4 X+ b
(setq elist (subst (cons 70 bit70) (assoc 70 elist) elist))* M f4 f6 L/ u+ r3 n2 A( s
(entmod elist)
, k5 ]) I; W/ A/ S4 c' v ;; Added to take care of updating Vertex information for color
/ Q- I4 O' J4 K4 ^5 ~8 W4 d& J ;; and linetype.: q) j7 Q) i8 P0 h- B8 i
(setq save-ename ename save-elist elist)
$ x- b/ @- _/ ^* { (if (= (cdr (assoc 0 elist)) "LWPOLYLINE")
C& ~3 G8 C3 s' X7 |$ u6 v (progn# a" A. _5 C* w6 Q
(emod ecolor 62)+ E( G5 A1 H1 f' @3 [
(emod eltype 6)" B t& }, H3 D9 T
(emod eltscale 48)
4 q; H5 ?3 @6 n (entmod elist)! I$ i% \/ r" C4 I
)4 M7 l# t1 X: H7 V {7 k" k7 l
(progn& H; {8 ^/ B, x3 s4 O
(setq ename (entnext save-ename))- ?0 p' l' e1 _0 U4 _* S
(setq elist (entget ename))$ C0 s; v/ ?, H0 Z* g$ j8 j
. b7 V* g+ ^+ q3 l" _, ]
(while (not (= (cdr (assoc 0 elist)) "SEQEND"))+ p$ e0 ?) ]* g8 w2 W7 Y/ u
(emod ecolor 62)
/ i2 W# B% d0 u* f# c (emod eltype 6)" }: k0 r% g9 ^1 i3 k# E
(emod eltscale 48)
. j- |% \, r3 `; J+ ? (entmod elist)
# |9 E3 |' D1 v; x (setq ename (entnext ename))
7 Q& X- ~( V" e8 z" I (setq elist (entget ename))
/ U+ d5 n: p2 b# a* o )
) A1 g; @) a: B4 L6 o5 k; M. b$ O% q ); |" q$ Y% ]" k. K) s- `, Z6 ?4 T
), D6 p- H: v2 s# n1 o
;; Update the SEQEND
( Y& S6 B4 m" N (if (= (cdr (assoc 0 elist)) "SEQEND")
1 b+ n* m l- ]1 A% [# E0 g; N (progn
* j7 H/ X# j. X5 K7 ` (emod ecolor 62)( W. |5 N6 o5 o) o4 ^9 c3 s
(emod eltype 6)+ d% F" F! C, @% _ X- D$ P
(emod eltscale 48)3 C7 |! F' ?' `( V" k: u/ `
(entmod elist)( M* ^$ `) w2 ^1 n( }4 m% ?. ^8 h
)- R& |7 g$ m# c- a$ F0 \
)
6 K) h4 A8 m$ H' Q& f2 H8 x ;; Go back to header.
5 \- w% a+ i! z4 w% X& G' ~' ^$ f3 i (setq ename save-ename elist save-elist)$ u, @ K1 a" L0 y, J
: w+ I+ h5 z1 u
(entupd ename)- o) \; M1 [0 H
)
5 q0 F/ f2 f3 j/ a' L9 V. y- p
) `4 ?; W2 k w0 O! T+ ] ;; Increment vertex. Set tile values to next vertex+ r0 G8 Y! n! ?+ W
;;
8 O% i. X7 S" K4 b a (defun next_vertex (), ?+ K4 s' T, ~- q4 Z
(if (= (cdr (assoc 0 vlist)) "LWPOLYLINE")# _; \2 k( Z# H3 L! u/ _
(progn) i* K. k" Q. ^, l9 w' b6 ^$ j1 z
;; If the counter reaches the number of vertices,4 G/ V+ `! e$ }. f/ }, @& { e8 `
;; roll it over to zero again.
5 H- J& [" @7 f @+ a (if (= ctr (cdr (assoc 90 vlist)))
2 x. G& w# ]/ V1 k (setq ctr 0)+ u ^$ J! g; e, i, o9 T% L
)$ m# k/ ^! z4 ~% C$ M
(set_tile "ctr" (itoa (setq ctr (+ 1 ctr))))
) [* r# L( O% S' Z3 H3 ~3 \ (set_tile_vpt pointype)
- k4 y( }6 q1 z+ Z+ V! r# z ), F1 o$ [3 R* R7 p* I$ U8 L' b
(progn
8 R1 `& T4 X/ Q% u, w* J" [1 e (setq vname (entnext vname))
/ N* ~5 r) h+ e# K- y (setq vlist (entget vname))
8 @/ K t a% \, u4 f% d( k (if (= (cdr (assoc 0 vlist)) "VERTEX")+ s7 ]: }0 Y! i' N; W( ^2 p
(progn- Y+ i1 M) x+ x% ]: s# A
(set_tile "ctr" (itoa (setq ctr (+ 1 ctr))))
5 W; j* M6 ?& A* d- F q2 u (set_tile_vpt pointype)
. z# t8 \6 }- X& y )) j% E' P5 U0 N1 s% S5 F; N
(progn
0 l8 O( v- m5 d) H1 k# X5 L2 U" ] (setq vname (entnext ename))
; Q- X" u5 _7 X5 t; a( j. H (setq vlist (entget vname))* i8 L5 T! z0 M% Y: N4 M
(set_tile_vpt pointype)! |5 L/ H- r$ j: h! B8 o! H
(set_tile "ctr" (itoa (setq ctr 1)))
. I: I% y! P- Q )
9 q# Z& M9 |3 l )
- L# q; T6 Y+ M1 E: \ )* T8 `3 _+ f t. Z/ G
)
5 M% _" j6 p0 ^ w: X+ p, z )
! t. ]* P3 w9 H) @- U
* l, L. J* W' d/ Y( n2 d8 p, N (defun ddpline (/ oldecho)
# t" \ v) s+ v9 @1 ~8 n0 A (if (not (new_dialog "ddpline" dcl_id)) (exit))
8 m( w! {: i4 k, a. i+ g% }8 V (set_tile_props) K# g! g0 b [& F: d1 ?
(set_tile_handle)9 W4 \; W" m& k6 H B$ ]
(setq bit70 (cdr (assoc 70 elist)))
. J# C4 p/ ^0 E2 s7 `7 h( v, a (setq bit75 (cdr (assoc 75 elist)))
+ Y! L) L' o& @9 Q9 v, E (cond1 H$ c; d7 X8 L7 l0 [; C
((= (logand bit70 8) 8) ; 3DPOLY U' e8 _ @0 j. Y( Z9 r9 G
(set_tile "ptype" (setq pltype "3D polyline"))
G, \6 D2 V+ ]' z/ X (setq pointype 0) ; WCS or ECS point values
; t( O2 r, h2 s: t# d$ R7 ` (mode_tile "fit" 1), ~: {+ C; E3 T# r3 Q0 |
(mode_tile "mesh" 1)* o+ K" f- ]* `1 g( J
(mode_tile "bezier" 1)$ p) U4 y0 m" \1 j% ?- @) C6 Q, D# R
(mode_tile "ltgen" 1)7 h1 ^1 E' H* r
(set_tile "none" "1")
9 s0 P6 z9 d4 W0 t7 l" F7 P (set_tile_closed)
6 C6 S5 X: ~3 z" U# m3 D' z (set_tile_fitsmooth)6 i. q7 m# O; o/ }3 C: l& Q
)4 Y& V7 X. @) r% W/ A
((= (logand bit70 16) 16) ; 3DMESH
5 n5 V' k/ N/ \2 i7 z( V4 t# u (set_tile "ptype" (setq pltype "3D mesh"))% y: v' ~% x' Q: b
(setq pointype 0)% Q% ]# j2 ?& B
(mode_tile "pline" 1)! y9 x5 a: ]# O7 G( c
(mode_tile "fit" 1)
' d1 l/ o/ D9 j1 d1 i$ |: t6 |& W (mode_tile "ltgen" 1)" o4 ~+ Z) W" K0 m1 v, ~% R
(setq m (1- (cdr (assoc 71 elist))))
) x' Q2 l4 @& | f! Z1 K+ u (setq n (1-(cdr (assoc 72 elist))))
( J* l2 u' [* x( G9 \2 F (setq u (1- (cdr (assoc 73 elist))))# N3 _: R4 P3 Z% F/ o2 _1 B
(if (< u 0) (setq u 0))
. M4 o% R9 \+ D1 K (setq v (1- (cdr (assoc 74 elist))))2 h- H$ S- @. C: f8 |1 c
(if (< v 0) (setq v 0))( s$ A$ F& _* C* c U, _: Q z
(set_tile "m" (itoa m))
' a; l7 A6 ?) i* w: e (set_tile "n" (itoa n))9 n# ~& O; S! ^8 t, m
(set_tile "u" (itoa u))
- J: l; G2 ^7 l7 b1 G4 V (set_tile "v" (itoa v))6 Q' s( t3 D) ?
(set_tile_closed)2 L& W$ B+ S' i, @+ O
(set_tile_fitsmooth): j$ M/ O8 [# d' U
)
) x* `- k( n1 h6 o: h ((= (logand bit70 64) 64) ; POLYFACE MESH
1 [4 m1 i3 J/ ]! B4 }" _ (set_tile "ptype" (setq pltype "Polyface mesh")): V5 [; a% T- S: Y
(setq pointype 0)
! e# _- }* F- ~9 n6 T! I& [ (mode_tile "f-s" 1)
- t G- F& `( b" F; { (mode_tile "mesh" 1)/ D8 j+ p. y8 L; h& d, J# x% F: ]
(mode_tile "pline" 1)" F- T! Y+ I" Y( k: m
)' _, h( g7 t7 ^& H6 v, \" I
(T ; 2D POLYLINE
\/ P' |! t( b" ^ C (set_tile "ptype" (setq pltype "2D polyline"))# K1 L$ P' \5 a4 u* o9 C
(setq pointype 1)+ A1 q7 S0 `" b0 q4 h; l4 n
(mode_tile "bezier" 1)
; v5 u2 O1 f% ]/ V) _" o4 ~$ ` (mode_tile "mesh" 1)4 M# G+ C4 d0 P
(if (= (logand bit70 128) 128)% e$ b9 ~3 L6 l6 K3 ^
(set_tile "ltgen" (setq ltgen "1"))& m/ Y! _1 P" u( U u# r* k
)
2 p/ v `+ o+ e. m5 {( R (set_tile_closed)
* m) ^/ M% L" |% T5 d' ^ (set_tile_fitsmooth)
$ Q1 G! A: o9 G$ g. s )
$ D, n2 B5 o3 G5 c2 w9 F* [ )
0 G. }# d8 S! f3 V! x" D% I
. G2 X! }$ \# ?9 ?; ^! @* s4 m0 C (if (= (cdr (assoc 0 elist)) "LWPOLYLINE")/ U6 S9 [: o9 m2 ~8 n" m* D
(progn5 w! r' J9 O( d7 q9 M- Q
(if (not next) (setq vname ename))
$ a% c# t; T1 v7 {1 Z) f( \ (setq next T)
+ L7 X# t2 R- S' R (set_tile "ctr" (itoa (setq ctr 1)))
6 P; \8 N4 J8 v. X& f8 m9 Q (setq vlist (entget ename))$ \/ h2 r' I( s+ Z
)2 s U) M% h& ]# L5 j! G
(progn
8 w/ w3 T5 z! r+ D; D( }2 d (if (not next) (setq vname (entnext ename)))9 F j6 g+ c0 q6 S
(setq next T)
$ ?8 \( `0 w" I0 K4 @ (set_tile "ctr" (itoa (setq ctr 1)))9 a: J# q) L8 X( t
(setq vlist (entget vname))4 L" _: N' G s1 _7 M+ o9 ~- ?! m
)4 u& ]7 u5 u$ T# F
)
V6 Z. n: A7 l: {/ j2 J (set_tile_vpt pointype)
# Z% v; d0 x2 f+ w) T# r* U ;; Define action for tiles
5 K0 l; o! _* v9 ? (set_action_tiles) E6 ?/ H. O; i# a* r, I
(setq dialog-state (start_dialog))& P0 V3 c2 w5 y7 T7 c% D( T0 u
) d$ v7 ]0 d2 n8 L2 X9 Z. _
(if (= dialog-state 0)
# ] c9 N) I- I (reset). V. F# L0 l5 p! L s
)
% o& K" D$ c! D; t3 v (if (= dialog-state 1)
* M, f2 V0 N1 _3 W& B4 z; F8 r. S8 ] (progn: h% u% b; s+ `( v8 |
(modify_polyline)
$ G Y& Y' B/ q; C) g6 d7 x (if (or (= pltype "2D polyline")
4 }/ {1 ~, \# \8 U7 r: E0 X9 W6 ]/ L (= pltype "3D polyline")
1 I: |. I, u6 Z* [ )
% c" K' p; M: N+ q/ q (progn
. I) Z, A9 {9 g' \3 d (command "_.pedit" ename)9 |4 I6 [1 L% m' q, E4 X
(if (= spltype 0) (command "_d"))
" _3 @0 j* r/ Q& s3 S8 V! ` (if (= spltype 1) (command "_f"))
+ V) ~) J3 I/ [ (if (or (= spltype 5)
- v* P9 W( r8 K (= spltype 6)
( Y3 i6 |8 @5 e2 r) f- j0 u )
2 L i( @9 L( U# [/ p (progn9 A2 R9 e& l! Q9 o
(setvar "splinetype" spltype)/ Q. G( i! C" S) A$ k( A- T: ^: `
(command "_s")3 i# l3 f" F$ G
)
$ d1 q, ^& d7 [2 h, o )
- ?4 S# N; Z) [* y! Y* D3 I" B (if (= closed "0")3 j* I4 Y% r& r: r
(command "_o")
7 R- J- ]$ ?% X: S- I/ y8 d! }- z: t (command "_c")
" d( `& @4 G2 i3 r( k: y )
/ m; i' N+ ?3 j (command "")$ z/ p: J/ U, I" |9 U
+ ~9 q. `* W/ \3 r- j6 d; f
(if (= spltype 0)
2 q. y+ n. O; B- |/ E1 M (progn7 C/ b% R: A( e# b
(setq oldecho (getvar "cmdecho"))$ W# n- x) N8 o
(command "_cmdecho" 0)
4 ?0 W6 _+ {/ i# w6 { (command "_convertpoly" "_light" ename "")
V" `9 Y6 K2 ^2 `& f" |3 K; G (command "_cmdecho" oldecho)
& ~" t. J2 |7 `8 l% C5 a0 y )0 [# p! U1 O: s. A$ ^' ]
), Z0 f4 E [9 T
)
1 U9 q$ @ F% Q) z2 t0 u )
\4 p" T# M6 l& P2 J (if (= pltype "3D mesh")3 ~1 J$ m6 ?8 J6 i. a2 e
(progn
# L5 I& I. t5 {2 n, E3 ?" k$ Z* v (command "_.pedit" ename); c) y4 r: z; n9 v
(if (= spltype 0) (command "_d")), [4 w# H! o" H" u
(if (or (= spltype 5)1 `: T, T |" G1 x
(= spltype 6) K3 K% y3 T% M9 F: c7 v
(= spltype 8)! N: j+ @% U- |7 `1 \8 W, s; E* r
)
5 J( W' f, m" i (progn$ _3 L% N( j$ y* H
(setvar "surftype" spltype), [0 b1 c7 o$ Y
(setvar "surfu" u)9 E6 J8 h v, v5 K
(setvar "surfv" v), M% _9 Z/ q" r" g& d) J2 J
(command "_s")) t) W! p, O( m$ m; X
)
! v" R% L! [3 C- V3 V )+ V) z- X$ u n0 Y$ e/ [# o; c* j: F
(if (/= closedm old-closedm)
* X: s. x/ r' a, E (command "_m")0 P, |: n* j, [. [7 s0 u
)
' {4 V$ y; h* j3 Q (if (/= closedn old-closedn)- e3 ]: J- Z7 S6 W
(command "_n")/ C3 K0 w% r1 n3 _% o6 e# G# F6 J
)
8 m8 {6 [% n4 f" ~6 M9 ? (command "")
% j# m7 H4 G: y )8 w! Z- Z! O+ q: T8 |. w- l2 w9 @5 {" G
)4 h( [+ Y6 E5 \9 i7 g2 A7 l0 |4 l
)
^; C) I' j/ x )" u% V- s3 J4 F; r# A' R
)
! G) k+ h! @+ c& t% f- b* S( V ;;
4 |# Z, D7 N9 [7 y; o/ f/ J' M1 {2 w ;; All the spline data is contained in a single elist. We must do some
' W2 ~- s7 P W6 h' U+ d$ ] ;; tricky list processing to loop through the elist in order to display
* n0 o* x* i- H ;; all of the control points.
2 [8 H8 r+ [# [4 r: g9 p7 _4 C ;;
7 z3 m/ J( P4 Y: O, Y, y7 S ;; The structure of the elist is different for rational and non-rational
: ?( F2 M h( T ;; splines. Therefore, we check the rational spline flag.
& [) a' t; b0 ?# C. E% j ;;
* b$ d3 r% ?' Q$ b3 D) J: q! F2 y( i (defun next_cntl_pt ()5 @4 k5 \( h+ } y* k- R- _
(setq elem-no 0) ;; elem-no = element counter
4 m, d2 a3 L2 ?& C# k$ e (if (= first-10-time 1) ;; If first time, find location of first
) m0 {% M8 k7 e$ O (foreach list_item elist ;; cntl point element in elist
- K5 V ^6 @. I( V$ E5 `2 \ (progn
3 m/ Q$ b1 c x' T (setq elem-no (+ 1 elem-no))
1 r$ S% e1 M# R) L; h7 W% M (if (= (car list_item) 10)
; Z$ s8 y1 v3 _ (progn
0 v# A% ^6 R; }! a (if (= first-10-time 1)0 o2 u; E( k' W$ A
(progn# b5 c4 x4 _- X* ` }6 P
(setq first-10-rec (- elem-no 1))5 U( q9 I+ ^' W# ~+ T
(setq first-10-time 0); h0 [+ H$ q- Y+ z( ]+ t
(if (= rational_spl_flag 1) ;; if rational
' U/ H* G7 L8 G: [0 Z) y (setq cur-10-rec (+ elem-no 1))
0 z' u$ \$ r9 ?3 ]3 c' W (setq cur-10-rec elem-no)
' R9 M' |# ]5 E! ?9 l/ ? @ )
" P3 A( Y V2 X: W3 E )
: \( z8 a) O+ E5 X! k: M ): K# L# \4 k: ~7 r! q a$ T
)
& C) J/ G3 Z5 X2 M! c" v9 L ?) i )
5 P3 _3 A% j. X1 I )
: a: V- s+ Q' m* t- n r: O8 T1 p ); g& y4 v+ c1 ]( a3 U( A. p
) m$ F0 C& X9 A! }0 y0 p9 \
;; Now we know the location of the first "10" record; it's stored
5 q/ B; y9 u+ L- _0 G( W/ U ;; in first-10-rec. The first 10 record was already displayed when
e4 m6 y' N. z3 Y/ i$ n9 l* v ;; the dialog first came up so let's display the second one when: x/ {4 R' e% Z* H- d2 W4 G% x
;; the user presses the "next" button (the first time through).
- K6 Q* U, c6 ?0 f' } ;;+ u5 D) d* V. P9 D7 X$ c: L
(setq temprec (nth cur-10-rec elist))$ Q# A' d# D6 Q4 z! `- z
;;+ ^: P6 O4 N: U4 t
(if (= (car temprec) 10) ;; if 10 record
5 W1 X {- p( S0 y- ^4 k( z* E (progn
" T- D: c' a C& @4 ] (if (= rational_spl_flag 1) ;; if rational spline6 b H. `: M/ M- y9 N# H
(progn
: p% f) x' A( B+ D( J# ]+ T/ m) G (setq tempweight (nth (+ cur-10-rec 1) elist)): V& y) f5 q( }
(setq cur-10-rec (+ 2 cur-10-rec))
+ A7 w, F# w7 C1 S )& @) n* B) J$ D; f( @+ ^- j
(progn ;; else# X! R) W4 A0 f
(setq cur-10-rec (+ 1 cur-10-rec))9 V1 o3 p* B" p0 Z* z
)+ H/ U4 q) k3 f# e( T/ \' S
)
) y" ~' c: r1 m) e8 ? ) ;; end if rational spline
8 R* g0 |5 r& _ n9 I& W (progn ;; else reset counters
+ R+ p/ |6 n8 ?8 K6 Z5 t& G (setq temprec (nth first-10-rec elist)) ;; get 1st 10 rec5 C0 V W7 r' [+ z* p
(setq tempweight (nth (+ first-10-rec 1) elist))% e* c& U( p. Z( j7 G0 m' `
(setq cntl-pt-indicator 0)
+ f B/ ^+ a T- ^ (if (= rational_spl_flag 1) ;; if rational4 y3 ^) Z" q+ {7 m
(setq cur-10-rec (+ first-10-rec 2)) ;; point to 2nd 10 rec
, i4 h' D! ~3 _ (setq cur-10-rec (+ first-10-rec 1)) ;; point to 2nd 10 rec; X+ r8 Z3 v+ E/ @8 j1 B$ G
)
4 Q9 T: @' [5 x6 x )
; V, P+ I( G8 G- k q& v( S ) ;; end if 10 record
' X4 J$ v" N% y: W; p4 k
6 G" y, h+ e c$ r9 M) s ;; Display cntl point, weight and ctr. Increment ctr.; S6 }" K1 u0 x% R% @' Y- K: g X6 U
(setq cntl-pt (cdr temprec))% m3 R) @# o: A# \
(set_tile "xtext" (rtos (setq x1 (car cntl-pt))))
: d/ T9 [+ F( e. W: s6 z (set_tile "ytext" (rtos (setq y1 (cadr cntl-pt))))7 P$ T6 }8 n1 Y- q" N/ y' d* ^
(set_tile "ztext" (rtos (setq z1 (caddr cntl-pt))))
! S' Y. R. H1 | (setq cntl-pt-indicator (+ 1 cntl-pt-indicator))2 {% u/ a* w# [! C
(set_tile "cntl_ctr" (itoa cntl-pt-indicator)) n, P/ k$ z; m) E1 F) ?
(if (= rational_spl_flag 1) ;; if rational) x7 x% X* ~* ?( }+ o" \
(set_tile "weight" (rtos (cdr tempweight))) ;; disp wght
" T8 T5 K- ?1 n" N (mode_tile "weight_text" 1) ;; disable wght( u# k7 `: V) y2 S% b% V6 Z7 z2 W
)
- f* Q5 e+ i t+ c6 k# p )& e# S1 ~& e8 s% V. }! C+ t4 j
;;
5 e1 @$ q- X- e) o2 P ;; All the spline info is contained in a single elist. We must do some: i6 N; [6 E( j+ l3 x
;; tricky list processing to loop through the elist in order to display9 x( W* R- ~% t
;; all of the user data points.
$ u" I5 Y: ]: q- ]$ l8 Q9 Q ;;1 p4 Y& w0 p% D( C
(defun next_data_pt ()
' @- x- M6 u- z$ T" w (setq elem-no 0) ;; elem-no = element counter+ g# g9 W& B+ ?
(if (= first-11-time 1) ;; If first time, find location of first
3 |1 ^* Q" I; X1 C( G" O+ L (foreach list_item elist ;; data point element in elist
0 `( X, J/ [* c' y& |) f* l (progn
9 G7 q" ?8 E- s2 S2 v9 c (setq elem-no (+ 1 elem-no))% E$ l; ^6 Z- R* f. P, b
(if (= (car list_item) 11)
3 M- r- x* W2 ~2 K& d (progn0 [& U0 ^3 Q/ \/ ~6 [2 \
(if (= first-11-time 1)0 m( E; ]- [5 i$ {3 u/ Q- t
(progn
9 b8 H! f- K# G+ ` (setq first-11-rec (- elem-no 1))
( R9 E- w, o, A (setq cur-11-rec elem-no)
$ c3 ^4 Q5 k! Y: Q3 R (setq first-11-time 0)" w# g8 ?0 g2 w/ c
)3 A$ s! q0 ~ u) r! M! Z; M# K
)- P. K4 {6 b* O+ Y) X
)$ F# t+ X0 `0 G9 R- o: r0 r
): h9 \! O' a9 R0 s* u
)
& e3 q$ K7 Y; l# a0 Q3 n) p )( ~" {# k4 V: a f" V! w$ C
)
' f" d7 |; R0 F- F1 L. } B (setq temprec (nth cur-11-rec elist))
* X! T( J$ o! e' J ;; If it's not a DXF "11" element then we've gone past the last
1 @* \2 \2 \" N ;; "11" element. Go back to first "11" element. Reset counters.
1 s9 ?" w) p! x8 I! ^+ ^* F (if (= (car temprec) 11)
' {/ T- ?9 d; }) ?9 E7 C (setq data-pt (cdr temprec)) ~! C8 N' l: e6 l8 Q; m, z( N
(progn ;; else8 q- w2 I3 ^6 `9 G! `3 f! X# u
(setq data-pt (cdr (nth first-11-rec elist)))
2 l) B; z% j/ B7 \/ ^ (setq cur-11-rec first-11-rec). M; L/ n) i! ?* Q" N5 |2 q+ n8 |1 Q0 k
(setq data-pt-indicator 0)$ h* U" o3 K: z1 `6 t; S: o) B; S- M
)
4 h. c* B8 |( m, E! }: z )/ K( w7 _' t H
;; Display data point and ctr. Increment counters.
, d7 j& c: |2 V2 \* a, W/ ` (set_tile "dxtext" (rtos (setq x1 (car data-pt))))
1 m+ @6 T% E3 `( D (set_tile "dytext" (rtos (setq y1 (cadr data-pt))))
& _* m& {* W+ m (set_tile "dztext" (rtos (setq z1 (caddr data-pt))))) f8 }0 n" o) e0 `8 q$ c$ i
(setq data-pt-indicator (+ 1 data-pt-indicator))
$ A' u1 A! |" M0 `+ l (set_tile "data_ctr" (itoa data-pt-indicator))
2 W, J+ u! a8 m$ ~" _ (setq cur-11-rec (+ 1 cur-11-rec))
8 [- ]/ X. l8 N: B. L )
. m* x+ Q5 C% R# S. W) U ;;8 |/ E9 C1 a$ W/ U+ m
;; Modify SPLINE
6 Y; z0 z# e: _ ;;
! I& _/ u! [2 X1 G (defun modify_spline ()9 u1 B5 Z }. [2 z
(modify_prop_geom)
; b; y Y8 f7 x4 m K j (entmod elist)8 r6 z- Y& Q# N, C5 U0 g
). M) q/ a/ P3 x7 R
/ t* U6 W+ w1 E# t0 j
(defun ddspline ()
0 x+ y: f2 Y- Z3 ^- T (if (not (new_dialog "ddspline" dcl_id)) (exit))4 ^! Q* Y9 O6 ?/ I7 S
(set_tile_props)* d* B# l6 m3 {
(set_tile_handle)
$ ^: L6 p1 T- Z4 f! Q7 w! ~6 O8 I (set_tile_spline_props)6 L8 v; F9 b4 } l" B) Y
;; Display first control point
8 R5 u8 d! j/ O, z( M, K. @6 b (set_tile_cntl_pt)
& l' z* Q8 T7 E ;; Display first data point* y4 e4 F+ q+ t* l" S8 u0 D
(set_tile_data_pt)& L2 J- [# P$ c: B0 M% h1 o
* I( Q( e. D+ u0 S
;; Initialize flags to indicate first time through the dialog.5 J2 b# D6 \( }+ d' |! K
;; For control points and user data points the "next" buttons
- _, m! a4 V( D+ L1 W ;; in the dialog call the appropriate functions.. {" n C; s! l/ z# G; d
(setq first-10-time 1)3 K3 g. A8 N. B) E, d0 q
(setq first-11-time 1)' W% h: ]% M0 F+ ~' u3 Z
;; initialize control point number counter1 o. @, j. r4 f7 O9 s4 q
(setq cntl-pt-indicator 1)
/ F; H. A" c9 \' D/ G, { (setq data-pt-indicator 1)) A8 H" @- U! `+ o4 I2 }" ~6 u' X
(set_tile "cntl_ctr" (itoa cntl-pt-indicator))
. i. q6 a" c/ d( S (set_tile "data_ctr" (itoa data-pt-indicator))& o: a; q l' n5 B7 T
(set_action_tiles)' e' Z) Z+ K+ i
(setq dialog-state (start_dialog)); N, F; h: H6 p& H5 i
+ W! q" j7 L7 `# t7 J
(if (= dialog-state 0)
2 U' R5 Z" ?7 ~* P& \/ w (reset)
5 V& C) }+ h3 N* z2 Q9 u) N )
; E: t+ T& R+ c3 z; q) Q, r; Z (if (= dialog-state 1)
8 ^4 P N3 s/ _: p5 b (modify_spline)
/ u8 [% L) b3 y )3 @4 a2 S& `4 ^1 G+ n( H6 }
)
# C2 T9 t* m4 @3 }: @( [0 a1 R- H3 A, p* ?/ v1 x4 Z1 P
7 O+ u- L+ y F% e- ^5 g
2 K/ g* s" Y7 p+ Z5 l y
;;8 E' Y! Q/ E) F1 `
;; Modify DIMENSION
6 R1 z! D/ ^( c8 A" S ;;. m' h w" a' r$ _: |
(defun ddimen (/ dtypebit blkname bename sublist a stname n dimtbl8 | y- d" c2 k( ], R g/ Y
dimsty dimlist dimtext svtext dimovr sv_dvlist stlist
, p/ e" m. C6 d; z* t dimtype dimsvcurset)0 S( ]3 v, F$ m! S3 [
(setq dimtype "DDIMEN"3 C: o% Z) Y t& ~
dimsvcurset (ddimen_dimsty_restore)- W7 J7 U: Y2 E3 R# R
)
7 i; k- {# k: k$ s2 b (if (not (new_dialog "ddimen" dcl_id)) (exit))
, Q( J# x: j, v& W0 [ (set_tile_props)0 K5 Q9 }9 E# w6 y+ D; y) ]
(set_dimen_props)
; n# f+ [# D/ b- Q2 Y$ T* N (setq dimtext (cdr (assoc 1 elist)))
) i5 m5 T! w& d' i n1 l, `$ [. o (set_tile "t_string" (if (= "" dimtext) "<>" dimtext))* t* _; i# W N- k2 q
(set_tile_handle)( s1 ^0 z* J4 j7 m7 [; e H, F
;; Define action for tiles. f. z7 K# L2 l; F) \
(set_action_tiles)
: S. L2 v6 T- t4 r3 X( B; L7 \4 S. A- r% E' S. P: R8 r! r, \- E
;; Set initial focus to text edit box.
0 s5 k3 Z8 y. B- Y$ d (mode_tile "t_string" 2)
7 D6 T. J$ l [( c, \" M' F; U1 e
9 J9 I" e2 h6 @! k$ p' s3 s (setq dialog-state (start_dialog))
# q9 Z* a* `1 `! ?$ Y' y; ? (if (= dialog-state 0)) F8 N9 h" v; A: ^) d4 G
(if (= ddimmt 1)# g: v/ k P9 D8 r: b4 Y- O
(reset)* N% V1 A ^/ P1 {# {9 v3 d- u
)2 i x+ L. l( w( M" z9 @- W; A
)9 y* ^# S: R6 i$ Z: {+ K9 Y
(if (= dialog-state 1)% l" C+ R. N3 C4 C
(progn5 J/ x4 m& K2 Z: @
(if (/= dimsty stname)9 ]/ u, C% L1 S: _
(progn
( R; k5 W8 k- i5 B/ s: u/ R& E/ ^ ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case
2 D& h6 s- v2 d2 c ; doesn't have it.! R, N# P- D/ I& [8 C
(if (null (assoc 3 elist))% A7 |) T! E' h6 m+ u
(setq elist (append elist (list (cons 3 dimsty))))
$ F- Q" h( B5 B ; else just replace it.
: p5 o* y" o0 C$ | F (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
& f3 c, v* \+ h& F2 c )
. l/ P" a0 {7 d% }8 U ; refresh sv_dvlist with new dimstyle.3 s4 }( p, G7 [1 X% H# w& A
(setq sv_dvlist (tblsearch "dimstyle" dimsty))% f, e, C+ ?5 T$ B9 i
)
+ \0 l8 P+ k9 U% i; Q/ m$ @ ); d7 h Q: b. G5 e$ w1 C O
(if (not (null dimlist)) ; attempted to change dimvars
1 Q/ _/ _! |: e (ddimen_complist sv_dvlist dimlist dimtbl)
) R. T; x: x1 E' X$ x )6 l) F2 D1 `. I8 @
; Modify dimension text; _) h0 u+ g* C0 D* Z) Z
(if (/= dimtext text)2 j$ B4 F8 y) \9 C$ e+ a$ C$ O
(progn& c' Q: n+ U. p0 t3 C4 }& A5 `. D
(setq dimtext (if (= text "<>") "" text))' o8 ~) t- S$ z/ ]8 C
(setq elist (subst (cons 1 dimtext) (assoc 1 elist) elist))
! [. h/ e' [6 ^4 A* X/ Z )
, Y9 Y5 R" S# L7 k! C' w4 l' e0 z )4 C. r( Y5 A9 T. h
(modify_properties)
& b5 R0 j, ~- n$ x (entmod elist)& F0 R1 Z/ ~* m
)9 E, a& E" @5 e1 U
)
% G8 h" l& @' f/ c4 G: W- X3 ` (if (= dialog-state 4)- P2 s) e! K) N5 x9 R. {0 K1 a
(progn: L& ~; k: T% o9 w# }
(setq ddimmt 1)9 ]" f) ?* W! r1 `! Z/ @. @8 o
(if (/= dimsty stname)
' t# \4 e' V9 q1 J* Q (progn
, c2 e; V' z9 ^- u, P. U. D ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case
9 {, f8 V3 Z0 G- r ; doesn't have it.3 Y) A* j% K6 _. h% s' M0 d1 m% i
(if (null (assoc 3 elist))
+ Z5 B- M7 }! d" L+ ]7 [7 r/ s9 ~- R (setq elist (append elist (list (cons 3 dimsty))))
3 ]8 |) C# V8 c/ f9 B ; else just replace it.1 q- v# P6 D0 Q- [$ ]* k$ a
(setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
- R0 R0 @/ E7 Z) B- r- A )
5 l) e, _+ R- P# }0 ^/ M1 h ; refresh sv_dvlist with new dimstyle.
+ m. @8 H8 t& B (setq sv_dvlist (tblsearch "dimstyle" dimsty))% `; o i' `, X& t# \' E
)
: Y; k: D# I) r" x/ ^% T" T )/ e+ r) \# V& k2 e
(if (not (null dimlist)) ; attempted to change dimvars
& w3 f" k+ o4 ^' a& Z (ddimen_complist sv_dvlist dimlist dimtbl)
" w2 S) q, l: x )
4 j5 x! k- h! c k; q ; Modify dimension text& s0 @% R8 F" O) P) B" Y- q
(if (/= dimtext text)! L$ ~* K: q' Q+ E) O" K1 o* G3 U
(progn/ D& ]0 F" c% ^9 _) d
(setq dimtext (if (= text "<>") "" text))
: j/ S: `: C8 W# r' r* i (setq elist (subst (cons 1 dimtext) (assoc 1 elist) elist))% `) t. q5 D5 U" b# l
)/ S1 y- g$ M. ~
) j1 b8 H0 s" D6 |5 ]
(modify_properties)
/ {! W5 U5 N4 q" N. Z# Q/ E (entmod elist)
& p' @% [3 k0 ]2 I4 |' r (safe_ddedit ename)
0 S9 S6 x4 C& C (setq elist (entget ename))
( F& Q# l" ?* ?; L4 Z4 C$ [ (ddimen)$ u7 k- ]6 u0 U$ `
): S7 Y% x5 ]# C$ g+ f
)3 s! n/ J% F0 p; D
(ddimen_setvars dimsvcurset) ; Prepare to exit
, M, F# v. D6 B! \4 k1 b )% }+ i4 v$ ]8 ]
& P1 H1 |$ L5 e( d6 r" o
;;
' z v" o3 ^3 t/ _7 f! \. L ;; Modify TOLERANCE2 H# A; L" e! p4 v% p: a. W
;;
# [$ \0 c- N7 t* v, P+ X (defun ddtolerance (/ a stname n dimtbl
0 I: ]0 w% H! B& y, I7 e! w dimsty dimlist dimovr sv_dvlist stlist dimtype2 `4 u0 c4 d4 |' I6 s% C3 P
dimsvcurset)2 ^: R/ D& C0 b4 F+ n/ ^, C$ o2 G* T
(setq dimtype "DDTOLERANCE"
0 f' t4 d+ o& s8 _ dimsvcurset (ddimen_dimsty_restore)
4 f2 e$ i. q7 z% X: q7 S$ E )
$ k) o: M4 f- g: N! U. N! i (if (not (new_dialog "ddtolerance" dcl_id)) (exit))' K8 p% C1 Z. H1 U1 Y
(set_tile_props)* v- Y/ v+ g6 Z6 [
(set_dimen_props)- J" `% z, |5 d" n
(set_tile_handle)
; T1 r% E! @+ H! s3 |" C% \ (set_action_tiles)
* H9 ]0 e P' _9 J8 s' \6 u (setq dialog-state (start_dialog))' g0 u% l) i1 M/ [; V4 E, n5 y( G
(if (= dialog-state 0)" `8 X- M: |- M: E8 r
(if (= ddimmt 1)
2 R% f, O9 L$ R (reset)" I3 w/ Y9 Q' `1 q4 W2 O
)
8 W" P! F3 W# G. D w" y% d )3 d. x x# @, v0 d0 X) B1 A
(if (= dialog-state 1)2 v. R. ^" `# J
(progn
" i6 v! c0 U, \- L1 ^ (if (/= dimsty stname)
: V% Q1 {/ x: Y& x6 f* ` (progn/ A3 t, x2 m7 \7 u1 G- x) D
; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case
+ D+ b" s% k. M! q3 G ; doesn't have it.$ V! S% ~2 Y/ H% V& Q2 P
(if (null (assoc 3 elist))
5 p" ?) ]4 R5 k x: b9 Z d (setq elist (append elist (list (cons 3 dimsty))))6 `, y0 F, K1 g, d
; else just replace it.
- Z+ h3 ^5 _% A (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
; s& G8 N. t* a8 ]7 H. n )/ G- v: E+ f2 f2 J
; refresh sv_dvlist with new dimstyle.
) ` p* T) r7 h (setq sv_dvlist (tblsearch "dimstyle" dimsty))
' g, W K1 a7 i: f: N9 W* a: p$ k )5 ~1 w0 x* e, k& {
)4 D x `# \* }6 K3 ]
(if (not (null dimlist)) ; attempted to change dimvars
$ m- A, p! h) p (ddimen_complist sv_dvlist dimlist dimtbl)
' h) i" D- W( {, h. {( n P! X! V2 u: m )3 Z* P8 Y9 g5 G+ E$ ?. J3 ]5 ?% ]
(modify_prop_geom)
* Y! f6 t; B3 y. a# y (entmod elist)5 D( a& C( ?3 m0 k
)
* M* v* H8 F3 ?$ o# Y9 l' M )
; [( @& l5 B7 P6 `- ]1 z (if (= dialog-state 4)
9 x/ N) o2 ~3 `& m (progn
3 I+ Q, u( b" c. l (setq ddimmt 1)
6 _. T7 W0 x) ^1 y# i1 R, t& t (if (/= dimsty stname)3 G' p+ I5 k5 y% A" @# H3 l! x
(progn4 V& V: A1 O$ ^+ w/ A# ~( w. l
; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case
, o" C/ K {. r- {. a+ M ; doesn't have it.& Q# X" g3 s( }( O) q C2 G, `
(if (null (assoc 3 elist))$ C1 Z* w8 l) Y+ W
(setq elist (append elist (list (cons 3 dimsty))))
% ^- g1 a# O% D. p) r1 W ; else just replace it.
+ q( X% N u6 u; H; X; I; ] (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
" L$ R% S# ?; I L7 |% I )8 f( L Y# @8 Y: v, G* D2 g
; refresh sv_dvlist with new dimstyle.6 c" U# n y& _( @
(setq sv_dvlist (tblsearch "dimstyle" dimsty))
# V! F; _" ~ v* ]" O. ~7 r ) a: A0 o9 P' Q/ D
)/ ?) Q! X1 Y! v+ s5 u
(if (not (null dimlist)) ; attempted to change dimvars
# i* q0 U" S# \* J: d$ Q, K0 H* ~ (ddimen_complist sv_dvlist dimlist dimtbl)8 w' `% n! e% A" c5 v" r; W
). Y$ x# \. e/ B. ?9 L
(modify_properties)2 n- z. @! ^$ H2 G, N9 n
(entmod elist)
/ r" i5 o! ?' ?; S' y (safe_ddedit ename)
, H1 y; p0 R4 f5 G- K) @ (setq elist (entget ename))
2 u' G7 G; c: u( j% a* u. Z (ddtolerance)
& F% Z' Y* _( T; k3 I )# V; W/ R$ c! u3 h# D: H# F
)
Z2 S" t- S, y (ddimen_setvars dimsvcurset) ; Prepare to exit
& ^9 G6 N1 M1 V& [. ^2 c3 O)) X' k4 `2 r" J# \5 G+ \) l
' L- H( D, Q3 U9 c/ j5 ~6 d5 E
;;/ p8 i/ M+ {% J, ^2 y% D. X. _! N
;; ddimen_dlg - jump to ADS ddim module8 n, Q, G6 e8 ?( l* T' j
;;
" e+ j9 E1 X* r! \- R
0 X+ P7 N k& O# T: U0 ~5 U6 W (defun ddimen_dlg (dimtype tile dimsty dvlist / dimlist)( C5 ~& p/ E" I! q1 R1 n6 {
m8 Y6 A5 s) E e( |4 A ; Jump to DDIM with overrides if any.. q: e I% s$ H6 Y
(cond ((= tile 11) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Geometry
" S8 p) }/ d4 V: _' C ((= tile 12) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Format
( H- z$ @# h3 E+ ? ((= tile 13) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Annotation# @$ `1 E9 ?& I; `% M6 C2 H7 M
)
# p3 }6 l8 A# K3 h )2 _3 R& G; h4 K5 b0 y$ `
, t' B9 b% R1 e$ z; [$ k& S
;;
$ D# x3 \$ n9 f6 I2 B# ?$ e+ M& @ ;; Dimension variables updated are stored as overrides.
- I @0 f9 N+ ~ f9 K ;;& c+ }: _1 U! d
$ ~9 _; Q# C- y0 h' t( y (defun ddimen_complist (dimolist dimnlist dimtbl / i odvar ndvar
" t1 m: u' m5 _1 c dv dime commandIssued): R/ |' D# H0 Q$ q% w2 q# t* n$ z: l- j
% y% J8 s E5 h5 ~* q- F; P6 K
; Here we skip the following first three items:
' X5 B: `; U; P9 V" I& A ; (0 . "DIMSTYLE") (2 . sylename) (70 . 0)
7 W1 _: B* V X ;
6 `% Q5 L' t0 [1 P! A: X& { ; The list comparison immediately begins with dimvar./ `9 j8 p* ^6 X" n2 n9 F
;
7 y+ r& ]. w; t, U' h; q r# { ; dimolist - original states of dimvars
6 v3 @9 \# ]4 y3 C ; dimnlist - new dimvar list which is of the resbuf's
6 I* W# f/ @0 b& r7 i ; dime - entity name for the dimension8 L$ j0 U2 j% S! X# w7 D3 z
; odvar - value of dimvar for the dimolist9 U* ?2 \' @, d7 ~9 N/ x
; ndvar - value of dimvar for the dimnlist
# V5 k. n" u6 i$ Z
/ _& ^! n: d; l, S+ ?' z (setq i 3' _) O8 v4 L! W. M
dime (cdr (assoc -1 elist))" Y: |, D8 S* N/ g2 l3 c: h. O9 @
)
: g% t7 g& @9 C- Z7 y' z7 o (while (setq odvar (cdr (nth i dimolist)))
( e: R, l# C. | (progn0 ]. |4 ~: n: m' m! T0 D
(setq ndvar (cdr (nth i dimnlist)))/ n5 X' r! H6 C. m- @( j: D
(setq dv (nth i dimtbl))& }# P+ T6 O: P; x0 d; K
(if (eq dv "dimtxsty")
& U) ~2 c% ~. w( c* G/ _ (setq odvar (cdr (assoc 2 (entget odvar)))* a# [6 s4 G2 A- U
ndvar (cdr (assoc 2 (entget ndvar)))* O+ A5 Y9 X, t" P9 V) w* q
)
: K' L, A5 E7 `' q$ @ )
. }8 l$ ~. s3 N8 n# x; V. U
9 G5 D8 e6 I( p ;
8 @- [" j: G; ^5 C ; In order for DIMOVERRRIDE to operate correctly with string- l* O$ l {9 S/ H$ Q
; based dimvars, we must pass "." versus NULL strings.
- Z5 P2 L; t. q4 w7 y# i+ ^4 {( A+ s ; In this case ndvar is the new dimvar value the user wishes
: N" X3 r: \$ a- |# P8 @. b ; to update on selected dimensions.
9 l3 r: ^' _1 {: K ;* o; y) ~& i: @; {7 W. t& b
(if (/= ndvar odvar). M: A6 u2 v! k
(if (= 'STR (type ndvar))2 L: d) {5 w2 H, r; @
(if (= ndvar "")& k- A: ~5 g! V: b. n( X
(setq ndvar "."))))
1 W& f, g+ [; w1 o, N
8 I$ F" z. H2 M# v: ?$ U (if (/= ndvar odvar)
: ~0 _8 m( w: ?4 N, R9 ] (progn
" |- j' U& [* Y: ~3 {$ j5 @" H/ ] (setq dv (strcat "_" dv))
c: K% L: f1 Y ;/ h# c U J( L0 o4 \$ f
; Start the dimoverride command- M; |3 b0 R: m9 Y# B0 ?+ t
;
8 s& G% m, u% U( p (if (not commandIssued)- N& ^0 H" F2 T; l4 m% N* L
(progn% F+ P) N% A$ A" T
(command "_.dimoverride")1 H! X$ V `* s4 J
(setq commandIssued "T")
# \4 @7 @0 M# X/ ~& u )3 q4 ~& z2 ~5 a; i& t" V3 R
)$ L) u N2 j0 I a, {
;
& t2 u7 L$ F7 ? ]; _ ; Issue dim overrides
4 J K8 u" A; p6 M3 d G ;: K" d. o3 g+ k
(if (and (or (= dv "_dimclrd") (= dv "_dimclrt") (= dv "_dimclre"))- w. v! O' ^; }
(or (= ndvar 0) (= ndvar 256))
2 n% g1 F T4 m- e3 n, | I )
( f) G* r- v9 j8 m; t (progn. q( |9 _$ E- u3 _; K7 x
(if (= 0 ndvar) (command dv "BYBLOCK"))
1 a( q# T* H* F7 o# a4 H (if (= 256 ndvar) (command dv "BYLAYER"))' _) [. k. A4 O( I3 i
)
+ |+ @/ q# o6 N5 a- M9 ^ (command dv ndvar)
, U( r. {; O. s1 h# r )) f* H( ]9 {2 C/ V" c
)* ?7 q9 V. J$ K. f1 u) j8 Z3 N9 Y
)3 s+ j- A/ ] ^$ G% t# p w
(setq i (1+ i)); B5 e ?9 l0 a. N3 j5 H; I R
)2 A5 l/ ?3 Z+ V
)- P! `6 I, D; s/ F
;
i6 c; Q% N, {7 l; b ; Select Entity and terminate command
7 h5 V5 j6 C7 o. f" O1 x2 j& N9 F ;
. D% h4 z# Q9 [ n2 \5 N6 x6 @& X (if commandIssued
7 {: s L( N" K+ C) Z (command "" dime "")
# P6 Y+ W) z* b# r2 } L* e; F )/ u! X' Y, G. x2 ~2 Y
)
2 D8 g9 ~" b, x& w! X s9 z: ]- P9 x* B8 J
;;4 J, p; Y2 ?0 m7 q2 |) y/ m
;; Get style name currently selected style name.9 U# A6 B' P8 [3 U
;;: i6 ^" W& H/ c- U
; I& i+ @0 B0 {! A7 D* O
(defun ddimen_style (/ dimsty)8 x8 s! |- H% K& a2 L
(setq dimsty (nth (atoi (get_tile "mod_style")) stlist)
! n6 g/ E) [5 ]' j3 | dimlist (ddimen_getdimvars dimsty)% i' R4 L' e; `! F% ^$ ^
)
9 U' f8 ]6 R, e5 q2 A' A! b9 y dimsty& P2 g2 f+ w4 F: R
)
* O8 i# S% v2 U: U) F! @
$ }* K" {3 r. Q6 t) F$ H ;;
4 M! ^8 n/ Z/ b8 E) {+ C1 w ;; Set dimvars
% x* t3 L& w& `4 W; k ;; l4 F- z6 R8 y1 K w% M6 w
(defun ddimen_setvars (dimsvcurset / dv i)* k* C* x2 W% ^- J4 f2 [& r# k
(setq dv (cdr (nth 1 dimsvcurset)))
" p) j' p% G/ }) [" u/ C (command "_.dimstyle" "" dv)" b" ]. Z4 l l5 z
(setq i 3)
) s* w" P c& @4 M5 | (while (setq dv (nth i dimsvcurset))
; U* T* b7 p6 u- B7 u6 u (progn9 F$ o" i, {% \! F, R
(setvar (car dv) (cdr dv))
& G( H/ ~' e) l: q& ` (setq i (1+ i)): i4 r1 ?5 u1 N4 E4 g X
)# p. V {. O# M1 ]- x+ O
)
0 C% C4 Y9 \( W2 a% I3 g3 v1 L ) k' ~5 T: W+ _0 D- |* ]2 Z5 t
;;
* M# W# ^$ ~: E) j9 t: ]. y) e/ \ ;; End-of-dimension
; i3 T( Y! v" C' J) I, I! S) t ;; ==================
5 f* w2 W8 ^! L* X+ e' P2 s+ \+ b+ P" X, ~# A$ `( J
;;# B$ y6 }. d; k3 K
;; Sub-dialogues for properties. Common to all object dialogues
% }% G8 ]! j9 o5 M. ]: I ;;
; M ?( D# y! [$ Z( R/ g6 R ;; This function pops a dialogue box consisting of a list box,image tile, and
! v$ l, E5 E, ~, L6 U/ H ;; edit box to allow the user to select or type a color number. It returns0 p% `: z! v3 ?$ V: K
;; the color number selected.
8 @/ J0 S3 r) |; Z (defun getcolor (/ old-idx colorno cname lay_clr)! Y- _& R9 T$ s/ T+ o0 Z' N
(if (= (get_tile "error") "")
/ x' o' H$ |0 Z! w% O" k (progn( ^$ l. v0 z7 W% Z8 H! V
;; Get the color associated with this object's layer, for use( k: ~& d9 Q! t0 V4 {1 G6 M
;; in the color swatch if the user selects color BYLAYER., _- v6 {0 ~6 p
(setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))0 m- ]- B1 j: Z* ^: o, h7 ~2 W6 O
(if (numberp (setq temp_color (acad_colordlg ecolor T lay_clr))); _) g' `, x% d
(progn
' m( N; o9 }7 ^; k" q' B (setq ecolor temp_color)$ Q, @# U1 _8 C
(setcolor)
+ Q8 W1 n" p/ |/ a5 M# Z! J )
: R# z1 m y: X# K (setq testcolor temp_color)
4 K3 F% t& _6 D/ E" b4 {+ I) B )
( w% w; \4 s' ^+ [3 v9 ] )
8 u6 v8 A" X0 r; [ )
& e% M% [; _# Q( [+ a ecolor
/ }" K8 D% b) s/ f/ ^& W; z( k )3 Y6 H8 C1 ~1 [ y9 D
;;0 m! V8 x( I- r. o3 V
;; Function to set the color tiles.
4 E* A. I; d8 [" D (defun setcolor()" P1 a' A U! B: B2 s
(cond/ g+ m' W5 G5 ~0 | b2 p* i
((= 0 ecolor)
2 H. n4 c2 l/ l. ~$ m/ ?: t (set_tile "t_color" "BYBLOCK")
n! O, ]: {; o (col_tile "show_image" 7 nil) ; show BYBLOCK as white3 C8 d/ j; n) [, O2 {! P9 o* J6 y
)7 f6 d8 ]- z6 l
((= 1 ecolor)
5 w" B. j& q0 G: ] (set_tile "t_color" "1 red")
0 p9 y/ m/ K7 S/ q (col_tile "show_image" 1 nil)) t/ a$ ?- H: F3 y: u+ |9 \+ v6 k
); k+ n! j! u; g
((= 2 ecolor); e1 a4 F- D" r4 I% p* e$ F
(set_tile "t_color" "2 yellow")' j% W# s! b% x: l! {# M
(col_tile "show_image" 2 nil)
- g1 u- v( [1 f& y+ V/ m )4 B+ \: o6 K! \& O/ ?- Q
((= 3 ecolor)
8 u0 \ J( W* H& H% C (set_tile "t_color" "3 green")4 H/ z8 [% R8 g6 S# X1 `
(col_tile "show_image" 3 nil)
: P) G' ]& |/ i. E8 {, y )
4 x ]9 B* T, ]. L; \ ((= 4 ecolor)2 g# O3 R2 U- e; C2 g: y
(set_tile "t_color" "4 cyan")2 @5 o! i5 W" y [0 s
(col_tile "show_image" 4 nil)4 [2 Q! i. c1 m8 ~" i+ a. W# S) e
)9 t6 O9 q$ h0 W
((= 5 ecolor)4 A- K0 S- b+ X- Q
(set_tile "t_color" "5 blue")* R" d. z8 ?# Z/ _9 _. I2 E
(col_tile "show_image" 5 nil)
/ n& j \8 Z# R% _8 S$ z9 C* ~ )
- j$ d) x" ]5 q ((= 6 ecolor); Y# o4 j( K" y
(set_tile "t_color" "6 magenta")
, n5 e- e& G7 {* a; L4 F (col_tile "show_image" 6 nil)
+ k$ U3 K$ F( e )! |, C9 _: S7 n3 K" z. D0 A0 K
((= 7 ecolor)7 ^- k3 u/ e1 G& V# Y3 Q
(set_tile "t_color" "7 white")5 h$ z9 j1 L' Q+ U& v+ I, w
(col_tile "show_image" 7 nil)
; Q- o6 d5 n" u) S% Z )
5 s' G% |! l8 a ((= 256 ecolor)# U8 \6 \ Y' H8 b
(set_tile "t_color" "BYLAYER")
) x- A; x! E# h (col_tile "show_image" (bylayer_col) nil)
9 u% L2 y7 @" M6 G/ j/ y )7 j" a1 n' O, U7 H
(T9 O8 O1 q9 x) f
(set_tile "t_color" (itoa ecolor))5 W( r4 s5 u( U( x2 z/ O
(col_tile "show_image" ecolor nil)
' L& X- b: I0 W% K )% q5 k c' Q4 X+ b1 \
)
: F' c+ z2 H4 i5 c% J: |- ?) F7 t' R. v )
0 b; q$ Y% T8 F5 w! c, O: X, y ;;
" i. h: y+ t3 N+ \% X; M7 _6 u ;; This function pops a dialogue box consisting of a list box, image tile, and" v3 B& i) G/ ]: u" N8 P+ ?- `1 u
;; edit box to allow the user to select or type a linetype. It returns the. M8 g' d4 u5 h+ G1 f
;; linetype selected.
3 P# ?' @- r2 Q0 L0 j7 B7 m( o0 ? ;;# x9 B+ I/ q: C& D* R
(defun getltype (/ old-idx ltname)2 r" B0 ]7 e! A* ^0 b+ N( G
(if (not lt-idx)
% a, N9 C4 g6 [( p8 j9 J# ~3 K (progn0 k3 g8 T& K- t: j
(make_lt_lists) ; linetype lists - ltnmlst, mdashlist
& ?) G4 H3 ?5 G4 s (cond
- k. m X$ n! c. I5 {! @. T5 ]& i ((= eltype "BYLAYER")! R& h. t3 Y; }2 O2 R
(setq lt-idx (getindex "BYLAYER" ltnmlst))): i7 X# |! T0 D( p
((= eltype "BYBLOCK")
1 q7 f" H& t% P4 b k7 { (setq lt-idx (getindex "BYBLOCK" ltnmlst))) `. P: D% o+ m1 T0 u0 x# j
(T (setq lt-idx (getindex eltype ltnmlst)))
4 S0 ~, N8 Y( @! a2 j" `5 E4 y )
4 C7 i$ F7 G# F. Q7 p, r )8 f% @" O1 H, S2 ~
)
. ?3 F& |8 y) t) |3 @7 w
4 }1 s( D4 L" W( C+ Z3 k (if (= (get_tile "error") "")
. `8 c- b/ @, a& e (progn, f g$ [( q3 s: ^
(if (not (new_dialog "setltype" dcl_id)) (exit)), E- @* B& X& |! A
(start_list "list_lt")4 K% a7 _4 v2 E6 k3 N
(mapcar 'add_list ltnmlst) ; initialize list box/ \! K$ V8 a$ r. T7 P1 M" T G
(end_list)
& U1 c: W3 p& n/ ]: h+ z- B% v. g (setq old-idx lt-idx)4 w- C) b% U0 j; l, k; ^
(ltlist_act (itoa lt-idx))4 i3 O+ H+ `8 u4 e
0 P r% T) G T
(action_tile "list_lt" "(ltlist_act $value)")
! m" F9 N- O$ U( A D$ B (action_tile "edit_lt" "(ltedit_act $value)")7 c& a% i$ `1 R
(action_tile "accept" "(test_ok)")
: L* @% o1 l/ _& U; [/ n c4 ` (action_tile "cancel" "(reset_lt)")
" S7 U! e; {- [7 \! b5 L @0 O! J+ D) F# U
(if (= (start_dialog) 1) ; User pressed OK7 e8 O( ~# ?$ U/ M5 Q
(cond) ?2 ^ s, N4 `* i% e
((= lt-idx 0)6 g4 ?7 j* A9 k, ?. A9 G3 I
(set_tile "t_ltype" (bylayer_lt))
3 g/ D2 f3 s$ I9 D$ }/ D' T "BYLAYER"
0 D& h3 N# U# a3 f* H )
0 `) I" ~% I" `! s ((= lt-idx 1)
8 m1 ]- E8 }) d6 Y5 |( B2 E$ | (set_tile "t_ltype" "BYBLOCK")! L) O$ |/ G' Q- V6 ^
"BYBLOCK"
# w& |& C4 R- a0 r# ]4 v )
2 I9 @& \! \$ F/ f7 @+ u& }8 S, ^ (T (set_tile "t_ltype" ltname) ltname)) P [0 O3 J9 O) F6 u+ R0 f
)
( A8 R! B! y: i% i$ i& a8 c0 J eltype+ r1 H& d1 K# ?% g6 o5 S
)+ I& R" h7 D: r5 N k
)0 E. h7 Y' z; c# W" B5 v' M
eltype1 _: O% d5 m$ U7 E
)0 c1 j9 o( a" N" W$ a* g
)( A( z! O) |6 @& B4 u# j4 P
;;
* J4 x) n" D2 y0 c d ;; Edit box entries end up here6 A r' q$ k/ ^" b( H+ ~
(defun ltedit_act (ltvalue)& { }- d0 L& o! S$ ~: ~
(setq ltvalue (xstrcase ltvalue))
9 e* ^: P) d( u$ K3 d1 M1 p (if (or (= ltvalue "BYLAYER")$ g. A' P* V7 U+ p; Q
(= ltvalue "BY LAYER"))" Z( Q3 \' y7 s7 X D* D p
(setq ltvalue "BYLAYER")
p+ s6 S) S! h9 r( }2 _ )3 h: M4 G/ ?* ?
(if (or (= ltvalue "BYBLOCK")7 q0 n+ c3 c' C8 R2 d
(= ltvalue "BY BLOCK"))* |! }2 n$ G8 W0 ]# [4 M
(setq ltvalue "BYBLOCK")5 [% p1 ~7 E- f$ Z
)
- w! T- q0 d* ^0 N' {* o1 C (if (setq lt-idx (getindex ltvalue ltnmlst))
) i. ]- Y- P, d! A1 ]& P) m7 h* Q (progn
$ k& @5 |9 U+ G- M, h9 G) L (set_tile "error" "")4 J% ~$ w8 q9 v9 e( a1 h
(ltlist_act (itoa lt-idx))' x6 x( `0 G" F1 t) B1 G4 f
)3 h/ d, f; d0 m' }
(progn1 l' J2 M" M, Z& e- d
(set_tile "error" "Invalid linetype.")
$ Q% k0 d/ K. }; D( R (setq lt-idx old-idx), b, Z2 u1 N- ?7 m2 G" }8 A" q" A
;; (mode_tile "edit_lt" 2)6 E# h: g, q$ [) f1 m" U B1 _
;; (mode_tile "edit_lt" 3)
; b& g3 T6 A, _4 P )# t& L4 y: u! L9 b
); A' V) T2 f8 G
)
1 y; G1 ^. P8 K2 ]; b) a. N6 s ;;+ W8 o0 J* q, ?3 F6 ]+ \1 j
;; List selections end up here. Update the list box, edit box, and color; T" S( W' f {- r, a/ c+ O! u7 j
;; tile.
% v9 k- g2 t: \. f9 q7 X( u ;;. y& v* [ Z0 F+ f
(defun ltlist_act (index / dashdata)
& \# C% `1 I( a) C (set_tile "error" "")
( n1 T# Z2 m, ?8 H0 S (setq lt-idx (atoi index))
J1 z# p. T* ?8 z (setq ltname (nth lt-idx ltnmlst))8 U0 w" o& D" }5 h9 w7 t4 a4 {
(setq dashdata (nth lt-idx mdashlist))/ m+ s$ d* p b1 b6 P
(col_tile "show_image" 0 dashdata)5 q% }1 c/ x4 a. W0 I4 D) i" X
(set_tile "list_lt" (itoa lt-idx))- [0 Y5 [3 t' _5 n1 t' G _
(set_tile "edit_lt" ltname)5 \, B. g' [1 @/ }& O, g- o6 t
)
$ c9 R# Q! T/ F ;;
6 D, `1 q' V6 X4 z1 B ;; Reset to original linetype when cancel it selected
3 F' E E( u6 u1 [ ;;
/ W, o8 O% q. ]; h( i0 d* D% } (defun reset_lt (): i- ]3 i5 B [" X" `
(setq lt-idx old-idx)
/ | b6 B( L6 h1 z4 Z% ^: | (done_dialog 0)9 f) m1 y$ |/ o0 Q
)6 W: u) a2 }9 P8 L8 f- ~
;;
7 w8 a4 M; i, u d" J- N ;; This function pops a dialogue box consisting of a list box,image tile, and
! m" [6 p! |3 s/ l, @# j* i% \ ;; edit box to allow the user to select or type a layer name. It returns the
Q G! g! @: S7 w" g/ o ;; layer name selected. It also has a button to find the status (On, Off,
~7 ]' E0 b# [4 P4 N3 Z' x) `" Z ;; Frozen, etc.) of any layer selected.6 a% d1 V% X# V) V, j
;;* I' C, l( p4 O* s) P4 J
(defun getlayer (/ old-idx layname on off frozth linetype)& H/ { s# V& B5 B9 Q3 j) x
;; Create layer list the first time the layer3 X( u- l0 g; ?% p7 B
;; dialogue is called.; N' C2 q8 ~ K/ |+ T- {$ d
(if (not lay-idx)9 r3 k X+ E$ w) {0 i5 x
(progn$ W6 Q0 n$ g) b5 u* K, P: _3 z
(make_lay_lists)/ _* A; @# ?/ \- ^3 N4 C
(setq lay-idx (getindex elayer laynmlst))9 a, D; n( E7 p
)- T, E- O E$ W- n+ |$ L, t
)" P- o; ?" w, R
1 O4 }, F m" e* ?- r" {
(if (= (get_tile "error") ""), P5 s- m0 N2 H9 H. f3 Y8 |
(progn5 w* C+ P( @3 \2 f1 F8 H! ]6 t. s
(if (not (new_dialog "setlayer" dcl_id)) (exit))
( G* G% j% z3 ~; K) p. b9 P4 g$ Y (set_tile "cur_layer" (getvar "clayer"))( e8 u- I1 ^' d8 ]
(start_list "list_lay")% ]0 c& b( b4 {& B2 P& `, z: V
(mapcar 'add_list laynmlst) ; initialize list box
8 V5 Y1 f4 i) K/ V! \, a: b' { (end_list): h3 ?, d: X% N/ @# J; `
(setq old-idx lay-idx)7 F2 y! c7 y( I* ~; n
(laylist_act (itoa lay-idx))
& l5 I+ m% i, @ (action_tile "list_lay" "(laylist_act $value)")7 L8 E( x! U4 ^% X% p" z$ m
(action_tile "edit_lay" "(layedit_act $value)")
6 Z: Q3 B8 h7 e! s (action_tile "accept" "(test_ok)")
( d/ S5 Q h, I: c7 m (action_tile "cancel" "(reset_lay)")0 i& n+ E, h- m: \* k6 H: t; s
(if (= (start_dialog) 1) ; User pressed OK+ K4 o g$ }/ t' o3 J% g
(progn
3 _; t, G5 y5 U {0 @ (set_tile "t_layer" layname)+ k* g& g8 r7 _6 G! @
(setq elayer layname), E1 H! U2 k% w* n
;; If layer equals bylayer reset color tile
! u9 Y# |' X* k4 P8 I3 P2 U5 n" l9 m* e (if (= ecolor 256)2 X; j9 C* a- `1 u
(col_tile "show_image" (bylayer_col) nil)
1 k$ @' b# W. \ )) s0 a$ [' _- _& M) G: k
layname
/ D0 A$ |3 X7 a ), D# G4 x1 I( [3 [ l/ r
elayer. d+ L4 d# h2 v8 h8 o; a
)8 M f* g$ M. ?( q( p
)
@7 y, }: m5 h* v/ [ elayer9 @, T) W9 a8 F. N
)
+ Y- w; K7 _* v )
4 Y6 ]( o; M+ K# h ;;( D5 w" \/ x( ~# y4 w
;; Edit box selections end up here. Convert layer entry to upper case. If, P# `" D. S6 g6 N1 K
;; layer name is valid, clear error string, call (laylist_act) function.
6 |! Q& m0 G8 f- m. n, u3 Q J ;; Else print error message./ [( t/ S2 X/ C# ~
;;
# \* e/ {9 L. x8 i$ W, V (defun layedit_act (layvalue)
+ z0 H9 q9 }; h: m* I% p/ s4 Q' Q5 L (setq layvalue (xstrcase layvalue))3 O& Q, K. I# r+ o# s: \
(if (setq lay-idx (getindex layvalue laynmlst))
2 x. _5 s# p* X7 v (progn9 |0 V2 L/ U" `/ k6 E! v
(set_tile "error" "")
, N5 r4 G) S/ p. g (laylist_act (itoa lay-idx))
t: l) {3 K* ?/ Y )- P& B3 `* ]1 Z) N2 p; c$ Y& B( L# C
(progn u3 z' ?2 b+ P! y' k
(set_tile "error" "Invalid layer name.")" A* V9 j$ @9 L2 |- a
;; (mode_tile "edit_lay" 2)
% _2 O7 l& a) v* {+ t: S( X" Z;; (mode_tile "edit_lay" 3)% |1 i2 u1 M: d! B; ^+ ~8 A, n
(setq lay-idx old-idx)
; Z8 O; V( `8 u; Q: w( C )
4 v w9 j$ D0 j- M )
/ w( h2 o) i8 n7 d )
( L6 r& q2 E2 m S ;;8 B+ k& x- b, c0 M9 Y# Q
;; List entry selections end up here.
3 Y( S1 W2 ^0 k ;;3 g! o, q: l" [
(defun laylist_act (index / layinfo color dashdata)
' \% _, D* R7 Q4 @6 Y5 Y T. r ;; Update the list box, edit box, and color tile.
3 Z. D9 Y h; w! S+ R5 \- |, r/ S (set_tile "error" "")
7 k1 d4 k* b8 f8 k' z6 R7 P8 U (setq lay-idx (atoi index))
1 \, _, d! L3 G- G; m (setq layname (nth lay-idx laynmlst))! R0 J5 |; d& E3 G! r
(setq layinfo (tblsearch "layer" layname))
' p, P4 t& k Y# ~9 @6 \ (setq color (cdr (assoc 62 layinfo)))' z8 L; l# m5 A O6 h' c) C
(setq color (abs color))" M" W. G/ [/ B& m$ c2 `. C$ E
(setq colname (colorname color))
* n7 L. R* T4 b (set_tile "list_lay" (itoa lay-idx))7 h& n$ X% B6 v/ W0 ~# n
(set_tile "edit_lay" layname)1 R7 g' x6 v" i9 s/ M
)
5 V2 c) L! z) I! L ;;
# ^9 |) B' M% L3 ^# o& a$ b ;; Reset to original layer when cancel is selected.
9 _1 z* o" d2 Z/ S1 K' N' U p ;;6 o3 J0 X$ e7 p2 s$ ?# b
(defun reset_lay ()
8 I/ n' v' ^. U* N* S (setq lay-idx old-idx)
' I5 o; H( [* w, O& f (done_dialog 0)8 K; Y6 i; m2 z
)
4 o! V4 x" m9 s) _- _8 ]5 R ;;: C' x" f* j0 f$ k+ Q+ |
;; Checks validity of thickness from edit box.
& x7 u6 g2 k6 _) ^* u (defun getthickness (value)
( a2 `1 N+ k+ \3 e8 c- R0 Y$ g (setq ethickness (verify_d "eb_thickness" value ethickness))8 { J% R8 ?; {
)3 c5 U9 N1 F, R
;;
) O* T8 @" t$ Z: { ;; Copy of (getthickness) for ltscale. If more, make this function
A) t% x4 N" C) {6 t ;; generic.
) |# u: S' u! r3 d% A- a (defun getltscale (value)
- t7 k. W3 w* J( h (setq eltscale (verify_d "eb_ltscale" value eltscale))' d; e. L' o, x
)8 L& r: [- v( d/ a* m4 f5 |8 j
;;, N1 Z( v' ~1 S
;; This function makes a list called laynmlst which consists of all the layer c" a* z( N, Z
;; names in the drawing. It also creates a list called longlist which
1 Y7 d6 V. P1 O* B1 o4 Z ;; consists of strings which contain the layer name, color, linetype, etc.# W' B4 [ u8 a- H2 M
;; Longlist is later mapped into the layer listbox. Both are ordered the2 P+ s8 x$ S5 o3 t5 T" g. J2 U* X7 l
;; same.! n; X$ y1 F6 } s& a
;;" _1 ~0 O- m) f6 G
(defun make_lay_lists (/ layname sortlist name templist layer_number)
: r4 E0 D+ t7 |! \& C X, c (setq sortlist nil)
% F6 q! y0 D* b, j s (setq templist (tblnext "LAYER" T))% H8 R# \' f2 P* W$ L
(setq layer_number 1)
6 n2 S5 z/ `5 [4 x4 L (while templist
/ \/ Z/ Y% ^* B- s ;; No xref dependent layers, please.
" x2 V- A$ N* S8 f. B7 K" E (if (/= (logand 16 (cdr (assoc 70 templist))) 16)
8 p$ u! u9 K0 `2 Y$ w- O (progn- F e0 ^/ ]1 V3 s5 y
(setq name (cdr (assoc 2 templist)))7 B) G x: }6 w! k- H
(setq sortlist (cons name sortlist))
" R+ I6 d1 Q [8 [2 d )
* {6 P! K! ]8 A( L0 i# C! f" @ ): T. b$ ?0 Q. c P; v1 p
; Get the next layer.
. |4 ?# n, F5 A2 e3 e (setq templist (tblnext "LAYER"))
9 l( j8 q7 ?$ |8 n6 ^: x# Z ;; Not dead message...! q% ^# h6 L/ @+ K) ~
(if (= (/ layer_number 50.0) (fix (/ layer_number 50.0)))
0 w; }! d$ l F (set_tile "error" (strcat "Collecting..." (itoa layer_number)))
' ?! h, S- o2 P. q: t3 D' z )
3 |* g7 n/ i X, f V# X. ]2 x$ p (setq layer_number (1+ layer_number)) R) c1 a1 e* u* ^- b$ u' I
)1 n; O" S! D3 ~$ h" F
(set_tile "error" "")- O% v! A6 V/ J% [% K$ d
(if (>= (getvar "maxsort") (length sortlist))) R% V" w4 F+ X9 e" n7 c
(progn
y7 K! Z5 g2 S4 c5 A# ~ (if (> layer_number 50)
& _) B% N7 i( I& n0 [( [0 [ (set_tile "error" "Sorting..."): ^# V5 m6 z& s
)
: n( [" J; H& C (setq sortlist (acad_strlsort sortlist))' q0 I7 Q- x3 a2 d3 z: S
)
# I& a v; K) }: _ (setq sortlist (reverse sortlist))/ m: K3 ]% A/ i& e1 i' X
)
$ M# m( l) A- \/ Y& J: T5 Q (set_tile "error" ""). C6 \4 }$ K K3 r* c' Q4 j
(setq laynmlst sortlist)
6 P& y0 E% p, Q8 s )
4 q/ P3 f9 F, e x0 ~ ;;
6 X& J8 ?/ ?7 u U ;; This function makes 2 list - ltnmlst & mdashlist.
* T; M/ c" g) Z# I ;; Ltnmlst is a list of linetype names read from the symbol table. Mdashlist/ d6 M$ B; a+ y
;; is list consisting of lists which define the linetype pattern - numbers
6 u0 r b$ h8 D0 p% w ;; that indicate dots, dashes, and spaces taken from group code 49. The list8 Y- `5 `' `9 X- K; O' ]: M
;; corresponds to the order of names in ltnmlst.: [7 B. Q& ~! W+ R4 Z1 O
;;
) y) l1 O: J% C$ G+ W0 d- p* U (defun make_lt_lists (/ ltlist ltname)$ F, @7 m* h4 t8 I
(setq mdashlist nil)
, r, ^* c1 S* u' z7 m, ]$ ` (setq sortlist nil)8 t' q2 `# W% R
(setq ltype_number 1)# J+ @( c/ T" I; a
(setq ltlist (tblnext "LTYPE" T))# S1 e: ?& A; T- X! u) n
;;(setq ltname (cdr (assoc 2 ltlist)))9 Y4 k c' i9 E6 a+ A+ L
;;(setq ltnmlst (list ltname))
# F1 m7 B8 U: h5 Q% Y/ S# f# f9 u (while ltlist* }7 f9 g# s* L/ n) }/ `
;; No xref dependent linetypes, please.0 I9 V" V- S+ x2 r" f9 E5 t6 ^
(if (/= (logand 16 (cdr (assoc 70 ltlist))) 16)3 B6 `9 J$ I' b1 M0 o
(progn6 ]6 K: T# o& A
(setq ltname (cdr (assoc 2 ltlist)))1 `% D/ D, f, |, ?
(setq sortlist (cons ltname sortlist)); C. ]' B# R, m" U4 a8 A: G4 L
)
0 L+ y2 \) N( ]7 J$ T/ T4 U )
& P/ C( c5 @4 \" L [3 l# p( _9 i ;; Get the next linetype.3 ~6 C! Q u( I% D. r, m* A) ^6 K
(setq ltlist (tblnext "LTYPE"))1 G3 T8 F" f3 X" E, r8 R2 J
4 u0 ]; J/ ~. p& |% C ;; Not dead message...
7 H* @& `, I3 e' v3 h6 F (if (= (/ ltype_number 50.0) (fix (/ ltype_number 50.0)))6 s! b2 h, ^2 I
(set_tile "error" (strcat "Collecting..." (itoa ltype_number))). m- V( ]5 W# u% j' G! a
)+ B ] F* M: g9 y$ v1 ?
(setq ltype_number (1+ ltype_number))
, i& f2 ]5 z5 h& e
& V8 C( {) w/ u% e6 W3 r& q: ? )
+ x$ E3 C. Q- u, ?$ W6 m/ u* \3 P3 g, l9 t+ _1 M L- O: R
;; Remove Collecting message.
7 c7 ^ e& P7 i: c; f) f/ P8 ^! j (set_tile "error" "")" b* c+ n, W7 D7 k4 W4 y
1 C) V# i! Y5 o
;; Sort based on maxsort.! ~# C" l4 T; G/ p& T% Y
(if (>= (getvar "maxsort") (length sortlist)). [- R4 e3 ]4 A3 R ?* m% q5 t9 z$ D* R
(progn) W/ x- X9 d1 f- V' F# S& j7 R
(if (> ltype_number 50)
' t0 @1 `; g0 ^ (set_tile "error" "Sorting...")0 Z' J) P. H1 n& y* B
)
* n7 t9 s) Y6 `3 k3 L/ A b (setq sortlist (acad_strlsort sortlist))
; s( u% W- I& Z5 I# Y/ i )( `" r3 U& u d. d, C( F
(setq sortlist (reverse sortlist))9 D% N3 w" D/ f8 x, `7 D
)& V6 R* N k! g R7 X8 ~' @( P9 u u
(set_tile "error" "")' b) K4 Q1 u$ s8 ^( X: A# k1 |
(setq ltnmlst sortlist)3 @ Y5 S5 {2 m8 V; @" H, ?
# F% D3 y) _! t" G# ` (foreach ltname ltnmlst
* s& Z4 ~4 d. x6 y B) t (setq ltlist (tblsearch "LTYPE" ltname))
8 X+ H& @' _. G6 {: }) l/ d5 U (if (= ltname "CONTINUOUS")
1 f+ w1 e* f! W (setq mdashlist (append mdashlist (list "CONT")))
! g& Y- c. L- q) H+ E (setq mdashlist
+ Y+ ~1 w& g% ^+ d (append mdashlist (list (add_mdash ltlist)))
: f& I' X; S, ]! I0 {# @ )
: A7 _) p& j( L3 s )$ U P6 T X% C
)$ W5 E1 C4 |9 m# q/ [( R
(setq ltnmlst (cons "BYBLOCK" ltnmlst))$ {: \0 X$ V8 N$ k& y# f0 `
(setq mdashlist (cons nil mdashlist)): E! H- k7 q8 a
(setq ltnmlst (cons "BYLAYER" ltnmlst))
/ r1 b5 }- [4 U% x, Y# X (setq mdashlist (cons nil mdashlist))9 c0 Z" n/ ?0 h' c0 f s
)
' n, A5 I+ a: h) a8 z @0 l. o& Q ;;
9 P/ e* r- i* F" }0 E" W o0 u0 h ;; Get all the group code 49 values for a linetype and put them in a list4 `6 f/ ~9 y2 p$ B8 F; {# ^
;; (pen-up, pen-down info).
/ U) G) a5 `$ X# ~% K ;;
* D. W% e# b; {4 t7 | (defun add_mdash (ltlist1 / dashlist assoclist dashsize)- C. f: e1 B0 d: D$ L- W6 m
(setq dashlist nil)
3 [5 L; s- D" M; C" k5 a (while (setq assoclist (car ltlist1))# m( v4 _$ d# U
(if (= (car assoclist) 49)
/ A/ I9 v' ^1 \ (progn0 |3 c% Y/ R; e# ^
(setq dashsize (cdr assoclist))
1 s* y( N3 m, V [( z (setq dashlist (cons dashsize dashlist))3 @8 z" T, I) H
)
6 ~, M T" t2 k9 @# A* k )4 x4 |! f. {$ A! D' F0 ^
(setq ltlist1 (cdr ltlist1)) ~% R! K4 K# q" {0 W
)6 F# h Q, x% l; }5 G
(setq dashlist (reverse dashlist))
! y6 I8 @, U- @3 B1 B )& x8 N+ G8 x6 U. Z8 x. P
;;$ L, a# \( v' P g; [/ E3 n1 {( \
;; Color a tile, draw linetype, and draw a border around it) x( M2 |. u; z7 {; i2 R @8 _ ~
;;9 C; a- Y% u9 @* w
(defun col_tile (tile color patlist / x y)
R! C: b2 m A" O) j (setq x (dimx_tile tile))4 C( A$ u O' T
(setq y (dimy_tile tile))
! o1 r2 l2 E3 W1 K1 M, | (start_image tile)
9 `8 r* u+ l. o: L+ H- E (fill_image 0 0 x y color)
% r) E" y* Z9 B/ ~/ v+ E9 e (if (= color 7)/ P: i$ B/ Y; @, A* D m- i
(progn
9 e" W; a$ K; S. y. W: C/ K6 P (if patlist (drawpattern x (/ y 2) patlist 0)) r: G/ t9 p" H4 M
(tile_rect 0 0 x y 0)/ _1 J4 r- w% z4 A. P
)
/ |$ q7 A# z8 H' Q (progn7 g- p! I; g2 v6 g" G. ]% L5 s
(if patlist (drawpattern x (/ y 2) patlist 7))
7 X/ o$ |" q& U$ E1 |+ ] (tile_rect 0 0 x y 7)
; T8 y! m, Q# k3 S' j )
; n: I: x7 j- l9 |, p3 c )
$ Y0 _- q0 A2 M# e( g6 v (end_image)4 l) z5 A4 m1 h5 W" r0 z& l6 g% N
)' H7 x. V, K' }) I- o" Q4 L
;;, s: b2 i2 g, ^# V" v
;; Draw a border around a tile
- \- m" c, K& | m% t' Q ;;
( y+ m1 {) V' |, F* y (defun tile_rect (x1 y1 x2 y2 color)- B1 {6 X2 n) R
(setq x2 (- x2 1))
" X& Z! T5 T3 J, E w (setq y2 (- y2 1))
% A4 I6 S; r0 R5 A( F5 `& k2 } (vector_image x1 y1 x2 y1 color)8 G$ g0 L- V3 B- V
(vector_image x2 y1 x2 y2 color)( d# G" K) l9 y3 F5 ^/ d3 X# c3 w
(vector_image x2 y2 x1 y2 color)" `% o* L b/ U, D" O& y3 D
(vector_image x1 y2 x1 y1 color)/ s% d r7 e; T4 a2 b& o; e% N
)
4 `9 r2 b" J& K5 e$ D Q ;;
$ k/ j% `7 l# }& F5 o) R ;; Draw the linetype pattern in a tile. Boxlength is the length of the image) [2 T$ Q ], V. @; J" k
;; tile, y2 is the midpoint of the height of the image tile, pattern is a0 _ B2 T" K) a/ j
;; list of numbers that define the linetype, and color is the color of the
/ J) m* \$ z3 b; H1 W: @ ;; tile.$ h: V: \+ j+ G, k* y
;;: a7 S/ v, R/ A9 T( ?# M
(defun drawpattern (boxlength y2 pattern color / x1 x2
$ _. l1 _0 a5 K% K4 L0 W! G patlist dash). \' S( ]4 \% \. x
(setq x1 0 x2 0)( d& Z& p7 [1 p3 r* d- I5 F
(setq patlist pattern)
) c2 F& }( J, `4 @( z (setq fx 30)- u8 U8 }4 Q; S* Z1 n: C" a d
(if (= patlist "CONT")$ m, Y+ E. ^) B
(progn (setq dash boxlength)3 d* F+ x" t1 d0 e' x8 b' Z
(vi), O8 ~4 b4 t& o& q Y- a
(setq x1 boxlength)1 p1 \ L' s) r1 Z+ q$ R/ D4 Y
)1 W& A" k" i* @7 }- P' R
(foreach dash patlist
) m5 r! Z( S0 r( G1 c! a% \ (if (> (abs dash) 2.5)
/ J5 ], O- s2 V (setq fx 2)
. k5 H* _6 u" X" |; c( ` )
( p; ?* A- \4 |# X0 `: d )
! w- u; W0 p7 m5 D$ o C+ o' j )
/ {5 E( M( v( ?5 C (while (< x1 boxlength)$ x5 u/ U! b- Y" L
(if (setq dash (car patlist))0 y, W& B, G" l" h& t# i- @
(progn; Z: V* S# Q; q1 u4 ?3 p
(setq dash (fix (* fx dash)))
$ r ~+ I* k) ?% P5 U (cond; e0 L; d) `3 c- X- b! \0 `
((= dash 0) (setq dash 1) (vi))
8 J U! o# E, A3 \6 H ((> dash 0) (vi))* p. U1 p1 b9 G' Y9 E8 A
(T
* \; ` r7 A# |8 U (if (< (abs dash) 2)
8 H4 }4 q0 G: \5 G4 A1 I; F (setq dash 2)
/ U& \- g- L- L* t7 J5 ` ): J; E' M; \4 u/ P' S
(setq x2 (+ x2 (abs dash)))$ x/ [ s! O0 g6 p% H: B
)2 @; b- {$ O- {" c
)9 B6 M6 U* o) h F5 a0 G
(setq patlist (cdr patlist))# [( ^2 S: {! n: x- o& u4 `# N
(setq x1 x2)# ~, a7 _- u1 ~4 \
)1 ]% G7 g% Z3 V; ]% I7 l& B
(setq patlist pattern)# t! x5 _5 U/ [" o: q
)
9 ?3 `7 r: v7 i1 q )
, `4 J, [; l( `* _1 _ f. P% [ )' M- D( }1 g( ^5 G% ~8 N; C
;;1 c' `( G8 l# q/ s2 M
;; Determain state of xclip; ~0 @$ H/ q$ F7 u. Y. _1 U& h
;; Returns the group 71 value of the spacial filter dictionary.
2 U5 w) |% }9 v+ n; W9 F3 g+ h ;; If the entity doesn't have a spacial filter dictionary, this
8 R4 U/ d5 f) z8 [ ;; returns 0. If it does it will return 0 or 1 depending on the, l6 A# F, j3 d5 K+ {+ X; c
;; current setting of the state of the clipping visibility.2 P# W5 ~" H9 V
;;2 }7 K6 f. V: [% x g6 R
(defun xclipon(elist)! [+ s5 ^; @3 K& E8 o
(setq hasclip T)5 O% ?: u9 l- x8 S* y) X
(if (/= (assoc 360 elist) nil) o/ n; b1 N8 C, u
(progn
9 ^3 e( U$ A* ~; [! I9 ?/ Q (setq tmp (entget(cdr(assoc 360 elist))))! \2 t2 d& j2 k7 `1 }$ m, ]) }
(if (/= nil (assoc 360 tmp))
4 o5 h4 k( @! p9 H (progn% \* G9 ~4 p, n/ Z1 R9 o# C9 k; W
(setq tmp (entget(cdr(assoc 360 tmp))))
) J M9 d* {" D# I (if (/= nil (assoc 360 tmp)); K/ `3 D. i2 o. {! v1 }
(progn
5 D/ J/ d( d0 M8 p! U% T (setq tmp (entget(cdr(assoc 360 tmp))))
) x; |# @& l/ p! l0 Z (if (/= nil (assoc 71 tmp))
# ]4 k: t! x3 V* P" P (cdr(assoc 71 tmp))3 U9 s1 \# ?, p( n! c a
(progn
0 a" {* p) ^9 e4 F% R* w (setq hasclip nil)5 n4 _4 ~* r3 E* s5 ~
(eval 0)
$ R, {4 Y# R& v: m6 |1 N* E0 f ), L# G2 o6 F! i. C% x7 C
)
$ I. t7 u# _; e6 n' Y% m )
7 }4 U, ^7 y+ [ (progn 4 {6 K0 `% Z% y# [% }
(setq hasclip nil)4 y! Q6 N4 h) I
(eval 0)& b# q2 ^. v. P. N" A
)
- { `3 K1 j7 N$ [3 M1 @ )2 r ^7 s4 u4 `4 a# r
)
! L$ K/ W2 [: q, [ (progn " k% @ Q: }1 Q0 o6 ]* E/ W
(setq hasclip nil)8 O" e( D& G# c
(eval 0)
- j8 d) K. y- [" n; ] )* d# g* v& `$ e% d4 J; J
)$ j3 W! I" J2 U; ?- x
)3 c, t' H6 ~: e1 S/ Q2 s
(progn 4 g. z0 x/ `0 w8 d6 c
(setq hasclip nil)5 L0 D% V/ K6 A8 W6 h$ U
(eval 0)
% g z" K5 O, C7 i6 Y )
, i- [% ^5 M! g+ L- l8 M8 c )' g( s2 L1 E' g9 t- R {# O
)
" p0 {- }0 l; b) H; x" W$ U* S ;;, h6 m1 f& T0 o- n( D
;; Draw a dash or dot in image tile( K+ F/ z3 L# }; j+ O6 B( [
;;0 a* C& B1 J" Y! U
(defun vi (), t1 E; ?: \ P
(setq x2 (+ x2 dash))2 U0 @$ }- [ v. `, m" B4 p% U7 J
(vector_image x1 y2 x2 y2 color)
0 M6 L6 P7 h, e# ]( m9 ^ )
1 h9 l. ^" { Y1 ?7 X/ z ;;
$ N' _$ a- @3 U6 m" q ;; If an item is a member of the list, then return its index number, else
4 [* s' g0 z& n& p2 z! A3 }; ~ ;; return nil.7 t' y* D- w: L- V1 p" X, Y
;;
4 p6 }! ^) _3 L" n. `+ D (defun getindex (item itemlist / m n)$ O2 D1 h8 e8 B8 H1 R( c
(setq n (length itemlist))
' Q# K ~) g) Y% O (if (> (setq m (length (member item itemlist))) 0)
7 e( z+ T0 j' N, I* Z/ k (- n m)1 J% g2 G8 a0 l% Q$ n8 c
nil
: }7 Y# |) g( p6 { )! o0 a: W0 Z' Y. K/ O2 r' ~
)
2 N( F) o& Y# T; P+ j1 h; G! Q ;;( j- i. @, }5 G. e. B- e
;; This function is called if the linetype is set "BYLAYER". It finds the
; r1 Z3 g" ]) w" Y/ J6 T ;; ltype of the layer so it can be displayed beside the linetype button.
8 y' T$ s0 f) A7 R ;;
j$ M# o) x% V+ s/ P, o& h (defun bylayer_lt (/ layname layinfo ltype)
/ ~, t, t8 e& x* `; J( S8 k (if lay-idx4 A0 ~! S4 i( ]
(progn9 i$ w# v1 E: _# L! d
(setq layname (nth lay-idx laynmlst))
! p8 _9 B7 Y3 _* V5 \& e" k* z- x: e (setq layinfo (tblsearch "layer" layname))
) U4 y/ B2 Z! N0 i: E3 b (setq ltype (cdr (assoc 6 layinfo)))
1 |* L0 e& a& ?4 O "BYLAYER") h2 [4 f' g; I$ _$ A
)
/ X+ U) A+ }. U f "BYLAYER"3 k3 t2 j! z9 b
)9 b! _$ v% b' n! Z
)
- Q6 q9 J- K+ n+ m' K' i# ~0 d ;;
! G/ W ?) u! Z$ ]0 h2 U! {! l ;; This function is called if the color is set "BYLAYER". It finds the color
& `5 M C6 D2 [5 n" V, }* I) U: |; U; \ ;; of the layer so it can be displayed beside the color button.
" @. p; u( U$ h3 B! Q! ]" N. w$ i ;;4 f7 v$ w4 M8 _6 d+ g$ E2 Z1 V
(defun bylayer_col (/ layname layinfo color)5 J S' ]% H/ t. q+ k+ o5 I
(setq layinfo (tblsearch "layer" elayer))
- M4 j& t% B5 I" [( C (setq color (abs (cdr (assoc 62 layinfo))))
: g, F7 c" S+ c2 O5 ~& t )/ h0 |! C" N2 n" D% r# @
;;- _% q& a. M8 U1 f) l0 {1 Y1 x
;; Used to set the color name in layer subdialogue.2 m/ D+ l, ]/ w/ O
;;
# D% y# N, {1 `1 u% Q& n (defun colorname (colnum / cn)
2 S8 T( m& n, |' g (setq cn (abs colnum))
. ` C, w5 q0 r$ W (cond ((= cn 1) "red")
r, k0 U$ @; |2 ~% s ((= cn 2) "yellow")
7 n7 e7 w& W; A% n! G ((= cn 3) "green")
+ S4 W P( y X- r8 f% K ((= cn 4) "cyan")0 A) ]; z8 h) \; c( e8 } ~, p
((= cn 5) "blue")- Y3 I7 `' s0 m0 [: M% j
((= cn 6) "magenta")6 n0 l4 d( `& |6 H- R
((= cn 7) "white")+ [: H$ L: c) {! n0 ~/ m
(T (itoa cn))
- u% F" [2 Q7 H( _0 O+ A5 G5 M )
5 I$ e2 C" G3 ^2 P# ^0 z )
9 L. ?5 n: E' M$ V ;;" _. i( L. d! M
;; If their is no error message, then close the dialogue.
! {' u% w+ k4 G$ T' N ;;
! ?/ H! m! i1 N( g5 o# R, z3 ~! l (defun dismiss_dialog (action)4 O- M4 W w# X& i+ ~4 r% j8 E- ^
(if (= action 0)6 Q. @' M `# ^% {; P$ P. S! ^
(done_dialog 0)
; D: d+ P: l+ n7 `# }$ {4 W# W (if (= (get_tile "error") "")
' a* A7 U. Y, F4 B/ { (done_dialog action)2 `9 h ?/ t# r9 d
)
5 q3 }# Q' T/ s% y )
/ A4 L4 p' ?2 T8 n )
L6 j. h/ Y$ i" G/ o5 h/ J) `3 t! Y5 z5 V. M, O
(defun test_ok (): B" o: A# ~5 b( X: a1 ~* ?
(if (= (get_tile "error") "")
2 h) Z+ s3 S0 l6 \, | (done_dialog 1)
, N0 z! B2 u7 K8 @1 D: d" H )
. Z- |$ p* U4 G' ^5 Z )
8 K# u, _1 G* v& G! u; B* m. m2 Q, W
(defun cancel () I& _3 n6 T; q9 V+ h" e# n* J
(done_dialog 0)' @% _0 e/ d0 K! R5 O2 I
)
. H0 O! L- y9 J+ v+ P1 _9 X5 ?) ?) F) z5 ~; j% b
;;; =======================================================================& {# N+ d2 f1 d' d+ ]7 [) W
;;; SETUP layer and linetype lists for application, and initialize all
1 g/ c9 X% n- x3 [' o# b, M0 X2 a;;; program variables.8 k) m/ i3 P2 I* B
. B- D9 P/ G3 l. J8 |6 n7 H" e (setq elist (entget ename)) i1 |% W2 ]3 _0 z
old-elist elist7 H, |# N! @( f" _
modlist elist: c1 I3 c3 }/ F6 Q& r9 Q0 Z1 ^
etype (strcase (cdr (assoc 0 elist)))+ P7 a5 [$ L1 Y/ h. p5 Q& n7 l. S
ecolor (cdr (assoc 62 elist))- q3 }6 R: s0 h
elayer (cdr (assoc 8 elist))8 K; d; g/ A" K
eltscale (cdr (assoc 48 elist))2 {% }; g) z1 K5 F7 }
ethickness (cdr (assoc 39 elist))
: g! A c7 N+ b eltype (cdr (assoc 6 elist)) A# ~1 |7 F, A, W5 `/ ?
)/ v/ e% A) @8 N6 n: @: c9 t/ s" h
(if (= (assoc 210 elist) nil)
! n9 p( j$ l" f0 Q5 o$ Z) Z (setq extru (list 0.0 0.0 1.0))
+ ~, M! l I6 F$ X; G/ r2 x$ L- B (setq extru (cdr (assoc 210 elist)))
& \6 O6 ^4 C' g; v; K )1 A* K/ z9 U( T3 t5 i9 }
3 Y# r: d* N8 S( q9 A; N* G# T
(if (not ecolor) (setq ecolor 256)): R+ H- V! u- |2 g" s; l
(if (not eltype) (setq eltype "BYLAYER"))) Q% C6 L0 {( P5 q
(if (not ethickness) (setq ethickness 0))( w; q$ k. @% V* l/ o' ]
(if (not eltscale) (setq eltscale 1))( C5 V* w4 O0 U7 g5 r( n6 K
) ; end ddmodify_init
2 e1 I! T7 m" e. a# q! J0 v2 K% D1 {3 c7 f. I, s! ~, C
;;; --------------------------------------------------------------------------* R( w6 {& O; Y. ]1 |& i
;;; Function: DDMODIFY_SELECT3 u* Q& i1 c0 d6 p) i
;;;
; [! O/ X# A0 g A2 s;;; Object aquisition function.2 w) W! g: |2 s9 j2 T* U
;;;8 F/ _* J/ U+ J& x. C
;;; (ddmodify_select)9 ]1 W; N9 x M/ F
;;;+ }6 C" o3 A' h e
;;; Obtains object to be modified, in one of three ways:- {' C% L8 a' T7 o
;;;
- U4 y' o/ l. [7 F;;; 1 - Autoselected.2 M7 K% ^) ]8 V3 O% ^( B& c
;;; 2 - Prompted for.
; q: R& F" [4 m1 C& [) T! l;;; 3 - Passed as an argument in a call to (ddmodify <ename> )
& d3 J) t/ y% N& _, C+ R& j;;;
. Y- X4 b' n/ [( W% o0 F;;; The (ddmodify_select) function also sets the value of the4 ~( m: ?$ E; I/ E3 V
;;; global symbol AI_SELTYPE to one of the above three values to) W4 ~9 u/ Z7 J0 s1 ` i% s! G* D
;;; indicate the method thru which the object was aquired.$ O* C& c4 ]9 \: B% d
;;;
# e0 y0 L4 ?6 ~& N) q9 [& K;;; This value can be useful to applications that want to RESTORE: z' Z" W" E# g. B, t/ z6 F P
;;; an object that was autoselected to its previous selected state0 v/ l1 z, o# }9 m
;;; when they terminate, although there doesn't appear to be any
: H# `3 W' G9 };;; way to do this right now.4 d1 n6 X, ^2 o1 u! u& K
) {- r8 ` F$ L: |6 {
(defun ddmodify_select ()+ d- G- ]8 D6 q
(cond" e9 ^, S! S {8 H3 j9 V
( ename ; (ddmodify) was called8 b5 D, H7 [! d1 P5 ~! l
(cond ; with an <ename> argument
, k! I, H) F* y6 g4 L/ o1 W ( (entget ename) ; If object is non-deleted
}6 X* ?. g3 I+ g% u+ i. Z: ^: Z (setq ai_seltype 3) ; then return its ename.$ w1 ^- A- F c
(ai_return ename))))
3 C/ w8 R2 O( U: n E9 O' S, Q7 f7 g+ F( W* A$ i, {9 C E
;; return auto-selected , see ai_utils.lsp
' o: q8 a4 {% x# Q ( (ai_autossget1 "\nSelect one object to modify: "))3 Q h D% N, K- q2 q9 I4 V1 d1 F
/ L+ v( j; d! `8 H% C) k (t (princ "\nNothing selected.")7 |9 o8 ]$ c5 n. O1 Q9 F
(ai_return nil))
# }, W" _( X8 Y! L )
- C( n( j4 U: \! M4 i)
! u: _5 v0 J6 ], S* X; n7 v- B
( x; L2 |2 ]9 S5 U1 w$ N;;; ============= Command line interface function =======================
- b2 [! C/ f9 {3 s8 B+ [8 n- X/ v# H4 A% t0 v
(defun C:MMO ()
a Z! J% p& W6 ?3 I9 h: V$ A (ddmodify nil)
7 U. b9 d. L; Q6 x$ [/ Q) A) D (princ)# k9 C! f4 M9 U/ \# T
)
: E9 L' N. t3 Y9 V. q5 b3 V( `7 j/ A+ [
;;; ================== (ddmodify) - Main program ========================
) W, ~7 k( {/ {( k;;;
5 j7 p [. L$ R8 [;;; (ddmodify <ename> )+ O9 X5 i2 t D. \" i4 |
;;;+ S! C; J) h& d1 h
;;; Main program function, callable as a subroutine.
% j2 p. }8 \- M;;;
& j7 d, y$ j+ r7 _& S9 ] H9 g;;; <ename> = object name of the object to modify.
! K* |$ h$ x$ z, f;;;( j4 g- A3 w& B5 W2 w, X
;;; If <ename> is nil, then user is prompted to select/ l+ `% a& b6 h! v; ~' s
;;; the object interactively.
z& `) u3 n; j6 o2 R' U;;;$ t0 H4 s3 ]- }; v5 T$ J
;;; Before (ddmodify) can be called as a subroutine, it must& O- G( w9 V* M- u1 p, t! D4 i
;;; be loaded first. It is up to the calling application to
) [/ s4 e% P+ A6 A/ p3 P0 S: y;;; first determine this, and load it if necessary.5 g; u% Z( H0 N8 @% b: X
( l! L) D" K" o% z- n
1 P" e! s& {* _, ^& ~: C
(defun ddmodify (ename /
. a* s9 r+ w+ I( r: N2ndpt ell_calc_area move_pt1 templist3 R/ |5 ~/ ?* [( c3 x3 w
add_mdash ell_tile n tempmod
6 M" R7 ]: y, J% R* Lalipt eltscale name tempst_ang
% j+ i( b5 X5 tang eltype newpoint test_ok( C+ }. z# _+ ^* l+ v( e$ o6 W$ ?
arc_calc emod next text
$ T% W1 H6 b H; ?6 F, @& ]arclen end_ang next_vertex th-value
& C7 \: O0 y# b& hassoclist endpt obl tile
9 K1 O) L! @ n$ R- l7 Z/ x4 Tatprompt errchk off tile_rect
4 t% J/ H# ]5 z6 Q+ Oattag ethickness old_majrad tilemode% h0 v& J0 a+ y5 `1 }
attprompt etype old-closed totang
2 N2 C7 R+ l8 {% n9 p+ s2 w" R- qbit extru old-closedm tstyle
9 c8 ?0 Q0 e, ~- [6 Q* obit1 fchk old-closedn u4 O p% U: d4 z- |
bit-10 first-10-rec old-elist undo_init
/ Z) \ ~; [" ?( z2 n" Hbit-11 first-10-time olderr upsd' y: h* A: A# Y+ H* H
bit2 first-11-rec old-fit v- |% j/ H. U# e# t" H0 k
bit3 first-11-time old-idx va. M! X4 i% d* K; I! ]9 z
bit4 fit oldlist value" y4 w, X, m7 r( M0 x, H
bit70 frozth old-spltype ver_4
4 P' g5 [6 p: T! |9 m* ~bit-70 f-vis old-u ver_ang1
2 z4 o2 @4 g; `' M+ o/ Bbit75 fx old-v ver_ang25 f) Z* [- e5 O( e! `
bk-up get_color on ver_col9 k# g* Q$ b: m
bkwd getcolor onoff ver_colsp' O! y ?1 M0 h5 }/ Y% `+ F( {
boxlength getindex on-off ver_eangle$ ]8 a! H3 H, U8 N# m: m4 c1 h$ o
bylayer_col getlayer patlist ver_hght
B4 V# G8 W* a. {bylayer_lt getltype pattern ver_majrad
9 o0 x& b& @" c/ |" ycalc getthickness pltype ver_obl
+ i/ A& q- \" P& Rcancel globals polytype ver_pt1
* W2 N4 \7 z; Y+ c5 hcir_calc ha pre ver_pt2
1 _0 J# C9 z) ^$ G% r$ n7 l5 i1 hclosed ha-prev proplist ver_pt3
y7 \) ]) L$ ?- [! Cclosedm help_entry pt ver_pt4
# v# U- D5 |; k$ x3 f0 yclosedn hght pt1 ver_rad6 ~9 z4 \. c1 W4 J* V. t, l3 \
cmd icvp pt1_eq_pt2 ver_rot" s, W5 c8 [! ~/ t3 o$ @
cn image_add_vector pt2 ver_row
0 z2 P0 v! x" E0 V, _+ E( jcname image_clean_variables pt3 ver_rowsp) G1 C$ Q$ O: i- z' F
cntl-pt-indicator image_cross_product pt4 ver_tag L/ h3 e2 W$ p8 D+ X
code_71 image_disp_opt ptype ver_u
* s1 u5 ?/ {1 v, x8 Kcol_tile image_dot_product radius ver_v
6 ]0 d! B0 g! F6 F P! r, ?! T& H5 Bcol-idx image_normalize_vector rational_spl_flag ver_wid) O) x8 E; \, I2 {! v" N
colname image_rotate_vector reset ver_x1
! W, P& D& S; K$ e; p7 mcolnmlst image_scale reset_flag ver_x26 R# ^; R9 b: A7 }4 j& Z
colnolst image_scale_vector reset_lay ver_x3
( L/ U) F4 B- p# l. x1 s; ]colnum image_update reset_lt ver_x4
& L: A9 j) p8 u5 N3 C& d" W mcolor index reset_uv ver_xline_pt1# i* d5 ~' t1 b, M0 ~+ C
colorname inv rot ver_xline_pt23 W# D4 J& j% P8 J/ N
colorno item rows ver_xline_x1; J+ ~: ?' A- }- j' i2 ^/ y! q
col-sp item1 row-sp ver_xline_x2
u* ~4 d) P* M' d; S5 Ucolumns item2 rrat ver_xline_y1* P R( X) i. q& e) v
con itemlist s ver_xline_y2, Y6 ^+ V, a% `
coord jlist set_action_tiles ver_xline_z1; T4 \: Y J h4 s% ^3 o
ctr jlist_act set_just_idx ver_xline_z22 x5 K- Q. f+ o/ J3 S; p
cur-10-rec just-idx set_tile_bk-up ver_xscl$ r* X7 K) N! K2 A
cur-11-rec layedit_act set_tile_cntl_pt ver_y1" }% g$ b/ i3 `- g2 d
cvpname lay-idx set_tile_data_pt ver_y2( z7 f" f5 u$ W: k: t% z9 i" n
dash layinfo set_tile_dirv ver_y3
; S4 @, X; w: l; ~8 l B& Q8 ndashdata laylist set_tile_edges ver_y4# `5 r$ \& w0 n2 ^* M& G3 w" h
dashlist laylist_act set_tile_endang ver_yscl
. l5 T. y# G: f3 B' ?1 u! e9 e& e) e, L, n( vdashsize layname set_tile_hght ver_z12 e" u i9 R2 P; g$ Q* d$ L
data-pt-indicator laynmlst set_tile_icvp ver_z2- q3 [9 z0 H0 ~ Y' R) ^
dcl_id layvalue set_tile_just ver_z3
+ ^ `1 R( P2 ^' E6 Ldd3dface line_calc set_tile_obl ver_zscl( F6 |5 u1 M! j( E1 |
dd3dsolid linetype set_tile_prompt verify_a9 l$ g9 h& I$ r/ {
ddarc list1 set_tile_props verify_d( }! y3 W% o0 g& i
ddblock longlist set_tile_pt1 verify_i e5 `: s6 T5 W4 ?
ddbody ltabstr set_tile_pt2 verify_xline9 \$ j- [' \/ u8 l! j2 ]
ddcircle ltedit_act set_tile_pt3 vfy
* D9 [' k6 F. j% tddellipse ltidx set_tile_pt4 vi
- D3 |( {' h& U5 e! Uddgetprompt lt-idx set_tile_rad vlist/ \- m" j/ n- o# [! A. F- B2 T
ddgettext ltlist set_tile_rc vname/ N" p+ Z0 Z; F S' d2 }
ddimage ltlist_act set_tile_rot vpf O8 K! ^8 P y! v
ddimen ltlist1 set_tile_scale vpid3 q' O8 a ?" H
ddleader ltname set_tile_spline_props vpldata
4 p. j0 K4 c6 Yddline ltnmlst set_tile_stang vpn
& a! f- B* k- T# Tddlist ltvalue set_tile_style vpt
1 \$ @: A% X( f6 b) }# p) fddmline ltype set_tile_tag which_tiles
. e- d' L, W1 @, f, S5 _0 T: M1 Bddmodify_err m set_tile_text wid; k" J8 k. R7 x& @" V
ddmtext majrad set_tile_vpt x; c- ^) V9 [' \* F7 I
ddpline make_lay_lists set_tile_wid x1% t, q7 _' J8 H$ U
ddpoint make_lt_lists set_tile_xline_pt1 x2' q6 B% G5 }4 U$ U
ddray mdashlist set_tile_xline_pt2 x3
2 \5 x/ R5 P" \/ q' ^* A# Zddregion minrad setcolor x4
) G8 m5 P: W* ]& dddshape modify_3dface shght xdlist/ K1 a$ H8 @3 D' A8 I8 N
ddsolid modify_3dsolid showpt xline_pt16 H$ M' b, g( {! ^, `/ z
ddspline modify_arc size xline_pt2' ]3 l$ U& l1 }% x, \1 V1 k _
ddtext modify_block slist xline_x1- y5 l, S! `4 J. X5 g" k
ddvport modify_body sname xline_x2
" v0 y) n$ N6 Y! O n. z% L4 gddxline modify_circle sortlist xline_y1+ W- ~4 a2 s; |+ X& [* N2 N9 q, H
denom modify_ellipse spltype xline_y25 u( M9 f- d# C/ N _. \
dialog-state modify_image ss xline_z1
; E) _, ?% b( Z* N- tdir_pt modify_line st_ang xline_z2
6 K2 J7 C& Q3 L5 Wdir_ptx modify_mline stpt xscale
$ v9 v1 ^2 M1 Z2 p" F, |# T8 C5 U9 rdir_pty modify_mtext style_act xx) E* v m8 b! J8 M
dir_ptz modify_point style-idx y% Z- Q. B5 e) X# r+ Z0 c
dismiss_dialog modify_polyline style-list y1 f6 u( y8 m* B5 l f6 P3 p
drawpattern modify_prop_geom tagval y2
: F9 E( @0 h. h# u" B6 Z- @echo modify_properties temp y37 u( }! n4 E$ u9 V/ r6 x7 q
ecolor modify_ray temp_color y4) f+ {4 F9 j a$ m, |
edge1 modify_region temp_dir_x yscale
3 D0 P2 u! m4 L* E( d/ O) }! l- ~edge2 modify_shape temp_dir_y yy; ^" d& h2 _: x- e2 p4 T3 J* P9 s
edge3 modify_solid temp_dir_z z1+ M# W' H1 h# ~7 y6 k
edge4 modify_spline temp_xline_pt1 z2
, d! j# v' S5 ~0 sedgetest modify_text temp_xline_x1 z3. l+ c6 w8 W5 ~
elayer modify_vport temp_xline_y1 z4
" x/ \4 x$ P3 l. {3 j) z5 v3 Belist modify_xline temp_xline_z1 zscale
* E3 }7 h% o. F" m1 W2 h5 Tell_calc modlist tempend_eang zz& {( ^, X5 ]; Y2 F
dir-idx safe_ddedit ver_MtextWidth xcliponoff$ f" T$ N9 J, j1 y
MText_style8 k& |2 M/ F7 b _
)" t' ]# G) B$ J* V
( g* b: A) [! N7 `$ y7 G (setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho2 H! U! M- O' T4 a6 N( W7 R7 t& z
old_error *error* ; save current error function
4 W6 R0 ]! D% W1 y7 G *error* ai_error ; new error function" P/ M' ]- o4 W9 H4 \6 m5 _
)" Q" O. `4 B* A
! E( t! v& p/ l1 O! A/ p
(setq old_pickstyle (getvar "PICKSTYLE")) ; save old pickstyle) o+ A) E, k; b0 W
(setq new_pickstyle (logand old_pickstyle (~ 1))) ; turn off group selection! u* ^# u( ? E: L! N
(setvar "pickstyle" new_pickstyle) ; bit and set to new value0 }, F4 D- _$ v# \
/ b3 H. c9 c. E/ {/ W. ^" f# g
(setvar "cmdecho" (cond ( (or (not *debug*) (zerop *debug*)) 0)
~" [4 m' Q/ ?: r& C, G) W' V0 Q6 r (t 1)))* X& m% G* N1 R7 r7 Q
(cond* n- Q% g6 P$ G
( (not (ai_notrans))) ; Not transparent?
, D6 a. [3 S7 R$ o. Z6 \ ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
+ q2 M/ _( W- g" Z* C ( (not (setq dcl_id (ai_dcl "ddmodify")))) ; is .DLG file loaded?( m8 r; K8 q' x: D! Q
( (not (setq ename (ddmodify_select)))) ; object to modify?0 T. {, x9 O5 B8 W7 \2 _$ ?0 B/ B9 _
: h9 f4 f) p, |1 z0 A# n, } (t (ai_undo_push)2 a8 Z; s A! w- U' ~( R/ A) k
(ddmodify_init) ; everything okay, proceed.0 ~4 p$ G* c! {8 b0 w) b
(cond" g( N, N6 }# K& l8 B0 T9 k+ E( i
((= etype "LEADER")8 I& ?( v5 }* `: _' ]
(setq help_entry "modify_Leader_dialog")
2 @0 I* T5 i4 ]7 c; i (ddleader)* i! i0 R- [" g) G& `( p
)$ X( J! @: m+ c3 v" O( c6 u
((= etype "ARC")
, K! W6 Y0 O8 O% q (setq help_entry "modify_Arc_dialog")
& ?, Q/ \# B3 t, a; T; m0 m$ y2 l, R (ddarc)
& \/ Z2 F2 [% z' G )" o/ K) P7 z- P/ E- L5 H0 e
((= etype "ATTDEF")7 W2 G9 I5 `9 A7 o! J
(setq help_entry "modify_Attribute_Definition_dialog")3 x- ?. e) l5 z F& d, `7 e& o
(ddtext)
, J6 o: }* t2 }4 k+ M )
1 ~( i5 C& o7 V" N* f ((= etype "CIRCLE")
( v5 {/ q+ ?- h5 a, n (setq help_entry "modify_Circle_dialog")! f; e7 z) U: c5 b
(ddcircle)
3 Y) w' E. |4 F) s" V/ g3 m )
; `2 ?* \# O8 E ((= etype "ELLIPSE")$ Z7 J! ]' C) f% c4 z; ~
(setq help_entry "modify_Ellipse_dialog")
, H% I) I" v) M; w (ddellipse)
% N% F3 I) J' C7 {1 W7 g7 v )
0 A4 J& t$ n# u, T0 ~& ]) g ((= etype "3DSOLID")" G: c7 N2 J$ C! G: t3 | g
(setq help_entry "modify_3d_Solid_dialog")
9 | Q* d# [ f& P1 ~- U2 w: J7 @ (dd3dsolid)
% M, a! q. V+ X3 {% H G' D9 } )' h' D( h a3 i) [5 u3 w
((= etype "BODY")
- H: F+ L% @4 y. O$ W. u* s( V# F (setq help_entry "modify_Body_dialog")
" B# w2 I% k0 o: A6 f) a (ddbody)
7 Q9 U* h6 a# d ]0 d )# u% D' b. }1 \1 `, Q# r
((= etype "REGION")
# s- T5 M4 g7 T7 P (setq help_entry "modify_Region_dialog")& R- I3 t9 d, u* t( W& b$ l! n
(ddregion)
3 S4 i2 L5 d# [2 ?! D )3 k, k! ^# ~ k V \; q5 ]
((= etype "HATCH")
# }: Z8 ^4 Q3 R7 w0 f" w7 b: l! P (setq help_entry "modify_Hatch_dialog")0 l3 q9 U# g/ I3 E0 y$ W8 o o
(ddnewhatch)
+ J) u! ?) [' ]% Y ). K' O9 v# X; o
((= etype "SPLINE")% d0 H( a) r+ M3 V2 \
(setq help_entry "modify_Spline_dialog")* S4 @( S$ Z# E5 s; v
(ddspline)& n w( K6 h! D7 `# f/ ]
)2 e- A9 w0 N, w: G Z, @
((= etype "INSERT") ; see ddblock for help_entry9 ~8 \; ~' Q5 L& z% c! m9 v! }
(ddblock) d* ^; U% D6 E8 j: _
)6 \* S* q- c( T* o$ O
((= etype "LINE")
+ [ s8 E2 B$ a7 H (setq help_entry "modify_Line_dialog")6 r: ^% o9 Z- O6 I/ C
(ddline)7 Q# L7 _/ ?! \0 F( v- @4 D
)
2 u8 X, R' \5 P/ I% o7 ?- x" |" I ((= etype "MLINE")
+ ~, B, U3 X1 t" p8 c (setq help_entry "modify_multiLine_dialog")4 y+ s1 T% `. @' z2 C
(ddmline)
- H7 |. n" E- v m8 _' f; I. Q )
( }+ _' V; [ F$ V! y ((= etype "RAY")3 n! l' o; h. g8 S" j% W) R7 w* f
(setq help_entry "modify_Ray_dialog")8 I& i4 U' g. O1 `. F& v
(ddxline)
+ J" l4 \5 n; [- g )3 F# H' {8 h/ Y1 G
((= etype "XLINE")8 \0 E8 l) d7 [' r( p4 r. l8 a
(setq help_entry "modify_Xline_dialog")3 M; f( \& m: V* g. A, {- m
(ddxline) J9 e6 A J+ Y( `2 B* Y% _
)5 l' @5 P/ p' b& Q" O& L+ r
((= etype "POINT")
" z" E8 u+ j7 k+ Q* C) K p (setq help_entry "modify_Point_dialog")
0 y( X }0 j y9 ~1 F+ M* H$ Q8 {6 F (ddpoint)0 E$ D# x( D i6 H" I+ ?" Y
)9 j" V( K9 u+ [; l8 y% p2 h& V
((or (= etype "POLYLINE") (= etype "LWPOLYLINE"))# B7 z" R/ G$ U
(setq help_entry "modify_Polyline_dialog")
. ~9 @' F6 |; X4 S ;; If a 2D pline, check to see if it is planar to the current
2 j0 d1 `) C$ r. }8 Q ;; UCS, reject if not. To see if the pline is parallel,
k H- y: D9 T2 C ;; the 210 group (WCS) is added to the current UCS origin (WCS)
% F' r: L# |7 T0 q1 ? ;; and then converted to the current UCS and checked to see if* u/ C$ U- p, ?! Y2 B5 h
;; it is equal to (0,0,1).
1 X+ e ~! `! @! Q/ L
1 [2 Y/ k3 `& u7 O ;; Incase the 210 is default and not in the dxf list.- O1 S; d- q% P% [; E
(if (= (assoc 210 (entget ename)) nil)
8 U7 ?, t5 ~. K% F! m (ddpline)
+ ~- R+ C; G' m" l9 _; w (progn
9 m: X$ `! B' O. k& Z (if (and (zerop (logand 120 (cdr (assoc 70 (entget ename)))))
4 z$ Q8 i# W8 G* a% i' f+ s t (not (equal '(0.0 0.0 1.0)
" ]; H; s3 v- g3 U, o; O (trans (mapcar '+4 s3 k! B: h* `: v& {
(cdr (assoc 210 (entget ename)))
. T+ a* w" W$ ^ (trans '(0.0 0.0 0.0) 1 0)
" n& }' f7 V1 m )$ o7 X1 G/ n1 T$ r+ f$ ~5 ~. V
0 12 [8 T' M8 e2 l' K
)
7 I) V; h% }; {& A1 q 0.0000000001 ; fuzz5 }( X% R* U" O, g( \
)
$ B8 b* g( Z' P3 ]9 }' ^9 o6 q! U( x )0 n) }1 u" ?# n/ j7 b
)3 ]- a3 n' d1 i& z% U$ n4 @( S5 D
(princ "\nThe 2D Polyline is not parallel to the current UCS.")
. d% ]- r( U+ B6 z (ddpline)
8 d, S" E8 H7 |, m4 d: V3 t. i8 n3 G )
/ S& S8 Y& n/ f+ e" c8 O )
! R; M4 O- u' s; B) [ o$ Y )+ L4 q8 K% }& y# N9 ~' {. n
)
/ A, N2 M; E& @$ P1 m$ h' n K1 j M: J9 S( u) \8 D% J4 [
((= etype "SHAPE"), f0 |# ?8 y7 r, w4 Q
(setq help_entry "modify_Shape_dialog")3 Y% S8 O# |6 ~1 m" Y6 X) |
(ddshape)
" @# |3 I( J% F )5 Z7 T1 t: @# x. ~$ z o
((= etype "SOLID")
" C. E |# f3 s1 f0 N3 r7 Q) P (setq help_entry "modify_Solid_dialog")
* `6 ?) M% g$ Y# B8 B, G (ddsolid)
( U! v, Y) e) X1 z6 O )
' Q) n# c) l5 Y7 [! v a ((= etype "TEXT")6 i- E @8 q. S7 F& T1 S
(setq help_entry "modify_Text_dialog")
& D2 Y* p3 [- C: d8 n8 g. Q (ddtext)
3 u) _* o/ w m; h$ Y' { )
L" z0 p2 g% E5 {0 {3 A ((= etype "MTEXT")
0 g8 `' B% J+ B (setq help_entry "modify_MText_dialog")
' e1 `. E* f4 S. r (ddmtext)
# K8 ?6 }' ]9 a# | )2 l: M' p0 Y# X8 H/ a
((= etype "TRACE")
+ S I8 H1 }: H, r: t (setq help_entry "modify_Trace_dialog")
: O( O* ?: u t4 A! ] (ddsolid)& w. M& j- d; a, |
)
1 ~% I3 w& W, _8 e ((= etype "VIEWPORT")5 f7 C. J: Z I0 z" B$ ]
(setq help_entry "modify_Viewport_dialog")" H' b2 r; V3 s# e9 t) j
(ddvport)
4 }0 c+ c' n6 E )0 H7 j4 L* T; n7 T" E
((= etype "IMAGE"), ~5 }, d# L8 o' v
(setq help_entry "modify_Image_dialog")5 i$ x) b) E9 {9 O/ c. V" r7 D
(ddimage)2 D( m' U) Z0 u. }
)
& k2 o1 x4 d3 Q3 r. @3 w$ s ((= etype "3DFACE")
0 O0 L+ \$ J' K' W; e3 d2 p (setq help_entry "modify_3D_Face_dialog")
0 ]4 e$ c5 @+ M4 _* k (dd3dface)' \* M0 y4 ]( L L7 r& `& A
)- ~& T0 j4 N% \/ V
((= etype "DIMENSION")
( b" {' r5 d4 z5 L' _& E j (setq help_entry "modify_Dimension_dialog"), g7 c0 S9 V( ~6 s0 K' F( M
(ddimen)
. v) N) m- a# M, r )
0 F* A% }9 o- F ((= etype "TOLERANCE")
3 i q0 g! ~& w (setq help_entry "modify_Tolerance_dialog")# G0 u' y; N3 f$ M
(ddtolerance)2 a; q- K4 F0 A, F0 j6 w; ^# c( a$ C
)
* D# p7 r4 a+ L. v+ O! T;; Fall-through condition changed by MCAD for MDT 1.1 release.9 y5 |0 j g5 {
;; This allows DDMODIFY to work on any custom object or any new object type+ s$ z3 J3 n) t {8 {- H- @) R
;; that isn't specifically handled above by calling the more generic DDCHPROP.3 S' m! ~! d% f4 |4 |, n- g
(t( j3 H" g' X6 H: e' m, N0 d
(if (and (not ddchprop) (not (load "ddchprop" nil))) I: V! ^: R! H
(princ (strcat "No dialog support for object type: " etype ".")))' F* r! ]6 C7 r- | N7 e5 N$ d
(progn
9 D [ S v. z (setq tempss (ssadd ename)); F& A8 F7 b. p+ f" E3 R! K
(ddchprop tempss)
& O2 i1 s/ E' h- T7 z (setq tempss nil): u3 W! l; a( L: ?/ j
)
# F# M: s# f/ o; s' d1 n# M )
! J( w/ p" J) P b+ \ )
+ J# u9 q4 p( ] f7 X+ R" ]: m;; Previous fall-through condition.6 i; C: h) M4 P3 `* d# V8 b4 F( z
;; (t (princ (strcat "No dialog support for object type: "! u9 L4 s' [: }: g, v
;; etype "."! t& a5 T; ` ~+ f' f& T
;; )
2 ?/ |3 o8 K% t+ D;; )! n) n, u3 L8 X1 I. ~9 i4 k
;; )5 `8 h. H0 F6 D* u
;; )
2 a; A m7 M* R3 {, t (ai_undo_pop)" e5 {+ y3 y* ? E# p0 U
)
0 v% B( D3 \% [" b' U5 q* h- l4 D& x7 U ). c7 p6 \0 F; L* o, J1 b) G5 T: H( K
" r$ G( E$ R M7 L9 x' B+ P9 l/ i (if (eq new_pickstyle (getvar "PICKSTYLE")) ; if user didn't change pickstyle
# O8 R0 u* h0 ^5 d! _! S1 ?% i1 F/ ? (setvar "PICKSTYLE" old_pickstyle) ; transparently then set it back- L, Z$ G! W2 g
) ; to what we started with% t; q K6 `) B
, H- Q7 S4 j# ?" k( }- ]1 F
(setq *error* old_error)
, h# n" @; R( j b# p (setvar "cmdecho" old_cmd)
+ s, O$ b2 h" t7 ^- J6 ~+ W (if (not reset_flag) ; if object was modified, then
$ q+ M/ E" S7 Y# G4 z! K! T5 C' r (ai_return ename) ; return it's ename to caller
4 }* d1 \( M6 ~/ J* J ). M$ \. i! b8 s Y- r/ O! B
)( \6 e3 @6 `0 h) l2 n) C
6 m! C( h. @: G
(defun checkForLockedLayer (ename)
1 u! Q% W0 A0 V5 K (setq layername (cdr (assoc 8 (cdr (entget ename)))))
1 F8 h5 p7 a! l9 f (setq layerflag (cdr (assoc 70 (tblsearch "LAYER" layername))))' U: n" U5 F8 J' q
(if (= layerflag 4)
& D+ l0 d' `" K. c" n6 d( F T% D: n6 b, u% `6 a/ G3 R8 A
nil5 e" O/ S) L& V/ S7 u
): u. R9 x- C/ i5 K7 O+ |9 D
)
7 p0 u7 |; \2 r: o* U8 f% S3 h( D6 q* B
(princ " DDMODIFY loaded. ")
: [+ o; O, F g4 ]0 G. Z0 F' \(princ)
; k. k" H- G- a5 V;;;???;;;---------------------------------------------------------------------------------------
4 Z7 o8 `1 e& l7 v, S b9 k% s
* N2 g1 r; m- X; {* V; Next available MSG number is 8 0 {" g8 r* ~8 o
; MODULE_ID DDUCSP_LSP_4 \4 r2 n! S0 z
;;;
0 z# `5 j2 g- j. {* V;;; dducsp.lsp
1 w7 B2 V- ?# v+ a) e; Q;;;
9 r/ e; p- k6 o4 s3 y;;; Copyright 1992, 1994, 1996 by Autodesk, Inc.( H9 R7 s- \9 {* ~
;;;% P2 Q8 X* {+ h* X: R7 R
;;; Permission to use, copy, modify, and distribute this software, n, e' Z8 ?) N. l
;;; for any purpose and without fee is hereby granted, provided
. u8 o6 `1 p" N4 d$ e' n;;; that the above copyright notice appears in all copies and
9 d, Q: W. Y' }+ d" e7 ^0 p8 |/ a;;; that both that copyright notice and the limited warranty and4 g0 p7 `! _& i, I# }/ I- q6 q/ o
;;; restricted rights notice below appear in all supporting& p5 ~" {4 Y' o9 S0 U- Z- Q& M
;;; documentation.
7 X, e) i9 B, R- B. k;;;% l3 ~ S' ?5 C* u
;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.( e% L# e3 G! R. \" P" Y. H
;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
; x) g) g% v* z2 ]# f- b) w4 v/ X, g;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
& {& U2 \# k3 z- W* d7 J0 };;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE4 W( Q/ I- r4 K6 U5 o+ Z; m
;;; UNINTERRUPTED OR ERROR FREE.
+ S$ o, J* H5 c- Z9 d# }7 G;;;
7 B! @- h2 q! R! t;;; Use, duplication, or disclosure by the U.S. Government is subject to
% K1 z* s/ n9 V9 V% B$ I/ p;;; restrictions set forth in FAR 52.227-19 (Commercial Computer4 H( r4 S. {6 ]* f
;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) ' }* m9 c# ~& u) C7 _/ p8 _0 j
;;; (Rights in Technical Data and Computer Software), as applicable.1 U, E7 U' v3 \ y
;;;
6 W7 {! W9 I' B; J' [' W;;;.
/ L1 H& ?! w) d;;; C:DDUCSP - User Coordinate System presets dialogue.
# p6 e8 Q7 \- J, Q. [, g9 M;;; ( t2 u; k# |7 J" H/ U) i
;;; Uses DDUCSP.DCL for the dialogue definition. The# ]" U* U. g" |
;;; slide images are in ACAD.SLB.
; N/ |- P" |% G& g;;;0 F4 }1 n' k4 e1 f
;;; ===========================================================================
+ l6 p2 v5 Z0 X* O) S;;; ===================== load-time error checking ============================
& w5 y6 ?) t& e2 z5 b2 C' {7 s6 `;;;
4 c; d2 }: T9 z4 ]: q+ w; E u" z" h y5 L# i6 Y" {, @
(defun ai_abort (app msg): d# y" u7 W3 M" n
(defun *error* (s)
- {; \9 \6 L+ H/ R5 z0 w (if old_error (setq *error* old_error))
: K- }7 V! p$ p& Y% ]! ^ r (princ)
: s3 m' b+ F$ ?" y1 {; I3 P" I )
* w7 T7 j7 D! s+ Q, \) f6 f (if msg0 o2 ?7 t2 b" f3 d
(alert (strcat " Application error: "9 [9 Z0 R; z5 y% a- |# y+ E2 a
app5 H6 |3 I3 |7 Y Y, Q
" \n\n "
* r& P' z/ x+ Z- X3 P2 B4 N msg
; H$ J, r( v) S " \n"
+ E, L& Y: m' L) n )2 D" H" s! W% {# f2 }$ y
)3 [0 E- U4 k g- q) `7 {
)
& {1 U5 u3 B g6 q3 ~! O (exit)
9 \) F8 S' H& q$ M )' {/ h- ^9 A: Q5 L* k$ P: D
- x5 Q& X) ]$ u# d$ H6 Z;;; Check to see if AI_UTILS is loaded, If not, try to find it,
; \7 j& l0 L" M' X5 X;;; and then try to load it.
. ~. \% p8 Z* t7 R;;;* e9 | H4 k Y4 y- Q# @0 X
;;; If it can't be found or it can't be loaded, then abort the
: ]" X* m: o: [; t5 _;;; loading of this file immediately, preserving the (autoload)$ {( U2 p- D# \5 X
;;; stub function.3 P9 g( [5 S1 W8 l" Y) N( u1 e3 e
9 ]! M$ |5 Q9 x5 i& ^ (cond
0 f- q" q: A2 v ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
S4 s( I2 R8 }% c+ i' \0 `# }2 r/ `
( (not (findfile "ai_utils.lsp")) ; find it
# R3 N: H ]3 Y (ai_abort "DDUCSP"
, ^0 S5 c& K$ V; x: }. f" O( M! ?/ k2 m/ ] (strcat "Can't locate file AI_UTILS.LSP."
7 V# A; {( J: f( F/ f. m8 M) h "\n Check support directory.")))7 }0 ^- l" ~9 b" D9 S0 N1 \. f
4 Z$ L" D [0 f& z/ E ( (eq "failed" (load "ai_utils" "failed")) ; load it6 }( ^. k+ t8 J5 X' D
(ai_abort "DDUCSP" "Can't load file AI_UTILS.LSP"))
& m& a! N% m& `- n2 ~6 ?- I( d( | )
( |' @9 H6 @4 i( D8 o: V/ V6 z. `: N% @# h1 d
(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
7 d s; w* D; w, g. G0 n (ai_abort "DDUCSP" nil) ; a Nil <msg> supresses" F! `4 P0 q. E4 R
) ; ai_abort's alert box dialog., p0 I+ u2 s6 p9 i2 }
. _. k+ d# j4 {* M
;;; ==================== end load-time operations ===========================; E4 E) }! ~! w- e9 T
0 i" N( G4 n5 d1 C1 e& M
(defun ai_ucsp_start ( / program)
* v1 F* x, h+ n( u V ;; Get program name
/ d" t( Z4 p" f1 K/ E3 {( w (if (not (setq program (getvar "program")))/ ?: h2 p, y9 c
(setq program "acad")9 V/ D+ u- T4 E2 N. l: t
)4 e! c* J: x/ ?5 M- q6 C2 i
(foreach v0 '("world" "left" "cview" "top" "front" / D; B; M" V/ z" o- U# _5 G
"bottom" "back" "right" "prev")
% `0 m9 _" Q3 i" K# h (start_image (strcat "ucsp_" v0))
1 [/ J+ l5 ^2 z( u- [8 d6 Z8 W. H: Z, D (slide_image0 B% [3 g& J9 T
0 02 r$ D3 _# C. h% J1 {/ H9 b2 {
(- (dimx_tile (strcat "ucsp_" v0)) 1) (- (dimy_tile (strcat "ucsp_" v0)) 1) v; ?7 I0 y3 E3 v& }
(strcat program "(u-" v0 ")")
) w' y1 a$ T% n9 L# ^2 W )
, C: W- m% L9 w9 s (end_image)
1 E2 }" b- H4 u; s2 i" k )9 @/ [. Q* R* L2 i9 {8 S. ]* P9 F
)
% `- |2 V& D" u+ j
, Z0 Z. ^2 J: c(defun ai_ucsp_set ()! F: D' }5 J9 B* P( s9 C
(if ai_ucsp_sv+ _- p$ z l! `: N4 C* m7 }
(command "_.UCS" "_V")& L3 t. x9 D- e2 q. D X' P
(if ai_ucsp_prevs( q+ I! |6 @' T7 Q0 ?
(command "_.UCS" "_P")* F2 ~, X( R% j4 e5 x- I
(if ai_ucsp_chg
$ ~2 T ~# f7 b1 O (progn
0 @4 S+ b Q: ]- k* V& [ (if (/= ai_ucsp_a "*")# U. V' \# _* ~2 I2 X3 c
(setvar "LASTPOINT" (trans (getvar "UCSORG") 0 1)). M b/ {0 V+ Q4 h& W
)
/ }! @ j2 X& }- ` (if (< ai_ucsp_pick 6)
. U4 w. ?" l/ i0 Y- p (setq ai_ucsp_set0 "@")
0 T8 f, {8 M8 @. {4 c" w3 X (setq ai_ucsp_set0 "*0,0,0" ai_ucsp_a "*")
$ {/ s) C; S' a% ]# T: B E6 o: | )! f+ s$ ^8 r% a, @ g/ k" Y4 ~
(cond ((= ai_ucsp_pick 0)
+ T+ N7 g+ {! c6 g+ I# ? (setq ai_ucsp_set1 "0,-1,0"- s: [3 {: J6 n7 D5 N6 s# ]1 G8 R
ai_ucsp_set2 "0,0,1"4 ~+ ` Q2 M% F9 n2 G" e
)3 K5 D+ Q% _0 G- n3 h
). s6 E8 ^7 M M" R% S5 e/ [- V
((= ai_ucsp_pick 2)
$ g7 m8 s) Q. r' K7 _ (setq ai_ucsp_set1 "1,0,0"
1 ]# G, h! c; A$ a ai_ucsp_set2 "0,0,1"6 k& r6 P) u% K! f6 Q' h- h9 ^
)& \, e* W( y9 r* M: B
)& S }' u Q. e, M8 p1 Y
((= ai_ucsp_pick 3)
2 r* y; @ d: u" Z1 y3 q (setq ai_ucsp_set1 "1,0,0"
& K* h1 [* V. ] ai_ucsp_set2 "0,-1,0"& n. ]; Y) U" f! f
)4 N( Y: W, Y" Z) M8 v9 Y/ I
)
, z" n+ K" x+ M1 _/ P+ B; @ ((= ai_ucsp_pick 4)
6 ^5 |+ Q+ x4 ~. F R0 r (setq ai_ucsp_set1 "-1,0,0"8 ~, O) u( B$ F0 u5 [( n
ai_ucsp_set2 "0,0,1"
- J- F4 H! X, B; f5 S* Q$ ?: D$ y )
W0 y( k" r0 {7 J$ f# n )/ d, {0 x: @' l+ S$ L0 s
((= ai_ucsp_pick 5)
: Z; V: d* x: p8 U4 Q' K7 L (setq ai_ucsp_set1 "0,1,0"
4 e7 r2 J6 {! ?6 G" o: |/ b ai_ucsp_set2 "0,0,1"
3 [3 ]9 Q8 h: s: `4 ]/ | q )
" k# I; v4 P, I2 J )
" P; e+ |* W8 H& j) l (T
& ?- v" m3 s! k2 C+ p$ n (setq ai_ucsp_set1 "1,0,0"
0 j7 t5 f. m" F; B2 K ai_ucsp_set2 "0,1,0"4 e* {- L6 B8 `8 ~
)
6 U8 K6 ]9 _6 k0 T! y5 m* u )( A6 r( G0 J! R
)
; s+ c0 W, e5 T/ |0 [! B5 C8 Q* D (command "_.UCS" "_3P" ai_ucsp_set0
' s+ y. o7 g6 L4 `5 e5 p# u (strcat ai_ucsp_a ai_ucsp_set1)
# y/ k% ?# O4 }& V (strcat ai_ucsp_a ai_ucsp_set2)% w e; b* f$ {" H# S' k2 W
)
0 J9 @: c2 w. } \+ [. ` ), q/ i4 [4 v! d' J% Y! I
)
& C2 \% b& O5 p) t2 \ )
5 j# P$ Z7 Q# K7 j- \. ?( Z )
+ v& T; M2 R0 o) a2 |* [9 u)! _5 _9 L1 {& O0 k
& E% t4 l* U$ B8 a
(defun ai_ucsp_p (val currtile)) Z5 D( j4 R" ?# e1 j+ Y' `
(mode_tile ai_ucsp_currtile 4)
1 f+ G; P" z, W4 E (setq ai_ucsp_pick val% v* t- u+ y2 q/ M8 B, v4 S& q9 {
ai_ucsp_sv nil @- {, y" ?. y0 }' ^
ai_ucsp_currtile currtile# W% L" w2 ~ k- k, y2 ]/ g
)
) [6 ~' C; a# ~- a3 a s$ O2 O9 g. T/ p$ h (if (/= val 1)$ `4 X, Z/ s; h. t( F
(setq ai_ucsp_chg T)
: X$ |. o! @' E( k9 X P: Z )! G* M4 c/ c6 ]& u) k8 N, f) Q
(mode_tile ai_ucsp_currtile 4). m3 t0 g0 A0 I) |
)* H3 q5 f" U) Y; X$ K* ?
$ g8 Q! ` o% K% N* A
(defun ai_ucsp_swcs ()
" {- j& C1 d; P* G8 y+ z (mode_tile ai_ucsp_currtile 4)5 v; }0 |, o: P3 Z, `/ @' q0 q
(set_tile "ucsp_a_wcs" "1")3 ~! A- ~8 o! L
(setq ai_ucsp_pick 6
$ G) G1 `8 t3 f ai_ucsp_sv nil
/ U I+ J5 R2 \0 D# H ai_ucsp_currtile "ucsp_world"
$ i* h) T4 ]* p# F$ E' u )
6 ~; ~- \ B7 Y7 o (if (/= 1 (getvar "WORLDUCS"))
2 T1 {8 j$ O2 B4 c3 X (setq ai_ucsp_chg T)
/ ^9 {* r/ B) M (setq ai_ucsp_chg nil)9 V* f% C) l& _
)
: X' i' s1 Q6 r! J (mode_tile ai_ucsp_currtile 4)
3 w! l7 \ s! I$ e2 i& I)
: o( h. e/ ~# I! m
) l+ X J$ \" g# s9 K(defun ai_ucsp_cview ()/ s5 V0 O7 \* |# }, v
(mode_tile ai_ucsp_currtile 4)9 \1 o0 o; g, N: T
(setq ai_ucsp_sv T 3 M5 U- f/ ]3 f4 _
ai_ucsp_chg nil2 h* {! w6 _1 y9 M3 E5 i
ai_ucsp_currtile "ucsp_cview"
. x2 f( O; ?* e8 u" U) D' s W )# d- r( i1 Q/ F7 b# j
(set_tile "ucsp_a_wcs" "1")
: j% K2 C% u7 b6 I" V2 @ (mode_tile ai_ucsp_currtile 4)3 d; a; b) U" I& V
)
- i J9 ^6 z! F* J
V( `2 B$ T( F" F! ?(defun ai_ucsp_rucs (typ)7 x( W) i! R+ _6 |& @/ }
(setq ai_ucsp_a typ)
1 K! a0 \$ J: H3 a$ M (mode_tile ai_ucsp_currtile 2)
3 p; X9 p+ L9 t( b( E0 d6 E)
, F+ f* \4 y, {% F$ P @! [
3 \$ q6 ~. S/ V$ D(defun ai_ucsp_prev ()% q7 V9 Y2 D' B3 j2 U
(mode_tile ai_ucsp_currtile 4)) F1 p8 d- P s) d' y) }
(setq ai_ucsp_prevs T/ e5 t& b: s2 w, I
ai_ucsp_currtile "ucsp_prev"
! N( A8 G0 a# ^; c )
7 k- i+ M) e# @1 P* |; h% w* E4 o (mode_tile ai_ucsp_currtile 4)
# [: c! A' _ \3 [' w)* C% Q$ n' f8 L9 c, u
4 J8 a4 W- B0 W, a
(defun ai_ucsp_main ( / ai_ucsp_pick ai_ucsp_sv globals)$ S t! k( W* Z5 B: f
(if (not (new_dialog "dducsp" dcl_id))
0 J1 ?1 m. R* e (exit)- ^* ?; ` T; r. f' h
)# ^# Z( h3 A! `8 l/ f
6 ^4 ?' T% [; F+ s; w5 C, b9 K# C
(ai_ucsp_start)3 J6 d; `# ^2 q# L
(setq ai_ucsp_a "@" q4 K% }& j. U1 j( O( r* R
ai_ucsp_pick 2% H) V7 P/ f9 V2 Q% r
ai_ucsp_currtile "ucsp_top"
; D7 i1 }% ]! s! R- q3 U8 W* Q) b8 z )) N8 O8 |5 B( ?
(if (= 1 (getvar "WORLDUCS"))
4 K( M, |% d( x& F1 E$ O: |6 C. @ (progn+ q3 u5 [3 j+ o6 D+ c) Z! e/ D
(set_tile "ucsp_a_wcs" "1")
" _9 o+ h/ }' o0 ` (setq ai_ucsp_currtile "ucsp_world")
$ ~0 l0 u9 _0 Z8 U9 L )
' k& x: ^# m" S" A7 \" }) E (set_tile "ucsp_r_ucs" "1")) @5 t' X! B- G$ X5 M
)' M) h9 { |/ ^& M( F
(mode_tile ai_ucsp_currtile 2)
& J+ ^% L8 `( z( Q" S* e9 ? (mode_tile ai_ucsp_currtile 4)
/ R; p0 j6 U1 i) I8 M (action_tile "ucsp_world" "(ai_ucsp_swcs)")
4 q% `7 y0 W) S2 ^, i (action_tile "ucsp_cview" "(ai_ucsp_cview)"): D. K S1 L0 `
(action_tile "ucsp_left" "(ai_ucsp_p 0 $key)")2 \# B6 N9 s; `/ J% V! r
(action_tile "ucsp_top" "(ai_ucsp_p 1 $key)")
+ `; @0 a- W7 X- T. u1 h (action_tile "ucsp_front" "(ai_ucsp_p 2 $key)")* G3 X D; t. y8 x: A: t
(action_tile "ucsp_bottom" "(ai_ucsp_p 3 $key)")" F: q! T5 ]! Y& x5 ]3 U
(action_tile "ucsp_back" "(ai_ucsp_p 4 $key)"); A) F& T7 I# ?; a
(action_tile "ucsp_right" "(ai_ucsp_p 5 $key)")
9 e0 h! ?2 \3 C1 O) S+ R (action_tile "ucsp_prev" "(ai_ucsp_prev)")7 u; w4 k" A3 J* e
(action_tile "ucsp_r_ucs" "(ai_ucsp_rucs \"@\")")" K8 P/ m! Y9 ^8 O- |3 u
(action_tile "ucsp_a_wcs" "(ai_ucsp_rucs \"*\")")0 n' c2 c5 v1 p& K; V( R
(action_tile "accept" "(done_dialog 1)")
- S2 @8 Y2 V8 `9 X+ F (action_tile "cancel" "(done_dialog 0)")" t' e/ O7 k, ~' l
(action_tile "help" "(help \"\" \"DDUCSP\")")6 h1 q) _" d; k$ v" N; n
(if (= (start_dialog) 1)
1 _1 \: p* y F: ]( j (ai_ucsp_set)7 a% `7 ]/ W4 C5 T) ^$ s4 U8 P$ h
)
7 [) L" |, N, I7 T, u)+ m: d" M/ D2 @7 q# U* }
6 j) q% W+ ^1 k5 X
(defun c:UUS ( / app dcl_id old_cmd old_osmode ai_ucsp_prevs
8 Q: F2 G7 r2 [" b ai_ucsp_sw undo_init). }3 O/ H& C( o7 V7 v2 A
' g; r" H# q2 H3 B
;; Set up error function. n6 o2 M2 x1 X; t' g$ s9 t
(setq old_cmd (getvar "CMDECHO") ; save current setting of cmdecho- T2 j& m0 `( T0 Y, q
old_error *error* ; save current error function# j' R8 }( ^9 f; r& D x% R
*error* ai_error ; new error function
4 j8 B' k2 p- j4 U! C old_osmode (getvar "OSMODE") ; disable OSNAP for duration
8 t" v7 Z& P( Y/ J; z4 W/ Z ): A$ X! \6 m! I; b; w5 V
1 k. k3 g9 c9 W. U1 f+ l2 f
(setvar "CMDECHO" 0)
- p k& O0 F; ^/ @- @
8 `0 U- {" k1 x$ T9 P (cond
/ I- n- D8 f! a/ Q( M ( (not (ai_notrans))) ; transparent not OK& @3 s5 }1 S9 N* z3 ?; N) U
( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
% Z: G8 ^, n$ M) Y' ]: H- @ ( (not (setq dcl_id (ai_dcl "dducsp")))) ; is .DCL file loaded?
& ]* A4 w- r2 K/ J (T (ai_undo_push)
3 H! L. D* a3 ~" V( c" | (setvar "OSMODE" 0)/ k# v3 G: a J3 y# I) k
(ai_ucsp_main); J9 Z; e2 n) a4 `
(setvar "OSMODE" old_osmode)* E* x( O1 \# {" y" M6 u+ Q
(ai_undo_pop)1 Q: s: D6 K0 c* k
)
0 P, |- V, F* @3 _) i" Y6 } )# v% P/ b: U5 ^; d( }
9 k. O' }& }( H# F' m: Y
(setq *error* old_error) 1 j2 v1 f! `" W4 @0 ^: E+ {3 l
(setvar "cmdecho" old_cmd)
2 H( j4 [+ [/ L$ V0 g% U+ F2 V
% c1 j5 J' e4 B (princ)2 z4 D& m& U Y% x# d$ Y# S
)
; t' U% H5 ^- a o' L! @
3 ~# q6 D& F Y4 w* C$ r5 h(princ " DDUCSP loaded. ")+ _* h# E" N/ W8 _1 p5 @0 L8 N/ k
(princ)
. H4 O1 H: M8 x8 d; c
6 X. L8 v: c0 [- [0 U;;;???;;;---------------------------------------------------------------------------------------
$ [4 S( @5 ]2 b, h z3 |6 s, U' w% l, o! e6 n
;;;----------------------------------------------------------------------------
: f3 w2 Y3 P( N8 X6 D;;;
r+ \5 M' S* H& y$ K4 p;;; EXCHPROP.LSP
2 ~/ v# y5 ]# [: ];;; Polyline and text modification capabilities added by
% T4 w- n2 I) Y;;; Randy Kintzley
( J9 ]# U4 ]0 P2 I3 w. D;;;
. ~. q! [ @+ A( f8 [% ]/ f! z;;; Copyright (C) 1997 by Autodesk, Inc.
' z9 }6 s; Q: X: C2 h;;;1 v, Q# {2 G2 [: j% x8 F
;;; Permission to use, copy, modify, and distribute this software" X7 U& X# M) V" x
;;; for any purpose and without fee is hereby granted, provided2 `6 L2 d( E' H/ ]- J) m, V2 t% C; O
;;; that the above copyright notice appears in all copies and
. U9 g" K! B& x! j* [, `, N;;; that both that copyright notice and the limited warranty and5 b! Q7 ]! R) c1 ^$ {
;;; restricted rights notice below appear in all supporting3 p2 u/ Z# q* I2 [
;;; documentation.# b+ a$ J; n# V) k0 M
;;;
- R! L/ C- C) Z' m5 d;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.. q6 a, l q0 y, m& H
;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
$ ]% w7 L n; ^) a) `6 s;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
# Q! K+ a1 f) k" u! } t9 R" ]# z;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE8 I) d- E! N2 I! n( U
;;; UNINTERRUPTED OR ERROR FREE., a8 R" W2 i3 p; }
;;;# c# Z5 G) r) E* g% C5 d
;;; Use, duplication, or disclosure by the U.S. Government is subject to
3 a y2 S; r3 a; {) ^( m;;; restrictions set forth in FAR 52.227-19 (Commercial Computer
: j4 T7 k( N( t$ {% m! }6 q;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
9 k! U3 M, N6 S) v; o, l, i. p;;; (Rights in Technical Data and Computer Software), as applicable.
( `9 ]5 C$ ^" z. T. k;;;
: M2 s! Y1 f/ |9 Q& A0 b;;;.
6 r3 ]! U G0 m; N7 g. Y;;; 28 February 19974 F2 {7 G9 O: y% Z) _3 C3 g2 ?1 I
;;;, H# V% [& X5 N+ X' M: O2 S% G
;;;# Y% {% N# F/ c& O% E; N* T. f" {
;;;----------------------------------------------------------------------------
6 e7 w$ b5 W- t! s;;; DESCRIPTION) Q" [+ i4 q) \3 [- z
;;;----------------------------------------------------------------------------" J2 ~% ]9 o( ~* C% Z( W8 U* N
;;; C:EXCHPROP is an extended or enhanced version of ddchprop. This
+ N7 a" w$ J/ l4 ^" X7 };;; command gives the user the abilitie to change several characteristics
- r2 b0 G, ]. Z6 H;;; of selected polyline and text objects. . _; }7 m, }9 h8 U: z
;;; The style and height of selectected text objects can be modified 7 d% W- u( T, ]" n
;;; (including text, mtext and attribute definitions) as well as, width and . J9 L( h- Q7 U2 X
;;; elevation characteristics of selected polylines (includes lightweight and
; D( ?' \' I' B9 c4 X;;; traditional polylines.)2 d' J3 X: F$ _9 A! }
;;;----------------------------------------------------------------------------/ | Q; _- b" c8 R9 @8 H
;;;----------------------------------------------------------------------------* L9 d f, B! L" o: v& Y% K& q; e0 C6 K
;;; Prefixes in command and keyword strings:
9 i7 D" A1 i2 A;;; "." specifies the built-in AutoCAD command in case it has been( G+ j) A& i3 H9 k* n1 ~/ T
;;; redefined.
7 w0 @! G% Z4 ?: s8 P# G$ U;;; "_" denotes an AutoCAD command or keyword in the native language
& ?* M1 l3 a! b# x% F;;; version, English./ _1 d7 _9 p7 p6 ^. P+ m% g# [
;;;----------------------------------------------------------------------------8 c/ g. w+ S" @! S2 S$ g- {3 s
;;;7 D& U: p! B a% w5 g( C; L8 @
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 k& j: ]% a# J0 X8 f+ E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GLOBAL INFO.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
" A' x1 V1 w+ I$ t# J5 J3 w;Functions created as result of loading file: exchprop.lsp$ v: ]# `1 B+ y4 s' Z3 R: _
; DDCHPROP24 ?( V6 u3 d& X9 H! A4 S% A; ?( z1 N
; DDCHPROP2_INIT, W# U! f8 L7 h* c- S7 U, }4 A' c
; DDCHPROP2_SELECT# G" `3 t) b% K3 ^
;
b9 r. V+ R" E* M! {7 G! |3 |;Variables created as result of loading file: exchprop.lsp
8 A" c- Z( A4 p( m1 i; OLD_ALLOC
# g+ ^$ E- I) g) Y2 z4 j' P;
H. o$ g, X6 D. };Functions created as a result of executing the commands in: exchprop.lsp1 `" X0 Q- I; }/ M7 b
;9 F' `# N0 ~' {- c/ F' Y
;Variables created as a result of executing the commands in: exchprop.lsp
/ z2 S6 Y% u$ F) ^; AI_SELTYPE/ \( E" H2 t% X, x$ J* F
; BONUS_ALIVE) q# D; H0 e8 P% F- T9 \) J" o
; BONUS_OLD_ERROR/ y- d4 d9 }0 r2 [0 q& n( D/ G
;;;;;;;;;;;;;;;;;;;;;;;;;;;;GLOBAL INFO.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7 j* \6 d/ v [/ M* u% \' D
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
: `3 P" Q; q3 [ e0 |; d' }! c# O
. i, B' ?; _# J/ Y5 z/ @5 H;;;3 y k0 ?, j5 u% E S5 Y! ~. D/ r" r
;;; Avoid (gc)s on load to improve load time.* o. v B- W; {! q% F& e% A
;;;# K( a% v& c, k+ ?% N, R: h
(defun do_alloc (/ old_allod new_alloc)
9 u4 b) w* f; i7 w (setq old_alloc (alloc 2000) new_alloc (alloc 2000))% Z( L. r8 i h$ U* D: t/ l
(expand (1+ (/ 4750 new_alloc)))* N. L; N9 l. K
(alloc old_alloc)
7 X5 y; v7 j0 b! A);defun/ u1 E5 a1 }. J* E2 w( b; T
1 ^( `: h) O: Y& S9 a# `2 z
;runs at load time - rk$ M O& d) o# o2 p+ P3 A+ M8 y6 B
(do_alloc)/ B$ q: R; ~$ h5 V" O" S& K
(setq do_alloc nil)1 p0 s( F0 t$ y" _ a
;;;" l# k) D( a) H3 K# V/ z: ^
;;; ===========================================================================
, E: E: i! O$ [& H/ m;;; ===================== load-time error checking ============================
# Y+ H8 y2 h2 n# |;;;2 n. J* Z6 ~+ h5 |5 c2 \& [
8 w3 I% p R) Q& [5 c (defun ai_abort (app msg) ) Q6 x3 |/ D5 \
(defun *error* (s)
: T5 V& I6 F2 f# e# o1 ^ (if old_error (setq *error* old_error))" Q7 @( v4 ~9 u- U$ o4 H! h( A. ]
(princ)$ O& Y& f! B2 B" r$ ]/ m. J
);defun
?* F0 N1 N" L9 R (if msg
( n, }: y3 ^2 V (alert (strcat " Application error: "* E5 b/ @- P, m1 C# }
app' N+ \: n$ S: g$ i. P) K) k- j, H: W
" \n\n "
^1 {7 o6 v0 E. T* C# K+ h msg; z) ~& g9 N& I
" \n". g0 h9 B" T+ c3 F9 l
)
& r* z% o# a; `$ a P+ ?3 y3 p Z7 M );alert
9 H% K4 h4 W, A: t0 a );if" R8 ~0 r* ~* y7 y; `
;(*error* msg)
: [3 a0 S0 A( Q6 h6 }+ Q+ Z, d (exit)
+ O9 q. z0 \/ |2 _+ E; u );defun ai_abort A+ U, T6 O9 m9 Q2 `8 T
5 B; N5 y# w# a' `4 e9 t' ^;runs at load time - rk
9 F/ O ?2 o# x* Y7 i$ W0 @;(if (and *error* ;added the if wrapper around this - rk.% S' y# ^2 T! R/ D' O7 U
; (not old_error) " x b# y5 K5 Z
; );and
2 C$ |. m/ y# b& n; (setq old_error *error*);setq3 A; o0 p* ], Z+ q4 l
;);if: l1 _. F) M- u
0 c7 `( \+ G6 h% g% l$ d% e/ y3 l, |/ a2 n* f9 Y
;;; Check to see if AI_UTILS is loaded, If not, try to find it,
8 q% ]+ l5 J4 S; C! P;;; and then try to load it.
! T4 u& ?$ j$ z;;;, v7 N/ L2 u! [- K8 ?- J8 n( O- f
;;; If it can't be found or it can't be loaded, then abort the- e7 [- p( v+ r" V2 D7 N. B
;;; loading of this file immediately, preserving the (autoload)1 Y$ ^; K# [6 P9 |( [5 o/ v- d/ {
;;; stub function.9 h+ H9 p: u- `
' G; Y r. v: _; Z;runs at load time - rk.
! ]2 I u9 C+ [) O/ J9 V( a B(cond
. V* T' d/ o: {* d ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.6 J: m- k/ V+ e' v9 h
( (not (findfile "ai_utils.lsp")) ; find it1 _- ?/ T* U, S$ K* Y% b' B0 w" I
(ai_abort "EXCHPROP"6 Z7 L( k- Z% K9 q: m) i
(strcat "Can't locate file AI_UTILS.LSP."
3 D: [( m! m: Q! } "\n Check support directory.")3 p% @4 w' [% W" K5 `+ F
);ai_abort
4 b" Q! B, D( [) n9 X8 p9 n. C )- p, N4 g# T3 k) I# @! H9 B1 \
( (eq "failed" (load "ai_utils" "failed")) ; load it
/ P* q9 m5 [1 q6 F4 H (ai_abort "EXCHPROP" "Can't load file AI_UTILS.LSP")
& E$ ?/ y/ F" T- U )
( i) h. ^2 B/ s1 A. H& S4 e& o+ k1 V);cond close
+ c6 r6 W, a. Q! @8 _0 b/ V. G5 R: x0 e0 C( S% v
(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP. |4 T# L1 {2 e* {
(ai_abort "EXCHPROP" nil) ; a Nil <msg> supresses
5 C! z7 S0 N2 M/ T8 F# _);if ; ai_abort's alert box dialog., G* q |: V2 d. v
, \' `+ {+ T3 U+ t i7 Q1 w;;; ==================== end load-time operations ===========================
2 w$ U% J% T- t$ A3 Q! p1 t0 g- B# h
( Z/ C5 ~; Q- p2 x;;; Initialize program subroutines and variables.
" }% _. E6 I$ X, v9 m7 A l+ P' @9 x, w1 f N0 {
(defun ddchprop2_init()
; J$ `- h+ U- y6 p1 Q3 ^9 i3 p& ?* c8 ~2 U j
4 e" Y- k$ N/ J& ~% X$ o2 m
( T1 Q3 C7 ?: L7 f/ y1 n& t3 B ;;
$ O3 B1 |! T3 l4 x+ K ;; Define buttons and set values in CHPROP dialogue box
* e; r. k2 E, Z0 G2 X: N ;;
# a9 ~: b8 {) T. |; {7 J (defun call_chp2 (/ cmdact p1 p2)! t: v. `5 a5 i
/ U/ k$ X0 K' P9 ~2 } (if (not (new_dialog "ch_prop" dcl_id))
# h& J" g) ]& Z$ p( _- E (exit)0 ]! ~0 L$ V7 s& U3 c% i
)
1 }9 N# ~0 o" n* ~3 `
/ r2 ~" Z8 v1 { (set_tile "error" "")
R7 u2 `0 f- ]& E) r) k- O3 |, T ;; Set initial dialogue tile values7 @6 b) M! R5 E8 x: P
(set_col_tile)9 p( L8 r6 z# P3 b2 z
(set_tile "t_layer" elayer)+ \& ^$ f6 C! A2 ?
( R$ [+ s4 V3 S. N# s* Y0 L: P
(cond/ n7 j8 h3 u$ Q! f& K W* @( b
((= lt-idx nil)
* g* N5 M, F. f$ {( P* v (set_tile "t_ltype" "Varies")
- l h7 I/ R3 c& u4 Q5 b )- Q: q: i1 v' ~& X) P0 N# k
((= lt-idx 0) ; set tile "By layer & layer linetype"0 s0 J/ p9 m/ O3 x* ^( B/ m% m* {
(set_tile "t_ltype" (bylayer_lt))
4 f# Y/ _) u& x0 w9 T# P ) Q) @0 D4 b( W+ D. e
(T! Z/ J+ e; O5 e
(set_tile "t_ltype" (nth lt-idx ltnmlst))
- t) r! c6 h6 b# J9 N! ^ y( x )0 I$ @0 o! ?: t3 K
)
9 u3 N7 p h, O, F0 P. {) l! u9 t7 z1 [0 B8 v
(if (or (= ethickness nil)* }. u9 ^, c Q* G0 T8 r6 R
(= ethickness "") U+ v+ e: V6 G
(= ethickness "Varies")
+ X/ R' f) m- \& q$ d1 A& d );or
0 P/ b6 A8 f% [ (set_tile "eb_thickness" "")5 L r: _ I( {1 L( o4 t
(set_tile "eb_thickness" (ai_rtos ethickness))
* z1 p4 w: U" p# ]6 T% J );if
& f0 ^6 E/ L0 s7 q/ a5 h$ D (if (or (= eltscale nil)
9 W. U) w& w4 J (= eltscale "")
4 K6 C3 V' \) s: o2 N5 x (= eltscale "Varies")! B" w# _. L7 n
0 W% A$ c# V9 p _( k( Y% w4 A8 v- g6 k )- t% h7 d1 p u8 r
(set_tile "eb_ltscale" "")8 M3 |. K8 K4 m! p
(set_tile "eb_ltscale" (ai_rtos eltscale))4 `" P6 R# Q ^6 l+ f3 S
)1 O# z: O {& ]5 `, p
(if2 G3 _: s& U O0 m$ v1 L1 {7 D
(numberp ewidth)6 Y9 F+ v0 ~1 {9 |" S( q( H: k
(set_tile "poly_wid" (ai_rtos ewidth))
- B! T7 D) b! t) y( o' V (set_tile "poly_wid" ewidth)
/ k7 y8 R+ G6 R) L, V4 S )
( Y7 a# e7 ^5 p5 b, j }* j6 l (if9 C0 l! U$ F( E# x) }( X0 x# j
(numberp eelevation)
- s4 ?$ U4 F1 [/ n (set_tile "poly_elev" (ai_rtos eelevation))
! |* [; {3 R1 g% X! A/ D (set_tile "poly_elev" eelevation)! R3 T7 l2 R) E9 D8 s
)
4 b* x. O$ ~5 d$ W ~, u (if0 |: k& y& x8 a$ Q1 d: D8 P
(numberp eheight)6 M; _2 Z/ J6 r4 D
(set_tile "text_hgt" (ai_rtos eheight))
3 `3 A1 g5 f7 w (set_tile "text_hgt" eheight)
/ U: j- R! x" Z9 T% {" C )# V5 _8 {$ r0 o& C+ A* T
(if (not estyle). B( c, l) x( E0 w+ `. d
(setq estyle "")5 W' Y* K, V2 {6 g, |/ ^
);if # E- r) G9 q5 N! V& u) D8 a* @ B
(setq hair_style_list (tnlist '("style" 16)));setq
; k9 x8 D6 X; c (if (not (member estyle hair_style_list))( R4 j( H" u/ A" w( F' S k
(setq hair_style_list (append hair_style_list (list estyle)));setq: [ d1 p% W5 d
);if
5 K/ t5 [4 u* e* ?+ T7 e. N% n$ u: z. Z1 \
(setq hair_style_list (acad_strlsort hair_style_list));setq
* L# `. Z! i1 w# N7 I% ? (mpoplst "text_style" hair_style_list)
/ |+ y/ q4 J2 g) Z2 K# H (set_tile "text_style" ! F7 ~, x7 C: ?1 S' Y
(itoa (position estyle hair_style_list))
7 n$ M9 [, c) y1 M3 h" o( c# g/ Z );set_tile
6 j" j. I% L4 ~- [: c; Z& S& V0 T
;; Disable tiles if need be... ;@RK
9 K8 y; @8 }+ `& t (setq a 0). \) U8 {2 B+ e S
(while ( < a (sslength ss))
' W6 V5 }9 A3 F0 Y% {$ _1 s (setq which_tiles
8 o, [+ q0 @) c5 N; ?" G3 N (ai_common_state (cdr (assoc '0 (entget (ssname ss a))))))
% d+ I/ H3 s% R/ u _& u: k9 o2 B
0 J) ~6 ~4 B9 K; I1 [: B1 e ;; If all fields are enabled, don't bother checking anymore.
! F) r, I3 `! [+ ` (if (/= which_tiles (logior 1 2 4 8 16))
7 r9 a' q, P1 w' G' \* h! ~7 e6 L (setq a (1+ a))' W* j/ U1 ]" z8 b1 f
(setq a (sslength ss))
+ A5 l4 E- v8 J& Z0 { )# H6 f+ b, `# Q2 M F. ] _
)6 I }; p' M9 D: I! E- F; j
;; Layer Button and Text Field! s6 {9 w' h* b
- N' a1 m! j$ K1 F- E# c (if (/= 1 (logand 1 which_tiles))
. B" e: T& R* O1 ^ (progn
, |5 n4 R7 \4 k, W a$ W (mode_tile "t_layer" 1)! ~! D. r* T/ R& M3 N% q- f
(mode_tile "b_name" 1): z' P3 X' F" T2 {
)
8 i( v% ~, H8 G/ [. [0 V )
5 N3 Y& ^% V- O3 ^1 W6 B }3 R! i2 E- g$ \8 T
;; Color Button and Text Field
. m9 v1 L. V) W# b/ p' S' e (if (/= 2 (logand 2 which_tiles))
6 R7 H6 j( E0 I1 S. M' F( @ (progn! D8 X# p1 N. A
(mode_tile "t_color" 1)
; @9 a* k- t$ | (mode_tile "b_color" 1)
5 [/ H; G: T3 T (mode_tile "show_image" 1)% \0 _7 L- E5 o( A2 X
)
6 o: T' e8 Z' J0 u% u# v' H% q$ |; m )) K4 p( F5 N/ g. m
;; Linetype Button and Text Field
* ?# x7 c) i5 m4 W1 L4 E2 h (if (/= 4 (logand 4 which_tiles))# V0 I! N5 q4 g. `
(progn
+ Z9 m# f/ \/ A+ X9 q! i" E* J; ^- v (mode_tile "t_ltype" 1)4 q5 E' @' f$ L$ L
(mode_tile "b_line" 1)8 e8 t! { ?5 C t7 D/ j) W- d
)0 T: b) N+ j7 y9 N. u2 w0 j1 _
). J" x" t6 r/ X/ S: ~/ \/ _
;; Linetype Scale Edit Field& {. ]8 {6 a" ?. @8 m/ c2 J) j
(if (/= 8 (logand 8 which_tiles))' P4 x) J( v! U. @2 o* h# b
(progn/ ~0 d; P: D& J0 p: }) m
(mode_tile "eb_ltscale" 1)
4 G8 p2 |6 O- c )- P1 |' m5 d" \0 b1 F. [- f3 \# ^0 o# [
)
' a; D9 F! e! j' N' x ;; Thickness Edit Field.
: t2 `% i7 q0 X6 _# `8 g5 B+ P (if (/= 16 (logand 16 which_tiles))0 V6 t, r- r! Y) R2 N6 o9 i- v E
(progn, Q( E) E3 g; ?
(mode_tile "eb_thickness" 1)
& i1 W) L7 f, Q$ `$ f )! o4 K* y8 Y2 j
)7 Z4 V) y, a* K @) d% O: f2 A( K8 v
{" `4 n" H& O; T7 F! W2 I: |$ k ;; Polyline box and tiles @rk 10:05 AM 1/30/97
, S; s5 D' r- o. V (if (not (= 2 (logand 2 eflag)))( `& l. T, |, u5 a1 V( b
(progn
; f8 o+ y: c% M2 h& [- |7 [* Z (mode_tile "text_hgt" 1)
4 Q6 J$ ], h- G7 h2 [/ j$ U+ F6 P (mode_tile "text_style" 1)8 J. h9 f2 n- v( R3 O; w/ i
);progn5 F; J X9 ?1 F3 W( }
);if& x3 V8 V2 r9 `7 Q7 C+ q
(if (not (= 1 (logand 1 eflag)))
- u' b0 Z) l% U5 `, b3 [( J4 B6 Z (progn ; s: }3 g% }% w; A) x
(mode_tile "poly_wid" 1)
; M4 J0 l9 L7 s. C (mode_tile "poly_elev" 1)
9 D% q1 t+ J7 b( { );progn then disable polyline fields; N4 K' [7 A8 @- a. C6 E( I
);if: N2 U6 {/ e1 Q! z( |
8 @2 A& a* G% B. K. p
;; Define action for tiles
! K8 s! t% z+ F5 H- N \ (action_tile "b_color" "(setq ecolor (getcolor))")
7 D" D8 N) V# c5 J (action_tile "show_image" "(setq ecolor (getcolor))")# |, W3 i" ]' \
(action_tile "b_name" "(setq elayer (getlayer))")$ s( f5 F1 L; G7 W
(action_tile "b_line" "(setq eltype (getltype))")4 U/ q/ D! w8 s+ R; l9 S' y5 x$ W" [; d
(action_tile "eb_ltscale" "(getscale $value)")9 u) y( n# p1 c$ P6 M/ {' d" f6 n
(action_tile "eb_thickness" "(getthickness $value)")
& [" M% g1 b/ | (action_tile "poly_wid" "(getwidth $value)"). z7 X) {$ _/ T" A
(action_tile "poly_elev" "(getelevation $value)")
0 P/ b$ R( u% ~( K% P& A/ Q (action_tile "text_hgt" "(getheight $value)")
, r7 _" _9 Z3 d (action_tile "text_style" "(getstyle $value hair_style_list)")
9 `/ H8 u, Z) c/ b; J (action_tile "help" "(help \"AC_BONUS.HLP\" \"EXCHPROP\")")
+ ?) S) c1 C+ L& [, P8 W+ L1 e$ P (action_tile "accept" "(test-main-ok)")
# V0 J' f' g3 a" v, k$ N. R- I: U7 R8 B. d; U$ |4 Q
(if (= (start_dialog) 1)
$ u1 d" F. ]% M% z0 P7 e h (progn3 z0 @7 e. n3 k8 \# @; ?
; Update special properties for polyline and text selection-sets.' [5 Z9 `8 x5 L% M+ X( C
9 e" @( Y- ~# n4 e% @) c% U0 t
(if (and (= 1 (logand 1 eflag)) ; polylines rk chprop* F2 O9 ^( f8 p' U
(or ewidth
" X7 [5 ~9 a% v% u2 @5 G1 Y5 e eelevation
3 g3 p* S/ v; Y$ f1 c9 ?: C );or
: r- o" B9 A! ]3 b );and
( d* Y! R) ?0 d- T' }7 l! g* i (progn! Y1 R) E! h0 d
(setq ss-index 0
* ?' ^ N( \7 V$ c3 V, S# A ss-length (sslength poly_ss)
& b. j5 A8 P0 L, m );setq
8 t I9 f: q/ F E: f (while (< ss-index ss-length)- t0 B( A( Y! k. s5 W0 G- q
(setq ename (ssname poly_ss ss-index)
+ a5 ^7 z' Z" m! {! P elist (entget ename)0 ^% c* e& z- w2 ~( U) n
);setq
; ^! n$ o3 I! N8 D( T (ucs_2_ent (cdr (assoc 210 elist)));this function lives in ac_bonus.lsp# G; {* n! h% n. M# T
(if ewidth
# C; Q9 B g O. r* O2 I (command "_.pedit" ename "_W" ewidth "_x")' v( u8 g/ U5 D! r' c
);if ; D/ b8 L" r9 X; u4 H- f
(if eelevation
1 d& _$ j. ~. w5 Y9 A (progn
$ Z: B/ M% H) s4 ~ n1 l (setq p2 (list 0.0 0.0 eelevation));setq5 r* I9 g5 x7 ?7 o
(if (equal (cdr (assoc 0 elist)) "POLYLINE")$ Z8 I4 W' M) ^* l
(setq p1 (list 0.0 0.0
. g' q5 f' a: r1 A1 I2 q (caddr (cdr (assoc 10 elist)))" x. ~' \, h2 H7 c' O# I
);list
7 G9 h5 ^6 k: V/ | );setq# u1 e8 H$ d$ m: m( V
(progn' B. _; Z& V" s x
(if (assoc 38 elist)
" c' z, \% o$ D0 h( N (setq p1 (list 0.0 0.08 l+ v; W$ y* P$ O. f: v5 ~$ l
(cdr (assoc 38 elist))
' U8 C7 P% L" o, H );list$ |3 K. e' N0 ]; a* H* t1 ?8 H
);setq
' \2 u$ i+ n9 w ] (setq p1 '(0.0 0.0 0.0))" g8 b% q% A* L
);if0 Q$ s, M& V; {/ f
);progn
, ~" X# N' x. n. d9 |" z: Y );if: P4 y! [3 T5 ~' \6 k! J8 @! v
(command "_.move" ename "" p1 p2)
: X1 D. \/ I, I/ T; T );progn then change the elevation of the polyline% G6 U1 C; l% k; P3 p% q
);if
7 d5 }; ~3 Z1 _+ r9 A; N (command "_.ucs" "_p")
. q( |5 i" k& W. e7 {# m (setq ss-index (1+ ss-index))& F, w) I. S) P0 |' q4 S' c
);while
+ o& {7 T K8 E* Y7 G2 s );progn then polylines are in the selset7 @$ N7 B& R2 F; O
);if, z, @- W% e/ C/ ^$ v1 W# i
(if (and (= 2 (logand 2 eflag)) ; text: `# Y3 O) D! N: X/ _/ V0 s1 c: ^
(or eheight
3 m0 Z; O v8 @% v estyle
* j" f* I- ?# x4 n, W0 i3 a );or
' ^+ m: ~1 S9 Q( [, d5 Z. t+ _ );and
. p; i u; _6 f4 f6 R (progn
( j! f5 [+ v. b2 w4 C- a9 U% p (setq ss-index 0 ss-length (sslength txt_ss))
! j% q3 m+ R/ G- d2 k/ T D (while3 x2 R2 p: M1 I! C& P
(< ss-index ss-length)
4 z$ b6 E5 I8 ?$ Y/ I6 J, C$ f (setq elist (entget (setq ename (ssname txt_ss ss-index))))% L0 J8 m* _0 ]' S. M
(if (numberp eheight)1 N* T# U6 K2 R% ?
(setq elist (subst (cons 40 eheight): P' U2 b# C$ [/ Y$ v% d0 m P* p
(assoc 40 elist)( S4 |4 P7 u( B6 U/ p0 l S& x' j+ v! u
elist
- U% j6 _# X0 _& }4 W/ ?9 v );subst. U' \% ~! l5 R- k9 j
);setq
8 t& f$ L# s1 l; x5 ]1 Y );if
6 A* Y+ C+ F- F. K$ M (if (and estyle ;(not (equal estyle ""))& |! r% q% l9 d3 B# ^
(not (equal estyle (cdr (assoc 7 elist))))
- i7 l1 k m; D# E, k) ? );and+ _/ z! x5 j7 _" M$ Y
(progn
% d9 e @! k3 X5 R( e" e- t# c ;rk. This needs to be implemented as per mtext font issue in ; ddchprop_notes.txt
0 M }# t+ `. ~ ;(if (equal "MTEXT" (cdr (assoc 0 elist)))! @* S1 X/ C9 B" d4 g+ K7 E8 j+ |3 X
; (setq elist (fix_mtext_fonts estyle ) @1 V* D- M4 u9 k7 T: \+ w
; elist( [* e0 A$ p& O& V: s7 N
; )
& L7 l2 j& \6 \2 W6 ?& j ; );setq then
) p. o% _! U4 L0 ~5 A (setq elist (subst (cons 7 estyle)5 y. V: W" q0 i! w) A4 l1 m
(assoc 7 elist)$ U* `0 g4 ]2 g
elist
3 O+ b3 @3 I$ m );subst
& y. `( h: E0 K, b0 j5 N+ S; f );setq else7 ?. g$ j9 G- _* i: n, ~6 ]
;);if
# |: @* s% ] T* ^ );progn
" M( l2 A# y' X) }" D0 g );if
( Y) V, Z1 Q4 Z8 N% T- Y8 L (entmod elist)+ J" [1 [: L# n. L
(setq ss-index (1+ ss-index))
! l, o1 [8 V" _. P% [ );while" a* E5 J, ~& u' I9 P8 @
);progn then3 y7 X" e; ~3 l3 u! O/ R1 Z+ b/ A
);if
" s3 a! _: ]" x8 |- Y& W
" W/ W) R; [+ t( k3 a (setq cmdact (getvar "cmdactive"))8 E) Z+ i- K& t
(command "_.chprop" ss "")
, b$ Y, R! `6 x" @( X5 _! r3 o# ~ (if (/= cmdact (getvar "cmdactive")) ; Is CHPROP actually running?
7 z9 j9 S# O) F* ^9 F& d: ~$ \ (progn8 j: D1 _9 y$ A; z: s% h$ e
(if ecolor; b. p, Z; z7 j3 G+ D+ J
(progn$ i* Q. ~+ Y- J4 [ @: I
(if (= 0 ecolor) (setq ecolor ;|MSG0|;"BYBLOCK"))3 E$ ^3 A- v5 _# X! _6 `
(if (= 256 ecolor) (setq ecolor ;|MSG0|;"BYLAYER")), s! E8 ~ C0 D: c* D& g
(command "_c" ecolor)
7 n' V9 g ~" o7 W! v' G );progn then% V6 o. ?4 W. J5 p* [( F
): G# m" g5 H2 V, ?0 ]0 G
(if (and lt-idx& o) |! `+ E: {0 x: l
(/= eltype ;|MSG0|;"Varies")' X3 C1 r; z8 n6 a
)$ }+ b& S$ r+ g$ R2 e3 r5 @/ d& R
(command "_lt" eltype)8 P; D. E, i& H: ?9 }, m
)+ ~/ F5 ^* }+ D
(if (and lay-idx
6 T; _0 F& s0 n/ m/ Y5 e9 N# \ (/= elayer ;|MSG0|;"Varies"); x8 E: R. ~* h( Q5 h
)
% b0 C6 J4 `0 y5 h (command "_la" elayer)6 Q5 \& ?2 w8 N' N! b
)
3 ]: r; w) Q* M (if (and ethickness
$ n C8 X% j% @ (/= ethickness "")
* p$ n0 X, l l( t7 k) z6 d. u (/= ethickness "Varies") ( g8 u+ R; X* ^5 h, ]7 t9 w
)
8 Y9 ?/ y" d2 i+ A! v (command "_t" ethickness)
3 _7 P" P8 ~0 z# [ )
* N! Q- }8 v! Q* ]$ d (if (and eltscale (/= eltscale ""))
. F! V- l/ v+ k# v (command "_lts" eltscale)
& n, j% m% I% @( @0 x6 | );if# N( X3 I( u# M. u
(command "")" w0 [$ t6 o9 q- O. L. V ~% r# K! r! \
)8 ^( g+ K' D5 w* A
(princ "\nProperties unchanged") ; CHPROP didn't like our SS set
) L) { j* R3 L$ { )/ K: a4 k4 ?# r/ \; F4 e9 v
4 m: y, c h, |0 y+ a, S );progn then OK was picked in the dialog.* X% @7 T U$ N. {
7 h( i/ h& D' K/ P# @/ V ;; Fred GERBER - 25-AUG-940 ^. F+ ~/ h5 b8 ^* A/ B- B' H
;; Don't print the "Properties unchanged" message when the user cancels$ K- O3 z) w* v' }+ q# v. q1 m
;; the dialog because he knows that already (otherwise he would have
0 R2 f4 Q5 a2 g. @+ g ;; hit the "OK" button). Display the message only if CHPROP fails for* J: W1 E7 s: Y( t' R2 W7 l
;; some reason, because it is not the expected behavior of the command.
8 Z* D- p$ C) l ]( P ;;% J1 Y( v! F$ Z; G1 ^0 z
;; (princ ;|DDCHPROP2_LSP_8|;"\nProperties unchanged")% a9 E; M. J+ P
);if4 G: G0 F6 W: h/ n: }) m
(princ)
0 W1 @, e" z& N2 s, \8 B );defun call_chp2
" X) M5 o9 B* w% J) s m3 C! A ;;3 M$ V' K1 b4 h3 B1 m* L. ^; x( p
;; Function to set the Color text tile and swab to the current color value.1 M+ t* q3 V1 o% L
;;
& c, q$ i* G9 r: _8 G. N7 ? (defun set_col_tile()
2 v9 L* ]3 d- x+ S: j (cond6 k- M2 k/ o7 Y5 L
((= ecolor nil)& u( P6 @6 O1 O+ t [3 n4 R
(set_tile "t_color" "Varies")
1 E0 n- r3 {1 |9 T (col_tile "show_image" 0 nil)! Q5 T' d5 ~- ?# ]! w. e
)
! q2 E7 v8 m9 B8 t; u ((= ecolor 0)
2 Q' l( d, P( r c+ |% N (set_tile "t_color" "BYBLOCK")
) O2 s0 c) a7 W, @: ]: i2 u (col_tile "show_image" 7 nil) ; show BYBLOCK as white
( h( E+ _; O3 u/ q* |7 c n2 I )
- ^+ H+ q: q' t9 `6 h! @3 K ((= ecolor 1)4 Q1 A3 |( ]: w
(set_tile "t_color" "1 red")
, J5 |. C0 ]7 n! v4 {6 I+ N& H( M (col_tile "show_image" 1 nil)
# [8 K$ Y) s: b) i" M, s* n )2 ~2 |6 w( L% X/ K: d* R- Z+ f
((= ecolor 2)
8 J. _+ j4 r' o (set_tile "t_color" "2 yellow")
# M1 M' t: R/ y (col_tile "show_image" 2 nil)# {" e" r Q5 R C" I
). s g. H2 |3 U3 U0 w
((= ecolor 3)* Z& Y/ v" X& W1 z' ^
(set_tile "t_color" "3 green")
3 K% G1 E: C; u) }% I9 _ (col_tile "show_image" 3 nil)6 m0 l4 @ X& N5 Q+ f$ g1 X4 e
)
3 B( K/ R* ]: _( p. x* P. d ((= ecolor 4)2 M* o7 m* ?( j: `/ O: R+ R
(set_tile "t_color" "4 cyan")
- B1 u ^% [( p8 f0 P' f% W (col_tile "show_image" 4 nil)
c$ |3 g: F) C U& W" K )
P4 S1 b9 b" m& i! P5 k2 z7 H% f- n ((= ecolor 5)
) K2 q9 _- B U4 P! s5 e (set_tile "t_color" "5 blue")
# ]- W! f" T$ _0 I8 l$ D (col_tile "show_image" 5 nil)
4 ^1 W, T* k/ b1 |" u4 D ); R" M0 F4 W2 e0 m/ C4 n
((= ecolor 6)0 i% n5 H. o. U8 [! ~& h! z
(set_tile "t_color" "6 magenta")
4 E0 g* {$ W, Q( s (col_tile "show_image" 6 nil)
/ C& {; r$ g+ o) q5 l" \, z1 E )
( G" J* J9 i+ O0 [3 x ((= ecolor 7)
5 e e% i) d. p8 V$ e& ?8 f& v2 w, T (set_tile "t_color" "7 white")
Z7 F; ] v: Y, Y. b (col_tile "show_image" 7 nil)
) E a" t, @' F. G) G) I )
. w3 Z0 w7 ~; J. l. {0 u ;; If the color is "BYLAYER", then set the tile to
. A: N- C9 t' V9 V. I2 z+ x. a ;; show it's set By layer, but also indicate the3 ^! J7 n' h; z: v& A# o- N, T7 z2 l
;; color of the layer - i.e. By layer (red)8 s6 S5 O {2 D" a3 S" E% F
((= ecolor 256)# K# I( ]) ]; j4 J' ]7 u& m
(set_tile "t_color" (bylayer_col))
: B/ I" S) u( {! `& G0 r; n. z (col_tile "show_image" cn nil)
: i! L* B2 {9 k) [0 w )
" q$ d1 v: p% L {9 P/ \' n (T: o: |5 c l0 E3 |+ y9 Q
(set_tile "t_color" (itoa ecolor)): V2 G1 J# _( b* Q% Y4 V8 }+ }5 E
(col_tile "show_image" ecolor nil)
( g6 d8 W0 \0 `3 k; @! j. |6 Y )' c6 U* ~3 W1 q2 ^# m
)$ U$ J/ A; l4 H& T
)
) A4 T% E# t& E& |- k# Y( V ;;
- K& Y0 M* i+ q- i# [ ;; Function to put up the standard color dialogue.' m2 U7 C4 Z& U$ e1 L+ T. H. @
;;
( [7 S" b$ x7 n; l (defun getcolor(/ col_def lay_clr temp_color): h4 H! r: l2 ]( G7 E
;; col_def is the default color used when rq_color is called. If ecolor
( B# h- q4 U) K' i) p. S ;; is nil (varies) then set it to 1, else use the value of ecolor.
' d& A% ~# w6 V s; U (if ecolor
8 C& v a( H& c9 E/ b (setq col_def ecolor)/ o/ L, _3 `2 V
(setq col_def 1)
$ P' S P( E) p )
2 R$ v; U& Z$ M; N/ V3 k, U* z
3 `4 z0 U; w4 J' B4 B ;; If we're working with a single layer, get its color
5 S. ^' Y. b9 n6 U# L) q: R: j9 \ ;; for use in the color swatch if the user selects color BYLAYER.
, t, i- n' N5 n1 _/ v (if (/= elayer ;|MSG0|;"Varies")$ T* H# E2 d7 @9 Q4 ~' o0 x
(setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))' Y9 h! R# \8 |0 K% d
(setq lay_clr 0)/ V6 U4 q; j8 I. |2 [& Q* p( g
)! _8 g, ]: m3 Q* V# Q
(if (numberp (setq temp_color (acad_colordlg col_def T lay_clr)))# Y% `1 a3 b3 ~" C! L
(progn
- z) u/ ^+ E) T0 P2 G: h* [ (setq ecolor temp_color)- R- z( ]( I" ^0 [
(set_col_tile)
2 i# b' I8 D6 C6 { ecolor9 M# v5 C* q' E. ?, i# u
)
4 \% U) r' W& s ecolor! O' O# U- @" u: G
)
. i; I5 b4 F0 a5 W; @2 l )
5 d. R5 E8 P) W; X6 W) a ;;
* s. s- d' b+ h) ~: |7 ~) [ ;; This function pops a dialogue box consisting of a list box, image tile,; |7 e3 A9 ^6 S# L& \
;; and edit box to allow the user to select or type a linetype. It returns
; k- ]5 N/ j) H, A7 j* M9 z0 S ;; the linetype selected.6 Q8 e5 C# Y- Z
;;
9 n" A/ r2 }' P' B (defun getltype (/ old-idx ltname)7 B+ d6 L2 u8 _, x% V/ Y
;; Initialize a dialogue from dialogue file5 D" b0 z* V& H5 b& d- f9 {0 {7 D
(if (not (new_dialog "setltype" dcl_id)) (exit)) t! V( R8 o/ B& n z1 ^
(start_list "list_lt")
( b/ g" x- X1 i" h) z (mapcar 'add_list ltnmlst) ; initialize list box+ _; [* J% I% q' `! x) h @( V
(end_list)
' _0 ~% n3 U8 r2 c (setq old-idx lt-idx)% z, y0 P' R z
;; Show initial ltype in image tile, list box, and edit box A- b! v1 k; E; P0 k
(if (/= lt-idx nil)
# I# i. z) W1 ~, o9 l9 t' I (ltlist_act (itoa lt-idx))% a6 d) ^+ t7 E7 b3 g7 x% }# M
(progn
- G( z8 W m. P% l (set_tile "edit_lt" "")
+ |5 l5 ]9 O* R; j& A# w (col_tile "show_image" 0 nil)
* O5 M7 W' V( n+ _+ I( w8 K4 J } );progn else
+ E9 x) B" k4 E0 ?$ w );if1 w; c1 X* w. A+ m& n; _" v
(action_tile "list_lt" "(ltlist_act $value)")
8 \& U4 U- Y5 |( c7 R% x (action_tile "edit_lt" "(ltedit_act)")
) K! s! E+ z1 T$ F" C! D (action_tile "accept" "(test-ok)")3 D) j$ q2 X1 c) Z4 O, ~ e
(action_tile "cancel" "(reset-lt)")2 j; l5 F; s) V2 b
(if (= (start_dialog) 1) ; User pressed OK, m7 l' s# S: ^4 L
(cond9 Q# T" L9 S a0 C% z# z
((or (= lt-idx nil)7 d- c# N. c+ B r$ i
(= lt-idx (1- (length ltnmlst)))) A3 {* `6 X4 s
);or% b/ W% {7 w. U' Q& Y9 E: C
(set_tile "t_ltype" "Varies")
; k) J& x$ Z* T) S* i ;|MSG0|;"Varies"1 Z4 o; m$ j k0 Z5 x+ ]% |
)( a. f$ }0 V* h- V4 L- r: p
((= lt-idx 0)
" R, }/ J* s+ x* o- ] D# o& I (set_tile "t_ltype" (bylayer_lt))# g; U+ b" U$ W( W# ?
;|MSG0|;"BYLAYER"
' Z `% ?- i: e7 @, _1 w )1 ^3 X- B! y" a
((= lt-idx 1)
+ E. G7 d& A" {. K e (set_tile "t_ltype" "BYBLOCK")
' n1 j" D- q0 e2 ?; h( h9 P, X, S ;|MSG0|;"BYBLOCK"
2 k- a8 n3 T# n& o4 n' m0 G Q )* V: d1 `+ M y
(T
7 ~& e! ~! N4 W+ [/ T. Y) {* K (set_tile "t_ltype" ltname)
, x( g& ~! z' H& J6 I' V ltname1 M( s# e) J/ V7 a+ w
)
7 Z" C7 s- ?/ ~, E# u7 W# [' _0 [ w) o );cond then. z+ O, s4 X4 `% m0 Y! K; A
eltype
8 j( I% J P: ]: `% D1 I6 S5 R% M );if
$ \, q- P2 m; p );defun: v* l3 i, e! \% a; [
;;& i0 d/ b! _& V! }" X9 R
;; Edit box entries end up here' ?7 `& n" ?/ D& T2 J3 `
;;* G0 D# W/ _1 R
(defun ltedit_act ( / flag)
5 {7 E7 i) W9 U2 C* q/ P/ h ;; If linetype name,is valid, then clear error string,7 v% i- R! k, x' o6 I+ ]
;; call ltlist_act function, and change focus to list box.
F2 e+ y8 k7 R1 B) Y5 g ;; Else print error message.
" `$ X/ D4 ^: T( \! J$ R: p$ d
0 G9 o) j" `, ]9 W9 r" S (setq ltvalue (xstrcase (get_tile "edit_lt")))
% k) J7 c3 E; A- z6 x (if (or (= ltvalue ;|MSG0|;"BYLAYER")
0 h( W& y4 u1 a! b (= ltvalue "BY LAYER")0 }7 ?# b% X. V8 }% e+ S9 M
)
! | C5 Z- p& Y# R (setq ltvalue "BYLAYER") F& f: W# f( J [/ o
)
K9 k: `3 V1 N( s" P* i* d8 Q (if (or (= ltvalue ;|MSG0|;"BYBLOCK")
S5 B3 H! ^# B% j (= ltvalue "BY BLOCK")
8 Z0 U" U* B% f, o# K" D )0 q; |/ T0 @9 b0 B
(setq ltvalue "BYBLOCK")5 l+ ~$ ]9 r2 M# b
)
T8 c! d8 _- C9 H' ?; l (if (setq lt-idx (getindex ltvalue ltnmlst)) j X- }$ X0 J2 T2 g4 F7 p
(progn
/ ]' s9 u l+ i0 A) E8 Z. p c (set_tile "error" "")' W4 Q* L u9 F: v, ~& L
(ltlist_act (itoa lt-idx))7 z: l* |4 o( O& s, }
;(mode_tile "list_lt" 2)
8 b: ^% E5 f# I, k' l );progn then9 \- T" [1 o5 y7 H2 p; s
(progn
; w3 q& M) i5 K& ` (if (/= ltvalue "")
. u1 L( u; l, \. Z/ T4 O; G9 q (progn
8 c4 S. y k: x# \ ? (set_tile "error" "Invalid linetype."), H6 P, F5 E# f1 ]
(setq flag T)
1 y6 A% t5 i5 {' R, q& U );progn
- g' `9 Q7 o% p4 O. e! n. t7 p )
; ^. |! f! N, @. K& i3 d (setq lt-idx old-idx)
: t5 E' @2 N9 P4 {- R3 {6 k# Z );progn else
4 v E. B; B/ K7 v3 O );if: k( i" e I& p* r1 H
(if (and (not flag) ;added so a return will take you out of the dialog.
: j; k: b. U6 L' l& ]+ j# U+ e; U, d (= $reason 1)
- b8 E, o- k( r; m* a% Y ? );and
% h" p. O, `; j (done_dialog 1) 1 z+ o: d& O$ U$ k" Y/ o# |/ L
);if
# u8 y3 q4 C% _2 W# I );defun ltedit_act
( r& o; g: Y4 z/ q* m* P8 q ;;- `$ C j% s( T# e
;; List selections end up here5 ^ A# m; |; j1 Z6 B
;;
. E% G, e* |8 F1 t5 B: d) r$ Z (defun ltlist_act (index / dashdata)
( x* s+ B, `) Y3 ~ ;; Update the list box, edit box, and color tile
! ]' M+ s" p' D& z# c4 } (set_tile "error" "")
: U3 ^/ _6 d& ]# M4 f6 P3 U6 e (setq lt-idx (atoi index)) x. e, @' F/ q% V& a
(setq ltname (nth lt-idx ltnmlst))
+ ~8 \2 V9 d% Z7 s1 F2 K (setq dashdata (nth lt-idx mdashlist))
O# j( B/ R3 P (col_tile "show_image" 0 dashdata)* ~8 e) S' u7 L% ^0 [
(set_tile "list_lt" (itoa lt-idx))$ Y* ~/ K* b- @
(set_tile "edit_lt" ltname)
2 r; ~2 x) p$ }$ ]0 F5 K" o )
: j, o4 y3 E) m# ^; f, N% F. V ;;4 `3 i- ^; Y% Z, E3 P
;; Reset to original linetype when cancel it selected
C, n2 @8 [/ a# E5 W: o ;;
4 v) W* x; `$ E. e+ ^ (defun reset-lt ()
9 Z$ j, }+ Y8 _ (setq lt-idx old-idx)6 {3 y4 t5 p5 b! ~9 k
(done_dialog 0)
1 ~" H9 C' K9 n- C: c8 N )' y+ D6 S4 h) [% J7 {) \# C
;;$ w: U5 \: j9 M# n! S) `
;; This function pops a dialogue box consisting of a list box and edit box to
6 H& I$ r7 a5 Y2 @1 n; z A ;; allow the user to select or type a layer name. It returns the layer name+ P) z+ [, z. b$ \9 Z
;; selected. It also the status (On, Off, Frozen, etc.) of all layer in the7 k: t: P8 c: f
;; drawing.' l& C7 R$ z" `0 c7 S6 l! l
;;
# `* b2 E) P4 X" z; ]2 P' n B9 \ (defun getlayer (/ old-idx layname on off frozth linetype colname)5 o% D5 v% O0 b0 E
;; Create layer list the first time the layer% n$ _, P1 Z4 e/ c# K
;; dialogue is called.
' E* l# `4 J, c" P (if (not lay-idx)( D# \+ o: q# U. I& j h
(progn) T/ G G, }5 B' ]1 y3 _, T: Y4 U+ z: J
(makelaylists) ; layer list - laynmlst7 v* J7 ~/ R3 K/ Q$ x
;rk& A S( S2 @; D2 Q; m& Z5 D
(setq lay-idx (getindex elayer laynmlst))3 H) {. C3 p- B: h7 k
);progn
6 L: [: z, F5 _: D$ p4 d* Y3 n );if
6 c# w: {/ g6 M
+ s, |: z5 b) C7 n/ E ;; Load a dialogue from dialogue file9 e& L: M7 K9 S) Z. l5 u
(if (not (new_dialog "setlayer" dcl_id)) (exit))
3 h9 z8 z8 U) ]0 r (start_list "list_lay")( v" C1 a: ^, c0 E) n5 q5 t
(mapcar 'add_list longlist) ; initialize list box9 f, x, m f$ o
(end_list)
7 _; Z6 }% k3 I+ Q1 Z ;; Display current layer, show initial layer name in edit
7 E! @1 t/ I( c1 D) n ;; box, and highlight list box.
0 o! _# a2 W3 h8 p1 S) U" ?6 R; R9 ~ (setq old-idx lay-idx) j! ?8 f6 F! |5 m8 [% O" e+ X: D
(if (/= lay-idx nil) (laylist_act (itoa lay-idx)))
) j* B& i) O5 w$ L (set_tile "cur_layer" (getvar "clayer"))
0 Z6 ]# {0 ?1 @$ M (action_tile "list_lay" "(laylist_act $value)"), P8 i+ `& F- Y7 Z* I7 \' ^
(action_tile "edit_lay" "(layedit_act)")4 F6 g j5 d4 v
(action_tile "accept" "(test-ok)")
* Y: b8 |0 c6 [) ^, e (action_tile "cancel" "(reset-lay)"); ~5 {- v- @2 e+ P: E' E
(if (= (start_dialog) 1) ; User pressed OK* ~5 ^; x! z8 r) |. F' ]
(progn
- f4 K3 E, t! ?, ? (if (or (= lay-idx nil)$ g+ \! @5 q2 k
(= lay-idx (1- (length laynmlst)))" \, g* \8 x& ]+ z2 ~. P
);or+ `+ H) H+ M- {$ K
(progn
) u8 n/ b; ?! u! C (setq lay-idx nil)
6 U- }. d8 b+ u+ g0 ?/ _ (setq layname ;|MSG0|;"VARIES")0 y# ^- g1 x0 W* U5 s( c4 ]
(set_tile "t_layer" "Varies")
7 k* J- p+ G. M8 n* c+ F (setq layname "")2 N9 {) S$ S- e1 F2 |
);progn
$ D ?( k4 Q& }# G* @ (set_tile "t_layer" layname); J: P! {, x) F p( A" b
);if
9 j' _1 h7 s ?3 U ; If layer or ltype equals bylayer reset their tiles# c, V' ]6 ?) x! M
(if (= lt-idx 0)+ f! T' T9 ?, a# {9 n
(set_tile "t_ltype" (bylayer_lt))1 h) @" K" }4 s- n
);if
! y; l! R- j4 G/ ^: f (if (= ecolor 256)5 h* q5 w! ^" a9 R
(progn
8 P2 n) g# J: K( m (set_tile "t_color" (bylayer_col))
1 P6 O) l' G! _; M# Y i (col_tile "show_image" cn nil)
. x7 z& S1 V* W9 D# A )- g5 F. E% h2 Y% |9 v
);if0 }' O4 ]0 w( C! b: m6 s
layname
! o9 t9 k* p9 ~9 J );progn. H/ s2 {, N3 C* O1 Z
elayer
# F) ?; u( e* [& X );if
- R* h: d6 g* W5 j, y9 @ )
" ^" }% m$ A$ E5 n ;; v% e: d5 R1 i8 u1 S2 ~
;; Edit box selections end up here
1 G( o/ [) i* e4 i4 Z0 ?' u& R- ]' @ ;;
- u- j+ l/ o# v( m (defun layedit_act()
: z4 Z9 ~' k: B f! _ ;; Convert layer entry to upper case. If layer name is
5 q. O" [4 ]- _9 Z [ ;; valid, clear error string, call (laylist_act) function,) L: S+ A! r/ c1 N7 |4 T' r+ J
;; and change focus to list box. Else print error message.
4 h$ Y' f* `4 O9 t! h (setq layvalue (xstrcase (get_tile "edit_lay")))
+ h, t1 n, x( E2 D6 a (if (setq lay-idx (getindex layvalue laynmlst))0 S0 |5 @7 B- r) o; o
(progn
+ Z, J+ ~0 ^: T (set_tile "error" "")
5 G' E; H7 T' A5 U: e (laylist_act (itoa lay-idx))
& y3 J& {+ B$ d8 H )
5 N! x. q- @4 M( j5 d# O (progn
+ a9 A* T% N# C0 {' j# { (set_tile "error" "Invalid layer name.")
! J9 N% V& ?3 _3 `) { (mode_tile "edit_lay" 2)
, d+ @3 Z+ \; n V' _" ~/ |8 R (setq lay-idx old-idx)
8 Y" v* B- s/ b2 X) g. U! L! Y )3 Z6 J I& t* Q/ z( s" [* u
);if- s5 A2 S: w! x2 _+ J* R
);defun
" y3 H/ _+ o G! { ;;' O4 q. c( f1 R R0 w
;; List entry selections end up here; r- [( A5 j" P1 a" v* G
;;
$ @7 Q r4 V' |! O (defun laylist_act (index / layinfo color dashdata)& b1 I# V' v k4 P$ r1 n' Q4 n; S
;; Update the list box, edit box, and color tile
/ j, O0 {3 x% d" m, u) _ (set_tile "error" "")& h; w; _/ ?% L4 \ j
(setq lay-idx (atoi index))3 P+ T- y5 y6 O% G0 X
(if (not (equal lay-idx (1- (length laynmlst))))
) Q, `! H! Z$ [$ \. W* ? ? (progn
5 l: z# G% o G9 H5 D3 |' M (setq layname (nth lay-idx laynmlst)): ~1 ? m$ B) [, x
(setq layinfo (tblsearch "layer" layname))
3 ]1 R- f2 U7 G1 f! W. g6 y (setq color (cdr (assoc 62 layinfo)))
, Y- n9 e& D I& P3 F* r (setq color (abs color))
% D( ^: B9 C* J% Q& r+ j (setq colname (colorname color)). D2 D* V9 C0 A
(set_tile "list_lay" (itoa lay-idx))
4 S/ q6 N0 a1 R& T (set_tile "edit_lay" layname)
# S7 W) c$ I" A. y5 Z- m* y6 ? ;(mode_tile "list_lay" 2)7 a' m# n6 P6 _8 y' [9 a
);progn then 0 K. W3 J; I# T
(set_tile "edit_lay" "")
. c# X% X3 X1 `& G );if
1 ]9 z4 g- z2 \7 n, a );defun laylist_act9 i, ~, J$ \, n5 o6 u& ]
;;
* O* l5 ?6 `! {! [ ;; Reset to original layer when cancel is selected+ y9 m- E' y* H
;;
% c Z1 h& {' | (defun reset-lay ()3 a) k/ w' I B9 g3 ?! {! V
(setq lay-idx old-idx)
1 @! b0 z* J% t3 g8 L2 v (done_dialog 0)
- l3 M2 [! y# L9 T3 o$ A1 C7 R ); h( F5 U3 o" ?( }) A
* v7 R' L, g. h& K ;; Checks validity of linetype scale from edit box. It checks to
$ }! [# T1 \1 A3 f8 {7 w3 d- c ;; see if the value equals "Varies".
' @5 ~' i3 A N I$ z) {2 Q q0 G2 X# J c" U, E) w" ]
(defun getscale (value / rval)
: S! S. V8 ?6 E+ v- c (setq value (strcase value)+ V5 p0 z4 _4 E* S; m$ ^+ }
rval (distof value)0 J4 Y c; \" y7 s6 F. q) h
);setq- k2 Z7 |( j. D0 J2 t0 b. N; U, T
(if (or (= value "")( m7 O! h; j8 w
(> rval 0.0)
, K% E) w- Y. [ )' {; k N& P1 |0 e$ Z5 ], z
(progn8 A( m6 m: f7 M+ u$ I6 j
(set_tile "error" "")# J, I+ \) ]3 N/ h9 S
(if (= value "")
" r( \5 n4 [ Y (progn
1 K0 H! ^$ R( G w (set_tile "eb_ltscale" "")
2 D! z$ |/ M: F (setq eltscale nil)& P! T4 |8 _3 U, K/ A" J- k0 w) d2 e
);progn then8 Q$ ^9 t2 H A1 V* @
(progn
( f/ i( }# Q/ S (setq eltscale (distof value))
4 K8 `: W9 U' D, P (set_tile "eb_ltscale" (ai_rtos eltscale))
) c$ _1 I& }/ r: Q8 U0 @ eltscale# s7 ~) _" R+ A7 K
);progn else8 @" N/ U8 l' G" h9 ~8 V
);if$ W" ]2 P) ?' E$ t2 c
);progn
4 V9 A- V9 }( N+ f. [ (progn
5 d5 c; L( H/ } (set_tile "error" "Invalid ltscale.")
, m3 U( g6 F; t `: L+ _ nil
! i" T w9 }/ J1 l- B );progn else
9 N0 G8 [( M Y: u );if/ ]( q* g6 f/ ]
);defun
+ q& |7 ~1 ~. {2 S3 @ ;;
! Y- Y9 `; C6 G1 a; {# i5 e) g ;; Checks validity of thickness from edit box. Since (atof) returns 0 when a
& o! t8 y/ M7 |0 z: |$ O4 h ;; string can't be converted to a real, this routine checks if the first& m) i1 G' ?. C; w& ^, I
;; character is "0". It also checks to see if the value equals "Varies".
0 ?+ C; R7 A: {# U! R% A ;;4 u2 i) ]) k, O% G5 U
(defun getthickness (value)
9 @5 A# N$ Y( K( K! c7 F (setq value (strcase value))
% m: I& @, w6 j+ C2 X8 O (if (or (= value "")2 _# }1 Q1 K C# Y8 i
(distof value)
1 o% d; t6 A, s0 U" e; `: L );or
~% Q* y6 k0 k" A7 {( a# V (progn
3 }, b9 X, Z# N (set_tile "error" "")$ h4 ^) s4 ^8 V
(if (= value "")
# q* B- s, B0 V4 H! b! a! J (progn
/ {; |2 S6 R( \7 g (set_tile "eb_thickness" "")/ t& S- ]- }5 h5 v/ M
(setq ethickness nil)
- H2 G2 o# x- o" } );progn
7 \" R* m4 @, y3 L* t (progn
! Y6 l; \' A$ b6 d1 L0 b+ n8 ~: k" B( D (setq ethickness (distof value))! a, b( V* ~6 c* m; H* L+ \# ]" Y
(set_tile "eb_thickness" (ai_rtos ethickness))
" p w: _6 P+ I/ k a2 Y ethickness" b4 y+ D3 l% H9 i
);progn# ~( U, w. w+ r I* X* N* p
);if
7 V6 W# V4 \9 l( H$ E# J );progn! t: q! K$ b& ~) K
(progn- L F& S* V4 R' B! C; F# N" W
(set_tile "error" "Invalid thickness.")
9 B! C- f1 X; k7 y nil
/ V9 |. c5 N/ \( L0 H% A' } );progn
5 Q. S K% z O9 F5 x% `/ }. y) { );if
2 V9 W( g2 v, ]8 j1 o: A );defun
, T& u. A2 ?) ^! J' w# D7 c ;;
5 B P$ ]* n" s. r% R8 i q/ y ;; Checks validity of polyline elevation from edit box. A/ f Y: C( W' s% Y, N& X( `# l
;;
# p! Z; z, O+ _2 o, }+ \4 _& Z9 q (defun getelevation (value)
* k2 w" V! |0 t2 D3 A (setq value (strcase value))
* k7 M+ x& r: q5 Y" O+ K (if (or (= value "")
/ A. O/ Y8 h, j: x2 j E/ |. S (distof value): @/ z) Y2 _0 S5 j$ s
)& `. K1 Z8 |6 z! y8 a" U
(progn- ?# n1 j. s* B, I6 @
(set_tile "error" "")
3 h: r7 q& _" \ (if (= value "")5 f9 T( p: a! v9 b% Y6 ^' z
(progn9 D1 w! O, C# s
(set_tile "poly_elev" "")
0 ~ u$ `) e1 f& Z* I7 S (setq eelevation nil)
; Z3 y9 R7 j. _ n );progn
8 ~8 S( p0 J0 t' n5 K, ` (progn) Q7 R+ H( r. ~! P9 L% Y5 c
(setq eelevation (distof value))
3 _7 I7 \+ B+ J" x3 S& h" U (set_tile "poly_elev" (ai_rtos eelevation))
2 v' g% G6 k3 y! A% X$ @. y9 E eelevation
0 x0 }8 ]) B! s% a* U% e );progn" p+ X$ y* h9 I0 M% r% K
);if% g* s) {$ {. d& U% A
);progn
! x( c# Y6 `5 a$ Z+ \ (progn, ]; f% N! I2 E% |% k- |) Z
(set_tile "error" "Invalid elevation.")
3 k' Y6 n9 l- Z X nil
X$ H! P; Q& f0 p1 W) f! _' e );progn
- e. z, y8 g- z) {; n );if
; z/ k) H& y# y3 T4 ~ U$ n+ h );defun
' x8 B+ }: g% q( v ;;- Z7 M" s+ p8 N8 \+ S2 B$ L7 `
;; Checks validity of polyline width from edit box.! w( g6 g( Q ?% n
;;
g! k* L0 n6 T& c9 k (defun getwidth (value / rval)& G, G: s' X+ z E
(setq value (strcase value)# c+ ]# U1 ^1 j! K8 V6 _
rval (distof value)
8 r8 x" b! }, c$ ~4 \ @( ~* d- Q )
1 c5 z- Y- d; p, z$ ]) v (if (or (= value "")5 S1 H! R( y' J [# F3 m
(>= rval 0.0)
: }1 |: Z: |' ~ ~ )
6 p" X7 z. H' U2 p' F (progn/ d3 ?9 f2 e8 T. }, I0 |8 Q/ @
(set_tile "error" "")
" O& u; C$ a' Y0 n0 K) Q+ I2 k x (if (= value "")% a0 S. b! p8 K& k! ]+ R# A& O9 w' b
(progn. L% R) a, i5 X2 @+ S% `
(set_tile "poly_wid" "")
9 Y4 m# S) s* G: ~! K (setq ewidth nil)
* \6 ^- i8 A5 p3 ]) W7 O );progn
1 i; m; ~: _7 ~ (progn2 V4 W4 x5 Q; r" A) o0 B& Q" {' f- r
(setq ewidth (distof value))7 a1 @- m1 B$ m, X, k
(set_tile "poly_wid" (ai_rtos ewidth))( r8 p0 @+ |- ^) W+ m& ~
;width2 h4 g, K. a! S3 @8 ^9 v+ D0 X
);progn
" l0 H8 I, w+ U );if
! B0 V) ?2 M5 [( Z );progn
) q2 ^+ t5 T( g+ V; H5 t (progn
3 \5 p: J7 M/ o8 ^ p! m (set_tile "error" "Invalid width.")
: b5 D6 U& J/ s) b/ ` ;(setq ewidth nil)
! k2 k9 i1 v; k nil 6 [8 W, u7 q- J; T0 `
);progn
' Y1 E5 B" g" u7 C6 W. I );if
5 E$ y1 |$ T6 d3 i0 v" Z );defun
A" Z% Z; a2 j: t5 x ;;
- k8 s: P( g7 |8 [6 ^* X ;; Checks validity of text height from edit box.
8 i* t/ f9 d4 n* Q* a ;;0 a. B* u. L1 b5 Z w ?( x
(defun getheight (value / rval)
0 `7 E6 {/ m {2 [ (setq value (strcase value)
! Y% z9 Q8 a9 w9 W( E/ r rval (distof value)% m+ {) k6 i+ I$ X
)
) l. d+ n( |& t. @ (if (or (= value "")
$ j4 {! X4 C3 u# Z& A' d (> rval 0.0)! z6 ^; P& X r& h8 u$ B$ Q
)
L/ h( [+ [* i# f7 S (progn
, u7 W7 _" }# M& a a* ` (set_tile "error" "")( ^2 i$ R' a; D9 Q* T
(if (= value "")
. V5 f- R3 x4 q" S! w) D) D" O (progn
* C9 J# c- W* S$ x" N& Z% f2 Z (set_tile "text_hgt" "")
8 a6 ~) f2 I! \: _ (setq eheight nil)7 q/ h3 h7 V1 K) w
);progn
6 G8 p8 r! U/ D: x8 }- X, q* i (progn
' u0 _4 X- e$ m3 O: r (setq eheight (distof value))
" ]* b9 G; S2 _ O. O8 D (set_tile "text_hgt" (ai_rtos eheight))
7 m9 _8 a" [1 v# d5 A4 j" P: h7 h9 N eheight
8 Y- I6 f: U2 f );progn
* q- V) |& b' u" h# L A* w3 s );if
- Z1 {( O& W% ~6 z3 k9 Y0 d8 W );progn
; f% d& b$ j3 V/ S# P" v (progn* a( D8 A A( {9 i% U/ x, c
(set_tile "error" "Invalid height.")
" R, C8 Q& G7 b' |9 _ nil
6 _- A, K6 d) f+ E, w$ L3 J1 @! q );progn
9 T, b- g' x% N1 M );if
& }3 ~: r, E+ a );defun
, p, h0 H2 {- _, }- f* Q$ x7 F6 M5 h& P* f' p! V, T
(defun getstyle (value lst / rval)
X T6 ?: \( Z5 e" C: { ;(setq value (strcase value))5 u) ? D6 N' `
(set_tile "error" "")7 f) y0 y5 p% e/ {$ A
(setq estyle (nth (atoi value) lst))3 e% N% n4 a+ h* s
(if (equal estyle "")
% X. E) l' V2 @1 Z: Z (setq estyle nil)1 H x4 h1 r8 C+ [- `( g
);if
; E1 L; x1 e; D7 E% Q0 g1 j5 ?& p [0 z* F1 X3 n! }. \
);defun getstyle: |( x& O/ ~/ ]: [
5 f; F/ I7 u# G8 U
;;* b; q: i1 i/ g, n! {0 ]
;; This function make a list called laynmlst which consists of all the layer' _' b/ A1 s- X# p/ ?3 i
;; names in the drawing. It also creates a list called longlist which) K% P6 d+ y3 ~/ k
;; consists of strings which contain the layer name, color, linetype, etc.! h: \' m4 G2 E4 u) K% M8 j
;; Longlist is later mapped into the layer listbox. Both are ordered the
/ I) x8 K# t$ ^# X1 n. {- O3 e ;; same.( T+ Y% n) h0 \% x j) v& I
;;
5 U' l' O+ r* Z6 y; e& b3 V (defun makelaylists (/ layname onoff frozth color linetype lock vpf vpn ss cvpname/ [0 Y ~5 Q% u6 X/ K# d. g
xdlist vpldata sortlist name templist bit-70. G5 c8 x& B( A* J; G j
layer_number
) x+ S8 k. K b )
8 v3 }$ @+ f: Z4 \ (if (= (setq tilemode (getvar "tilemode")) 0)
( Q: T& O) A5 S0 c: h8 m# C7 B, r0 ~ (progn+ E9 A1 e6 F; r5 ]0 F6 `
(setq ss (ssget "_x" (list (cons 0 "VIEWPORT")
7 Z% b, a% G/ }( v. ?9 Q (cons 69 (getvar "CVPORT"))
' j8 Z% d6 d# B C: u )
0 m1 W7 f& ?1 p: E4 q% E+ E ): |! z6 w) b: X% r `8 ?7 {
)
& a; f, D# e' U- v6 ` (setq cvpname (ssname ss 0))
9 p# ^% ]! r8 A: t4 b! b3 ~) [ (setq xdlist (assoc -3 (entget cvpname '("acad"))))1 H: M% W7 a* V, z; A4 E
(setq vpldata (cdadr xdlist))8 q/ v. _2 t5 ]2 N# Y* x
)7 ?9 e# h9 N! ^8 T, Z' v0 |1 C
)9 _' t" x& c7 }$ N$ K2 a) u5 D
(setq sortlist nil)
4 K% u( q/ R$ C! Z (setq templist (tblnext "LAYER" T))" B& a. V6 } y6 I9 b7 O
(setq layer_number 1)
+ r& Q \' [- B L9 W6 T( Z: [ (while templist
! P8 R7 c; R; S" ]$ c/ | (if (not (equal 16 (logand 16 (cdr (assoc 70 templist)))))/ f9 U% a" |. g! |/ A5 O
(progn
) K! k' P) H# ?! D2 x (setq name (cdr (assoc 2 templist)))3 i: y2 i1 G; m
(setq sortlist (cons name sortlist)) Z- D M+ C2 n" V
;; Not dead message.... T! f* F& g! f5 }- L* k! K
(setq layer_number (1+ layer_number))) o- D" U9 C9 z2 M$ G$ p
);progn* \4 I& r0 G: f/ @& Q6 Z
);if
6 G/ q/ w" W3 V8 [" Z1 ~ (setq templist (tblnext "LAYER"))
- G }+ n, w4 B$ t2 M; F2 `: O; ? (if (= (/ layer_number 50.0) (fix (/ layer_number 50.0)))3 s4 M+ z" i5 y9 v) I% w6 n4 _% ]
(set_tile "error" (strcat "Collecting..." (itoa layer_number)))% q) E; {# \! M8 B8 d9 Q% }8 ~0 m
);if$ j; p" X- u1 l% ~2 B, I
): Q, J( X2 T+ U' f6 X% g; |5 f
(set_tile "error" "")
2 b0 K; `3 `4 n4 D" ?6 A7 G. ] (if (>= (getvar "maxsort") (length sortlist))
8 u, `: t& M5 x) |* P (progn
. X2 q4 k0 h8 P b: w (if (> layer_number 50)
( u: b, Y% w/ e5 |; P# @6 ~ (set_tile "error" "Sorting..."), ]7 y: m) k* M% H* @+ J
)) n( `* a( t6 v6 r+ i5 C
(setq sortlist (acad_strlsort sortlist)). E* E0 T& E% E3 }5 m
)
* v. p1 P+ ?% {5 P$ Q/ X0 R [ (setq sortlist (reverse sortlist))/ N+ C& h3 D- _' R
)
" }5 j3 z% I1 R3 z (set_tile "error" "")
: o4 t. `6 p9 j- c4 B1 z (setq laynmlst sortlist)
' T& t2 `1 Q7 s ;rk # a, j9 \4 r7 X
(setq laynmlst (append laynmlst (list "")))
3 t3 d% x# z, z, ^8 o' ?4 _+ y0 l3 w9 w5 d: s
(setq longlist nil)
0 W( \& ?0 C5 g' y) s; Q4 f (setq layname (car sortlist))% u- J6 p3 Z% g2 ^3 F* k4 m) s
(setq layer_number 1)
* O- l5 d, ]* U4 V1 f1 ^ (while layname
7 [( |% q6 b# A' y (if (= (/ layer_number 50.0)
6 t% ?, F) d: B. c5 `% r (fix (/ layer_number 50.0))* [; r# d1 q+ a! d. Y, F: c
)
* A' D q$ a W5 V M8 g: r (set_tile "error" (strcat "Analyzing..." (itoa layer_number)))
$ J4 t* }* J$ X+ {" v );if6 d' g( w5 m: U* f
(setq layer_number (1+ layer_number))1 M8 e! ~9 f# B/ I9 o
(setq laylist (tblsearch "LAYER" layname))! | o% d- b/ |, Z5 W+ g% }
(setq color (cdr (assoc 62 laylist))): W5 y. k9 o3 S6 I3 d. v
(if (minusp color)
* k6 x0 x' D* H8 @7 x" d (setq onoff ".")3 X) b) F$ P; p ^$ [0 _; h
(setq onoff "On")
6 O; @4 `# u+ o- h3 B5 b )1 c$ y2 u' T0 |: y
(setq color (abs color))$ B6 P7 i/ d- H/ M4 r
(setq colname (colorname color))4 E; v2 d: S0 M' x5 w% L/ c# q1 W
(setq bit-70 (cdr (assoc 70 laylist)))
# I, l! X0 h7 f: J' n8 W (if (= (logand bit-70 1) 1)
, E3 u5 B' d& t: z) | (setq frozth "F" fchk laylist)* B# E& J4 Y- q$ z( h. J
(setq frozth ".")# S! ^6 m+ a7 V% s& k$ B
)
# M8 w% H) i# }+ X$ g7 r1 U9 U (if (= (logand bit-70 2) 2). c7 Q& F6 n+ y) A' W3 Y8 X
(setq vpn "N")) r5 U* O/ q3 a( O
(setq vpn "."): H8 ^8 P) E' U5 W
)" K- Q" t9 D2 a2 |9 J5 b
(if (= (logand bit-70 4) 4)/ f0 G- U" q* r. R1 S- G
(setq lock "L")
( G9 z& p1 S Y' W" B8 x (setq lock ".")
! W r* b* o0 g+ j% n, G2 N )
9 a7 |% O7 g- {6 g4 G (setq linetype (cdr (assoc 6 laylist)))
- o5 }/ W: r! r5 X1 w& a. f (setq layname (substr layname 1 31))
0 E; U) m$ K M i (if (= tilemode 0)
5 `/ H" ^- _& o: E: ^ (progn
' s! b& Z, |- q. S; t (if (member (cons 1003 layname) vpldata)" e4 d" H" E/ ^0 w3 T. x
(setq vpf "C")
* `9 H: A, f; S (setq vpf ".")
$ j4 Z2 t# L; ?* i/ x8 r+ P ), f3 Y7 Q. z; R. c1 h( m+ o
)
8 J9 G! s, x! ~8 x% a" x! N6 i (setq vpf ".")& [ G; h% _) p) I; x! M) w
)
9 T4 p4 P4 P: ^: l! X% U2 Q v (setq ltabstr (strcat layname "\t"
0 @8 @/ V7 J# } onoff "\t"; _# D* Q: G* b( e+ P
frozth "\t"3 i+ N( ]) O0 Y; q5 o* L% O
lock "\t"
' u) y: M- _* T vpf "\t"
6 S( ?0 T% U3 N. n, U( ~ vpn "\t"3 E# J# j7 a1 G7 w6 [( k" k) F
colname "\t"
$ d6 a3 H0 X; ~. }. P linetype
( Z2 z6 G. S- D! O2 w' }3 z) w4 Q )
2 U" z- x8 {# M )
5 X7 ?/ g/ @4 O% n! a% L (setq longlist (append longlist (list ltabstr)))
4 q/ W' u2 i3 H3 l: y (setq sortlist (cdr sortlist))
% `9 T0 \( m( U (setq layname (car sortlist))
; i ~2 i, y$ d' [& Y/ S );while
# P/ ^, p6 d* k5 c (setq longlist (append longlist (list "")))
. H8 b g& K: `* b (set_tile "error" "")
, o7 Z' | J \- I D )5 [) o9 t; }/ g. C9 n( i1 P
;;+ I) T% C0 Q7 M' M, `% ?( D
;; This function makes 2 lists - ltnmlst & mdashlist. Ltnmlst is a list of' M: F K9 v3 {& I0 }
;; linetype names read from the symbol table. Mdashlist is list consisting
3 d( J! \! ?9 a/ v# M ;; of lists which define the linetype pattern - numbers that indicate dots,1 q- g' B% Q+ e, q
;; dashes, and spaces taken from group code 49. The list corresponds to the4 t, ]+ f/ C# K" d$ ?
;; order of names in ltnmlst.8 i7 P. a0 j7 _7 L8 G, L
;;! r/ I+ S% @$ q4 P. \ f
(defun makeltlists (/ ltlist ltname)' E6 M. ]: W4 Z% n6 R8 @" H
(setq mdashlist nil)
3 R' F1 M+ [. n0 R: C1 ] (setq ltlist (tblnext "LTYPE" T))& F( ~6 I, ?/ k. z2 j
(setq ltname (cdr (assoc 2 ltlist)))2 Z% w% F5 p1 l1 [+ Q
(setq ltnmlst (list ltname))
& d3 A8 z a( c9 Z5 Z (while (setq ltlist (tblnext "LTYPE"))
7 ^7 i* L, u' S: k (if (not (equal 16 (logand 16 (cdr (assoc 70 ltlist)))))/ U! [% h% C5 L8 b, I
(progn
' N& _ k9 C6 w8 N$ G/ Z; k (setq ltname (cdr (assoc 2 ltlist)))
( \7 j' L" ^! q) }9 f- e) [) _' ? (setq ltnmlst (append ltnmlst (list ltname)))# \/ }8 f; O2 F, o; V9 A- t# |9 F+ I
);progn
; `7 J& q( m5 c1 d );if 5 _( m5 t) O* v/ u% L8 X9 v2 ~
);while
1 I* j) g: R% J3 F. K* s (setq ltnmlst (acad_strlsort ltnmlst))
6 [- L: P$ ~$ C! w5 O/ M (setq ltnmlst (append ltnmlst (list "")));add by rk ' `) n x" x6 _8 W; w+ f2 z7 S
(foreach ltname ltnmlst
- H: d$ P1 o/ p" I (setq ltlist (tblsearch "LTYPE" ltname))
, q W; Z/ G4 w8 V+ J# s3 K( ?; | (if (= ltname "CONTINUOUS")
- n! I' K+ g3 S% X (setq mdashlist (append mdashlist (list "CONT")))1 A( R/ ~ P4 x2 ?
(setq mdashlist4 P4 v K7 g( p) t/ X( e# W. T( A
(append mdashlist (list (add-mdash ltlist)))1 V1 c0 B4 |: m* r8 D$ V% r T( v
)
2 H+ E! U6 e+ Y3 y2 Y# Z )- C, H4 }2 T# S* x* [; C( o
); z% n+ I0 p; j; X4 @
(setq ltnmlst (cons "BYBLOCK" ltnmlst))4 Z7 L- A# X: w4 u3 r
(setq mdashlist (cons nil mdashlist))& A6 M$ f* H+ I( Y
(setq ltnmlst (cons "BYLAYER" ltnmlst))
3 h6 `- J; l0 y* Y! c (setq mdashlist (cons nil mdashlist))
1 |" C! l) c' B3 v" [3 b. ]% \ )" U; n4 i* u& P
;;
: r6 L! l$ F) U ;; Get all the group code 49 values for a linetype and put them in a list
& Y! P, k. O! e- q ;; (pen-up, pen-down info)
5 Q, K; ~( [) ] ;;
2 |3 \8 d- L6 i) a (defun add-mdash (ltlist1 / dashlist assoclist dashsize)6 C( ]# N4 C7 t; m+ }
(setq dashlist nil)
: Z! z# m1 S$ ^+ R, g+ G (while (setq assoclist (car ltlist1))
# [6 x6 Q( C+ t (if (= (car assoclist) 49)
' Y, ?& w$ z$ h% i8 f( o9 [ (progn
% ]( j- G6 f2 c (setq dashsize (cdr assoclist))
9 @! d1 P3 O# W( b7 C5 n (setq dashlist (cons dashsize dashlist))
: _9 n/ t$ Q# d* ^6 n$ g )
1 r! u) M" G* A8 X5 @( b- l ). G9 O) z3 F& c6 n! x' @- h
(setq ltlist1 (cdr ltlist1))
+ y, n2 \2 f8 {9 e0 ]* F )7 V# S9 @, `2 y' R" c$ O7 `; ?
(setq dashlist (reverse dashlist))
" U( W2 s$ ]( C8 C )9 ~: S e# L* P; E1 [
;;
0 b0 _* c8 R: ?1 I4 A ;; Color a tile, draw linetype, and draw a border around it
/ @7 B0 S; V" R5 z& e7 g. ]9 x) U ;;+ x# l! s. z* K% v
(defun col_tile (tile color patlist / x y)4 d" h5 k3 r+ ] \( W3 a$ {
(setq x (dimx_tile tile))8 {' T' {8 e$ Z. y- @3 p
(setq y (dimy_tile tile))
" C4 J% Z, X, x. F0 Y% {& E (start_image tile)$ I) u9 F J0 n. \+ I- r" U4 A
(fill_image 0 0 x y color)1 K+ T+ R( R0 n, y
(if (= color 7)2 h8 ^- }9 D& I# f
(progn
- ] @- s; `/ x+ j+ t7 O6 F (if patlist (drawpattern x (/ y 2) patlist 0))0 p [# a$ \2 O) N. R
(tile_rect 0 0 x y 0)
- N' [2 f1 Z. n) y9 C% \ )0 u4 N7 T9 ?1 }$ Y
(progn- Q4 h1 r" }6 j- F
(if patlist (drawpattern x (/ y 2) patlist 7))/ |5 T- {! {1 O) o- n: a& y
(tile_rect 0 0 x y 7)
7 ^- {2 \/ ~" ^# w* U+ q, M )
( U9 ~# l0 `$ H9 B! j6 n8 F& K )
! [9 l4 D( d' X (end_image)
+ n8 `8 ]4 K1 ]& t+ c+ t4 o; c )
3 a' Y* h+ ^) ?! l, n7 j ;;1 b# X& Z, {9 W. T c
;; Draw a border around a tile
! p8 P( ~- I- U- p ;;9 ~5 s$ B5 R8 v/ I
(defun tile_rect (x1 y1 x2 y2 color)6 V5 W, ~5 s+ D( z9 b" x
(setq x2 (- x2 1))
p0 c( F7 o& U. P (setq y2 (- y2 1))- z% B9 b; T: Q8 r
(vector_image x1 y1 x2 y1 color)3 i& d* L& J% d% |6 a& Z
(vector_image x2 y1 x2 y2 color)
, L1 k3 u. W' D5 K* v3 C* j% b (vector_image x2 y2 x1 y2 color)$ I: N3 B& J. \: _% x
(vector_image x1 y2 x1 y1 color)3 {2 B# H' S1 s3 K
)
4 T5 s: G7 y) l I& i ;;1 e$ h! }# z+ q, s; t" u( z( }1 @1 |
;; Draw the linetype pattern in a tile. Boxlength is the length of the image& V c" N; Q, R) X
;; tile, y2 is the midpoint of the height of the image tile, pattern is a
4 l( O; o; O# i3 B/ H/ D ;; list of numbers that define the linetype, and color is the color of the* Z# @/ z& c+ O8 A
;; tile.
. J1 k; \+ D" |" A f ;;( P! B4 o3 P8 n# E/ m/ J
(defun drawpattern (boxlength y2 pattern color / x1 x2
$ D3 W! A& p7 F$ U5 c patlist dash)
* w2 l/ d3 g% i. | (setq x1 0 x2 0)% r6 i; R8 ~+ j( [; k& j# [8 h5 |
(setq patlist pattern)
- D8 ?0 t: C' E/ G6 e (setq fx 30)9 ^4 i( U. r0 g3 e% Q8 n- `6 o
(if (= patlist "CONT")! K; t. V, ^- b: ~) |$ R
(progn4 Y4 Z) B s. r A) ]
(setq dash boxlength)
! [/ G$ c1 _# J* t8 ?# T- G. d+ P (vi)- y% l* g5 E1 k0 `4 [
(setq x1 boxlength)
9 a) u- D) ^$ G) j, O( z3 n% { )7 U" {7 l" B g' O5 f! N9 f0 B, s
(foreach dash patlist
$ m* E: u; u4 l7 X5 O (if (> (abs dash) 2.5)
3 x1 o# P0 K; p5 x (setq fx 2)3 f% u# S& `# Q D# R* I* b
)9 m. X- @+ m" I
)! m) k/ @: k. v
)
! |' c f s: y l* C (while (< x1 boxlength)
) k$ v0 M3 ~, j: X( o" N( m! r (if (setq dash (car patlist))( ^* g. o5 |& c1 x2 L0 R
(progn% o# H' F/ q' t& d9 H) S' q
(setq dash (fix (* fx dash)))1 n0 D' `3 G1 A6 t* h; }- |
(cond0 {2 J; x5 Z# s5 D# ?, Y4 v- ]& `9 C7 a
((= dash 0)
1 }! k$ M% A; B (setq dash 1)
/ H7 |6 G3 |& `! ]& t2 ^& B (vi)
9 f9 I# h8 b e8 v( e! P )
1 ] m5 ^4 m4 Z/ \$ n ((> dash 0), }1 T* R4 k; s+ X, H- h
(vi)
* C; g' O* P; \ ): A J3 n9 L; Q" y+ k9 w
(T1 K* o; K0 p2 h$ _4 t- j1 M1 S
(if (< (abs dash) 2) (setq dash 2))! W* X8 `. ~8 o$ a' |
(setq x2 (+ x2 (abs dash)))
1 f* K! p# E9 N8 }) |6 g4 y% S )
6 r& [9 u4 _9 l9 Y* m* k2 i )- e; p/ P# A/ J1 q
(setq patlist (cdr patlist))5 l) S, T" @7 r1 g' \8 y6 z
(setq x1 x2)
f" w. [# }7 D) \, j! D4 l6 \ )
7 ~9 L3 D' V8 }- i/ k: {8 Y (setq patlist pattern)
8 k; S, ^ _0 V1 p5 Y: a )
8 @$ B# m9 A! t. s, U. x$ U/ Q )
7 R9 H9 O- I; q' |) @ )5 j1 W4 F# H! h$ z8 |! i6 `
;;
# }8 C) ] ]+ Q; P! o- q ;; Draw a dash or dot in image tile% {% x7 n7 F- O
;;
9 f$ w5 [9 i5 b (defun vi ()
( ^# w$ v6 ? z8 f( F% B (setq x2 (+ x2 dash))
; r$ M8 N4 G6 h* |. a& x (vector_image x1 y2 x2 y2 color)
, h3 d$ z E$ f2 e1 [; R1 ~6 P9 | )
$ A2 u+ l, g! ]3 ~. `5 H I- ~
& L% ^/ b; E; C ;; This function takes a selection and returns a list of the color,
/ C8 V: B) \/ s/ K4 { ;; linetype, layer, linetype scale, and thickness properties that$ `" i$ e% D) j" H! {% M) {
;; are common to every entities in the selection set - (color* K& E" w# B2 M* k
;; linetype layer thickness). If all entities do not share the same. j; F+ ?& M0 V0 x0 d
;; property value it returns "Varies" in place of the property
9 a3 A3 @9 @8 d ;; value. i.e. ("BYLAYER" "DASHED" "Varies" 0)0 w$ H/ K3 k- N' a* B6 i' @
;; The last item in the return list is an integer flag for the2 y/ @+ T% o" ~
;; homegenity of the selection-set object types.* S B7 i6 u/ B- z Z
;; 1 = All polylines. z, s3 ?' }" i5 s3 A( ^- M
;; 2 = All text or mtext or attdef, or a combination of the three
6 K. G2 v8 k. o* a+ M+ v ;; -1 = Any other mix of objects( x5 H+ D+ |$ @2 _
, x( a# U* p; s" y# N, Q (defun getprops (selset / sslen elist color ltype layer ltscale thickness8 ` o5 M$ ~& a! e
width elevation height go ctr
/ i* g5 u9 e4 t& [ eflag , G4 W0 l [$ c1 D0 ^: R
etype temp
* x/ V8 s/ Q7 X txt_ss ;;;;rk 11:24 AM 1/30/97
! j1 j9 Q- c+ A% y" } tmp 4 r8 m* \: e8 e5 v
poly_ss
- I. @- U1 s$ m8 G style
& ]- H9 @6 u% u+ p )
" B! S/ R# w" q; s1 s7 N
: Z3 Z5 W; S7 m" W! @+ w" H- @; s( A$ C
(setq sslen (sslength selset)) V6 T# l1 V. S. U# }! n) K. j
elist (entget (ssname selset 0)), a2 x& j+ K& `
etype (strcase (cdr (assoc 0 elist)))
% P( i1 K0 S7 j0 l0 Z- v, z color (cdr (assoc 62 elist))
0 u& L. i& t: R ltype (cdr (assoc 6 elist))
( I0 h- ?. a% K# \5 } layer (cdr (assoc 8 elist))
( h; {! p: H5 s1 P thickness (cdr (assoc 39 elist))
7 e9 L# |3 E1 Y8 W/ h ltscale (cdr (assoc 48 elist))
, S& Z' {: e2 o( N$ I4 t$ }* U. d );setq
! }# s/ \. d# v0 K! z" l1 z8 f
! @ b& \1 ?& a! \4 C$ i (if (not color) (setq color 256))6 T y: i9 ]6 l& I- z, o3 T
(if (not ltype) (setq ltype "BYLAYER"))
7 d7 C( C2 `& W& @* p. [ (if (not thickness) (setq thickness 0))
0 K7 ~+ G+ E% c! t (if (not ltscale) (setq ltscale 1))- \; }6 |5 k$ f) O/ L
- g* P/ H! n- E* R; D$ v
(if (not width) (setq width ""))
/ S, |* i8 s4 b! B: I (if (not elevation) (setq elevation ""))
! o* t1 x# |& z/ B( o) N% b9 @1 H (if (not height) (setq height ""))
. Z5 A' @- A8 X- j0 T9 y% R' }# S& D" x, ~: T: m8 l- `
(setq go T / h4 {" r3 g" k5 `$ f9 H! s
chk-col T 8 V! W: Y( g' r
chk-lt T 4 i% Z) d6 R. Z/ @( ^. Y
chk-lay T
7 h4 `9 |/ {9 Q8 @; u' U( k chk-lts T
) {/ Y9 H9 S M, t chk-th T
' V& y! F. h- G( h* t- n# L ctr 0 Y0 `' G8 O3 N2 K
);setq
@6 R/ ^0 V/ Q& a. f
- ~6 w6 p' L6 P2 Y/ \- j J ;; Page through the selection set. When a property& f: }2 y5 z) K) i* Z% E
;; does not match, stop checking for that property.3 C' Y' b3 z3 K. J) B5 X* n
;; When the selection set is not homogenous, stop checking.
% o. ?' ~* T+ \" I8 ?- i% Z ;; If all properties vary and the set is not a type 1& L; \7 i1 ~2 \' t+ z
;; (polyline) or type 2 (attdef/text/mtext) set, stop paging.
+ x; m! K- u) N% o1 n4 F& z/ N, T4 j2 y7 s5 s
;Lets set the eflag so we know if the selection set includes any
5 f7 h- ^8 [% a+ C8 | ;combination of polylines, lwpolylines, text, mtext or attdefs.# r/ d) M6 Q: x" o
5 X5 G4 S0 r. N7 U/ a0 Q/ D" Y ;watch out for 3dpolyline and 3dmeshes here! @rk 10:17 AM 1/30/97+ g7 S! q$ z6 Z$ L0 \5 S; s% t
(setq eflag 0)9 Q/ H! \$ V. j% N
(if (setq poly_ss
M9 y+ J5 V3 Q3 R4 ^+ a (ssget "P" (list '(0 . "*POLYLINE"). f5 l7 H$ b6 u* ]
'(-4 . "<AND") 7 U: g% |& i5 j7 u$ E1 o6 }5 z
'(-4 . "<NOT") '(-4 . "&=") '(70 . 8) '(-4 . "NOT>")0 y1 U8 f+ h3 C% j1 ?1 Q5 L, t" S
'(-4 . "<NOT") '(-4 . "&=") '(70 . 16) '(-4 . "NOT>")( \3 ~6 g0 p3 h2 w
'(-4 . "<NOT") '(-4 . "&=") '(70 . 64) '(-4 . "NOT>")3 J |# ^/ D) x, Z' g; T. P5 [
'(-4 . "AND>") , z4 P7 D& | k; ~. d% r8 {
);list8 v$ |+ O% s& P7 v( _/ W/ o2 E4 z8 h
);ssget get 2d polylines (legacy and lw)
- t3 q% N/ y t );setq
* l3 w* `% D- ^% `0 b( N/ b (progn! P7 {' |- ^+ e# c; M( K3 E9 I
(setq eflag (+ eflag 1))
/ f% f8 z, B$ c
9 O F* q) T9 T) ~' \ s j (setq tmp (entget (ssname poly_ss 0)));setq
" E7 r r7 e4 Z: M. a, |& K ~' t7 d( L& A
(if (equal "POLYLINE" (cdr (assoc 0 tmp)))
4 v8 U1 v* i3 q2 J3 ~1 O2 C (setq elevation (last (cdr (assoc 10 tmp))))
: E3 e) P4 X; q5 n. d2 \& Z e (setq elevation (cdr (assoc 38 tmp)))& A# ?4 B' G5 k- f; m* D# u k. D$ R
);if
" S( b! s4 Z* |2 `! U$ m! M5 Z- ` (if (not elevation)
% U$ D% n$ ]. T2 I% j; I! t (setq elevation 0.0);setq' w! y: l% u3 E
);if
/ z7 X! `- I U% x' g
_( u3 h) K: r! K (setq tmp (ssget "P"
; i4 G5 H1 ^4 w: k f3 { (list
$ C, C2 P# J& u" {8 s( s% i, R '(-4 . "<OR")
8 V$ d3 T; v9 \ N7 h '(-4 . "<AND")
; ~# R7 d' q' p+ i) j' n '(0 . "LWPOLYLINE")- b( y5 |4 E2 J% U
(cons 38 elevation)
3 ]8 z5 i9 x2 `1 F8 s '(-4 . "AND>")7 I# v5 C: L9 D5 I1 b$ @" C
'(-4 . "<AND"). Q& X( s" k) e- D0 M8 u. ?, G% Z: G/ j, I O
'(0 . "POLYLINE")1 X4 [' W$ T4 x0 R- I# U9 P
'(-4 . "*,*,=")
4 G v3 \7 |5 G* n" R. R (cons 10 (list 1.0 1.0 elevation))0 d& U7 n# J8 u* r6 P& {
'(-4 . "AND>")
# m5 I( p# J+ e: F '(-4 . "OR>")
8 a4 U! w5 }" i9 v! c );list% h* c: `+ W. n$ d
);ssget
' _. s3 \2 X; Y* |: `0 U# w );setq! x% t5 w) f9 H
. H/ }$ F7 Y) ^7 J" ? (if (and tmp
6 y* A% h; W& ^% N (equal (sslength tmp) (sslength poly_ss))6 t- b! A- d6 V
);and
5 G4 T! O, L% a. U7 |# t (setq elevation (ai_rtos elevation));setq1 Z% y! s9 @9 L5 J! J9 s. S( M
(setq elevation "")7 v/ S0 ~3 J' e4 o
);if
0 v: Y9 {( ^7 Q* _1 A; H. |$ R; q( W& W$ ]2 }; Q6 N8 L
(setq width (pl_width_getter poly_ss));setq
/ G' m: }; v- }1 y# ^+ a9 |
9 U, \; M3 j3 Q );progn then 2d polylines and/or lwpolylines are in the HHHHHOUSE!4 w Y P+ Y& g" b9 z" c3 J' {5 Z! B% j
);if1 s: P/ \, k/ T+ @ a# d
(command "_.select" selset "")# R3 `6 z1 t5 F
" ?4 ]3 V4 b+ Q- }/ y (if (setq txt_ss
/ t9 h2 M { P; p7 \" W' S- u (ssget "P" '((-4 . "<OR") (0 . "TEXT") (0 . "MTEXT")
9 ^0 d$ R+ {* U, S) u (0 . "ATTDEF") (-4 . "OR>")); d6 c8 v1 r- D- C6 ?/ H
) - R' S- F; r8 O$ c& Z! q( \
);setq
) c! y" ? G( a! e# L (progn
+ ~/ L) p4 a1 p0 k$ B* D4 u$ L$ E3 d (setq eflag (+ eflag 2))
0 X; c& n! D3 C, P' h" L/ K (setq height (cdr (assoc 40 (entget (ssname txt_ss 0))))
' _" Y6 p- y& x) ~2 }0 n tmp (ssget "P" (list (cons 40 height))) 5 u2 c) J8 M' v5 `) Z4 F. }
);setq
7 h9 f8 z- z& `7 q! M (if (and tmp7 b$ M( v8 \1 A1 ?
(equal (sslength txt_ss) (sslength tmp))
+ K8 ~0 f% T A6 x! E );and
3 H( O6 _; F, V' k9 j! s (setq height (ai_rtos height));setq ;@rk need to translate from float
+ y& W( m0 f7 P4 F ;to string and back again easily
2 o7 t: Q1 Y% C0 t1 N6 P (setq height "");setq else the height varies
' W$ _0 |8 x: T1 K5 U$ G5 p8 _ );if
' P7 w q/ f. L$ R1 U (command "_.select" txt_ss "") . Z# E' K6 @9 l4 y! L
(setq style (cdr (assoc 7 (entget (ssname txt_ss 0))))
5 @5 [& \% A% B; b: s" o tmp (ssget "P" (list (cons 7 style))) ' A: {3 V" c8 u, W$ \! s% c
);setq & b' J& d: P/ C* }
(if (not (and tmp4 }; S9 l% @/ v3 a; X; s# P
(equal (sslength txt_ss) (sslength tmp))
- H" s6 k& F4 z4 n5 b );and$ P. A$ c9 B& U# D+ d( W/ [: _! b
);not
2 d( v/ G7 k8 I! ^1 ] (setq style "");setq then the style varies
7 B* h' \8 r! Z" {. P; Z );if% W) F6 q8 \* P8 ^% G n
);progn the text type objects are in the selection set
9 W1 {7 R7 M2 ?8 Y- g );if" ]0 l9 X3 J# a; R c; J# m V; G+ W# `3 A
(command "_.select" selset "")/ Z8 W/ s* n, L) l
" h# T( a* K4 f* s+ |" J
(while (and (> sslen ctr)
$ Z$ C0 ?- h& Z9 K/ [ go
& j& G& w4 J) U; i& g% d );and( Y# E2 a+ G& u4 Z* M
(setq elist (entget (setq en (ssname selset ctr))))0 ?8 Y4 w, v" X9 m- c7 O2 B
# ?- h( ]1 a* o( v
(if chk-col (match-col))1 D- |* b) K, F& q7 U$ J2 o4 L5 d1 C
(if chk-lt (match-lt))
, Q! z: f& G) l7 A5 o8 R (if chk-lay (match-lay))
, [; n. C- R& j1 H8 h( ^ (if chk-lts (match-lts))
: Y" [, ?9 y: X( m# z8 Y (if chk-th (match-th))0 ~& {; m1 S: I# }. Z' K R/ I
8 g2 r" j# o* `+ P
;(if chk-etype (match-etype))
* r$ k7 j& d$ T" {. p, e B
& K1 [# i4 |0 k& n" R& I% } (setq ctr (1+ ctr))
6 T; v! f0 w; l3 z' ^( ^& I (if (and (not chk-col)
" g# u0 r% ~' q+ }+ F( F) i (not chk-lt)
. \% D) I7 P2 }8 I9 g (not chk-lay)
& c% \2 o3 J/ j; R (not chk-lts)* n4 i) @& a `9 K# h P
(not chk-th)
- N, A; h( N' C2 q% q* z' i: s7 `2 X ;(not chk-etype)
7 x2 J/ ^- @ `$ }! {3 l, K );and
. G6 k6 A2 l- v9 v1 \2 U" a+ t) S (setq go nil)
& f) z8 ^# g3 a* O+ q s; U );if) q; x+ E" E' b' G" L7 T
);while: {5 I2 L. ~% G- r& ^2 X4 v& g9 C2 n
, m* ~, ?+ P# z# K- ]- x F9 K
(list color ltype layer thickness ltscale
7 e4 w# P9 A4 F7 l/ m/ s6 f width elevation height eflag ( a' B( H4 ~( Z- u
style poly_ss txt_ss
" Q( E8 O$ |0 o' d: t+ i; t )1 K7 x/ G. I* y; ]
);defun getprops
$ d" B K4 Y1 t
) I/ _2 W9 s( H ; This is a speedy little routine to tell whether the polylines in
7 ?: P1 @( s v* c/ g ;the selection set argument are of varying width or a constant value. & K& }" J$ H; h# Y
;Looping through the vertex's has to be done for old polylines when
* j9 `* g/ O( S; y* A5 P# X* G/ Q ;the polyline header has width values of 0.0. Basically, in this case, 6 _/ i' y8 E' A) C' p! G
;information in the polyline entity header is abmiguous. Width values ; w* i; [8 J& Z P1 s% Z) w' r
;of 0.0 in the header entity could mean the polyline has a constant ; h7 O' O0 J Y! F- L9 R
;width of 0.0 or it could mean that the polyline has vertex's of varying 2 T w$ P0 p- d* M l, j, q" @* I# Y+ T
;width.
, I" B4 L% m; f7 c$ t ;
: l- B6 L$ y. z! i ; It's all in wrist. Err a.., I mean it's all in the 'if'7 O2 L# H/ m, x h O- A6 [$ e
;;
# Y$ f1 ?9 D( |# H, C1 ^3 i( d' r (defun pl_width_getter ( ss / ss2 ss3 n na e1 width width_a width_b flag flag2)2 }2 O$ k* c% h) w6 Y* n- q3 n+ j% T- i
, ~7 Z% \4 k1 z7 [7 c
(if ss
% a( F: {- }& Z$ f: { (command "_.select" ss "")0 N: |% ^9 V3 X- x
);if8 r! V0 S1 P" O7 a4 I5 n, B: H
(setq width ""
6 K1 Z3 {3 l% I6 r5 R9 F$ a flag nil
8 w& J# q7 {: D2 I flag2 nil
8 g! J5 m* g) N5 P );setq0 a7 I! y9 D9 y) C' u3 V
(if (not
: m4 M+ u4 Q) ^6 V$ I/ v; E+ {$ p/ z (and ss
4 E* n4 l: k+ Z8 R7 Q (setq ss2 (ssget "p" '((0 . "LWPOLYLINE"))));setq
2 r' z# u1 ?4 Q( H/ u- x! o( @& q1 \ (setq na (ssname ss2 0)6 {9 K8 b) a! g" N9 W4 T, k
width (cdr (assoc 43 (entget na)))8 o1 O& Q" K3 l, M, V5 ]2 B2 }; |
);setq- t; T) @0 v$ t! A, P, R
(setq ss3 (ssget "p" (list '(0 . "LWPOLYLINE")9 z1 m8 k2 Z( G
(cons 43 width); V1 C) ~4 w; U. l5 X$ }
);list
4 H6 `. \: w3 s* z );ssget+ O7 y: S$ m; p j0 _- [; J
);setq7 z# @+ H# _2 u1 j& g# W. j. ~
(setq flag T)
% R$ I2 z( [6 X [0 I2 c5 w* @ (equal (sslength ss2) (sslength ss3))' `8 u% Z/ o% _4 B" O* i
);and0 Z K2 J, L8 ?7 S' |4 K
);not+ V d# x# @$ M0 \1 r1 L# f% u/ A
(progn
4 ^ Z0 w$ x" l4 T (if flag% V$ \. G2 B4 U' v" L& t, D
(setq width nil) P+ R. K9 F8 v; ?4 I' D
);if
! t' m4 J7 {5 Z' v2 W: \3 _ );progn
4 W4 [ X' `4 B6 X );if $ c5 d; k0 D( K, f7 k
0 W" x7 g. }# J, U8 C (if (not
2 l% X q$ j# U0 `9 t! A (and
! G$ O; O; d8 k+ z, d' e* R, K9 n ss
/ {( P5 Z4 U+ I, D (progn (command "_.select" ss "") , j+ R# w, E( N, T! ]5 r
(setq ss2 (ssget "p" '((0 . "POLYLINE"))));setq
: M& {: M$ z& j- f )
" @5 }) s7 I4 a2 f [ (setq na (ssname ss2 0)
+ {0 f, b; _( T4 f( l2 b- O e1 (entget na): x! b6 Z/ z8 N, v
width_a (cdr (assoc 40 e1))
$ x5 n7 x7 b# Z width_b (cdr (assoc 41 e1))
$ _. k% s' o) H) ~* z$ O2 H+ P );setq2 ~0 t% ~. R" x% d
(equal width_a width_b)
8 ]0 B5 \* W/ i: g* G, ~ (setq ss3 (ssget "p" (list '(0 . "POLYLINE")
! V0 U& x; ]' M0 t8 R5 k (cons 40 width_a)" i2 ^. k0 _& C0 H1 B" ~4 f# Z
(cons 41 width_b)& `/ h2 d* M3 E& ]$ x
);list) I6 a9 X" e- m+ I2 V
);ssget
; A2 z7 j1 Q! \; O" c );setq
8 C% l ?3 ]9 A5 P, m, _" j4 [, v (setq flag2 T)9 J' O7 l, y9 \
(equal (sslength ss2) (sslength ss3))
" u, d0 h, [% T/ y* P- h+ v& Y );and & [6 d6 C2 x) ^& x' l# s
);not ' j3 B$ v# w! S* W2 E* w
(progn
' h0 n$ V5 c3 I8 [/ H X% Q (if flag28 g: |% a" l; C0 J, e' o0 P
(setq width nil);setq* {% u6 ?/ w- d7 P$ T
);if2 M8 U, [2 ^! v9 q2 K" m1 _
);progn then
+ z; _+ U( M2 A, ^ (progn/ t, Z* U6 v) H4 V% ~! I
(if (or (equal width "")* S* q0 ], Z7 `# d7 |. r1 C
(not flag)( J1 b% B$ o) F' E! m/ O) B$ c
);or2 p7 J: ?; V* z3 W, j- o- E& [; x
(setq width width_a)( W# |7 C z& ~; p1 R. G
(progn
) J4 o! G6 x( s) Z+ z- h$ Y- k! V (if (not (equal width width_a))% B* F: M; c& m6 H
(setq width "")
' j8 O& W S! \; ?1 {3 ^- b );if 4 `* m" J4 z5 d v' t4 J! C
);progn
2 D$ }9 e: h+ s' X* D+ C7 g9 B );if7 _& q$ a4 \' r% q9 P% O9 E6 |
);progn
: d9 q% j2 ~$ u& e2 J );if
; |4 `; E& F# K* O+ o# S2 e
5 l* s8 b+ P p3 G9 u
! t3 U8 C, K# C# k ;now for the special handling for old polylines* x0 ^- x' i9 u$ J0 C
(if (and width
/ N( F O2 h2 h3 v/ n (equal width 0.0)9 _. e4 M8 ]& Q, O" ^9 P
flag2
- C: U, {8 C* e9 y- Y( f7 d: l- m );and
# ~* R. l' v# v. W6 {% H (progn! k; f4 s. k ^
$ N0 J% @8 v$ \9 M
(setq n 0);setq) u+ N/ B& U1 P! J3 F& s
(while (and (equal width 0.0), F8 y l+ {/ z3 b
(< n (sslength ss3))
0 I7 ^$ |2 X' ~- Q );and
$ K( D- p7 g' S ^/ W$ ?9 @ (setq flag nil
3 v: Z) |% J9 z7 A% O3 {2 x9 K9 H! w9 v na (ssname ss3 n)
. @& c5 L$ M3 z) z% y/ `' o na (entnext na)6 Z. z7 Q4 Y7 [6 Y V/ M7 f
e1 (entget na)" k6 K* a5 r# G4 Q. U/ O3 W# H) T
);setq
9 n; W# n& z+ Y, _ (while (not flag)
+ m1 P J9 X- e( ~5 t8 ~' t (if (or (equal (cdr (assoc 0 e1)) "SEQEND")9 V( F0 D# V. |6 a4 i; C7 Q
(not (equal (cdr (assoc 40 e1)) 0.0))
/ k$ I- q: M' M& g% J0 `7 W (not (equal (cdr (assoc 41 e1)) 0.0))% \, v5 c3 ?; v$ [+ V
);or" \; Z' y% G" ^( V. [$ l6 a! G/ q- [7 W
(progn
4 i/ N a( ^5 O$ D; l! O (setq flag T);
8 n) T0 @% A" t; y2 } (if (not (equal (cdr (assoc 0 e1)) "SEQEND"))/ T# X& I: P8 w; h. ]
(setq width nil) ! C' r: X- {! N, M" L0 C, \9 i
);if
( _ X2 M+ R0 \ );progn then jump out of the loop* k. k* r, |, `1 Y
(setq na (entnext na)3 {8 i! e! F) \2 a
e1 (entget na)
0 W) { z& n5 r3 K5 r( S1 e );setq . ^1 B" k3 N3 h2 z
);if
9 H; M$ X7 [# J+ z- J, ^ );while
& v8 d# w" D! b# z! Y3 @: H0 k6 C (setq n (+ n 1));setq ' I7 ?: V4 p" Y" h
);while
7 X1 x7 a4 s! m3 t+ v5 R: k; w# i8 W5 q
);progn then it's a legacy , ~* D4 G8 H/ k( W) M
);if ;legacy polylines that may have varying widths ! k9 v9 Y+ k3 N/ ^7 S
5 s( P5 m X4 @ n (if (not width)4 O3 X4 D0 g0 A0 ^) p# `
(setq width "");setq: G1 R/ O8 ? |9 O: v- h6 e
);if
6 O1 L+ l* m6 M0 B8 @ (if (not (equal 'STR (type width)))
5 _. y. \: T8 m4 G; r (setq width (ai_rtos width));setq
- A1 a6 m) O, Y. i8 n* F3 x. v );if
* q5 F( v! d# v, U
0 R7 `, O1 T" T( L width
& L& x; }4 W5 w );defun pl_width_getter1 ~& l" V- y6 e/ Q Q2 W' `
: ~! ] v3 u7 Z9 m" y
5 b3 B3 z: u! n# J# A; F, Q; D (defun match-col (/ ncolor)3 Y; t5 X; O& O( ]/ \0 E
(setq ncolor (cdr (assoc 62 elist)))
' f' t% F& q. Z4 _# ^ (if (not ncolor) (setq ncolor 256))7 W) G0 ?( ~6 K( B8 x p
(if (/= color ncolor)" B! f) v# I5 Z! |0 k, e7 w
(progn
. b+ g B; K6 v (setq chk-col nil)1 N" M5 A M# w, Y' s0 ?" U1 ]
(setq color nil)5 m' C$ @2 h3 X( i% {% k; k
)
3 N/ O( h! |5 Y )
% y4 |) U; u+ }7 b. Z8 Q )
# [. K/ D* m$ C8 _% Y! _+ A4 n* x/ L1 A; `0 d
(defun match-lt (/ nltype)
$ v5 c2 D! X) `' E3 F& |! h, o (setq nltype (cdr (assoc 6 elist)))
8 _' l$ N3 [1 e: g (if (not nltype) (setq nltype "BYLAYER"))8 T: E: h$ R. X3 K( D: N
(if (/= ltype nltype)
' p/ }3 J1 k7 Y7 M0 z (progn
4 W% ^- t* n$ d (setq chk-lt nil)
; p2 Y2 Q& c) }- R% \- `5 ^! F# ~ (setq ltype ;|MSG0|;"Varies"): z+ z( L& Y x, t- B
)! Z4 V% E7 L1 w: B) C8 N# q
)
. m4 M: q/ l' G, ~1 e9 H )
$ [$ ]" x8 t" r2 K: t( T' Z R9 g* Y& P) ^) G( F" U6 \! K
(defun match-lay (/ nlayer)
2 X+ x' v0 ]4 C) T (setq nlayer (cdr (assoc 8 elist)))) j2 v$ } m7 P1 o2 ^$ H
(if (/= layer nlayer)
7 ?' @4 ]# |# r( r+ Y6 o) y! l (progn
2 w* U) F" p, @ (setq chk-lay nil)
, E8 |4 R0 J: M; O( [ (setq layer ;|MSG0|;"Varies") l6 _( t. g% p
)4 Z! V* l! z+ H$ E# H9 ^5 F6 a
)4 J( s) r6 ?. a, s
)! x4 V: m& K; O1 z6 m
2 x4 ` v' D# K6 S1 p% o9 F
(defun match-th (/ nthickness)
$ P" l: }4 M6 Z9 h, i (setq nthickness (cdr (assoc 39 elist)))
8 n) F C" @' l9 F/ ~1 J& h% ? (if (not nthickness) (setq nthickness 0))
& S- @1 e5 j1 G) a& H$ A (if (/= thickness nthickness), F% W; a( C' e, z; T2 ]
(progn
7 U6 q4 Y1 k- s, f- a& r) v1 a* a (setq chk-th nil)
6 M7 H9 ^2 |" p! e (setq thickness ;|MSG0|;"Varies")
9 D# J9 X" w) s7 J N+ d )
3 S l \( S/ N( n& J )) t( |/ ?. w% n( F6 B; O( i7 Z$ N
)
4 c3 c+ o" D. U8 A& g, m- B$ r( O8 N- r" B
(defun match-lts (/ nltscale)8 B2 r5 m( O* f; c4 I+ b3 r8 M7 h! i
(setq nltscale (cdr (assoc 48 elist)))
' }( H/ W/ V) E" c! x (if (not nltscale) (setq nltscale 1))
' g% O- c* g. n+ r (if (/= ltscale nltscale)$ K& w, p& @2 `
(progn# |; M! u' g' M# N j
(setq chk-lts nil)
4 I: M4 o# V1 }2 m# x (setq ltscale ;|MSG0|;"Varies")2 _# `/ q% i: N* `
)
# D. P$ t. G/ C0 D( o' r1 H" B2 q )
4 b7 ]2 h& N5 G5 D m2 R4 h )
% Z! G- s8 h L( f y' r# L# a: P& {. D
;;
0 p0 @0 D0 k0 p% @9 {4 H0 c ;; If an item is a member of the list, then return its index number, else
: d4 _% }3 f( g6 ~# k: }6 s ;; return nil.
, A+ \: K& U3 n; M+ I, w* l6 W ;;
?% r4 J- i# {& j (defun getindex (item itemlist / m n)% q2 f% w' @' Q$ i5 _ z
(setq n (length itemlist))$ w0 @# l, S, @# T5 ^& [
(if (> (setq m (length (member item itemlist))) 0)- K }0 X" n8 _
(- n m)
! h. P8 N& B( j" Q( k: h7 ]/ a nil
7 @8 ?0 J% S j) T+ \7 v% l. d )
; u& _( Q5 N0 {" H )5 V3 O$ f3 z# `
;;6 B1 v6 z4 |! e4 G, l
;; This function is called if the linetype is set "BYLAYER". It finds the" C- q4 m+ K+ M
;; ltype of the layer so it can be displayed beside the linetype button.
9 Z: e& C% Y. y( C6 M; n ;; F% x% j. x6 s- A4 q3 Q
(defun bylayer_lt (/ layname layinfo ltype)
1 v+ g2 ^. }! H4 i; p. r" `% W (if lay-idx
0 t/ }# F5 z1 Y$ e: W3 \" e+ q (progn: E) e- n* E3 x7 H
(setq layname (nth lay-idx laynmlst))
" G0 i8 [( P3 @0 u' ? (setq layinfo (tblsearch "layer" layname))
2 I7 l: ~: a; [7 p8 } (setq ltype (cdr (assoc 6 layinfo)))* {8 v" ~1 B- Q; h6 ]
(strcat "BYLAYER" " (" ltype ")")! y" B' h k8 H8 N/ |9 d, g& `7 }3 `
)
6 `5 Q9 g! J2 H5 H "BYLAYER"! _- V1 v2 M n9 G$ X, ~+ _
)' N7 n* f, Z1 p
)0 ?$ T; I) @/ s
;;4 r6 X1 N. I, [0 ]/ G8 @, d: r
;; This function is called if the color is set "BYLAYER". It finds the R9 H( u7 g4 }3 z6 p/ g! F
;; color of the layer so it can be displayed beside the color button.
+ q5 `. f' y' m9 z ;;
, k1 r2 T: S0 e* ^* Z (defun bylayer_col (/ layname layinfo color): S3 U' m! k" i% u) r# S
(if lay-idx/ H) U! |/ Z6 e! w4 b/ E
(progn
$ E* k! d! L4 V" { (setq layname (nth lay-idx laynmlst))
/ b0 Q2 C6 H% v; l) h$ y (setq layinfo (tblsearch "layer" layname))2 d$ [" ^* N7 A' t# y, y
(setq color (abs (cdr (assoc 62 layinfo))))1 E, G3 @5 u3 U" U
(setq cn color)2 _# B5 O( V$ P* Q
(strcat "BYLAYER" " (" (colorname color) ")")
* E( v1 `+ E5 u$ w )
6 v8 @$ v7 s. Q1 ~ (progn/ h$ @2 }1 v$ O9 ^: u6 F
(setq layname elayer)) |1 v' Y _( M& V/ c( j u
(if (and (/= elayer "")9 r$ I0 O J+ m% K0 ]9 p) h- y
(/= elayer "Varies")
" N& [6 D$ I% N2 y3 F! u, f );and; F4 O& {$ V9 }7 y5 F$ U
(progn
2 J( w! b3 p) B+ r+ _: G/ y (setq layinfo (tblsearch "layer" elayer))8 \) c3 ?; |* R( H6 ~
(setq color (abs (cdr (assoc 62 layinfo)))); H* `: r0 a8 ?" P* \: `
(setq cn color); A0 L {# B" J/ J" E4 j* w
(strcat "BYLAYER" " (" (colorname color) ")")/ |* |5 M3 g" u. U# y8 J- b; ^
)
6 T5 v- M& u' k+ X5 c' t/ j (progn: P7 ^) _- E$ V* W" I
(setq cn 0)- ~: }; y4 S/ e) a
"BYLAYER"
' m5 c5 ?3 U! O' a' W )
% P/ T9 D/ s5 [- h );if
C# i, a# E5 k, `. j" r, F0 | );progn/ z$ U2 i* Q1 S5 n' Y9 i
);if
% T( J7 l; h( O, v- R. }+ k )- {6 Y% N! R0 ~4 V5 b; f- @' H
;;' g9 B' K! q+ b; k( k7 Z
;; If there is no error message, then close the dialogue) z; C6 U2 t @* Q
;;
2 x) g7 H' ~0 w9 `9 N% L: W0 P ;; If there is an error message, then set focus to the tile5 C% Y$ R2 J. b5 }9 s2 X6 I5 R
;; that's associated with the error message.
, @2 w3 [4 |) b! J- ~% z! C- b ;;
. z) q. c4 n4 t& u (defun test-ok ( / errtile)& h2 n. j, N/ S" H* Q: U# ]
(setq errtile (get_tile "error"))
" ?3 s1 q) l$ Q( \- E (cond
$ l; I$ _2 z9 m0 \9 w; f6 J7 z2 H ( (= errtile ""): O8 T, b4 G6 G8 r
(done_dialog 1))6 s5 K6 `5 U7 w+ H5 Z% g: y6 L
( (= errtile "Invalid thickness.")" b! h4 N" L$ g1 @
(mode_tile "eb_thickness" 2))
0 K1 t+ M8 O4 F8 X( G7 w )
. k" x: ?( I$ } ), p5 P; Y8 B( y' p0 x* w( x v6 X" y
;;
8 @' d, ?1 b% X* r ;; OK in main dialogue.
: E) P9 i* l6 i( q4 G. z! H ;;1 r9 l" }& G: y) o5 l% L- N& k
(defun test-main-ok ( / flag)
1 n/ }( s* |9 k( D' ?! Y( I* e4 D (setq flag T)
. ^; P& x+ y; [) t9 w4 V1 h (if (not (or (distof (get_tile "eb_thickness"))2 U( u$ u1 W3 M& w# C
(= "" (get_tile "eb_thickness"))
! z+ P# R' T- ?% n p );or3 T% c% I3 j. G) V
);not
& A# X! X& B2 W (progn4 P1 D9 @ u* Q0 e( C
(set_tile "error" "Invalid thickness.")
2 K9 ^+ v1 P/ O+ x (mode_tile "eb_thickness" 2)3 p V% o0 {0 q" q/ F# o6 ]
(setq flag nil);setq7 D, f* D3 L m7 m3 ^6 B
);progn9 n2 u; P% u6 B* r7 |7 Z
);if" L; ?% C5 \. u8 \9 I: e* Z
(if (and flag
) P/ M! G1 o9 H/ Q. `$ \9 a# E* K (not (or (< 0 (distof (get_tile "eb_ltscale")))
5 k! ^0 j# c: ^* c# G (= "" (get_tile "eb_ltscale"))' V" Z* G" {3 L$ C) v" r
);or
8 W+ ]6 @ z- C) l8 g );not
2 Z2 g! G4 q4 Z5 P );and : T; }* a5 Z' @! o* Q8 X# ]! f
(progn
! O$ j9 D$ R/ w7 w# U (set_tile "error" "Invalid ltscale.")$ A" \# c8 M8 o+ X4 b
(mode_tile "eb_ltscale" 2)0 E( i T6 c4 k0 \6 q& G
(setq flag nil); ; v0 p: K z/ a8 ~6 I0 Y
);progn then
3 A! ]! B" G/ h5 m B& d! O0 ~, B$ [ );if1 L0 \" P# p* F9 S1 B2 S! e
(if (and flag! D H3 `+ R- b, _* n& r8 Z$ d! J
; Don't test the tile's value unless it's enabled.) z8 g4 P1 j0 p' }& C
; We're not set up for the display-only value
" a3 |5 B" h/ z& A5 [, m6 M ; of "" here in the error handler.& I% t y# c: ^6 p
(= 2 (logand 2 eflag))3 J3 |" l8 F! U
(not (or (< 0 (distof (get_tile "text_hgt")))' b% R! r3 X" L- Z- C
(= "" (get_tile "text_hgt"))
8 L2 X H d& x2 e+ Y );or
5 j, h3 }2 r6 U+ \" N+ f );not7 R! W" ~" q* G5 y: q0 U+ p! Q
);and0 S: {( a9 g) G8 h9 M9 h# m
(progn$ h3 ~& e0 ?: s! z; K, j' b
(set_tile "error" "Invalid height.")
( ?9 p$ A2 c2 y (mode_tile "text_hgt" 2)2 R% @5 B2 n$ [6 u2 L/ n# r
(setq flag nil);
0 i0 U" o1 K' L* F _ );progn then
( P$ Z" I* {; W6 u8 f: ]1 U. g/ X );if" _# b y, r% ] ^" M
(if (and flag1 l( {( d+ g% b1 S% i7 l8 g, H
(= 1 (logand 1 eflag)) p: P! d: {0 `& p/ }6 S
(not (or (<= 0 (distof (get_tile "poly_wid")))8 d( Y( j) K" l/ D0 D
(= "" (get_tile "poly_wid"))7 C1 U- m- B. J
);or) t' |9 H1 n3 s# h: Q- y+ W
);not
* d B5 Y% z! R/ c6 }8 V& q, ?) O0 _ );and4 _+ [1 T* h' i% F# X4 R: Q
(progn; I- a7 p6 @, M( k. |# p
(set_tile "error" "Invalid width.")$ v, u# l5 k; l
(mode_tile "poly_wid" 2)8 k0 ^7 e, H' W0 ^. l5 g$ t; h8 z
(setq flag nil)+ q/ N5 `" ]( H+ U0 G! m" c
);progn then
v( U8 T" Y7 U );if % W& ^: H w0 t& y( i
(if (and flag
* `) p' w, S# g* _ (= 1 (logand 1 eflag))
/ M1 ?# ?5 U1 H& \ (not (or (distof (get_tile "poly_elev"))
* D7 |* `! J8 W1 S! t (= "" (get_tile "poly_elev"))
* o- E4 |# [7 |% u );or* b- R# h" U) e
);not
* W U6 c" q$ d; @ d );and
. R/ |8 T0 q# h (progn
4 S- W, D/ E/ t" ~/ z& ]) p! H (set_tile "error" "Invalid elevation.")
1 C3 O; J9 a5 P9 p (mode_tile "poly_elev" 2); ]& i$ J, u" d, L
(setq flag nil)
& i- D9 d: W, W& E, G/ [ );progn then4 G/ _+ x+ N: w( Q* [9 `( ~) p
);if ' `2 ?; p* I* \# v
(if flag
; C# w: Y# p5 i' k* @- J9 f (done_dialog 1)4 \/ w% J: z0 T
);if4 j8 K) \0 M" u+ h
);defun test-main-ok
* c7 ]4 D- W9 i& n: g5 T" Q* u, ^9 a: H& J. h
;;# q+ d) G: S0 h
;; A color function used by getlayer.7 `# |3 b7 b* Z: t
;;
: a$ ^% j5 n& C( } (defun colorname (colnum)
8 I9 ^! _% g. k; n# x& E" x (setq cn (abs colnum))1 v" u# @6 S. O7 y/ \
(cond ((= cn 1) "red")
: l5 g5 V* i* h, ^2 z ((= cn 2) "yellow")
: S" m! W8 d% H5 K: `% u/ r ((= cn 3) "green")
# h( ^7 l2 {5 M6 H ((= cn 4) "cyan")
8 A6 S& H( g3 O2 s7 D6 s1 u( q ((= cn 5) "blue")* |7 V/ z1 V. ?$ h Z% @& ?- X: ?
((= cn 6) "magenta")
! X% k U$ D# F ((= cn 7) "white")
) o* [; O/ _8 G: U! w# r (T (itoa cn))
' I2 ]( H& Y5 o, K )8 ~+ ?9 l! p3 O$ y9 f- z! t$ L
);defun, n9 T3 t6 G0 m7 o
! D u0 [- l. j' }; f/ ]% y/ B' u* @;;; Construct layer and ltype lists and initialize all1 F8 {2 _. [% C2 ~* o$ {
;;; program variables:
3 T S* D# m6 H4 y
% R& {- h. ^4 ^% _" ?& s; (makelaylists) ; layer list - laynmlst& N+ U1 B$ Y7 p! F5 ~
% h5 n9 S; X+ f3 B
& w8 a! X% [0 h2 h' A
(makeltlists) ; linetype lists - ltnmlst, mdashlist' ~, ]& x( j' C( Y
7 h2 K0 i. j; j- q- v% a2 Q$ {& O
;; Find the property values of the selection set.
% O+ u9 A& O8 X" g Q. T ;; (getprops ss) returns a list of properties from6 [# _% X; q* J9 V' V$ @/ Y
;; a selection set - (color ltype layer thickness HEGHT STYLE WIDTH).6 ?2 p1 ]5 U* {2 C8 [
: Y/ F0 D, N3 {" @+ G. F
(setq proplist (getprops ss));@rk interesting things happen here
1 d9 c) V8 v2 }5 S- ]) \/ u% \2 Q% b9 C8 H* j& ?
(setq
% l. V2 D1 a0 ?( y) d% N# a ecolor (car proplist)
" ], l( s8 o2 X% P$ x% \ Y { U eltype (nth 1 proplist)$ f3 E6 a8 @3 D! m& J. s9 m% y' V H
elayer (nth 2 proplist)8 O3 v& \7 ?5 l1 l0 H
ethickness (nth 3 proplist)1 Y2 W& {( @" j) I/ V4 R
eltscale (nth 4 proplist)
* g5 ? n* ]5 M# u, } ewidth (nth 5 proplist)
K* [- ^1 \7 O6 J; a M0 \ eelevation (nth 6 proplist)
& i& N" V8 i, J; ~/ D7 { eheight (nth 7 proplist)
$ W8 Q% O$ u- y! e) F8 E ;etype (nth 8 proplist);commented out and replaced with the line below. RK.1 b+ ~, z$ k1 k- i/ A8 j( x# ?4 L
eflag (nth 8 proplist)% Y5 M8 O; U( T: I* }4 b
estyle (nth 9 proplist); J) ^9 ~0 K: ?6 d8 E1 e$ P8 B& Y" Y
poly_ss (nth 10 proplist)
/ t) t* ^; u! }6 A txt_ss (nth 11 proplist)# c0 o8 y0 F+ {
);setq
9 L* ?4 n( A/ W: I) U' {
! L6 {* Z6 ?7 U+ H ;; Find index of linetype, and layer lists
' B4 A- U! Y. K3 o* ? (cond! T, i6 f- N: l
((= eltype "Varies") (setq lt-idx nil)), x/ O! U6 q. v+ H
((= eltype "BYLAYER")( l( U1 y& @ w! k/ V+ A
(setq lt-idx (getindex "BYLAYER" ltnmlst)))' [' t6 H; Z& y D; G
((= eltype "BYBLOCK"); G1 L! I4 L. P5 i, D
(setq lt-idx (getindex "BYBLOCK" ltnmlst))), B+ I$ ~! `) A# X% |' D3 K
(T (setq lt-idx (getindex eltype ltnmlst)))1 h+ P+ }( H& z" F" h
)
, R$ W1 x4 W: w8 Z$ O5 \ (if (= elayer "Varies")# U0 n$ v/ s9 j: r M: B
(setq lay-idx nil)9 U7 r7 w# j: v X& _3 l& U2 T
(setq lay-idx (getindex elayer laynmlst))
: O( e; C2 W7 e. X2 e/ V' w3 \ );if' d/ @9 d) H- G {: X p5 l
(if (= ethickness "")3 V; f9 {) |! \
(setq ethickness nil)# d! m: d/ m+ ?( W' ]; U: _
);if
! z" g1 D( \- n% P (if (= eltscale "")4 c. W" l, D# {, t/ @- [
(setq eltscale nil)
2 r2 R! M" i5 Q );if S4 F( m5 {3 Q$ \# Q2 J
! o3 D6 M0 W& T8 R g* ~ ^
);defun ddchprop2_init ; end (ddchprop2_init): ]) G% x+ T: m V
8 {" ~% |6 h/ V( N' ]/ C8 o
;;; (ddchprop2_select)
! ?% ?) Y; U, G9 h( O. L; u/ F;;;4 O4 Z9 V- U4 X
;;; Aquires selection set for DDCHPROP2, in one of three ways:
* J& E9 Y& r, W3 m;;;
% i) R7 `( ^! n; A;;; 1 - Autoselected.9 L* m% n( K6 t3 i; k3 v
;;; 2 - Prompted for.' o+ Y7 h# v7 Z B
;;; 3 - Passed as an argument in a call to (ddchprop2 <ss> )1 E* h9 L1 P7 a8 z$ f5 ^
;;;+ E& ~ a+ U, h7 H$ Q
;;; The (ddchprop2_select) function also sets the value of the A. u' a4 I0 t9 d6 _6 d8 _0 Z
;;; global symbol AI_SELTYPE to one of the above three values to
4 I% ~0 j: R# ];;; indicate the method thru which the entity was aquired.
d: ]+ X& y1 c
% \5 [- T/ b/ @3 x5 g, K* m- |
9 O0 d$ y" c0 A4 R(defun ddchprop2_select ( / )
3 J, C3 m# v+ S; |3 c5 J# g L
. d0 ]' A' n% j/ b0 E# Q$ E3 P: {( Q. w/ G9 P
;returns only entities in ss that are in the current space. 9 T! d3 [' I) t) C: }: {
(defun ss_in_current_space ( ss / a cur_space ss2)
8 K, z5 G5 R2 g( z" K# d
+ e3 X2 a1 {# S7 ?6 [) |) [ (if ss: t! w; W1 g) }) Q( n
(progn* D0 i X8 q! z+ L f+ e+ ~
(if (and (equal (getvar "tilemode") 0)
: D0 P r2 W2 m3 w$ V (equal (getvar "cvport") 1)
" T% s/ N& S( _! w- I8 U7 a );and
`; X& j5 r1 b( g5 _9 ^6 ~7 G (setq cur_space 1);then paper space is where we are.% @% Z' o$ s" J4 J' t7 b4 J3 e l
(setq cur_space 0);else model space.
& u- v; a. x( i- s/ V% T );if6 f q& s# o) X/ k; D/ j
(command "_.select" ss "")( q" S" h2 T. T3 d A
(setq ss2 (ssget "p" (list (cons 67 cur_space))));setq
0 `- {/ l4 _+ P (cond ;;;;;tell the user what's going on.
7 G* }2 B3 ~. _# x% x ((not ss2) (princ "\nNo objects found in current space."))
8 I& @ e* L2 g: W! Q+ { ((not (equal (sslength ss) (sslength ss2)))
, P/ p: [! x' \/ Y, ^# Z (princ (strcat "\n" (itoa (- (sslength ss) (sslength ss2)))
- S4 d, y) K; N6 n3 g' Q " object(s) were not in current space."4 l+ x9 ?+ w" V K9 a$ H
); L0 {3 N, }3 v# J
) o: I! K' ]2 w1 r
) , y. x7 R2 k- `" V/ I6 J" K9 n
);cond + Q0 U. I$ o" ?9 P+ G5 y, ?
);progn then
; V2 n' d8 p' B1 @6 l );if ; n/ U; N% P: g3 @( {+ L
ss2) Z& P% i' z+ N9 S1 p
);defun ss_in_current_space
6 d0 f9 O* ^$ t2 ~
5 p4 k$ t* u5 ~9 G# l+ y/ r; J7 C. ~3 ~0 U
;;;begin the work of ddchprop2_select
2 z- c5 t( N8 {6 I& e+ | ^% E! a' ~+ R- T
;; temporarily restore original highlight setting.' d$ n& r" m& ]: J' o0 \( Z; V/ _! X
(b_set_sysvars (assoc "HIGHLIGHT" (car bonus_varlist)))
9 j* s5 R5 i H2 T (cond
1 m( @9 V- T l; a0 m ((and ss
, l" w4 K1 q7 f% ^6 p (eq (type ss) 'pickset)1 w$ k; g9 Q/ }' m7 v
) ; selection set passed to+ t2 m# a% \6 q f; X
(cond ; (ddchprop2) as argument# v3 }. Q7 r3 g" U" X, c
((not (zerop (sslength ss))) ; If not empty, then+ i# U; ]8 q/ t( u
(setq ai_seltype 3) ; then return pickset.( V" @. F* j+ N0 E4 W( I* X
(ai_return ss)
: ?7 Z2 W1 p3 v' S1 D( j )9 P! `8 p6 K: x8 Q9 b2 w( e; N4 ^( |5 n
);cond close
# N! G/ S% E( v% z# \" [ );cond #12 n6 w; B3 O) ~! Y, v
((setq ss (ai_aselect))) ; Use current selection4 e: N) f. Q$ O# ] s
; set or prompt for objects
/ D0 G8 G. w" H0 y6 P (T (princ "\nNothing selected.")
8 K! W2 |1 m2 [& g# v (ai_return nil)7 k* ?( S9 R; A$ ^$ t' y
)
5 |# N% d9 Z5 u# w: ~; }/ C );cond close
* ?$ X3 } A4 [6 g& A* C+ ~ (b_restore_sysvars): p- `, i$ w! Q" h+ d5 e
5 q3 O4 B9 ` q @7 R5 S ;(if ss0 Q" a# l8 [, }2 ^( W
; (setq ss (ss_remove_locked ss)) 2 `. J) y8 q7 b* G; B* N% e! a1 a
;);if* d1 o1 Z! E: F, ?( A$ d
(if ss
2 O& o K, [- J- S! G: B- i) ?7 n (setq ss (ss_in_current_space ss))
+ |9 J" p! M6 ^- @! m6 @2 _ );if: t6 [9 ^& c3 Y
! J, l( \) l2 l) w ss
p" `+ Z: ]' s0 B);defun ddchprop2_select
5 b7 k5 X9 z) Q6 i, F! M4 n9 k0 z. K% J$ C& b+ q% \
3 n( G# H! K7 j6 X;;; Define command function.
! D% C" j5 t) m& X1 F, N(defun C:CCH ()
1 K& Y* v' z1 ]0 N (ddchprop2 nil): E3 y: H* o# b7 J _8 `) S
(princ)- a: C: U! E& T/ g! `2 `
);defun! w7 P3 a. U3 @0 \# O9 ^
* {8 x- M( h8 p* h
+ {2 B* l% @9 a. I
;;; Main program function - callable as a subroutine.
# x, d" |3 q. u" ? ?7 t;;;
3 e9 a6 z. _/ @& [; S0 M;;; (ddchprop2 <pickset> )/ O: i* D, q% ]4 t/ o) u# d
;;;
* Q8 o' K1 y; k) }* V- Z& |2 I, `;;; <pickset> is the selection set of objects to be changed.
' w6 _- \" K# U5 e0 m;;;: l7 _" [' X# T, d4 h$ P% k
;;; If <pickset> is nil, then the current selection set is1 _- e9 i7 o: q5 l. M
;;; aquired, if one exists. Otherwise, the user is prompted( Q4 H; c" G- q3 I
;;; to select the objects to be changed.* M8 X2 d, j3 n
;;;/ Q4 r, S' C. O2 b
;;; Before (ddchprop2) can be called as a subroutine, it must
4 }" I2 U3 `2 v" Z! r* b& z: [;;; be loaded first. It is up to the calling application to
7 Q0 ?5 X& Y# a& g) R2 o' H5 ]' ];;; first determine this, and load it if necessary.
8 I$ t, G& v( i! t) f, S- K% \( ^/ G5 P, a `4 t' S
(defun ddchprop2 (ss /
7 v- ]% L$ C' l$ b4 p, F+ M! O8 ]4 r' |* Z/ r" z; e
a
; n p8 C, p7 W1 ^8 Y+ G' b/ V! O add-mdash9 i9 S/ `* j0 p, A" s& D
assoclist9 R4 f% F: O3 i
bit-70. N- C/ y" x! z7 z6 u ^9 J3 q
boxlength
9 o0 w" l* T. Q# R# e7 H$ s bylayer-lt, E: Y$ d' K4 g! k9 A
bylayer_col
4 l9 \+ i4 S1 r" X# x bylayer_lt' a* t' d9 C8 G; X, M3 b
call_chp2/ \9 O5 N" b& q4 |2 D4 r8 r3 ~. U
chk-col
* O3 @2 D, q9 G/ x3 q4 D' x; ]2 N4 g ;chk-etype ;var removed by rk
V& s, O1 D2 g) j" s- [' K4 s% N chk-lay + L5 }9 i( i6 H: Y2 k
chk-lt: p& L7 M: t- m+ j. x$ z4 H# Y
chk-lts ;var added by rk
( f9 |) x5 n8 @4 ]4 U9 N* \ chk-th- s: r, y- ]/ ^- \2 t, u1 q% S
cmd v e0 c" I+ R+ t, H( p
cmdecho( L$ E6 h+ {6 b- S( {
cn
! L9 v; ?% q; E: j9 x. ^ cnum
( W3 y7 M# q: s* q col-idx$ e4 x3 I- H1 N6 N, X
col_def
# M+ ^( L3 U8 U% g& r+ z col_tile1 J8 [: K4 n8 q4 w
colname
' I' _: s' S- k: a3 c colnum
5 X2 p9 T) T" ^, C2 X color
; j. }1 \/ ` s. V4 b# u colorname
3 q& k4 q3 v! A$ t+ _# e' M cvpname
3 A0 F# a" r# f+ X& m S7 I0 i9 z8 n1 [ dash
1 l. c( g: F; { dashdata: h2 H2 c" p: I# I5 `2 z: R9 m
dashlist: |4 o+ q8 Y; {) F1 {- w% X
dashsize
0 x" p3 C$ }; J6 @+ y$ @% a dcl_id
4 o6 o9 M$ u, ^5 J; Z ddchprop-err
# v, H* s0 d3 w5 m4 `. f drawpattern
$ k+ F7 ~! P" X1 c5 l ^ ecolor2 H) w4 K* \: `' o
eelevation
6 }+ P( w0 O# P; Q: ]5 } eflag. K4 x* \6 Q! T0 F, w
eheight
# n- f" c$ [4 W: M( a6 S elayer
+ z$ N7 c, _/ l# e6 h$ k elevation
+ D8 v% Z8 t/ B1 a9 Z elist
* @" b8 `; M7 j( g& Q1 _* H eltscale* I5 l/ A: x9 ]* y
eltype' A. r( d0 G% d5 m5 w/ ^
en
* A5 r) L; P1 [- B+ d ename
% G/ V2 m' h, O9 }+ x ESTYLE ;var added by rk2 F8 O( A" e% |- O; ?* O$ H9 N
ethickness
" t( u4 U1 S# A3 B ;etype ;var removed by rk x6 b! P& @7 _/ Q5 Q
ewidth
8 o- q6 x5 B: e5 c& {1 F) p: C fchk
6 E7 B, V# t* m frozth2 e# c! M8 |/ X& j0 F+ w
fx
0 {6 g5 y) i* Y7 a+ r getcolor
* k6 H0 H" ~* [2 A7 A, N GETELEVATION ;function added by rk
' g+ Q& z/ g1 n* o5 A: ~) l! C GETHEIGHT ;function added by rk
' t( k. T2 x: ` getindex
9 m% L$ G- d7 e( P9 B$ r getlayer
Z* r- `8 f+ A _& X9 k ;get_locked_layers ;function added and then removed by rk # u7 e; x( E% ~
getltype4 v# ^9 t6 x& F# ^; l* R( C
getprops+ p$ z1 X4 p0 {6 E0 O( F
getscale ;function added by rk& ?: c6 k8 l' l7 S4 m; u
GETSTYLE ;function added by rk$ B, @ N# ]" _) V
getthickness0 E- v% J+ h4 l
GETWIDTH ;function added by rk8 s4 b+ u2 b7 \( E0 r4 {
globals8 O5 s/ A' J& i8 v5 @
HAIR_STYLE_LIST ;var added by rk
8 k: p: d3 i- c6 h. j, _" p& e height
! r) M( i0 A4 F% H/ x7 ^4 ] index
; q( s: g* ?5 J item! m/ ^# r% X" E6 F; a j
item1
! \* r" p" y3 l# z item2
/ d: e4 M$ a* c. I* H itemlist1 X5 c. v- b- C/ ?
lay-idx
1 o) g8 y' ?4 ~ layedit_act h& x: l8 J# Z% I' Q( y
layer
+ x V# d# G5 `* `. ~* ~% \ layinfo
, E. y6 e) `6 H: @9 T+ Z laylist
% m0 G7 K9 ~' t1 T3 V laylist_act7 M# |. n8 f6 C: K' P6 _
layname
8 q4 w, I9 M) `, ?. Y. n laynmlst
8 G: F3 T6 }" P b8 o# R8 z0 z' F layvalue
; ?5 }- @/ T+ e. c4 t, m linetype* d b8 D9 }# b) W. r( S
list1
/ w7 S) {+ P L% K: @/ T longlist
. g1 v- u) ~* T. _9 q2 o, H/ i/ @ lt-idx3 p# N0 M/ k) d, w
ltabstr& z. g2 d. _. b
ltedit_act
+ O. `9 G0 O% s$ L' y0 C ltidx
' |- S& E6 Q! ]1 b4 a1 ~ ltlist
4 l5 d5 w3 ?4 o8 B. X& W ltlist15 }% U' s% g. n# A$ U6 h
ltlist_act
M; I% k5 e! P ltname- P4 f+ a6 y. i
ltnmlst
' p. j+ Z( e; ]6 D ltvalue D4 |" c1 X( x
ltype
3 w3 [* o" I8 `; g; |& f$ y m: v5 m- F* n2 H' [' }& |
makelaylists/ a* G; [/ f8 J& z, V4 L
makeltlists% [7 F2 q8 p& ]. q% p9 W
match-col
. k' M* Z& I# _( j* Z% A- J- a ;match-etype ;function removed by rk* o" e9 e+ m L! o9 {% }1 X! ^
match-in
! m4 \! C7 C+ I8 F# E* X match-lay8 i7 O5 [' [! r
match-lt/ {# i. Z; `1 M9 L5 M0 B
match-lts
6 }6 Y! \0 Z' Y* p) Z match-th8 o# {9 \! \4 p1 L- B
match_col$ y2 |, a. h- R7 m( C
mdashlist
; q) V3 I, S# |: ^ ;MPOPLST ;function added and then move to ac_bonus.lsp by rk$ t7 m# H- |* w5 T
n
0 Z* T, m$ T) |0 v; w$ e+ m! | name
7 [8 x( k$ M$ \. T7 ?# u9 I ncolor) m4 ~0 R( \7 V' T; }6 [% K# ^
nlayer9 g! p2 o+ F ^' B# e* R i
nltype; b# }% f( k: c U5 }
nthickness
7 w* X$ V) p n0 h off% k' V) ?3 P% D6 @: T7 K- f8 k
old-idx
^6 D9 _6 J* S1 p olderr( ]2 w# u( p& |7 d6 U
on3 g1 }1 i# [$ e+ y. G
onoff
9 W# l: u" Z; E; M2 s+ [ patlist7 m" x. _. ]- W7 s7 P0 z
pattern: _ W# y; l* e
PL_WIDTH_GETTER ;function added by rk; L1 f% S6 N( l1 o" e: h: k
POLY_SS ;var added by rk( z8 J! T j, U' v+ U: `& I
;POSITION ;function added by rk and then moved to ac_bonus.lsp& R/ A6 l3 S+ [) q) b
proplist
. D; E; v C1 f7 t reset-lay9 L B( S4 ?0 ?8 ?* B% O1 ~
reset-lt
; F, L' S8 T% r9 { s
( r' h5 P" a% d; L9 ~ selset
7 P' d3 V7 F0 `( N5 V set_col_tile5 q: ?8 b8 p5 e* Y2 t; x
sortlist
1 G6 ?' B7 T) _7 U ss
% S1 m- D4 ~% }5 y( ^7 ^5 q ss_in_current_space ;function add by rk.
5 e% _, B3 o- j ss-index/ z. Z2 a3 @7 I% j2 k
ss-length
- Y. X2 j1 U3 Z8 h$ S# G# c ;ss_remove_locked ;function added and then removed by rk.* |6 M+ o' J6 R, W
sslen
. r# X- R' U7 q7 }+ H0 Q5 Q6 b temp_color* M/ K" f! Y- w& J! X
templist; g. r3 ]: I( ^3 p
test-main-ok
: n+ a7 U; ?: Y) { test-ok) M4 F; Y* `. y. _& H
testidx
& {6 c2 X4 _6 @, l2 V testlay$ F* F' q: \- d% ^2 g
th-value4 M* ]0 E0 n ~! O7 a# C4 d5 o i
thickness( W( f0 d0 m7 z: o
tile: @+ {% H- T& M' R4 o, L# K) q. L
tile_rect( `$ {6 { [8 A
tilemode
, }) q6 T+ X4 X& `" s# e# h ;TNLIST ;function removed and moved to ac_bonus.lsp by rk9 x& A3 @9 Z' ~. Q. U8 q
TXT_SS ;var added by rk
+ s7 [) u$ b; U4 d. v; X6 j' }7 e ;undo_init ;removed by rk.
X1 D4 @( R5 ~1 U$ w I vi) h; ~+ w9 o5 _5 E* d# b
vpf5 F9 ]- \ X+ _! z* ~8 A8 C& h
vpldata
7 `5 t" K! a. |$ S8 I! S& d% ? vpn
) ]) b# j, A" x' _ which_tiles0 v& X2 i. c; Q, W a& m. T2 f
width
& a8 ^; L( y" L x3 j3 Q8 `& c6 E1 m: p, b
x1
& I8 Z5 X+ U& u$ D1 T$ i, e x2% i' @) N0 b+ [% K* \
xdlist7 L) _0 _+ X6 q5 X C
y
; M. }/ B* J; S y1
8 _; u& e8 t' T8 E y2- u) K! P# x9 T7 W0 A+ v9 l% g
)4 t, N! n4 }3 z7 G
' `5 i4 S: t8 h, P6 D# X (if (and (not init_bonus_error) ) Z3 V, j- A( ^
(equal -1 (load "ac_bonus.lsp" -1))
8 E, h! z$ S8 f, T );and6 p- P* ]/ \) q( g4 l, G7 q
(progn (alert "Error:\n Cannot find AC_BONUS.LSP.")(exit))8 A5 S; M: m7 L; ^- J& e
);if
6 F r3 a6 ?% s! m- ` (init_bonus_error (list
1 y$ @) `0 y0 X+ u$ t' p (list "cmdecho" 0
% Q/ M. z! H3 b! ~ "highlight" 05 {# P W, D3 V+ d5 E1 p6 E
"regenmode" 1$ U" n Q% h+ `0 ^
"ucsicon" 0
! x# P: r2 n( _8 z k8 y ) 3 b& A1 P7 x2 j1 y+ O% Z" g( U# Z
T ;flag. True means use undo for error clean up. Y* S3 r) E$ q
);list 7 V3 g3 _1 B- @; y5 O' {& I* x) O( W
);init_bonus_error- E; U- _% L& |$ S# U7 ]! V$ A. |% ]
* ]1 \; |3 C& M* L B: d, {9 j (cond* {7 ~) ?- e |
( (not (ai_notrans))) ; Not transparent?+ U5 x- M- h, I9 b( @! x I
( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?' X. w! S3 {; H! j: P! V* B. \0 Y" p
( (not (setq dcl_id (ai_dcl "exchprop")))) ; is .DCL file loaded?3 Q c, U7 S$ C( Y: I2 T
( (not (setq ss (ddchprop2_select)))) ; objects to modify?% Z* |4 e7 d* |7 F% c" b+ T$ }
(t
- x- p/ i' `4 J& t3 V; H5 m ;(ai_undo_push)$ I8 |/ t' u D6 V$ `9 f
(ddchprop2_init) ; Everything's cool,
, b. S# [+ m) ] (call_chp2) ; so proceed!
0 o1 R- P/ v+ Z% R4 s; L5 h ;(ai_undo_pop)
. q8 r4 D* V, k5 h( D5 M- Z- ` )
7 H' ~5 ]9 B6 d) r );cond close' ^% @( l8 k7 Z' {, L. p8 V
* d( F6 `( A+ R+ @/ j# H
(restore_old_error)# {9 a+ Y3 P- x; i* L
! ~. p2 w, ]% b0 Y
(princ)- T' G3 l/ ^7 W r
);defun ddchprop2
. |7 P* u6 E9 Q5 K& y% o8 {
, _8 p$ p- u& b% w- V( Y7 U* R;;;----------------------------------------------------------------------------! q* n, N& z8 H3 I
) S& c; x0 w) m(princ " EXCHPROP loaded.")' [1 v; |) U# C R
(princ)# V* a- H2 s. a" g- ?/ L% Z% d
1 D8 w, s* n5 E0 m# G/ R# M% o;;;----------------------------------------------------------------------------2 I# r1 S ?: F1 u
;;;---------------------------------DDCOLOR_LSP--------------------------------) k: d& d' Y5 @7 U
;;;----------------------------------------------------------------------------
) [, @5 _$ L9 Q# n/ x: ~) C# ?
4 G% {) Q; A" k3 ]* v% ?( @; Next available MSG number is 24 5 |/ ?1 p4 g# F
; MODULE_ID DDCOLOR_LSP_
( k: I$ O3 o- K, q P/ R" Z! w! G;;;
4 g+ i: m4 d( r. `9 };;; ddcolor.lsp
3 B; |# c9 H8 \' x: S# Y7 h! s;;;
1 {+ P: n* ?4 U! S) f4 ]9 R;;; Copyright 1990, 1992, 1994, 1996 by Autodesk, Inc.6 h6 Q* G! C9 u3 @! f
;;;
, x2 i5 f8 M, ~8 R" K; b;;; Permission to use, copy, modify, and distribute this software
8 I' q* O! D" ^, K" ];;; for any purpose and without fee is hereby granted, provided
6 Q( ^: u0 x$ f;;; that the above copyright notice appears in all copies and
, R0 m' g3 v' s- _;;; that both that copyright notice and the limited warranty and6 k) R" v0 Y3 Z8 B# h- h
;;; restricted rights notice below appear in all supporting
4 J* b9 H6 z* o7 G) g;;; documentation.. D& R5 ]3 A; ]! E$ p' D
;;;9 \* J7 b- F0 K
;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
. ]- }) m) y- c3 s/ A0 ], w;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF1 q3 c) M5 v$ n1 P( A2 A# n
;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.1 } o K2 s+ Z
;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
3 l: |, t' Q5 o( f, S2 P;;; UNINTERRUPTED OR ERROR FREE.- _+ r' X7 V% U0 W
;;;
3 Z) d \+ i; y6 p2 o1 t;;; Use, duplication, or disclosure by the U.S. Government is subject to) }. _; }0 [4 v: H, \
;;; restrictions set forth in FAR 52.227-19 (Commercial Computer
3 A) [9 D% \. f;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) " `4 {' ]3 E( z, d+ Z9 h4 G$ m1 a
;;; (Rights in Technical Data and Computer Software), as applicable." O5 x1 x- y4 U( \
;;;
2 m/ s- q" k1 j" k! ?, };;;.
3 E8 g$ Y3 p7 m& c' Q' w;;;
5 y) U# F% Z1 S9 k;;;----------------------------------------------------------------------------
1 ? z7 `. y. {' z+ s6 H, m: x;;; DESCRIPTION
5 E' _% K* b# [* a6 C0 i5 P;;; + O5 z) Q& @7 n" g6 a. o
;;; Chromatic Pallete style color selection dialog.8 Y6 ?( k( h( g6 a+ x
;;; 8 S0 f* L2 w4 s/ P" J% o
;;; Globals:
9 _, j- E8 ~3 A3 w! ?;;;
' s$ {+ z* X5 s+ J# `;;; chroma_color - Integer color index. The last value selected; Q" \$ |* @ b7 j6 {8 T7 J
;;; by the user in chroma dialog. It is not cleared or reset3 ?' K V( V( {4 r' @5 s, Q
;;; by a cancel. Only used for communication between callback" f$ L) R* `5 n
;;; functions and the (chroma) funciton.
6 w5 K$ A& X, v( S$ x;;; - F5 f) J+ i" }" E) F& y* ?
;;; Depends on the definitions for the dialog provided in chroma.dcl.
/ C5 x) a- _9 g3 v* a7 d;;;
; f' {6 a; D; \5 \( |;;;
8 W+ o4 C. L6 E- B; c;;; C:DDCOLOR -- Dialogue front end to the CECOLOR sysvar. Uses the chroma
2 {2 c8 J V G6 ^8 v;;; pallete style color selector.
+ y1 Y7 F$ ?( _* t) w& J: f+ E% S;;;
3 J: ~6 {4 w$ D: ?1 p5 f, y;;; ===========================================================================
0 |' E+ f1 u$ V2 T: ?1 R2 Y;;; ===================== load-time error checking ============================
( _- `6 b7 W# W$ A+ q;;;
% Y: G; W. z; Z% ]( V
J& C; L. J! @ (defun ai_abort (app msg)- j' u# S' G- B$ H. W8 f' Q3 B) c- J
(defun *error* (s)2 Q2 Y7 g! V3 y- V& D t
(if old_error (setq *error* old_error))
) o9 Z W; e' R( P (princ)0 G5 L N0 m% m: H. ]
)
$ Y6 M1 F$ `$ f7 I3 X) s$ M2 x9 I (if msg, a1 ^, S3 X% B: `; [8 }
(alert (strcat " Application error: "
( w% w" `1 i* A% `6 I. N1 r app9 L* l3 V) s1 j$ X6 \" m) ~
" \n\n ": f3 O& K! b! G. B* T
msg7 U6 O" f2 `& d, G A+ A9 C
" \n"
. ?1 x- S W! l. \8 C, K1 t )1 I* F& B5 \1 r$ Q9 I3 F
)
" i7 w' k v) A3 H )
1 i) o Z3 {* d3 _$ M (exit)
" M: Z+ J/ i+ ]* a )
! u F: P$ N% b% r; ^3 x8 ?9 r; Q, {; ^
0 ?; v1 I6 x1 j. j4 o6 \;;; Check to see if AI_UTILS is loaded, If not, try to find it,
, Y( }0 `6 Z! M6 a& k8 b. c;;; and then try to load it., i; }2 S" d, e: h+ d+ @/ @5 J
;;;' x* h" B/ X6 a
;;; If it can't be found or it can't be loaded, then abort the a- g6 s' A# x) `' {) h
;;; loading of this file immediately, preserving the (autoload)0 r }1 k+ h9 x
;;; stub function.3 m& v/ V& D) m, F5 i x# @
, q! f; d, F0 ^% ]
(cond( ~/ B! d- e4 m9 C7 j
( (and ai_dcl (listp ai_dcl))) ; it's already loaded.1 J( T" `2 R, L0 Z! T4 h* |0 b
, O9 C$ T' A- t/ J& Q2 b
( (not (findfile "ai_utils.lsp")) ; find it
/ e8 F! q+ t" J; _% G$ p8 [. M3 Y (ai_abort "DDCOLOR"
) |$ z/ e! t5 P3 |' V (strcat "Can't locate file AI_UTILS.LSP."6 X# J! i/ E( \
"\n Check support directory.")))
5 \: A* q z6 ^0 ]
$ p6 \2 U5 @8 ^% b" y ( (eq "failed" (load "ai_utils" "failed")) ; load it& A6 t5 h- }5 y4 K. [
(ai_abort "DDCOLOR" "Can't load file AI_UTILS.LSP"))
: J, j# W+ ^; i" Z0 x5 W )' }5 b! Y) e; \) r |3 q% Z
; Z: o) i) F- A (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
8 L" n4 X/ l# `- |. I4 P7 O (ai_abort "DDCOLOR" nil) ; a Nil <msg> supresses, V9 ?1 F6 [- a: x) t# v" f2 n ?$ r
) ; ai_abort's alert box dialog.
+ |% U. M! E4 v6 J; U* Z. X1 L
! H& ]+ z6 `, p0 n: a, T;;; ==================== end load-time operations ===========================+ K* x/ p7 o& }2 T* A: B$ K
; x8 I" i7 K/ O$ y
(defun c:ccc (/ co_oce clrx co_err co_oer lay_clr)
( Z2 S& I) f/ H
0 f+ E C3 q* F$ L) k ;; Main Color function, called by setup code.# Y( o# e" u* n- E B
(defun ddcolor_main()1 V/ {1 N( U4 T/ \0 C T
2 p7 r& o& A& ^+ M3 j+ e! z
(graphscr)7 n% b& g2 v6 Q w. T
3 e& v2 ?7 O) l' F! E' a% H ;; Get the color of the current layer, for possible BYLAYER color swatch.
0 g% N! d9 \7 H (setq lay_clr (cdr (assoc 62 (tblsearch "layer" (getvar "clayer")))))
6 ^% ?0 W3 A9 i4 w% h/ t3 J+ l, {; d1 i C% \
;; Call the dialog here...
4 y& o8 _( u% B6 l (setq clr (acad_colordlg (cstoci (getvar "cecolor")) T lay_clr))
* ]" e4 \7 r! ?5 ?4 I' O& p) f2 e8 K
(if clr) t. e& x9 t# [5 F$ y
(setvar "CECOLOR" (citocs clr)))
/ a1 D0 z M& |; t8 E )
, k( D6 [2 m% I7 W) \- P
, A1 o' `7 o7 ]6 W1 m" T ;;;# A8 x S( T; L( R# H1 u+ D
;;; CSTOCI -- Color string to color index
1 J$ f! j! A9 q9 u: | ;;; Convert an arbitrary case string into a color index.
1 s+ T- S/ a" y8 [/ x% B! P ;;; Returns nil if string is not a valid color.) {3 T* m9 c" c* y
;;;
7 a* j- Z) V6 q. V (defun cstoci (str)
! o/ ?- x+ |* ~/ j; g/ M9 { (setq str (strcase str))
; |' g$ w: D* V, s: l (cond# m. k6 M1 s3 M. ]
((= str "RED") 1)
) Z; V& p' K1 k ((= str "YELLOW") 2)$ l* s: W8 B3 W* l) f4 H
((= str "GREEN") 3)
0 C% B$ O- D ? ((= str "CYAN") 4)2 K. ]. f, Y9 R& L9 f
((= str "BLUE") 5)
* V) W* h+ Y1 D4 ]6 L q' ` ((= str "MAGENTA") 6)
" O }% ~ K- i* N1 I3 D6 [ ((= str "WHITE") 7)
3 {% X$ _- y/ I _8 h% W7 m ((= str "BYLAYER") 256)
+ `6 F$ q5 q" ]3 L* t ((= str "BYBLOCK") 0)7 F4 G1 `# B- L, Q8 ?1 P
((= str "BY LAYER") 256)1 T1 E. W5 l2 A! E! @7 _1 r9 q
((= str "BY BLOCK") 0)4 ]9 i/ V; S2 D
((and (< 0 (atoi str)) (> 256 (atoi str))) (atoi str))7 S2 C- m. {" ?
(nil))
0 f; b% e$ @& v( \& {( @ )5 @% k& s! r7 D6 j$ U4 p8 O# c* p
5 `7 ~0 D8 @; C# {9 p9 F; O0 r8 |( \$ C& y2 k
;;;
1 S6 K. v) N1 y) K ;;; CITOCS -- Convert color index into standard color name.) F; ~. P# o, M* s4 L- i; C$ U
;;; Will return the standard and logical color names as text
! S( r7 ?6 l# @1 X ;;; strings. Returns nil for out-of-range color indicies.
; B: G. B/ C: \; P6 i4 G ;;;9 D9 n! Z& V; d$ X) ]) q
(defun citocs(i) V5 U& q5 s5 G1 X
(cond; }- @* `) u9 L3 i2 Y
((= i 0) "BYBLOCK")4 Q+ L) Y% Z Z+ j! x0 G7 {
((= i 1) "red")
: T5 |% j: x' m ((= i 2) "yellow")
. l# |' U* G$ s+ O: @1 p ((= i 3) "green")2 ~+ h( l& d# l
((= i 4) "cyan")! L* z4 @6 _; @
((= i 5) "blue") ]; D& A4 n+ A& W3 l7 R5 g) f$ y+ ?
((= i 6) "magenta")) Q- s& Z3 @! Y$ `! {: `; Z' S
((= i 7) "white")- g/ ^* v3 k( w! o# a4 t
((= i 256) "BYLAYER")
; z8 ~# ]3 {6 I$ Q% C3 b9 Z/ Q ((and (< 0 i) (> 256 i)) (itoa i))
! w% T& j: Q8 ` (nil))
, ?& [7 F: q- N- i* Q/ k )
% j6 x7 i+ q) H5 {* P- @9 @4 j+ }. i, @/ u/ F7 F* T% j
;; Start of ddcolor$ c8 M$ \1 L, l) f- `
(setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho6 C0 S: e/ o9 I7 y3 A3 v
old_error *error* ; save current error function4 Q$ ?( X+ T9 A& _
*error* ai_error ; new error function
0 l5 d6 Y4 R4 p ^ )
6 F. W5 h& l: z ~
1 V2 m$ X. h* Z (setvar "cmdecho" 0)$ x% j3 X: R# i4 Z+ Q
; u" G. D& a0 g' H& _6 |- y
(cond
) v4 I+ x0 J$ x, y* d( r ( (not (ai_trans))) ; transparent OK# j, x$ f5 l& l! Z& Q; A7 B
( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?; E O4 `3 k5 Z1 l+ n' [' Y$ Q& d9 D, Y
; z' p0 Y$ Y: _& |4 ~ (t (if (and (/= 1 (logand 1 (getvar "cmdactive")))
4 ~6 C5 o* c! W. { (/= 8 (logand 8 (getvar "cmdactive")))
x5 G9 {2 P* u5 L )4 H* T# c R& G; t; S
(ai_undo_push)
! k$ F! ]: `6 O7 Z )! r7 N F& p5 Y' a
; O: B; n% t) [4 z8 ^ (ddcolor_main) ; proceed!3 Y, |# B! N: A. X* ]: i
6 P" M) L2 r h# M+ l+ T (if (and (/= 1 (logand 1 (getvar "cmdactive")))+ r/ `9 N* J7 d, U9 n
(/= 8 (logand 8 (getvar "cmdactive")))# s' y4 R9 P2 Z) e6 [
)
0 q' f# U2 V7 l- ], U3 A) J! z, j. a (ai_undo_pop)% m0 Z. x$ ~. O1 G$ Z
)7 e: ^( g( W6 ^0 M
)5 ^; T4 j1 E8 g2 V
): L x/ b5 e5 m9 t( ^
! b0 ~+ k2 U+ Q+ r0 w6 n
(setq *error* old_error)
! k% Y" J9 v$ W8 H (setvar "cmdecho" old_cmd)
1 u/ O6 M# ~/ J- h" @ (princ)
4 h+ H" s, V9 Q) W
. Y, S2 w% k2 g5 d4 l8 W)
3 Z/ F7 H& _9 o5 J$ x1 h; f6 G
- p+ L- y# B1 c$ f" B! G( h( } K;;;----------------------------------------------------------------------------
4 i$ Y8 x B+ g! T
/ Z( ^0 ~# x6 _" t/ B(princ " DDCOLOR loaded. ")7 v3 f" ]" p2 X- ~4 N5 ?
(princ)$ C- n7 L' y% a
1 o* B* F$ L A$ u8 s# C: ~8 d: b
;;;--------------------------------------------------------------------------;
$ n! v% N0 w7 R/ I* U( \3 R2 d;;;---------------Chon NHANH Nhieu Doi Tuong GIONG THUOC TINH----------------;+ d g# P$ G" ^# X& b+ U
;;;--------------------------------------------------------------------------;
( a# \7 L6 G: ~, w2 y. V7 j+ q;;; ssx.lsp+ ?3 H; n) o5 g( F+ U
;;; Copyright (C) 1990 by Autodesk, Inc." t. y* k; W- c# ^! X/ ?$ I# w
;;; Copyright (C) 1991 by Control Systems, Inc.
. ]9 }/ V5 ^) _4 ?;;;
/ R' e$ v* m7 n2 a;;; Permission to use, copy, modify, and distribute this software and its
3 r W% P% \( Y5 f;;; documentation for any purpose and without fee is hereby granted.
5 R$ z/ c6 g; @2 X;;;. B: T0 b( |. r2 }/ B" `! y
;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. `% _4 u# Z" R* E! h' b
;;; ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
8 o/ _0 H" t8 k+ a4 L g( N9 m;;; MERCHANTABILITY ARE HEREBY DISCLAIMED.* n: w$ `+ t9 j4 ~: A) ^3 G) a4 j
;;;
/ p8 L$ a7 A( G+ m6 j3 ?;;; Larry Knott Version 2.0 7/18/88
0 L0 H; D) g' r, R' P9 ?# H;;; Carl Bethea & Jan S. Yoder Version 3.0
; \$ X8 } B5 z% J+ F;;; Enhancements to (ssx).' ~4 t) e1 h2 |3 ~( S0 V' p g
;;; 15 March 1990 7 C& H: s2 b' R9 W# n% U
;;;; C' |% O) N E! _) z
;;; ARTIST Software, Inc Version 4.0 December 1991' S5 q! s. W/ q/ X- ~
;;; Modified for FLEXICON usage. If the variable FLEXVAR = 1,2 Q4 p6 i$ @1 j( v" J8 o4 ?7 h
;;; use Flexicon menus
8 H6 D' n9 y! ?, p;;;/ V/ H, a, E8 C7 }: w+ p, i
;;;--------------------------------------------------------------------------;5 y' p4 d5 M! z9 v# z/ ]3 A. R7 d
;;; DESCRIPTION( j' n% N7 z5 i1 t& H( ^! c* c
;;; SSX.LSP - o" h! U; v0 m& u" C) [
;;;
* G! |( r) ` s- e; C6 S- y r+ Z;;; "(SSX)" - Easy SSGET filter routine. 3 @. A% _4 ?* K
;;; - K1 W5 q# o3 F
;;; Creates a selection set. Either type "SSX" at the "Command:" prompt
2 g! I* W: h: i# K3 z( \;;; to create a "previous" selection set or type "(SSX)" in response to
( \0 K* x' p2 I( F;;; any "Select objects:" prompt. You may use the functions "(A)" to add
4 K6 G x5 \2 m;;; entities and "(R)" to remove entities from a selection set during : N$ x9 v( `& `( A+ Y5 ~
;;; object selection. More than one filter criteria can be used at a
; Z: G" q* F- x/ B! U0 S' H;;; time.
$ g2 D: Y, B' N4 d, D: }6 H4 L;;;
( \' t$ D: F, \5 n- A;;; SSX returns a selection set either exactly like a selected
( ~' V( I( ?7 S2 t/ p# u$ c3 |;;; entity or, by adjusting the filter list, similar to it.
$ ]& {# z: w# L. C- P;;;
4 b+ B$ ]- i* o. S# Y;;; The initial prompt is this:
! a: d& y% `8 D4 Q8 c7 z;;;
# @4 y. W, c, N" B! g2 N c;;; Command: ssx8 P% ]: N, e6 c" j
;;; Select object/<None>: (RETURN)" d# b: Z5 C5 N4 r5 h8 t
;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector:
. @$ H2 X0 J: t& {8 W2 n;;; 2 i G/ m$ ^, B: x0 Y# y
;;; Pressing RETURN at the initial prompt gives you a null selection $ l9 [2 Q/ @4 T, ^6 a, O9 j
;;; mechanism just as (ssx) did in Release 10, but you may select an
4 M0 P" [2 p4 z" k7 T! I. N2 n;;; entity if you desire. If you do so, then the list of valid types
3 I4 m, M# _8 h;;; allowed by (ssget "x") are presented on the command line.1 L' v) E/ U8 C; w( H1 P2 |
;;; # q8 D" [2 r- W5 r4 ?* ?4 n
;;; Select object/<None>: (a LINE selected)
5 K- k" Q- _" d" C7 a7 G4 }! j;;; Filter: ((0 . "LINE") (8 . "0") (39 . 2.0) (62 . 1) (210 0.0 0.0 1.0)) ; w5 C# C( Y" b9 n/ L
;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector:
' C# Y' @( D1 ?. A; S;;; . k2 Y! Z' J8 F3 |
;;; At this point any of these filters may be removed by selecting the
: w* Z( j8 v3 t7 a e;;; option keyword, then pressing RETURN.
! G# k% C) m3 X7 D;;;
) k \* Z9 q) o+ n: C- w;;; >>Layer name to add/<RETURN to remove>: (RETURN); ^5 T2 W, d9 \' ]8 D6 U5 C
;;; 0 ]" ~2 ]5 M% O: Q' B# b
;;; Filter: ((0 . "LINE") (39 . 2.0) (62 . 1) (210 0.0 0.0 1.0))! \! b4 t$ W4 [# F% z2 ]' ]( r
;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector:
; C& K0 g& Y O5 G5 G4 F;;;
/ ~0 q) n( b& J/ X5 Q/ u;;; If an item exists in the filter list and you elect to add a new item, * N+ d. `! G* A4 g* W
;;; the old value is overwritten by the new value, as you can have only & V3 J2 @1 ?3 Y" ]% m4 V0 v4 k
;;; one of each type in a single (ssget "x") call.' R! K: e, V& X( Q4 B
;;;$ n; \' S% D, b: }
;;;--------------------------------------------------------------------------;
; |' I* b+ O8 a9 A5 E;;;1 R& X% @! _3 j4 I' i9 H
;;; Find the dotted pairs that are valid filters for ssget" \$ _: W4 r' l7 h- a7 v! k7 B+ K
;;; in entity named "ent".& _" ~* a! ?% d9 _
;;;7 ?8 `2 T! T) ]% U
;;; ssx_fe == SSX_Find_Entity
7 L4 h- N5 g/ ]9 z9 k. ?;;;
7 y% W# o& b/ }0 a7 ?(defun ssx_fe (/ x data fltr ent)
7 o6 L! `4 r0 |! C. p y; ], Y: y% C (if (and (= flexvar 1)(/= t2 "Pick"))& f6 T O6 r7 a7 Q4 C% {* a: S
(setq ent nil)
" T; a, A# ]( x6 Q! Z5 C (setq ent (car (entsel "\nSelect object/<None>: ")))7 h' |& H, J1 e7 q+ d9 O
)8 d" q: e5 t$ L. O# c
(if ent
& \' u: }8 z5 Q% d8 T" Y7 s (progn
) U. I% R' {$ n$ f; s (setq data (entget ent))
& B$ ~# T$ i5 X: h (foreach x '(0 2 6 7 8 39 62 66 210) ; do not include 38
; A4 e$ i% O' ]0 t (if (assoc x data)
! i4 m& n& m) d: b! o. s _. ~ (setq fltr
5 l0 H5 L/ h+ j8 Q! Q (cons (assoc x data) fltr)
# {8 E$ d8 o2 u" }6 x )9 M% K7 Y" _% L3 U8 L
)
% t/ v% e: w+ Q ) 4 _ r+ J- ]- B3 }" F/ J+ X6 J
(reverse fltr)
+ G( P+ j* a" p: C6 ]7 g )7 l) P; V4 s' _
) : L) }. z7 Z* i/ B# E# X
)) |1 g: n, S9 I Z3 Z$ i
;;;& p7 l7 Q9 G9 ^0 e$ A+ I! Q2 l
;;; Remove "element" from "alist".' `1 \4 j3 W1 Y! k* C/ X6 N
;;;
+ D- [ Y8 V5 Y* k# L+ p+ n8 v% c;;; ssx_re == SSX_Remove_Element' |0 F5 H. O3 T! a
;;;
$ g3 M3 Y" q. s" y( P- N# e(defun ssx_re (element alist)( i: P: X- y" Z) G, k+ |- S l
(append
* X0 r$ s; m) k6 ~ (reverse (cdr (member element (reverse alist)))): T0 G+ I$ m8 ^* b) u2 X
(cdr (member element alist)) . P% T: f- m3 \
)
4 ?6 F. r4 L6 p; Z/ a* _; F. H)& N; a5 B, ^: k
;;;
3 ^' W1 s" v% @) v7 Q1 L3 b% r;;; INTERNAL ERROR HANDLER
F8 B/ @' t1 ]; o# l& `;;;
. N7 S$ v! a0 V: w% {# r1 e+ l7 ~& |(defun ssx_er (s) ; If an error (such as CTRL-C) occurs
( ^7 t! K$ S4 l0 v) f5 W* F$ l. w ; while this command is active...1 o/ y) S0 z: B' _. m: F
(if (/= s "Function cancelled")
8 }5 T9 F( z+ m' ]+ v (princ (strcat "\nError: " s))
7 T+ @! p6 T' j$ \% Y. x )
; c- |$ i4 |% Z2 v/ e5 p) @7 z. U (if olderr (setq *error* olderr)) ; Restore old *error* handler4 w! P4 z* Y& u ]
(setq flexvar 0); j# ]4 Z* A# S
(princ)
* t; K# y# }- ~% G)
0 E& [0 @- m6 u! E& N/ @0 J;;;8 ~, `3 g" ^$ Y" v
;;; Flexicon call routine6 }% n9 E# q4 y, z
;;;) \- Q$ g# \# h2 m
(defun flexmnu (a)
8 S& l% m$ w6 H- A& t2 o9 n (if (= flexvar 1)
6 M4 t4 I8 h0 Z! Z* e1 [' b( Q1 U" | (command "FLEXICON" (strcat "FLEX" a))
( m0 ~1 Q& o, e2 Y3 Z1 Q. n )1 @, t2 r: s2 M: O2 p
)
! N3 O7 P% u0 p5 j2 K
$ l) R9 H1 h, o! h- f/ ~1 [;;; ! g/ [3 S1 m' G& c) ]
;;; Get the filtered sel-set.
! v# c4 a( ^) V4 i* I' T;;;
" r& h ]/ [$ {1 F;;;/ l+ u1 H1 E/ A1 \9 G a
(defun ssx (/ olderr): X5 e0 ]. e5 d
(gc) ; close any sel-sets " v7 J _! p/ c+ V
(setq olderr *error*
5 {) J" \3 M/ H/ Q, C% L *error* ssx_er
/ A" r9 Y' ^- c' U' E )
5 ]5 C4 W" n8 F7 c. K2 ] (setq fltr (ssx_fe)) 3 l/ N3 {1 k8 W) M
(ssx_gf fltr)
5 G @7 ^1 b# ?, s1 X (if (= flexvar 1), v3 G! w9 `. @$ [8 Q5 i
(progn; c+ |/ _) v% E/ Z5 H
(prompt "\n \n \nNow select the required EDIT command and (P)revious.")
. W* F5 Z' O% c7 z& o (flexmnu "EDIT")
+ U! ?+ _. J& G ); E/ w! @9 x g
(command "p")
! z2 {6 r, ^' Q' m- b )( i: F. x; j$ V* p
(princ)4 P& C0 f n: d: t4 a& x
)
* ?# T/ X$ Y, F, p9 |9 S/ ^5 h( \;;;4 k* a0 i% J. e" ~4 M2 `0 @
;;; Build the filter list up by picking, selecting an item to add,# I6 ]6 K+ \1 d/ x& `
;;; or remove an item from the list by selecting it and pressing RETURN.; A' e) Z1 F1 V) d
;;;
. C3 z% H, S: h6 T2 y c$ a4 N;;; ssx_gf == SSX_Get_Filters* ?$ Z i( F, A _- w- u
;;;
' t) l; N5 F& c- y, I(defun ssx_gf (f1 / t1 t2 t3 f1 f2)+ q) v5 r. \! s2 e3 ?
(while 4 r5 J, O: \( d9 d, {' U( z
(progn
! z5 h! k" R! h4 f1 B (flexmnu "SSX")$ l4 y* j0 X: V/ P' S! H- u. b
(cond (f1 (prompt "\nFilter: ") (prin1 f1)))
* t' p1 f; b7 ?7 j' E (initget
/ J& A8 L6 X' o& S "Block Color Entity Flag LAyer LType Pick Style Thickness Vector")5 t& z5 ]; v8 j, @, p
(setq t1 (getkword (strcat
/ Z6 R2 ^( H/ |1 R% N- X2 j& N "\n>>Block name/Color/Entity/Flag/"
7 X* P! o' p5 v/ v$ L "LAyer/LType/Pick/Style/Thickness/Vector: ")))
! z9 h+ x' u- \ )
' o4 J7 i9 @+ ~8 N% i, l* W$ e (setq t24 X( \" X# }7 [7 P3 w+ `2 n
(cond7 p' l4 \* T3 L" F/ P" C; d
((eq t1 "Block") 2) ((eq t1 "Color") 62)
# O6 f) E% n/ J! T J7 a ((eq t1 "Entity") 0) ((eq t1 "LAyer") 8)
5 m( ^! e e9 n8 d" \1 F( A ~ ((eq t1 "LType") 6) ((eq t1 "Style") 7)1 z, P7 C" m; b' U+ r% e1 E% J
((eq t1 "Thickness") 39) ((eq t1 "Flag" ) 66)
' T% t* Q) d$ N6 m ((eq t1 "Vector") 210)
6 E/ Z( x/ D# k% f (T t1)
p" E$ k* m% n! U8 q, U )
' n" |* ^ S7 `* G( B2 l )
& D9 a7 \6 ?3 [- G0 O* k (setq t32 V, C. V/ C" [3 T6 S9 ^7 n$ m
(cond
. I7 l. C2 d& v* I ((= t2 2)
9 N* l, b. S3 F5 I" {' ~1 } (if (= flexvar gtads 1)
: A8 n+ }+ Y' b$ R) o (progn1 J4 b8 t# y5 [: ?) v/ k9 N
(prompt "\n>>Block name to add/<RETURN to remove>: ")2 V+ a+ n+ [$ A1 W/ ]
(gttable "BLOCK")! M( Q: H, r; f
)9 ~5 Z) E& M7 p2 b$ P; P
(getstring "\n>>Block name to add/<RETURN to remove>: ")
! t3 G" S4 z+ D' t )0 G/ b/ o* ~; ^
)
2 N( y0 y5 k5 O0 {9 [ ((= t2 62) (initget 4 "?")# h# Z0 J4 h2 V$ e" B$ D# Q
(cond
2 u M7 x& s( A2 r0 q5 s1 X+ U ((or (eq (setq t3 (getint 8 Q1 h' P) a- M/ Z9 j
"\n>>Color number to add/?/<RETURN to remove>: ")) "?")
: G$ ~4 t: `& z* { (> t3 256)); d5 S( M2 g8 V& l( d2 i/ B
(ssx_pc) ; Print color values.
# F: L* b3 M0 {. e) l8 H nil, w1 u+ d- N; ?" U5 X+ P% H2 ^
)2 T# i$ P/ \% _1 D2 w$ U, c% r
(T
/ a& i6 v* M) H t3 ; Return t3.% r( L& \7 ^! N- k* J
)% X, O+ {8 A% {6 b6 C* z
), Q, k/ D9 x5 _% L+ @ I1 Q8 J. B
)
0 z% C8 k) Q1 B4 e+ i. u! O ((= t2 0) (getstring "\n>>Entity type to add/<RETURN to remove>: "))
: f& ] ~ y# L; E k ((= t2 8)
- I: L x6 f/ V' O: ? (if (= flexvar gtads 1)8 h6 r/ S- b( z2 T( Z
(progn7 G3 h3 i0 c8 D( |
(prompt "\n>>Layer name to add/<RETURN to remove>: "); @* b; G) b. t+ ~) F" k; v0 d; ]5 C
(gttable "LAYER"). w, w3 C5 `7 O" c4 r2 Q
)
8 X' ?( S/ n/ N5 u9 h2 K5 h (getstring "\n>>Layer name to add/<RETURN to remove>: ")( D4 |& R5 u$ m8 r6 Y# C+ M9 K3 A
)' T- r- F' R" ^1 P( Z4 `2 Z
)
8 u# k8 h# r+ q$ m6 S ((= t2 6) $ ^2 H4 j/ N- G3 J$ @3 h
(if (= flexvar gtads 1)
% g, C' ~( Q/ s: x, U. d. r. G* L (progn
6 ^7 T1 a( w; P (prompt "\n>>Linetype name to add/<RETURN to remove>: ")( k/ ^' O+ H% @8 m k- S8 L7 t9 M' b
(gttable "LTYPE")! w5 N4 t' L$ O+ \% U3 Z
)
5 h' j. Q! \& l4 L* u (getstring "\n>>Linetype name to add/<RETURN to remove>: ")
/ [% } B4 ?3 X- s/ P4 x )
3 I9 n7 e7 S; O1 F+ S# e )% Z" s/ F$ f, c; g
((= t2 7) " O; T# `; `/ I) j' g' Y' a$ N5 @
(if (= flexvar gtads 1)0 ]. q8 U8 V8 {5 P ]$ T
(progn
9 A$ f' L4 [4 F6 P4 n (prompt "\n>>Text style name to add/<RETURN to remove>: ")0 B$ j/ _, i6 V7 X& Q5 v" z
(gttable "STYLE")) k/ j* T" P* f
)4 O( o) W# r2 y8 N' I
(getstring "\n>>Text style name to add/<RETURN to remove>: ")
0 v7 ^! t& z+ n9 d' Y )
% c/ w4 B1 W1 ^- H8 a* H' h6 n9 [ )
6 r8 g, D4 T/ N! n4 Z7 z0 P* i ((= t2 39)
1 }$ q0 X& z* T- q (prompt "\n>>Thickness to add/<RETURN to remove>: ")
% o$ ~/ _" F& U' U1 e% t" ] (if(= flexvar gtads 1)(gtfnum"Thickness to add:")(getreal))
7 X1 S0 k9 W& } )
7 |: Z1 r: S# \% s- l7 O9 ? ((= t2 66) (if (assoc 66 f1) nil 1))
y" _& I$ m! q! Y0 {! w! } ((= t2 210)
6 m$ B+ B5 j7 e% k (getpoint "\n>>Extrusion Vector to add/<RETURN to remove>: ")
* U! f t' ]* I: p- ?/ O$ J; f, B3 h )# e2 i9 b' f! S* Q9 f9 x
(T nil)
* q! `: {) y% _, g# a )) D- Z% E# H* B# M# K( i- U3 M
)' L; d! S5 r4 S+ h
(cond0 W2 R) G7 }5 E
((= t2 "Pick") (setq f1 (ssx_fe) t2 nil)) ; get entity
7 @8 e4 s: I2 T2 Y: ?5 P ((and f1 (assoc t2 f1)) ; already in the list
3 J0 M# b1 e2 F1 q, M* \* ^* [ (if (and t3 (/= t3 ""))
, t! J c; P6 R! N1 v3 A2 N ;; Replace with a new value... x1 v5 y+ ]$ Z! t
(setq f1 (subst (cons t2 t3) (assoc t2 f1) f1)) & Z- i% m/ S h' I+ H
;; Remove it from filter list...8 A1 }- u3 O& _! y9 m: z- j+ z$ B
(setq f1 (ssx_re (assoc t2 f1) f1)) : e* f9 n" W/ S4 c. t: J
)
0 w7 e: L# L7 q: {6 u )% t* R9 l4 r |7 x
((and t3 (/= t3 ""))
4 G8 ?- n+ e. C C (setq f1 (cons (cons t2 t3) f1))
- ?( r0 e) s, T; L! M: f) ] ) _# Y; Q3 D$ A+ O# S
(T nil)
0 ?) \# B/ \' i7 y7 k )
. W/ P% G. v: `0 g4 C7 ^ )
* ]. N8 s, k5 l8 j% R! ? (if f1 (setq f2 (ssget "x" f1)))/ C9 X1 B6 J3 Q0 q& C. [) V
(setq *error* olderr)( ^# M, @/ ^) O8 m0 A3 l
(if (and f1 f2)
! r0 n( y+ h* y; b: v1 Z (progn/ D0 v2 x1 x, j: J' y
(princ (strcat "\n" (itoa (sslength f2)) " found. "))
. B* {; t2 ^1 A# q) a, D$ N/ r f2 ' R3 ?, l/ X, G! k& ?) L; t
)
# q3 U1 s5 {: w0 Z& i% |$ S (progn (princ "\n0 found.") (prin1))
+ V) ~7 ?+ q8 ?# { )
) Y8 R: Q" \) T* f! [8 X" `)* T( \$ c* U" P. w B0 x
;;;
: O8 ~5 [7 u" H1 Y/ L;;; Print the standard color assignments.. r2 w1 f" A" ~" K/ {) a* ^
;;;, G6 ~9 Z% U# U2 m6 N. S
;;;
k. m1 Z" u# h0 Z% D(defun ssx_pc ()
7 [0 `+ Z/ e" D8 Q (if textpage (textpage) (textscr))1 A6 `8 K/ A9 I2 U5 t+ `
(princ "\n ")
* U# _* p3 u! Y& M7 ~$ e9 S6 s3 b+ l (princ "\n Color number | Standard meaning ")* n5 F8 A0 u- c7 a, {. ?9 M7 P) P
(princ "\n ________________|____________________")2 r g' c6 w3 O- h) T
(princ "\n | ")' ^5 Y4 L) L+ k+ s0 s6 ^( `5 \
(princ "\n 0 | <BYBLOCK> "), B5 i3 w8 a/ y( m
(princ "\n 1 | Red ")
0 r/ ]2 M4 z. X: \! V (princ "\n 2 | Yellow ")$ P% T: w% `: E h: O5 g* e
(princ "\n 3 | Green ")
4 u+ B/ {1 V* I% r (princ "\n 4 | Cyan ")
3 @- f; ], @4 L! e0 U5 `5 E (princ "\n 5 | Blue ")8 @# A2 L- j$ [$ a" q6 o( @
(princ "\n 6 | Magenta ")4 Z- M) K5 p) U1 q: [! A# v
(princ "\n 7 | White ")8 I9 n. T7 ^+ ?( N1 O. Z$ k* Z
(princ "\n 8...255 | -Varies- ")
- Z) D; I0 o+ w2 I/ M2 G- r6 L (princ "\n 256 | <BYLAYER> ")
e; d1 a; `6 d8 [+ z1 s (princ "\n \n\n\n")3 Y* O8 ^7 `) R7 L8 k- \
)
' E4 u' U1 r5 z4 A. b" k" ]2 a;;;1 V8 b# L. z& R" g0 i1 ]% r
;;; C: function definition. S. ]: p# q% O# G/ a. {# Y
;;;4 U# v( y9 @" }( Z S
(defun c:ssx () (ssx)(princ))/ i! b( H" Y% C: d) }5 B& i9 h8 n2 G# |
(princ "\n\tType \"ssx\" at a Command: prompt or ")
) R4 i! B9 z7 k* \, n2 S4 E! Z(princ "\n\t(ssx) at any object selection prompt. ")( g- I! d4 b, _: F- b
(princ)
5 E( U2 w0 b# f7 @" e
8 X- k9 b, n' _- b;;;--------------------------------------------------------------------------;6 {: Q5 J7 F+ v5 Z. ^+ H
;;;--------------------------------------------------------------------------;( k- ?& Y ?% S) e8 y: \
;;;--------------------------------------------------------------------------;
' h4 E A, N2 E; O1 V% J; k(defun S::STARTUP ()( r6 C+ Z) _+ u, B
(setvar "cmdecho" 0)8 j4 {) N; }/ p D& U1 y; z
(setvar "cmdecho" 1)* c1 l' O* i& c: U0 L! V$ r( K
(setvar "LTSCALE" 10)
: s# U' X" w: n# t
( Z' |: a) ]8 Z5 G) |: O$ Q0 y; h2 H2 q" Y8 v+ y
;(command "_load" "chenKH.fas")3 P7 k5 a+ _2 r% M9 ]& y# F
;(command "_load" "ctcot.fas")
5 Y! g) l( w, _& E9 W! P;(command "_load" "damdoc.fas")& t8 A+ r9 U* y: L9 t' L
;(command "_load" "ghichu.fas")
) E6 B$ e& Z" ]+ n+ k;(command "_load" "hamtutao.lsp")+ U; \" y6 n. U* D, ?: O
;(command "_load" "KHOITAO.fas")
' d1 t& ~7 A, R% T+ m' Y( k;(command "_load" "KHthep.fas") q/ I0 m- ^' y& @
;(command "_load" "mbmong.dcl")5 X7 B) u' I4 S, K( ^- s
;(command "_load" "mbmong.fas")
1 j* I$ G# p3 c* ]; Z4 @1 Y" {;(command "_load" "mccot.fas")
7 ]5 i% _7 M7 z4 g% S( H. b;(command "_load" "mcdam.fas")6 |2 X, v7 E* R: V
;(command "_load" "mcmong1.dcl"); M) ~8 V# `8 J7 E& D( v1 t
;(command "_load" "mcmong1.fas")
, ~5 D$ | k2 p2 s2 s% k$ r. X;(command "_load" "mcmong2.dcl")1 z V& [, D0 w4 y/ _$ G
;(command "_load" "mcmong2.fas")
: k- ^9 E4 u# ^/ R- R. R0 ~- E7 ?;(command "_load" "mcmong3.dcl")
; U1 u3 U9 v0 m \4 y% p o* G( a;(command "_load" "mcmong3.fas")
! ?+ F4 [5 d3 R1 K7 c0 C, v9 J;(command "_load" "mcsan.fas")$ t/ l0 p* \- v+ m1 b& y7 `
;(command "_load" "thepdai.fas")2 v G- q O* i) L
;(command "_load" "thepdoc.fas")
. L9 v5 T1 r! q1 g) ~;(command "_load" "thepmb.fas")+ H0 }& K' o2 S% a
;(command "_load" "thepphbo.fas")* [6 A: ?* l/ `
(command "_script" "thongso.scr")! M5 f" h4 R* y: T
;(command "_load" "thongso1.dcl")
B5 U' _- D1 h/ H; ^* @2 y% r' O# c;(command "_load" "thongso1.fas")
5 u F. p1 ?8 g* l;(command "_load" "thongso2.dcl")' p! H; Y; M% m- n- h5 j
;(command "_load" "thongso2.fas")
/ }3 z9 G7 p& I# F/ I4 y B;(command "_load" "tietdien.fas")6 r1 h0 L2 x' u7 `$ p
;(command "_load" "vehan.fas")
- g6 i( ?. S$ w% E& H6 E5 V(command "_load" "phamduy782006htd.dcl")
- T! A. `# Y6 i3 v5 f(command "_load" "DDCHPROP.dcl")
7 M0 [8 h8 B: C(command "_load" "EXCHPROP.dcl")+ g% i2 y: I* P
(command "_load" "DDMODIDY.dcl")
4 {' K3 I( P8 u# \5 U* o/ z(command "_load" "TK.dcl")
* q6 C- Z( q# ^" Y(command "_load" "TK_LIB.dcl")
- P7 o4 v+ t2 m1 m9 X(princ)+ a- T' O! F; i- y
)6 i" R' ^7 s `/ d
2 k6 P0 F; ?+ \9 F1 W& e) c, ]& _# P
(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\DDCHPROP.LSP")
4 K, E; n; m( J+ |1 L0 U! r. S
. ?; d- D: [3 e' j2 j0 M(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\SSX.LSP")
) C3 M/ U9 s5 w) M) ~; @. A7 h6 v1 O. |
;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\phamDuy782006_TKT_VNI.LSP")
2 E @4 l" I+ q. E( _6 g( V;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\phamduy782006ganhtd.LSP")
; p7 ` t5 ~$ ]9 ]$ v; T' K1 h;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\phamduy782006ganhtds.LSP")
1 K0 C4 }2 m' S4 K
. Q+ c3 }* \5 A. i* j0 A$ o(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\THONGKE-THEP\\TK_EXP.LSP")
2 S# W) o7 S# l3 ~# j% {2 ~6 H(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\THONGKE-THEP\\TKN.LSP")
4 l. W. O S3 j- T
+ P6 {5 c/ y0 `" q8 s2 ^;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\ACAD iit insertTEXT - iiT.LSP")
. \5 j% \2 |, S7 P8 y1 W' J+ w& X# I7 g
;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\ACAD iit insertTEXT - iPT.LSP")9 B: r$ Q- p, k" ~5 o
6 p- G/ h% C1 `$ p* r
(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\ACAD insertPOINT - PTA4.LSP")
$ X9 O( Y0 I8 z
! D1 y( u! K+ X3 a4 h* b) z- F;; Silent load.
" Z5 w- `# A& u2 ^( H+ v(princ)
" n& y+ L: _" g! X* j( V9 g* Z
9 F& L4 g7 z, @/ N( B! N. D. c4 c+ x) Q" L2 r
;; Silent load for the Express Tools.
( n J* N" G* [2 l- n, Y;; Altering this line will affect Express Tools functionality
$ g! m# A- y( U$ \3 w(load "acettest.fas" (princ))8 {2 R ~8 Q7 p
. L4 N$ h; C/ m5 A;------BLOCK NAME Put The End because ERROR other LISP-------+ t( l o! P. ?$ H$ f, s6 w
;------------------------BODER HATCH-------------------------
' `" w4 q* z( j; X, P
3 f# S' G# O8 x;;; HATCHB.LSP ver 2.5; @1 D# J6 @* y8 n
;;; Recreates hatch boundary by selecting a hatch& W X" h) Z Z, k+ {
;;; Known problem with some elipses and splines
. r2 |$ M3 R0 b0 I+ b, N;;; By Jimmy Bergmark
. |# R: v: Z6 [' P;;; Copyright (C) 1997-2008 JTB World, All Rights Reserved' |. N3 {. \9 Z+ C2 g' x7 s4 r) O
;;; Website: www.jtbworld.com
0 p' x8 w+ |/ V;;; E-mail: info@jtbworld.com! O+ i! q* l6 q0 _
;;; 2000-02-12 - First release6 s- r+ n' {8 M8 N" s. }
;;; 2000-03-27 - Counterclockwise arcs and ellipses fixed
8 D. p- b7 K6 z+ z% F;;; Objects created joined to lwpolyline if possible
' x% P: P# Q; N& e4 s c" a% _2 H;;; Error-handling, undo of command
& `. m1 y3 x" I3 D: J( ] ~4 M. Z;;; Can handle PLINETYPE = 0,1,2' c3 D7 I7 ]/ J+ f0 t
;;; 2000-03-30 - Integrating hatchb and hatchb14% [- ~: R& p1 k( ~
;;; Selection of many hatches
1 B! [7 d( z3 g* G( O: w+ U;;; Splines supported if closed.3 f+ a: d' m1 x2 O& _' |1 r
;;; 2001-04-02 - Fixed bug with entmake of line with no Z for r14
' W1 J/ H5 N4 b. c;;; 2001-07-31 - Removed an irritating semicolon to enable polylines to be created." V; H W, Z, C" K
;;; 2001-10-04 - Changed mail and homepage so it's easy to find when new versions comes up.$ X! I3 P5 e% y3 _. ~
;;; 2003-02-06 - Minor fix8 F n7 s% n' m+ C( F* e0 B/ O
;;; 2003-02-17 - Area returned if no islands is found since it's not consistant+ T# J. b$ m0 s I8 ]
;;; 2003-05-19 - Fix to take PEDITACCEPT variable used in AutoCAD 2004 into account
; v. ~6 S5 @' e7 i, }7 k% h;;; 2004-11-05 - Minor bugs fixed- U, L, U) y: j
;;; 2006-03-18 - Nothing changed from 2.1 other that it's been confirmed to work with AutoCAD 2007
G0 w6 _/ d4 G9 C8 k- o;;; 2006-05-13 - Create the boundary on the same layer as the hatch using the hbl command and3 Y% m6 q3 |% l$ g
;;; on current layer/color/linetype using the hb or hatchb command
$ P& }8 q+ N9 N0 U' r$ k9 F;;; 2007-02-08 - Fixed a bug with the hbl command( N% i. O/ J6 F3 E
;;; 2008-02-29 - Support for hatches in non WCS thanks to xiaocai1 q, R" |( z( o4 U% B& a0 P o0 c
;;; Tested on AutoCAD r14, 2000, 2000i, 2002, 2004, 2005, 2006, 2007, 2008, 2009
7 R# A! `, h( M7 Y. A) B6 E U;;; should be working on older versions too.& m( y6 i. c$ \7 M$ c. {$ `8 _
8 L" [# o9 c0 N3 Y) P3 l* v( g3 U6 o
(defun c:hb () (hatchb nil)) ; this line can be commented out if there is an existing command called hb
* _9 h) \. L) l& ?, s8 r(defun c:hbl () (hatchb T)) ; this line can be commented out if there is an existing command called hbl
; b ~# \ j, }(defun c:hatchb () (hatchb nil))* w9 e: }3 W' W% \
(defun hatchb (hl / es blay ed1 ed2 loops1 bptf part6 b' q9 W9 O6 s. u M% H+ N
et noe plist ic bul nr ang1 ang2 obj *ModelSpace* *PaperSpace*
% L# O9 C4 n- [! J4 \ space cw errexit undox olderr oldcmdecho ss1 lastent en1 en2 ss lwp
+ O+ T' n! m, W, @9 |* w list->variantArray 3dPoint->2dPoint A2k ent i ss2# w0 C- ]+ w8 f" A! R
knot-list controlpoint-list kn cn pos xv bot area hst noarea& | G+ @9 M0 N5 P# A+ ?8 c
)
" {; q% f( E/ _0 L9 _ (setq A2k (>= (substr (getvar "ACADVER") 1 2) "15"))
. l. I1 c/ L7 U$ @ (if A2k
& v& [6 O0 }. l4 a% U! x) {: I (progn
" A* `7 c7 g _8 L5 N4 S (defun list->variantArray (ptsList / arraySpace sArray)
# Z8 o+ `/ R3 ]6 x$ r7 Y (setq arraySpace
] ^, G; A6 w. ~' A; P (vlax-make-safearray1 f/ u/ M/ e& q7 ~) ^7 r h9 M
vlax-vbdouble
& `, C) E1 ?! {' f$ h0 M (cons 0 (- (length ptsList) 1)). m) e3 t( f' N9 b* A2 P3 F3 y
)! G; U' I- u" | R; D
)
# Q, A( ]+ x4 t k" K (setq sArray (vlax-safearray-fill arraySpace ptsList))6 t5 `' d8 c: Y/ K
(vlax-make-variant sArray)
! b5 g+ m7 {5 J7 ^5 D. U. ` )
* z3 }" g, P7 X2 u5 Z& @( @ (defun areaOfObject (en / curve area)! z' c1 E0 @# v/ H6 q
(if en
8 C9 L2 J6 r# I$ B4 [, K (if A2k
! j& D- T) w; K+ C3 B( Z- t7 p (progn
0 |5 {$ C7 ~1 F% \2 n3 _ (setq curve (vlax-ename->vla-object en))
8 Y4 ]3 c) l+ `/ f: Q- l (if: I. B5 h: B. E; |/ K" x
(vl-catch-all-error-p% x9 {& y2 u' m* e
(setq
, o2 ?' U2 L/ L area2 s6 q7 D" `+ E5 U. E
(vl-catch-all-apply 'vlax-curve-getArea (list curve))
9 m8 F) S( ^% {" Q/ q% y )6 y( o, F$ Z% W: t6 B6 W4 J
)9 G% y. {+ ^3 D. x( D
nil
& z1 j2 _) l& r% C" V0 S8 K area- \6 u/ @+ L3 D! T/ y
)
* Z$ z+ S( j+ D$ F) ~% c$ U ): D) o, q( [3 \- ]
(progn6 |: b" V; @' y* A. p5 T0 ~
(command "._area" "_O" en)6 ]& ~; ^% M) J5 c+ `
(getvar "area")
6 g' o9 X2 D6 A )4 o- G8 Y' |5 G6 Y
)
! a9 G: ^/ v m2 D0 B0 l& [0 w, y )4 H3 Y' e, R8 e
)* v1 z5 I* H! t; Q( x# z. B
)
' k7 B/ E! G( ?% e4 Y7 Q )
2 Z: }7 g0 \3 Q1 F (if A2k, }* R7 X5 f' E2 Z2 q$ S( S8 ~
(defun 3dPoint->2dPoint (3dpt)+ ]* K3 Z* J! Q# [+ r
(list (float (car 3dpt)) (float (cadr 3dpt)))
7 L; ]) m8 U- C" V7 d& i7 j1 f )
2 W, L q; a6 A3 K! ] )
* s- l' u1 ]/ q! U" E& ]7 U, u3 L1 z, b% n& w6 f5 @
(defun errexit (s)
7 s4 p# ]$ R, a8 C! B (princ "\nError: ")
. D _8 N Z2 _/ B' H' e (princ s)4 ]1 C0 R& r$ A( k3 @
(restore)
. T) g5 A/ x" u1 i7 R( J )
; S- y$ R" o+ V2 P- H; {3 Y3 Q/ d8 f _- X) _
(defun undox ()" c% ~% T1 @( T! E9 U ]7 y5 C8 k
(command "._ucs" "_p")' u( h) ^0 Y6 l6 @' G6 B
(command "._undo" "_E")
4 b0 x' q# y& i) M% L9 B (setvar "cmdecho" oldcmdecho): i! K3 X$ E* Q9 p& l) c" z
(setq *error* olderr)
5 I/ Y# e! d. ~1 j* Y (princ)
6 c' ]3 e8 t$ P" ^7 R )
) G! f5 K) X2 Z6 D7 i' _& n; m" \( _. f- x6 i$ c: B
(setq olderr *error*: b: Q' [$ u! `7 D1 M2 Y+ d7 c
restore undox7 Q$ r6 s, ^* I
*error* errexit3 v. B) `4 `! v1 A5 u0 D
)
$ E, k0 d7 Q7 ^$ t, w- @3 q (setq oldcmdecho (getvar "cmdecho"))
& Q U- M; u6 Y, w0 ~/ C4 D8 a (setvar "cmdecho" 0)
# g8 B) m) j- U' s' I* q (command "._UNDO" "_BE")
\1 u h9 T* P6 a (if A2k (progn3 P) \0 E4 X4 ^+ }
(vl-load-com)) f/ h: Y0 `0 w, B W; y
(setq *ModelSpace* (vla-get-ModelSpace6 ^2 S; Q+ p% b0 s5 Q: p! s/ I- y
(vla-get-ActiveDocument (vlax-get-acad-object))
- }. @! M# E; W% X$ U. w )
+ o( H1 V( E+ B# g2 q *PaperSpace* (vla-get-PaperSpace N& P/ x- w3 z
(vla-get-ActiveDocument (vlax-get-acad-object))
( S- B1 w2 x5 v, y0 U ). [8 T4 t0 T5 U! a6 O% K
))0 [# J K" O7 O& R1 Z# Y5 @6 x
)( C3 m$ h- d* i* W V
5 b. o3 p3 s" S# U# m* A
' h* V c. z( u7 C9 b; Remove for testing purpose) I% |0 ~# W# f1 ?) H( c
; (setq A2k nil)
, Y+ |+ d, f B0 e& h: O+ M+ U
8 k, k7 E1 e4 r (if (/= (setq ss2 (ssget '((0 . "HATCH")))) nil)
$ N! F9 S, H' a3 h0 {- M5 ^4 E (progn
! T. K5 G& F2 E' d. X& L- Y (setq i 0)
% j5 f- M) w7 _ (setq area 0)" D$ g) y, h9 B: z' o: L# Q/ X- U
(setq bMoreLoops nil)9 u$ ?. |4 P! w5 Q7 V5 w
(while (setq ent (ssname ss2 i))
6 S4 c3 ~3 s, O Z% h+ t& Q (setq noarea nil)! S! }$ Y# Q4 R } u
(setq ed1 (entget ent))# l# H( N% C7 B/ P5 K
(setq layer (cdr (assoc 8 ed1)))& o7 I" R+ B$ B7 N( B% t/ f! X7 z
; (if (not (equal (assoc 210 ed1) '(210 0.0 0.0 1.0))) (princ "\nHatch not in WCS!")) ;modified by xiaocai
\+ n8 N1 r; N" O; ~/ p) @0 N ; (setq xv (cdr (assoc 210 ed1))) ;modified by xiaocai( l( h$ X- u' {3 J u3 l. c- n+ ]
(command "._ucs" "_w")/ Y# Z( X' `0 o5 u
(setq loops1 (cdr (assoc 91 ed1))) ; number of boundary paths (loops)* A. {- }" _+ E" M" A X8 [
(if (and A2k (= (strcase (cdr (assoc 410 ed1))) "MODEL"))
% ]) h% Y3 X& Q$ G7 m (setq space *ModelSpace*) B6 U+ T, G. P& c0 V( _( i
(setq space *PaperSpace*)
% ^! f8 b* J3 @& t ), Q8 B7 o. N& f# n) X3 D! |
(repeat loops1
, j& Q; A9 z# c (setq ed1 (member (assoc 92 ed1) ed1))
" M s8 y2 w3 j; q0 o& O, k# w (setq bptf (cdr (car ed1))) ; boundary path type flag
' p4 ~9 I) y$ h- g+ f* l. H4 u/ N (setq ic (cdr (assoc 73 ed1))) ; is closed- \9 \& R) `& |7 U: k2 y! d/ B
(setq noe (cdr (assoc 93 ed1))) ; number of edges
1 G x) D; l+ i7 R$ ^5 p (setq bot (cdr (assoc 92 ed1))) ; boundary type) O, \* E7 [" [4 v% B
(setq hst (cdr (assoc 75 ed1))) ; hatch style: j6 w- v: |3 i2 T0 U. @8 J( w; c+ V
(setq ed1 (member (assoc 72 ed1) ed1))/ \ D9 p! V: g5 Y1 v2 R
(setq bul (cdr (car ed1))) ; bulge" J+ |2 c( K$ f% t! y9 v" Z% I2 N% |3 i
(setq plist nil)
" @% _# ]+ ^( H0 w- B! t (setq blist nil)" A5 A) {7 ]( M2 C }! ]; ~1 o
(cond$ l+ i8 y* U9 X" m3 X
((> (boole 1 bptf 2) 0) ; polyline
) n6 s4 _* _5 e b" c( h (repeat noe
0 i) ^- h, d% v (setq ed1 (member (assoc 10 (cdr ed1)) ed1))7 T* z3 V2 }1 q1 U. S
(setq plist (append plist (list (trans (cdr (assoc 10 ed1)) ent 0) ))) ;;add trans by xiaocai
q7 V: A; t' E0 g (setq blist (append blist
+ C2 h& a# F0 O L4 f (if (> bul 0). M7 |6 P6 S% O9 S' j
(list (cdr (assoc 42 ed1)))
+ i9 ]$ T; j( ^3 O+ [2 H- Z4 `" F nil
7 q! A$ v- l: {+ s+ W0 k" u )1 i- W7 H; w9 L: f1 \- c
)* }# j7 K5 C5 w9 k$ e# o) b3 b/ u* z
)
( k/ S2 C, w4 T3 W7 D+ y )
R/ J9 Y( Q- Z" w T! Y1 t. j (if A2k (progn
' u' ^9 o) X, o3 I3 D (setq polypoints
- R+ A" Z5 n! }" T (apply 'append' q4 x9 x1 x# l, M) z" {8 W8 S
(mapcar '3dPoint->2dPoint plist)
6 a) |& v. G. c )8 k) ]% C2 s( i! W
)# b2 o4 W# p* w2 h( g& Y4 B
(setq VLADataPts (list->variantArray polypoints))
" i8 `: z. a, h# q (setq obj (vla-addLightweightPolyline space VLADataPts))
: E- H* T, I1 L! U2 f: Z (setq nr 0)
: |7 B! A$ [9 b9 U (repeat (length blist)
0 v0 e9 V2 v, o (if (/= (nth nr blist) 0)
" I- ]3 y( H& G3 s0 @" [1 S (vla-setBulge obj nr (nth nr blist))9 j% y2 c9 z8 l7 v" `! P( K) j
)
- z) A& @8 X% _* f s3 e/ E (setq nr (1+ nr))& Q# J3 U# \+ _
)2 C- j1 i( b' }( l6 N( u9 n
(if (= ic 1)
1 }: z( K! A; q, N4 P% A% B, f' @ (vla-put-closed obj T)2 E- ~. p q9 A! `% M# ]
)
* r7 E: U+ m0 n) |7 t (if hl (vla-put-layer obj layer)); J+ x/ c% W' m9 v
)7 v V- \0 P* F, x: E
(progn
* l7 u/ W( \! o( I (setq ne (append (list '(0 . "POLYLINE")) (list (cons 66 1))))6 r0 H& L, x/ l a. \% N0 y
(if (= ic 1) (setq ne (append ne (list (cons 70 1)))))" `, `1 t: }2 \6 }# @
(if hl (setq ne (append ne (list (cons 8 layer)))))6 r4 L( J3 D! U d3 `! Z: b
(entmake ne)% d; ]9 o- L$ `& }
(setq nr 0)
! s* q8 o8 q0 I3 [ (repeat (length plist)* n# a8 s) H' ~7 e$ @
(if (= bul 0)+ a" t1 x+ I) o; g& l6 [, g
(entmake (list (cons 0 "VERTEX"). c. g1 b8 a4 t4 ?# T' t8 c
(cons 10 (trans (nth nr plist) ent 0) );;add trans by xiaocai
* y* m3 L! o. s5 \: |( J! } )
% w- Y2 _* n- c5 b )
/ u5 M1 f1 F' X1 m (entmake (list (cons 0 "VERTEX")& P; i% C& E, @: j5 X
(cons 10 (trans (nth nr plist) ent 0) );;add trans by xiaocai$ n0 T* h' W8 g" z
(cons 42 (nth nr blist))
) @/ ^# V. |3 y& g )
+ d/ X& I. w) d2 d )7 e7 f4 {% C) O) z& t+ ?6 Z6 v
)3 U2 B4 f( Q% l
(setq nr (1+ nr))+ p: b" m1 H8 G7 j
)& \( Z0 _' w/ G6 Z8 l. k
(entmake '((0 . "SEQEND")))9 ]4 a5 x8 B0 \7 M2 g
)
, I* E. l# k9 M0 E* _" w )
+ W4 W: u8 B) h! @ )
+ Q& ~8 c. Y- f; U3 c. N3 c3 @ (t ; not polyline+ t8 K; V# g) R3 w$ q/ z
(setq lastent (entlast))3 R2 ~ f: t, S% Q. E! N6 O
(setq lwp T)
$ A" l; ~; V* j6 T6 R, O (repeat noe. t& Y6 \3 x$ d+ e! l
(setq et (cdr (assoc 72 ed1)))% R: p7 E F ?9 W
(cond: k" L4 w" K# m0 `
((= et 1) ; line( a) J* g+ c& I, O
(setq ed1 (member (assoc 10 (cdr ed1)) ed1))/ x, h8 s8 I; S/ C
(if A2k
7 U3 \ G g" ]# |+ P (progn0 _6 d) {; o1 z/ w: {( ?# o
(setq obj (vla-AddLine
* q3 T( l; E# \% V# o space& H* t! ]4 q2 G6 Z. k; j- @+ ^
(vlax-3d-point (trans (cdr (assoc 10 ed1)) ent 0) ) ;;add trans by xiaocai
1 P* w" R1 k$ L0 u6 v% M (vlax-3d-point (trans (cdr (assoc 11 ed1)) ent 0) ) ;;add trans by xiaocai
! S; r, Y5 r/ l G4 x4 q3 S) ] ))
& E# _4 |$ }) {; n: k (if hl (vla-put-layer obj layer))! G# J: q$ l- y8 {6 U- @+ ]+ k& m
)" {* w( J, \' I! [- D# V. @
(progn9 q; L% t5 M8 B5 y8 W# t( f# ~
(setq ne (append (list (cons 0 "LINE"))6 ~+ Q; C3 g1 `' @3 K9 N
(list (list 10 (car (trans (cdr (assoc 10 ed1)) ent 0) ) (cadr (trans (cdr (assoc 10 . s0 S( e" L( b; ]" D( E! a
6 U" |4 h6 @6 ?% L8 H7 v* u3 Ued1)) ent 0)) 0)) ;;add trans by xiaocai) r8 Q+ `8 ^! A7 c a
(list (list 11 (car (trans (cdr (assoc 11 ed1)) ent 0) ) (cadr (trans (cdr (assoc 11
, O/ c& w L: @2 l0 _9 z9 Q# v( Q, {, q) {+ \ i
ed1)) ent 0)) 0)) ;;add trans by xiaocai6 o ]6 F: K- h% r# ?
;(cons 210 xv)1 G: W' t2 r% V! A
)# ?) m- C: |& s4 j9 u
); n: A) N. {# n9 ]; z/ w( g8 m
(if hl (setq ne (append ne (list (cons 8 layer)))))
# h% g4 z3 [8 V! }8 w' n (entmake ne)( t3 m: A, r: u$ u% F+ O% ^6 V
)3 v/ x! e& x+ _
)
2 w0 T! x+ C* c& D' G# e (setq ed1 (cddr ed1))) J- G( {: c5 }7 @- ]2 F+ v1 X" F
). b) I& T3 m# X' {' t
((= et 2) ; circular arc( ]* [7 ]2 L& A# p$ }! X/ ]$ c
(setq ed1 (member (assoc 10 (cdr ed1)) ed1))0 K- U+ R: @( h
(setq ang1 (cdr (assoc 50 ed1)))
5 e" D/ H7 P: ~- C (setq ang2 (cdr (assoc 51 ed1)))2 O: s1 q1 v8 v* \* ]
(setq cw (cdr (assoc 73 ed1)))
/ e8 S7 [ Z# X (if (and (equal ang1 0 0.00001) (equal ang2 6.28319 0.00001))
$ E& r/ x4 n4 } (progn; ?$ @. ~7 I; ~7 ^2 ^, S
(if A2k
% c. B: e' g) t- A) }& r (progn
4 s& d' b! w7 I2 R (setq obj (vla-AddCircle
1 H4 x6 |) `) O8 E( q! E; p space
" O1 U8 U9 m9 L( f (vlax-3d-point (trans (cdr (assoc 10 ed1)) ent 0) )( V- n! R/ }) P w
(cdr (assoc 40 ed1))
" r6 t3 s% e! t M9 D! \ ))
$ C' N# c6 h; F5 _1 D- W3 ~8 n% e (if hl (vla-put-layer obj layer))2 X6 A1 X# @% A p
)- J: T6 R1 z0 z2 a1 g2 a! B
(progn" v6 V6 Z/ g j1 @
(setq ne (append' I* `9 O/ h1 ^8 U2 k/ U8 R" ^
(list (cons 0 "CIRCLE"))
4 g5 _- B& J4 E1 {/ \$ z3 R5 r8 z) H+ { (list (cons 8 layer))# e/ Y& f* V4 k& U) N
(list (cons 10 (trans (cdr (assoc 10 ed1)) ent 0)));;;add trans by xiaocai
& ~7 ~9 J# K7 k" C. E n (list (assoc 40 ed1)); U7 }7 e1 g( z5 a2 Z# @
)
8 @+ O: h" Q. } )$ ]0 d" W% D: o$ J4 q% \! ^
(if hl (setq ne (append ne (list (cons 8 layer)))))
& m$ m. M, n x3 O3 X (entmake ne)
; e+ i+ V! C' l- ~ )
. g1 R3 U4 [1 g! t. d. n )
0 w; M3 a2 c: R+ w* g* C# h1 F (setq lwp nil)
# u% b. l* e0 w e9 Z. _ )
. K( P6 d7 |% r% l2 H0 W9 G (if A2k/ N D, B* K1 O. U
(progn# b5 ], V7 B: k6 j5 b8 b
(setq obj (vla-AddArc
0 e; a5 r: N9 z( K' B a space i) _+ w# d. F" f" s
(vlax-3d-point (trans (cdr (assoc 10 ed1)) ent 0) );;;add trans by xiaocai
+ e$ a1 ]$ S' f& q7 k (cdr (assoc 40 ed1))
9 t5 a0 h& d8 ]1 x, R' q (if (= cw 0)
) R$ f' ^) T4 C7 e! ]$ |0 o: r (- 0 ang2)( V5 q- y! \; \$ F j0 L
ang1
/ M, e& l' {! z! T6 j {( Q )3 h! b* c" N. B- v, C& K4 w4 X+ E
(if (= cw 0)
( [. O6 c& ]- q+ G$ W8 l (- 0 ang1)! |: t7 x( Z( H* C8 g/ l% R( l; E
ang2
6 k5 @8 V- |! M% v( d" u' ^ H9 g )
I8 C3 n" ^6 d% [# Q% n ))/ J" Q; @0 U% j k
(if hl (vla-put-layer obj layer))
" e: E/ ]' [7 f )4 p5 H7 }! c9 G' P! H, g9 {
(progn( p% h" p4 f# P" P( x, _! e
(setq ne (append (list (cons 0 "ARC")); ^0 v$ ?9 t% V+ P; h
(list (cons 10 (trans (cdr (assoc 10 ed1)) ent 0) ));;add trans by xiaocai' q* A+ V/ Y) Z3 N
(list (assoc 40 ed1))
' u0 @: S4 ~7 e (list (cons 50
) i. h$ o/ c' I# { (if (= cw 0)7 Q" x( _0 S' x
(- 0 ang2)
; |+ r, ~+ F4 R' F# T# E- j- B0 A ang1
# L6 y# p- N( r! D2 H2 q. Z8 B6 f S )5 p/ ]) D; h) K4 g1 y R4 H- r* T
))
: p9 m+ v- r2 }, p (list (cons 517 N! B, t' M7 [. `7 d9 B) a9 `3 u
(if (= cw 0)2 i2 X4 H" \5 P+ O0 z" f8 \
(- 0 ang1)8 {1 m$ Q- C4 c: v x
ang2
+ g! R! _: C" f: G x )! i( ~% J+ I4 i4 @3 H0 o! w
))8 t! Y) ~6 K& k, v
)5 H& ` H. N5 i/ n$ T* W- H5 h7 l
)
+ y' B& r7 j- G; l3 l (if hl (setq ne (append ne (list (cons 8 layer)))))
]# u' Q# v5 P6 ?) }' R (entmake ne)
# ]' d& R" C. M )* l! K. n n# u; W* d
)
' w& L8 a8 ?. o )
# D; v$ f. \0 M6 }- k$ M4 e (setq ed1 (cddddr ed1))! ?% d$ h$ }; D5 f$ v p% Q8 ~% [
), |8 g2 z d! T M V0 f
((= et 3) ; elliptic arc
; H' A7 C$ V8 b (setq ed1 (member (assoc 10 (cdr ed1)) ed1))
7 P, A3 D5 \# q, S6 b (setq ang1 (cdr (assoc 50 ed1))) @: h: W; J6 F" r* U' I1 L
(setq ang2 (cdr (assoc 51 ed1)))6 S0 C# z$ H* N! z) J8 G6 N
(setq cw (cdr (assoc 73 ed1)))
; Z9 ~$ v8 `7 H7 Y4 p# V6 n (if A2k (progn' {' ~ E& A$ A( G& [; [4 k
(setq obj (vla-AddEllipse: e% b, g5 n( i. v$ v9 D
space
: N% N% A) \% ` (vlax-3d-point (trans (cdr (assoc 10 ed1)) ent 0) )+ v$ W2 w' j7 K9 A0 t
(vlax-3d-point (trans (cdr (assoc 11 ed1)) ent 0) );;add trans by xiaocai s9 } {( X' U
(cdr (assoc 40 ed1))
. j8 Z/ P F" X% ~8 z. V. G2 C )' I5 _/ h5 u: G8 s1 u [
)& b& [. e5 v; [# E2 m4 L
(vla-put-startangle obj (if (= cw 0) (- 0 ang2) ang1))- [! z: L" @( }$ a5 ?' U
(vla-put-endangle obj (if (= cw 0) (- 0 ang1) ang2))
; Y* n! Y* |8 h! @ (if hl (vla-put-layer obj layer))( t& k$ Z. h* S% o8 A- e, p& v1 M4 w. q
)
+ O: R5 ]6 l8 W) r3 Q (progn( m. `, O* R4 V+ b6 f
(princ "\nElliptic arc not supported!")
5 o( b. v$ N4 u4 [ o/ O9 Y (setq noarea T): ~0 |$ [- V6 a* @0 K
)' K; i" C/ T7 a u
)
# H* e0 J1 W4 h, H" m! } (setq lwp nil)
( v3 d8 k* n F! H6 o3 x4 Z3 L8 U )
$ ]% H& g/ H! t/ t) X ((= et 4) ; spline3 @9 {4 I$ D6 N8 b
(setq ed1 (member (assoc 94 (cdr ed1)) ed1))
( s( J2 ?- m- [$ T (setq knot-list nil)
1 U3 t8 H5 |' o8 C9 b; E (setq controlpoint-list nil)
+ y, C2 H: Z4 Q- m/ e- A0 A (setq kn (cdr (assoc 95 ed1)))
( P4 q* ]% R6 i8 `3 x (setq cn (cdr (assoc 96 ed1)))2 W" G/ _7 W' ?8 v& G7 K
(setq pos (vl-position (assoc 40 ed1) ed1))
, }3 q, E' n7 t0 N) L3 ], w/ h (repeat kn1 N3 D* X+ N+ v, g
(setq knot-list (cons (cons 40 (cdr (nth pos ed1))) knot-list))* Y: _: q6 W. c9 W( \% ]
(setq pos (1+ pos))
4 V/ i$ j3 _5 _6 z' ` )6 g6 G2 ^! w+ [- ?" R$ ~
(setq pos (vl-position (assoc 10 ed1) ed1))! b5 Q" y$ x" v0 ~) [# X, N
(repeat cn0 P7 T! ~5 t- y% ^) v7 v
(setq controlpoint-list (cons (cons 10 (trans (cdr (nth pos ed1)) ent 0) ) controlpoint-
) Q$ t" o7 h4 k- [
b, |' d0 M5 s; Clist));;add trans by xiaocai
. y: x/ L. U3 R' L& J (setq pos (1+ pos))0 X* c0 ~9 j: l$ T5 G
)
) K `8 j3 \2 S3 Q* l% y (setq knot-list (reverse knot-list))0 V7 B: L3 I' L
(setq controlpoint-list (reverse controlpoint-list))" L8 X# H$ |4 Z- S9 D) f4 ~" u! a5 ^+ i
(setq ne (append5 A5 Z+ @1 n! I
(list '(0 . "SPLINE"))
& [8 ?: H, v' ?$ L (list (cons 100 "AcDbEntity"))$ @% `$ t; D- i* G5 o: J2 ] c
(list (cons 100 "AcDbSpline"))
- E# _4 C! J0 L; ` (list (cons 70 (+ 1 8 (* 2 (cdr (assoc 74 ed1))) (* 4 (cdr (assoc 73 ed1))))))
' L# @5 U/ X6 `+ o+ B4 j. j: Q: W (list (cons 71 (cdr (assoc 94 ed1)))) _8 X/ Q7 O' E2 a1 S
(list (cons 72 kn))& l4 x: S p3 H5 w, h
(list (cons 73 cn))- s1 m# f0 G) @; [0 E+ }+ }
knot-list ~: H" y3 h+ Z# Q5 }
controlpoint-list6 Y" n, W- \$ w# [. K' R
)/ u) Q: |# d( }6 m. p# x
)
* j: N/ L2 u6 T2 z6 f3 T (if hl (setq ne (append ne (cons 8 layer))))
: |; |! E7 H$ I) v4 w2 b' t (entmake ne)# K( i9 L0 G% N
(setq ed1 (member (assoc 10 ed1) ed1))+ b4 q5 v8 @9 B+ w
(setq lwp nil)
4 U7 z9 O5 W; c5 r )% w2 k; H) m, {, _1 I
) ; end cond- u0 a8 [" ^; c& B
) ; end repeat noe0 k3 I' z4 v0 z5 G
(if lwp (progn
. ]6 i2 L% l4 N6 _ E (setq en1 (entnext lastent))
% d6 @5 \% B& V& k (setq ss (ssadd))
8 r R7 y+ o6 E0 S( Q" \ (ssadd en1 ss)$ n) h* j. [0 o4 {( U! P5 v
(while (setq en2 (entnext en1))7 l# h% m% P8 Y. k \' f) D
(ssadd en2 ss)) {* c. C; U( K' \
(setq en1 en2)
) }5 \- U1 `1 A/ Q ); b4 S; T B4 q
(if (= (getvar "peditaccept") 1)
, j) f- E/ x: N5 |2 u$ [ (command "_.pedit" (entlast) "_J" ss "" "")
+ t3 l- f2 M$ ~ (command "_.pedit" (entlast) "_Y" "_J" ss "" "")
# B$ n1 e, X. g: b. l' k/ w! i+ t )* g) f3 y! e% q5 o- U
))
1 d( R- q5 S6 s* d% j$ d
. m; m. j9 }" w: s; \, F ) ; end t( j4 J) `# |8 J, v, u( ]: y. H
) ; end cond% E* c j. o$ @7 A2 h) I! `) ^' m
; Tries to get the area on islands but it's not clear how to know if an island is filled or not
7 ^; k) y& C+ Y3 J' Y; and if it should be substracted or added to the total area.( F, o% ?) H9 M- ?* N7 u8 s8 W
; (if (or (= bot 0) (= (boole 1 bot 1) 1)) (setq area (+ area (areaOfObject (entlast)))))
1 s$ B, V; M) K$ _8 h' J; (if (and (/= hst 1) (/= bot 0) (= (boole 1 bot 1) 0)) (setq area (- area (areaOfObject (entlast))))). T8 d7 _! {! Y) x& \# y
; (princ "\n") (princ bot) (princ "\n") (princ hst) (princ "\n")
1 M0 W5 Z9 N7 Y" ^' Q; (princ (areaOfObject (entlast)))+ {$ E9 q7 l1 D8 w
) ; end repeat loops1* t0 u9 f( c% Q- Y2 C6 O$ A" c
(if (and (= noarea nil) (= loops1 1)) (setq area (+ area (areaOfObject (entlast)))) (setq bMoreLoops T))5 U3 z5 I9 U; v* B9 Y a
(setq i (1+ i))
+ W8 \+ y$ U t )6 q1 D h6 \/ B! U$ P1 U. c
)$ r2 D+ j" ?( p$ \0 f! d' u) S: d' p
)' O# s z% y: F$ ~. i$ G" N
(setq ss2 nil)& X& M( u: ^0 P- t6 d
(if (and area (not bMoreLoops)) (progn
$ p. x; A! B% ]% m8 i& k0 v: I (princ "\nTotal Area = ")# W1 _8 n9 n3 K' Q+ ?$ k8 ?
(princ area)& i/ d7 ]2 Z7 T
))& v7 T! u6 q9 _# V' E b
(restore)
4 |( t( K' O4 d1 z7 J7 Y3 r (princ)3 r$ \- T; Q2 f. S8 N/ M9 v
){\rtf1}
! h" G. j+ t' E+ B- K5 N7 y5 ]8 y9 L' S
(defun C:BN (). |, c' h6 {: u
(princ "\nAdd block name to drawing.")
3 ^+ C/ ~/ a* I (setq pt(cadr(entsel"\nSelect Block:")))
1 [: U# n0 `" ?# H! i6 | (setq e1(ssget pt)) 7 S, q8 a" ^, R1 _0 B/ F3 F
(setq e2 (entget (ssname e1 0)))/ |% @% a; `- e: F7 e
(setq blname (cdr(assoc 2 e2))); W u' {& x2 x9 a; @! ^8 o4 V6 D$ b
(setq pt1 (getpoint"\nSelect point for block title:"))
/ U. u! Y, B; w; ^3 Z# ]; ]! i9 _3 C (command "text" "c" pt1 "" blname))$ n: c: Y, [* Y( V
(princ "\nType BN to execute)
1 w4 K* n9 d( w) {2 t�32
6 { T3 f r T: N, e! v. `4 |6 Z6 P; Z! z
4 C- {! r: a. [* Y! i! e' y5 i |
-
2025-04-21 Plot.jpg
(70.6 KB, Lượt tải về: 522)
-
2025-04-21 Text Style.jpg
(42.87 KB, Lượt tải về: 514)
-
2025-04-21 Layer.jpg
(26.81 KB, Lượt tải về: 517)
-
2025-04-21 AutoCAD Message.jpg
(8.58 KB, Lượt tải về: 506)
-
Screenshot_20220406-091212_Facebook.jpg
(306.88 KB, Lượt tải về: 502)
-
00st Cách Thêm Menu & Lisp Vẽ & Fonts Chữ mở Gõ Chữ Administrator để G.jpg
(249.66 KB, Lượt tải về: 535)
-
Untitled-1 Da Xong Trump Putin 0 Hoi Xong Chua copy.jpg
(299.44 KB, Lượt tải về: 509)
-
-
RUN-2000.zip
1.11 MB, Lượt tải về: 5, Tải điểm: Thưởng -2 điểm
Zip
-
-
0st RUN-2000.zip
2.02 MB, Lượt tải về: 1, Tải điểm: Thưởng -2 điểm
Zip
|