|
|
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 |
- ********************************************************************************
" F; H, U: S& h' J* Z3 r - * ACADLISP FOR AUTOCAD R.14 -> AUTOCAD R.2012 *
3 f' m! e. g! } } - * Tran Ngoc Thang DHXD-HaNoi41 from years 1999 -> 2015 *! a8 ?7 N" a) R j' f3 N6 v
- * Suu tam & Soan *$ s: h3 ]* y0 p4 X8 ?
- ********************************************************************************( W' i" ?) j! V( b
; z3 h) d& h+ }& L( O- ; Next available MSG number is 104/ C- s. D; [0 m
- ; MODULE_ID ACAD2000doc_LSP_
- w6 r3 s# S9 p* w5 N- J' M - ;;; ACAD2000DOC.LSP Version 1.0 for AutoCAD 2000: `5 Z* @! g0 w' p
- ;;;! J$ s0 I& y& R; `
- ;;; Copyright (C) 1994 - 1999 by Autodesk, Inc.# k1 A( A, v$ s
- ;;;
, S. P0 J; l3 P" N2 n7 U - ;;; Permission to use, copy, modify, and distribute this software% W6 `1 V- ~% n: C
- ;;; for any purpose and without fee is hereby granted, provided5 [5 R+ W. Q! |( S0 ]: m
- ;;; that the above copyright notice appears in all copies and ] M% g4 n) ^- {0 m, D
- ;;; that both that copyright notice and the limited warranty and
6 ?: D* ]% @$ Q# H- x5 J; r2 y - ;;; restricted rights notice below appear in all supporting
+ ^( U8 o" s; o0 p) L# c) w - ;;; documentation.
* f# { P& Q4 r# A - ;;;% v: f( I) i. d5 ?/ }# @
- ;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
4 s1 `5 a# B4 s/ x' a5 g$ R+ }! C - ;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
' C N$ s8 ]: g - ;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.8 D! F$ x8 v Y4 b8 V, M' B! k9 q
- ;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE! ]# w- F5 |* B& W
- ;;; UNINTERRUPTED OR ERROR FREE.
* c# `0 q9 h& o! h( i1 u - ;;;
! q9 X% E5 i4 E3 m0 Q, C m8 k - ;;; Use, duplication, or disclosure by the U.S. Government is subject to* k- E N- O5 P
- ;;; restrictions set forth in FAR 52.227-19 (Commercial Computer3 p4 l( o3 n4 x F
- ;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 7 M; s! L- ]& t
- ;;; (Rights in Technical Data and Computer Software), as applicable.
- k! a) T1 }0 q9 S7 w p( \ - ;;;
7 j: F" X7 y7 _/ T/ h - ;;;.
; z* |+ S9 V4 ^. A3 }, _* Q0 N - ;;;
4 g" y0 M6 P/ K5 l - ;;; Note:, L' D6 {$ `" C2 Q* R; a- \% U d$ _
- ;;; This file is loaded automatically by AutoCAD every time . A$ L7 ^+ }$ A$ `
- ;;; a drawing is opened. It establishes an autoloader and
# N9 P. b; h* Q0 U9 C+ y+ V - ;;; other utility functions.9 Z3 b$ Z5 b9 r; z% j
- ;;;
8 q( Y% `9 A! `; g) O4 p' c - ;;; Globalization Note: " l2 P( N( K. N0 H1 i3 m9 y
- ;;; We do not support autoloading applications by the native ! U' O/ ?& D6 c7 P: O
- ;;; language command call (e.g. with the leading underscore
& r. z0 N8 o* D5 s0 O5 B - ;;; mechanism.)
% Y- _! U& y8 h1 D* w - $ g6 @0 h/ E; j/ @% o2 ]
! W) q# R' l6 b0 Y0 |9 Q( m- ;;;===== Raster Image Support for Clipboard Paste Special =====
! P) }3 T0 b5 Q9 [' d - ;;
7 _; p) K9 G# _# U3 S5 S - ;; IMAGEFILE
+ M+ N- Z5 t, @: F; H) v - ;;
; @" A( V; A2 Q) v4 k - ;; Allow the IMAGE command to accept an image file name without
p8 b8 ~, q9 G0 o2 }9 I6 }' {9 B" B - ;; presenting the file dialog, even if filedia is on.. P1 d8 }3 S5 z. N
- ;; Example: (imagefile "c:/images/house.bmp")
! c1 ~" L i, w" K0 H% L; F - ;;3 F& [5 S7 \4 y% q7 d( `: V
- (defun imagefile (filename / filedia-save cmdecho-save)( X- }. G* z2 {' s( F4 _! J% J
- (setq filedia-save (getvar "FILEDIA"))7 ^# e; f; C6 x5 x
- (setq cmdecho-save (getvar "CMDECHO"))
B2 R: Y. s4 g- _ - (setvar "FILEDIA" 0)
$ z" ^; \; o* l; A+ j$ f - (setvar "CMDECHO" 0)3 R" S* a7 p6 ~. n
- (command "_.-image" "_attach" filename)2 _' \5 M( k) ]# V( H' N
- (setvar "FILEDIA" filedia-save)
# K; j4 Y n; c/ Y& W - (setvar "CMDECHO" cmdecho-save)/ B( T, S" ^) _& d# r- L
- (princ)" I1 u% }" P- T- U5 e) E( g
- )& f- g# Q. ^) G: O4 }0 o
- $ @+ \/ r3 `9 e; [$ y
- (defun c:zx () (command "zoom" ".5x"))
* ?, s; r% }6 [! ~6 x - (defun c:zz () (command "zoom" "p"))) f8 r4 j2 a# F( U* G- z1 N
- (defun c:za () (command "zoom" "a"))
( b1 r! P$ _: q6 ^ - (defun c:zd () (command "zoom" "d"))
1 J' x: |' ^6 u. ^( w - (defun c:ze () (command "zoom" "e"))
/ i, d8 b- g4 N0 ^2 C# c4 p' n - (defun c:zr () (command "zoom" "" "")); ~- z, Z, e3 e- R3 a
- (defun c:vv () (command "ucs" "v"))
5 l# R) ?2 {9 M$ v6 v% F - (defun c:co () (ssget) (command "copy" "p" "" "m")), J) h$ g' `& I, N& F5 d# K
- (defun c:c () (command "circle"))
1 p- ?0 j" D( `/ ^( G/ ?' q - (defun c:rt () (command "rotate"))& x% n" S8 y5 h9 L0 _& A& V3 p3 ]
- (defun c:3q () (ssget) (command "_rotate3d" "ANGDIR" "value" pause (princ)))# p# Q; g' {$ V$ C5 ], W: R1 {9 y
- (defun c:30 () (ssget) (command "rotate" "p" "" pause "30"))8 @5 a+ y# Q. @5 _ q
- (defun c:-30 () (ssget) (command "rotate" "p" "" pause "-30"))* S5 D' f% s x& y" O
- (defun c:45 () (ssget) (command "rotate" "p" "" pause "45"))
. X$ i1 A+ a) w- H) u7 h3 S - (defun c:r5 () (ssget) (command "rotate" "p" "" pause "5"))7 w' v5 `. r3 z% P6 W% [) c
- (defun c:60 () (ssget) (command "rotate" "p" "" pause "60"))
% I7 @! E. |: L6 G+ F# { - (defun c:-60 () (ssget) (command "rotate" "p" "" pause "-60"))
$ Q( [" Y4 f: s - (defun c:90 () (ssget) (command "rotate" "p" "" pause "90"))8 Q% r0 |- D0 b
- (defun c:180 () (ssget) (command "rotate" "p" "" pause "180"))+ H% c2 N0 T1 w7 H9 e9 ^7 p! @" f
- (defun c:-45 () (ssget) (command "rotate" "p" "" pause "-45"))
5 j3 z2 Q [- p2 v1 z2 N8 T - (defun c:-90 () (ssget) (command "rotate" "p" "" pause "-90"))* B4 L+ ^ t1 t) l$ B1 d
- (defun c:md () (ssget) (command "mirror" "p" "" pause pause "y"))
8 S+ g4 _" x+ m' U( | - (defun c:fd () (command "find" "p" "" )(princ))(princ)/ e, L3 ^6 t% y
" ~9 e* _. O; B) j8 v3 _! d7 Z; ^6 }- (defun c:romantdim () (command "-style" "ROMANT-DIM" "romant,vnh.shx" "200""1""0""n""n""n"))(princ)9 ]6 I; o% e6 I' T$ d/ [! V
- (defun c:romantext () (command "-style" "ROMANT-TEXT" "romant,vnh.shx" "200""1""0""n""n""n"))(princ)
! x9 D$ q: M( B @+ f- C- _ - (defun c:vnhelvthuong () (command "-style" "VNHELVLT-Thuong" "vnhelv,vnh.shx" "500""1""0""n""n""n"))(princ)
& a# K" _( j' F4 v- n - (defun c:vnhelvhoa () (command "-style" "VNHELVLT-Hoa" "vnhelvh,vnh.shx" "500""1""0""n""n""n"))(princ)0 u& l; a5 o* N2 v4 J4 T6 {
- (defun c:truc () (command "-style" "TRUC" "impact" "0""1""0""n""n""n"))1 J; F0 q' h; _, L& x- W
- (defun c:chu () (command "-style" "VERDANA" "verdana" "200""1""0""n""n"))! f/ x c9 U: [- R4 c
- (defun c:cot () (command "-style" "COTES" "verdana" """1""0""n""n"))
. \: v, l' C. @% A% E+ k - 4 I/ \, [% k6 E' y
- (defun c:an () (command "-style" ".AVANT" ".vnavant" "200""1""0""n""n"))
, p. o( B, E" s% C6 O) G- q - (defun c:ah () (command "-style" ".AVANTH" ".vnavanth" "200""1""0""n""n"))8 R4 o: {2 ` N5 ]
- (defun c:ha () (command "-style" ".ARIALH" ".vnarialh" "200""1""0""n""n")). ]. M- j }6 Y" d# q; C! ?
- (defun c:na () (command "-style" ".ARIALNARROWH" ".vnarial narrowh""1200""1""0""n""n")); \6 ]8 K+ u8 o" {7 l4 D4 d: W
- (defun c:vn () (command "-style" ".VNTIME" ".vntime" "200""1""0""n""n"))
2 t' t, T4 F/ y0 W - (defun c:vh () (command "-style" ".VNTIMEH" ".vntimeh" "200""1""0""n""n"))
" r- k" t" V7 K, g M) n j2 `
! a) L! `: w4 X1 c v: \2 q% Z- (defun c:ps () (command "PSOUT" "CorelDraw-import-Photoshop" "W"))(princ);export the current view of a drawing as an EPS file
% n* T, c/ b$ Z& j' |5 F% |
' j1 ]- [2 _- P1 b- ;free lisp by cadviet,cd2k442 p1 r0 }( L' \
- ;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
, `$ q, c; [9 ^' z9 ~. z5 _- l( {0 y - (defun c:FTEXT (/ ent tstyle )
7 l' [$ Y2 Z7 v5 C6 j7 _7 m - (command "undo" "be")
4 q% T I! `) E- T: V; [ - (setq ent (entsel "\n Pick text :"))
! v' T1 U# p* e6 i - (setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
9 K' F8 x+ `" T6 ~$ \ - (command "STYLE" TSTYLE "romant.shx,vnh.shx" "0" "1" "0" "N" "N" "n")! [; g4 v- V6 L3 Z* y8 Z. w
- (setvar "TEXTSTYLE" Tstyle)
( y5 I n1 H3 {' G* t( W0 u+ u - (command "undo" "end")- K& ?( ]6 j: P1 R/ ?- F+ b
- )+ _# Q" y5 l( r7 n N7 ?, X
- ;Cam on cadviet nhieu 27-11-2023 04h15p36s (thanks cadviet)8 T X5 x( u* b4 z
- # E9 X$ V9 H; o8 z/ l% l
- ;free lisp by cadviet,cd2k44
! _# r$ h/ b$ ?) Y7 x5 R/ ? - ;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
, p* e% _- i, F6 t* L7 \7 i" | - (defun c:Fvnh (/ ent tstyle )$ M' M+ m$ ^, B
- (command "undo" "be")8 y! t7 ^* F& X3 e$ R0 |! d
- (setq ent (entsel "\n Pick text :"))
9 n( {, Z' V7 i( V3 F' F - (setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
) |8 U4 ^( C$ H& h - (command "STYLE" TSTYLE "vnhelvh.shx,vnh.shx" "0" "1" "0" "N" "N" "n")+ E+ ?2 w# } i; v6 P6 J6 E
- (setvar "TEXTSTYLE" Tstyle). @/ N& m% q* F+ H' x
- (command "undo" "end")
/ w' i; f- R A( g% b0 s - )3 T% W% G! y4 J1 I' c* f/ m
- 9 y5 Q" w f9 a* l
- ;free lisp by cadviet,cd2k44. n2 Y* r) w5 Y. K' R/ Y( l& E
- ;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
# N" y3 E6 K) f7 u! Y9 [. i7 M8 G' z - (defun c:Chbg (/ ent tstyle )
& X, u! a+ g4 P0 S; y) q - (command "undo" "be")) h% C$ r0 j7 i/ H4 K. V2 M
- (setq ent (entsel "\n Pick text :"))
1 _( E* j. I! Q* b4 e - (setq TSTYLE (cdr (assoc 7 (entget (car ent)))))8 D. p) T3 \3 M2 R* g1 l
- (command "STYLE" TSTYLE "chhbg.shx,vnh.shx" "0" "1" "0" "N" "N" "n")& S6 K6 x4 b. _
- (setvar "TEXTSTYLE" Tstyle)
: w: `; o' T5 R- d$ b- Z6 V - (command "undo" "end")$ A' h1 d/ a" e, Q x
- )
, q$ @6 }# v0 W0 C0 _
# x6 v8 U* }5 `- ;free lisp by cadviet,cd2k445 C" R9 `$ Y/ k1 M+ v7 x! n( j+ f
- ;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830( F. p1 V) f2 \, [% {
- (defun c:Chsm (/ ent tstyle )* T) q- }/ Y0 ]# n, Y
- (command "undo" "be") _" Y3 i: H9 u" h
- (setq ent (entsel "\n Pick text :"))6 b2 Z: w N0 }8 n
- (setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
" x1 \# |2 G) D0 O - (command "STYLE" TSTYLE "chhsml.shx,vnh.shx" "0" "1" "0" "N" "N" "n"), X9 w; b4 V. p/ M8 |
- (setvar "TEXTSTYLE" Tstyle)
; j! p6 i0 n# A2 z7 h0 ^- f - (command "undo" "end")
9 \3 k o% v* u4 w$ R, ]. ~3 Q2 B - )
# ~! g* A8 j7 ^) J - / r, V6 A5 ?+ n
- ;free lisp by cadviet,cd2k44
% T% D+ R: a, Y5 h' p; x; T - ;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830* t# t5 r# S' K/ ^* ^
- (defun c:Fttf (/ ent tstyle )
q$ E+ b6 d8 M, a, H; s- E0 R; u) O - (command "undo" "be")* q; W, n: ~$ N+ Y
- (setq ent (entsel "\n Pick text :"))% N1 S; m+ J6 }. n( C' a# J
- (setq TSTYLE (cdr (assoc 7 (entget (car ent)))))0 u9 n/ Q7 ^# I6 [( c
- (command "STYLE" TSTYLE "verdana.ttf" "0" "1" "0" "N" "N" "n")
% {( _$ u0 l+ M& U - (setvar "TEXTSTYLE" Tstyle)7 s1 Y% m2 _; l& s% F
- (command "undo" "end")' M* W" B2 V u9 e: u4 Z' D, s1 i' I
- )
. ~. u& I9 l Z" h+ Y6 `/ w
- V1 }( L8 ]1 K* p- ;;; ============================================! n! j0 y s% A% {: h* n
- ;;;
& Y/ G; Q2 a# b+ G6 o' B5 g - ;;; LISP Creater Tao Duong Dan AUTOCAD2000- z+ i; t% Y$ j; F6 c
- ;;;; ^6 p( g; A: z/ L9 U* c
- ;;; ============================================
5 u; n7 ]: {+ P6 ^6 Q
% u |3 }7 X/ ^5 L- ;;; ============================================- E: M* K% ^" I3 m! y8 o9 [. h1 N
- ;;;
; v- ^ X& A, l1 P, U! q - ;;; CREATING FROM AUTOCAD2000& C ]4 U2 r+ e1 g
- ;;;
) v! O# O% r( n' \$ q# {2 q2 M - ;;; ============================================) W$ }: O3 M0 x
- 5 y6 c4 @! m/ G4 `! z6 @( G
- (setvar "INSUNITS"4)
, @# j2 n: A/ i4 X - (setvar "ANGBASE"0)
" V9 I* O; S' V# r" U - (setvar "ANGDIR"0)
3 W# g) {# Q, R - (setvar "AUNITS"0)
$ }0 B; X, y/ i3 y7 f - (setvar "AUPREC"8)
/ _6 |, _. G$ H+ j5 m0 J! p - (setvar "LUNITS"2)
0 e& N2 d+ X) ?# O- j2 [0 v - (setvar "LUPREC"8)$ z0 n3 p; h2 j7 k% [4 S5 E4 V& [6 W
- (setvar "ACADLSPASDOC"1) * m+ q! a) i2 O; C
- (setvar "pickbox"5)
- N* O0 q& P& _: K; r - (setvar "blipmode"0)& ]+ K, `! G& x4 D# L
- (setvar "mirrtext"0)& I! S6 R6 H/ V Q7 d( \1 `
- (setvar "cursorsize"100) P+ H6 e5 G* X% G0 G+ X
- (setvar "ZOOMFACTOR"75)
0 R; p) H e0 H5 a" ?. @ - (setvar "LTSCALE" 10)
; ^ x* X, C4 Z8 Y* Z - (setvar "lwunits"1)7 v& o/ L3 o1 j; x
- (setvar "DIMBLK" "Closed")5 E2 N! c4 R7 m3 E% b3 x
- (setvar "DIMGAP"0.0693)- `5 q$ A; _0 H
- (setvar "DIMASZ"0.20). v" Z9 i& l. @: E- W# u% S
- (setvar "DIMCEN"0.2). H9 K. @; i, `: g) u
- (setvar "DIMDLI"0.1)
, ]) R: n# N7 f! x5 {! [0 z: P* ? - (setvar "DIMEXE"0.0693)+ W* x7 n; Q' @9 _- ]% a
- (setvar "DIMEXO"0.25)7 i' S" g# Y, l/ C7 h
- (setvar "DIMDEC"0)/ X! [0 x' F8 _1 j2 V9 x
- (setvar "DIMTIX" 1)& v& _+ N# I+ u: l! X3 ~( C& ]. f8 f- o
- (setvar "DIMTXT" 0.099)
5 l1 _: ?; \7 g - (setvar "DIMCLRT" 7)
8 c9 I- M/ O1 Z8 j0 O9 q& K& \ - (setvar "DIMTVP" 1)1 B4 W, _$ X' L3 `7 t! L# R
- (setvar "DIMJUST" 0)1 Q) }6 s# u; {' s$ V2 }
- (setvar "DIMTIH" 0); N5 [0 q9 {" d- z7 x8 p) x- H
- (setvar "DIMTOFL" 1). F9 ~3 |# v0 k
- (setvar "DIMSCALE" 1111.1111)
0 u. h; H+ w& Z) g$ E - 0 W7 ~" c q1 \( }: d8 I T
* w' M7 l0 W; M+ I1 J
# Y5 ?- P) ]! \- (defun c:zp () (command "'.zoom" "p"))/ _! N0 w9 g# q& R
- (defun c:zz () (command "'.zoom" "p"))
7 v5 ?' v8 f) ?+ h! c - (defun c:ze () (command "'.zoom" "e"))
; P( P3 j+ G3 n/ w x+ a6 u - (defun c:za () (command "'.zoom" "a"))5 f2 M! x: W' X
- (defun c:zd () (command "'.zoom" "d"))
8 n; C6 M7 `$ ]. B; X - (DEFUN C:ZZZ () (COMMAND "ZOOM" ".25X"))4 Y9 w3 J# k# Z. G/ p* s- }
- (DEFUN C:ZX () (COMMAND "ZOOM" "2X"))9 u$ I- o. e+ J8 K" s( ^
- (defun c:de () (command "ddedit")(princ))
: q* h1 J7 W7 g- N, P0 ~ - (defun c:dda () (command "Dimaligned"))/ d. W# h. u2 v. d9 r0 o
- (defun c:ddb () (command "Dimabaseline"))
8 y# |2 w& H$ k U - (defun c:ddc () (command "Dimcontinue"))
: m- u) Z1 V5 T* B - (defun c:dde () (command "Dimtedit"))
3 J8 H8 i8 P' z6 H0 e) S - (defun c:ddf () (command "Ddattdef"))' y2 c% o" z$ ?6 N1 o& g
- (defun c:ddi () (command "Dimdiameter"))
$ V7 ^" S0 c! H; D6 r/ ^ - (defun c:ddl () (command "Dimlinear"))
7 E: p" {0 B' r* U( X9 O - (defun c:ddn () (command "Dimangular"))
& X/ o9 Q$ b/ Z. A6 @$ ^# x/ q/ x - (defun c:ddo () (command "Dimordinate"))
* Z! P' [ @6 C - (defun c:ddr () (command "Dimradius")): c: H/ P" e3 i4 [
- (defun c:dds () (command "Dimstyle"))
1 K& D8 a4 W ]2 T$ v9 C5 w
* _3 \8 ]; d9 f1 j( K+ M' a- (defun c:DU () (command "dim1" "up" "select" "exit" pause ))(princ)
7 J2 Q6 I, [* | { - (defun c:DH () (command "Dim1" "home" "select" "exit" pause))(princ)- N% a) h2 Q+ l6 R
- (defun c:UU () (command "dim1""update""all"))
, O: O* `9 w' p) j' X% p& H3 V - (defun c:ded() (command "dim1""tedit"))
; O3 s8 f/ ?# p) j% f! l3 v2 A - (defun c:da () (command "dim1""ali")): D+ S+ ?, K! s) X1 N) k) o7 o2 {
- (defun c:dll() (command "dim1""l"))
* i. d' j* K; g: g - (defun c:dan() (command "dim1""an"))
2 d9 Y9 [. q' p+ O - (defun c:d1 () (command "dim1""ra")) I3 z( b+ [% ^+ {) H
- (defun c:n () (command "dim1""new"))
8 `8 h+ S& i1 \4 Z" x& ^ - 7 H0 S$ M' V: a6 g$ x9 W
- (DEFUN C:PE () (COMMAND "PEDIT"))
+ _3 h! z3 a$ G - (DEFUN C:PL () (COMMAND "PLINE"))/ p3 z$ a- P3 P) h! c1 l
- (defun c:dd () (command "dist")(princ))% ]: d' i- ]; o7 q3 j
- (defun c:w () (command "pedit" pause "w" "au")(princ))
0 Q8 o1 t1 y) y( ?$ m3 X - (defun c:pg () (command "polygon" "polygon"))
' ^8 D" D9 G8 ^; o% \: O - (defun c:el () (command "ellipse"))
4 U$ T6 c: C7 H+ V5 @$ ?2 P4 m0 W - (defun c:xe () (command "explode"))) a5 Q, j N( u0 ]7 A: O5 }& w
- (defun c:eex () (command "extrude"))
8 [' i6 R3 d. w - (defun c:xg () (command "xline""a"))
5 R! A! a! \- p5 G - (defun c:xh () (command "xline""h"))
* ]/ x# r4 V9 w5 R, S; E7 \& t/ x - (defun c:xv () (command "xline""v"))
9 V W5 w, @3 }$ g7 c
: J8 |& X j5 J" [- g+ p- (defun c:oc () (command "osnap""cen"))
( v# `# N( S5 n: m# a& m - (defun c:od () (command "osnap""nod"))5 s/ M6 v! `5 p. W
- (defun c:oe () (command "osnap""end"))3 [ e+ f2 k9 D
- (defun c:oi () (command "osnap""int"))' N9 Z/ }( t3 F: e0 Z5 @2 i6 p
- (defun c:or () (command "osnap""per"))
2 j" z6 u p0 |+ v0 b9 D9 L( f - (defun c:on () (command "osnap""none")); a# e% K; R$ c/ O y' o9 j
- (defun c:oq () (command "osnap""qua"))4 \8 Z3 C" K( P) I. Z3 P8 S2 H; U2 x
- (defun c:om () (command "osnap""mid"))
* I6 O1 N: z& t3 B7 l% D4 R' ? - (defun c:ot () (command "osnap""tan")) p( ?" p% ^4 i
- (defun c:oin () (command "osnap""ins"))! a" r4 h3 I5 g# g3 P% c
- (defun c:oa () (command "osnap""nea"))$ t; q/ l5 K- R0 Y! X: U; R
- (defun c:ol () (command "osnap" "End,Mid,Cen,Node,Nea,Int,Perp,Qua")(princ))
! ?) S" k- K) j4 K# f, ~0 ~ - ;(defun c:du () (command "dim1" "up" "s" "pick" "other"))- O: O1 i* Z. ^6 ^$ Z. x
- ;(defun c:nn () (command "new" "y" ))
4 j e, z( I' t: z5 o- [" H - ) y" R4 h- |% X- U
- (defun c:/ () (command "limits"))
. Y! W! T: r2 | - (defun c:`1 () (command "region"))
+ }* O7 v( n7 w& j - (defun c:`2 () (command "subtract")). E3 M+ |* U7 S. m' ~1 k) o& z( L
- (defun c:`3 () (command "union"))
; |5 H( S7 e2 _% u5 [* B; t1 h - (defun c:`4 () (command "intersect"))
4 W4 i* H* }+ m5 h( x5 Z% o* N: z# L - (defun c:`c () (command "cal"))6 q r" F+ u9 V7 v
- (defun c:`g () (command "Polygon"))
( ?3 q- Y5 g7 I' [6 |, T1 ]; \
' k; v1 n/ ?/ }4 X' Z- (defun c:lmi() (command "LIMMAX" pause "" "zoom" "all" )(princ))
; J( B* G4 Z7 P - (defun c:drt () (command "DRAWORDERCTL" pause "Integer" "" "" )(princ))
7 O- X7 q7 M6 b& H - (defun c:ip () (ssget) (command "print,_plot" ))(princ)
" y4 I! u0 n# M' r. F - ) o7 @/ `- }9 `( M( I' ^0 w
- (defun c:ddm () (command "ddlmodes" pause))" Q8 C5 k* F8 c$ }2 {' R% ^5 H# s
, Z" u& u3 h% l: N" m5 W/ h! a* Z- (defun c:sha () (command "shade" pause))
! |: s* I- a1 G& w
( p, n( }. k! ?4 B+ U- (defun c:sr1 () (command "surftab1" "p" "" pause))
; T9 l W- N1 b6 n - (defun c:sr2 () (command "surftab2" "p" "" pause))
. h" T! J* b0 D9 ~+ Z. w6 v! T: j# u - $ }+ G- |, h% c$ Y1 X( X
- (defun c:ad () (command "audit""y"))( M: ]/ }# O7 Z9 N' c
- (defun c:q () (command "quit"))
' @* t8 ~. l. H+ m
. V! [& Q! b2 K6 ~3 D5 k$ [- (defun c:30 () (ssget) (command "rotate" "p" "" pause "30"))2 P' P! W: B* B/ o
- (defun c:-30 () (ssget) (command "rotate" "p" "" pause "-30"))/ }) n; w' J1 E0 d- q+ w9 f
- (defun c:45 () (ssget) (command "rotate" "p" "" pause "45"))$ p, _+ j9 F+ L; j% f6 r, p& s8 R
- (defun c:-45 () (ssget) (command "rotate" "p" "" pause "-45"))
# ]$ d* A( I. K5 X |$ [ - (defun c:60 () (ssget) (command "rotate" "p" "" pause "60"))
) [' e1 k1 q* ]4 v# ?& }1 ] - (defun c:-60 () (ssget) (command "rotate" "p" "" pause "-60"))
- z3 g6 c4 C: R* D - (defun c:90 () (ssget) (command "rotate" "p" "" pause "90"))+ Q7 ^/ z) b: x& D
- (defun c:-90 () (ssget) (command "rotate" "p" "" pause "-90"))6 E8 l6 v- s, G& [+ U5 M( S" K
- (defun c:180 () (ssget) (command "rotate" "p" "" pause "180"))
) e" J! }4 M# r' Y. ] - / p# @2 Z# x3 ]. s8 q0 p
- (defun c:u3 () (command "ucs""3"))- [4 r7 G, H. D4 ~4 `2 g1 p
- (defun c:ue () (command "ucs""o""end"))
' D0 ^# U/ f. _4 B% r3 z. z - (defun c:ui () (command "ucs""o""int"))
( c) A4 V+ J! o# ?0 L, o4 c" q - (defun c:um () (command "ucs""o""mid"))
2 Z& C% a1 }& |$ N- f @0 N( L - (defun c:uc () (command "ucs""o""cen"))* ]$ K2 ~6 u. ?$ G4 t+ a8 C* d2 a0 g& k
- (defun c:uq () (command "ucs""o""qua"))
' O; E- f+ v' H7 f( }$ Z - (defun c:3s () (command "ucs""3"))3 @; I0 {. i; B- D0 `- X
- (defun c:sx () (command "ucs""s"))) [( ?0 Z% F9 F( f7 H
- (defun c:sf () (command "ucs""o"))$ Y3 j- v9 r7 B
- (defun c:sz () (command "ucs""p"))
2 \2 y' f# s8 l - (defun c:sr () (command "ucs""r"))
9 \* ?1 q2 A- o/ r8 Y: W6 [ - (defun c:sw () (command "ucs""w"))4 O, l3 ` R5 O; E4 A5 I9 o
- (defun c:fv () (command "ucs""v"))
7 S6 v0 c6 i ]: {) c, i6 ] - (defun c:ux () (command "ucs""x"))
6 t, ~4 |- f% T0 k! G - (defun c:uux () (command "ucs""x""90"))+ ?, u/ M' b* ^9 h
- (defun c:xxu () (command "ucs""x""-90"))2 x. C: g. { n4 H, j! C/ L' T
- (defun c:uy () (command "ucs""y"))6 Y* d z) L+ t/ c! i# e
- (defun c:uuy () (command "ucs""y""90"))5 E/ y- B3 o1 w4 v: Z; N4 P
- (defun c:yyu () (command "ucs""y""-90"))+ Y7 t8 ~! @: K" K- g z6 I! Y- B
- (defun c:uz () (command "ucs""z"))
9 m, W" t* {% I T% i4 i - (defun c:uuz () (command "ucs""z""90"))( j: e0 Q" x! D6 b0 a& M, |
- (defun c:zzu () (command "ucs""z""-90"))' l$ |% i$ b5 R. m9 e
- (defun c:uci () (command "ucsicon" "Properties" ))(princ)
- [6 Q- M$ o5 z5 F% S - (defun c:ucm () (command "ucsman" ))(princ)
/ b1 U, \6 l" f+ `# p
- {! m* \5 w# z+ ^! F. l- (defun c:sa () (command "vpoint""_non""-1,-1,1"))9 U- q' i! K A: B9 @( X
- (defun c:sd () (command "vpoint""_non""1,-1,1"))2 `/ q- n; z9 w- V8 K
- (defun c:se () (command "vpoint""_non""1,1,1"))2 |: V; O) Q" d2 c/ ^
- (defun c:sq () (command "vpoint""_non""-1,1,1"))
$ `) Q& A( y* x - (defun c:vc () (command "plan"""))
& Y; y, q5 d c0 h M" s - (defun c:vd () (command "dview""all"))* }1 P3 S, c/ k) r% E
9 {! b+ N- |$ i- @* Z" z- (defun c:TT0 () (command "tilemode""0")), j$ |7 x* n9 G- k* Z
- (defun c:TT1 () (command "tilemode""1"))
) H2 z; K5 C# [( j7 m+ W4 _6 k - 0 n4 w3 H, D' M3 y9 V. o
- (defun c:vt () (command "vpoint""_non""0,0,1"))' X+ f4 O w' m, _% n
- (defun c:vb () (command "vpoint""_non""0,0,-1"))( L/ p5 f U9 j9 N! t2 g: t* ^
- (defun c:vl () (command "vpoint""_non""-1,0,0"))/ o/ ]- r( L! P |+ S
- (defun c:vr () (command "vpoint""_non""1,0,0"))% J9 d3 J! _0 I
- (defun c:vf () (command "vpoint""_non""0,-1,0"))9 r7 S& m% H9 _* d6 d% m
- (defun c:vk () (command "vpoint""_non""0,1,0"))6 J6 e, U W) w
- ; z$ }$ \7 F/ Y3 [' L3 b9 G
- (DEFUN C:MM () (COMMAND "MIRROR"))
0 T w% [+ Z( f$ e: X - (DEFUN C:MP () (COMMAND "MOVE" "P"))
+ ^! k( m( @) U8 T' |# U+ k: W - % ?- L2 {' J* L+ x) {8 U, N3 H
- (defun c:mee (/ a), }0 k' {3 C$ L X/ H9 o" O
- (setq a (ssget))(command "move"a"""end"pause"end"))# C2 o9 k( b; g- z
- (defun c:mc (/ a)
# O; b/ `! |9 f8 j; L - (setq a (ssget))(command "move"a"""cen"pause"cen"))* X% M% Z/ h/ j- ^# i4 X
- (defun c:cc (/ a)
; k% J; A3 T1 I6 ?9 m) T5 _ - (setq a (ssget))(command "copy"a"""m"))3 V( ^$ ?8 ^+ i1 r7 G4 H4 N4 U% v- N
- (defun c:ce (/ a)# e1 n; r, @, T K
- (setq a (ssget))(command "copy"a"""m""end"pause"end"))
1 S$ b; @3 B3 u# [7 @0 S - (defun c:cn (/ a)
: Q& M! Z: ^% d/ K {& n - (setq a (ssget))(command "copy"a"""m""cen"pause"cen"))$ v% o. ]5 J$ W: m/ q6 k
- (defun c:tl ()(command "trim""l"""))9 g) i0 Q7 O) t" ^1 `8 {$ S8 _
- (defun c:tf (/ a)% a* C5 i, k8 u+ [/ C% [; ]5 i: j
- (setq a (ssget))(command "trim"a"""f"))
8 l" z: o0 D, Z7 _ - (defun c:el ()(command "extend""l"""))
1 W6 R; r/ j* x7 @# M - (defun c:ef (/ a), P4 r. r; u5 F K& L. E# A
- (setq a (ssget))(command "extend"a"""f"))
! N/ P8 o5 V% D* u. f; q% a. z - 2 d2 S. ~9 X* M9 i+ [
- + Q' U0 W4 v, v6 \' x
- (DEFUN C:110 ()(princ "\nChon doi tuong can offset ra 110.......") (COMMAND "offset" "110"))
H! t% J8 O9 j/ g0 Z( x - (DEFUN C:220 ()(princ "\nChon doi tuong can offset ra 220.......")(COMMAND "offset" "220"))
$ g! R* |" M5 O) _2 B ?! X5 v8 v/ `/ y - (DEFUN C:330 ()(princ "\nChon doi tuong can offset ra 330.......")(COMMAND "offset" "330"))$ L, d. `" ]; t1 v
- (DEFUN C:400 ()(princ "\nChon doi tuong can offset ra 400.......")(COMMAND "offset" "400"))& z% x, |' o! s9 H
- (DEFUN C:55 ()(princ "\nChon doi tuong can offset ra 55.......") (COMMAND "offset" "55"))
: g7 Z' C' Q+ U - (DEFUN C:600 ()(princ "\nChon doi tuong can offset ra 600.......") (COMMAND "offset" "600"))
- n' O& ]/ q. l% e1 d: U- C - (DEFUN C:700 ()(princ "\nChon doi tuong can offset ra 700.......") (COMMAND "offset" "700"))
) z' L3 q" G5 J. O2 _ - (DEFUN C:800 ()(princ "\nChon doi tuong can offset ra 800.......") (COMMAND "offset" "800"))
' ~5 r) l2 q+ `" h( a0 D M6 d3 D3 b9 E - (DEFUN C:900 ()(princ "\nChon doi tuong can offset ra 900.......") (COMMAND "offset" "900"))
' I0 {# y6 L5 W3 f2 x6 | - (DEFUN C:1200 ()(princ "\nChon doi tuong can offset ra 1200.......") (COMMAND "offset" "1200"))+ `0 d- l5 U6 _; T5 K
- (DEFUN C:1500 ()(princ "\nChon doi tuong can offset ra 1500.......") (COMMAND "offset" "1500"))
6 l9 _+ c$ y9 ^3 v2 t* ~9 a( ^; ]) x - (DEFUN C:1800 ()(princ "\nChon doi tuong can offset ra 1800.......") (COMMAND "offset" "1800"))( T" y. K1 x T" ~3 m1 Y
- (DEFUN C:2400 ()(princ "\nChon doi tuong can offset ra 2400.......") (COMMAND "offset" "2400"))
9 p- O# j8 p7 f5 G - (DEFUN C:3000 ()(princ "\nChon doi tuong can offset ra 3000.......") (COMMAND "offset" "3000"))* I! Z7 `' Z* V" V G, |: L
- (DEFUN C:3600 ()(princ "\nChon doi tuong can offset ra 3600.......") (COMMAND "offset" "3600")), c& j3 R6 v* g+ m
- (DEFUN C:4200 ()(princ "\nChon doi tuong can offset ra 4200.......") (COMMAND "offset" "4200"))2 L- W9 L/ D2 G2 i8 s, k
- (DEFUN C:5000 ()(princ "\nChon doi tuong can offset ra 5000.......") (COMMAND "offset" "5000"))
1 } w/ [! ` d& k, u( A5 I
, M2 D$ _2 E6 v' q& t: {- (defun c:mla () (command "-mledit""av"))
7 E9 t4 d" U$ t1 [8 ^5 E - (defun c:mlc () (command "-mledit""mc"))
* H% u# g2 }: A6 e - (defun c:mld () (command "-mledit""dv"))
6 ^, E4 q, ^$ w! J* x - (defun c:mle () (command "mline""end"pause"end"))
# b+ |; E$ A2 g3 K6 }* p& U8 v( z - (defun c:mli () (command "-mledit""ca""int"pause"int"))% y |: A+ z& O. |2 P
- (defun c:mlj () (command "-mledit""cj")); J# }7 n4 \" E& Z1 y% }9 k8 i
- (defun c:mlt () (command "-mledit""mt"))( |; e8 | L+ a' E+ O/ J
- (defun c:mlk () (command "-mledit""ca""end"pause"end"))
" \9 M# d; ^, w. ` - (defun c:mlw () (command "-mledit""wa"))" k) Z# I4 s0 J" `* U
- & b2 M, ] V% f9 O9 k; c
- (DEFUN C:DCA () (COMMAND "DVIEW" "all" "" "CA"))5 m% Q) j5 j0 P
- (DEFUN C:DPA () (COMMAND "DVIEW" "all" "" "PA"))
9 @/ E7 g1 K8 C5 n - (DEFUN C:DPO () (COMMAND "DVIEW" "all" "" "PO"))/ D H: Z8 C1 U ~" y
- (DEFUN C:DDD () (COMMAND "DVIEW" "all" "" "D"))
4 Y3 t8 Q. C+ p: w4 B - (DEFUN C:DZ () (COMMAND "DVIEW" "all" "" "Z"))* w# ]0 |7 J: s
- 7 j2 J/ u9 }/ b9 X
- (defun c:p0 () (command "pline""""w""0""0"))
: B- R: X5 H) X1 f. r - (defun c:ot () (command "offset""t"))$ L, Z0 n' M. `# k$ q$ f* E
- (defun c:t () (command "mtext"pause"j""bl""h"pause))
( g1 T6 D& n( h$ G - (defun c:uo () (command "ucs""ob"pause))
0 z- \7 j8 a$ o% N2 r9 e - (defun c:f0 () (command "fillet""r""0"))
) N: c5 U4 D8 P Y2 M H p" `6 K - (defun c:fr () (command "fillet""r"))( B1 X; I8 U: ?/ e
- ; \. u6 N, S# M" g* F7 h
- ;CHAMFER3 T) n. D6 x. s7 n B
- (defun c:cf () (command "chamfer"))7 M9 z: c8 B8 p* [5 h
- (defun c:cfd () (command "chamfer" "d"))
7 ]* r0 k9 k b - (defun c:cf0 () (command "chamfer" "d" "0" ""))
8 ~. j3 d. Q. Y4 @% F; {, ` - 5 ^2 d; z6 P; u( U) ^3 I
- ;FILLET1 ^# ~( u/ T3 v% ~
- (defun c:f () (command "fillet"))
7 J" j s& ^, O8 b+ Q0 Q* g' I9 v - (defun c:fr () (command "fillet" "r"))0 F" @' B) [9 p
- (defun c:f0 () (command "fillet" "r" "0")); k8 e) J7 @% O+ D
- - `* X. M: O" Z8 A6 K
- (defun c:OO () (command "oops")). s& y1 a- U7 X9 E. O- B
- (defun c:dln () (command "dimlinear"))
4 w% o- x# Y% l, n2 H# T7 ?" t - (defun c:dan () (command "dimaligned"))9 a) _% R" c% T- M
- (defun c:ddc () (command "dimcontinue"))
6 |/ y+ n; X% A3 P8 C% r - 7 i2 N4 t% C9 B+ m( n
- (defun c:sc () (command "scale" "auto")): |, P8 i; p0 d- }5 M) ^
- (DEFUN C:XO () (COMMAND "snapang"))! A- E' v/ R5 z9 G2 T2 e* [$ n" F
- (defun c:cc (/ a)
, Y* ]4 L9 }8 k5 l1 G( p1 c! r. p - (setq a (ssget))(command "copy"a"""m"))! L* p/ P2 K( K8 Z1 `9 n( T0 y
- " z8 P" }1 \! V$ f# k
- (defun c:PJ (/ a)+ d$ ?) D3 l* c. P4 X7 ?
- (setq a (ssget))(command "pedit"a"""j""all""y"))
6 f3 i+ @1 }% Q, q& m# _ ^. k - (defun c:JJ (/ a)
8 ~( G0 r3 Y+ L, k, G9 L8 u m, N6 I) f- V - (setq a (ssget))(command "pedit"a"""j""y"))
2 A+ G U Q' M8 f5 S+ e6 T - (defun c:TN (/ a)& X; r* A1 a* `* e; ~( d# @
- (setq a (ssget))(command "change"a"""p""T"))
% Z, u& \. G5 x0 G - 7 G/ C3 p$ ~/ u7 \2 J9 z8 o
4 w( I6 t. A7 c# J/ r- ;=======================Tran Ngoc Thang - Tu nam 2000 - Hoc nam cuoi KTS . DHXD=========================6 ^* Z4 [- y3 ^. Q
- ! P: K4 C2 s T5 a/ n' d
- (defun C:IB ()(setvar"cmdecho"1)
/ s" E7 J9 ^( o/ v% o( |) z - (setq pt(cadr(entsel"\nSelect Block:")))9 E( o( Q# ]$ F5 d: b8 p# l5 f
- (setq e1(ssget pt)) 5 U0 E/ n- j; @
- (setq e2 (entget (ssname e1 0)))
. H; ^# l6 ?- R - (setq blname (cdr(assoc 2 e2)))& u$ ]( l K. r; R
- (setq oer *error* *error* err2)(command ".insert" blname))+ R( H9 G' a1 r+ }
- ) ~2 N+ |% j& D3 w1 }- {4 H7 n% G
- (defun c:II ()
8 P2 l3 Q* x$ L! _5 f* D - (setvar "cmdecho" 0)6 U. Z6 ^0 k/ c& j/ I. U
- (setq olderr *error* *error* myerror)
# c: O; R1 V- d: M& T - (prompt "\nSelect objects: ")
$ Q, P: N. J: S8 \- Y0 U - (command "select" "au" pause)
) J0 g! E$ l) I8 d/ N3 O - (setq sstxt (ssget "p")" V! |+ X/ p0 E; w, P
- sslen (sslength sstxt)! U6 O" R) u, f5 W( @' \. Q
- ctr 0
( `& Z2 `" u0 B/ _ - )- ~2 S: f8 m0 g4 ^
- (command ".undo" "mark")4 J- R8 G' v$ q# k
- (while (< ctr sslen), K ^: j/ e( W$ c: s1 t/ ]
- (setq listxt (entget (ssname sstxt ctr)); b+ M2 e- r& I9 r" D4 X' p
- txttxt (cdr (assoc 1 listxt))
: y& Z1 q5 @9 `, t4 N - enttxt (cdr (assoc 0 listxt))
, {! d6 A2 V1 Y0 E/ K2 P - ); B, ~& ]2 s5 ]) @3 S
- (if (= enttxt "TEXT")' n% m" W' G6 ` ?6 i
- (progn" e/ B; P1 l! ?( V, Z
- (setq testxt (substr txttxt 1 3))% I0 I( a! k+ _
- (if (or (= testxt "%%C") (= testxt "%%C"))
( u, ], x9 I6 F; A2 {8 Z - (setq newtxt (substr txttxt 4))# L* q+ n- X% o7 `: R
- (setq newtxt (strcat "%%C" txttxt))
, f4 @% j) w/ z2 k: m7 c - )4 `' |; t5 F( I8 I2 ?, G
- (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))
, ?8 |: ~) z# E- t - (entmod listxt)" j0 @0 n4 l4 X$ x) ?8 D/ x
- ) L' n L) K: m+ d! x) P2 e" }/ a
- )
. c9 h& u8 C4 s8 q O - (setq ctr (1+ ctr))
' l3 h# `/ d H) r! Q - )
% _$ a3 v: _! x3 ] - (setq *error* olderr)3 ` T' `7 A* e, k6 B# J
- (setvar "cmdecho" 1): u. M) Q" C8 h' L- I
- (princ)0 c: T( W, B2 D4 S9 B
- )& u6 f/ x! T. s2 w1 f. G
- # v2 c( X8 q! d# p5 I" m2 z
- (defun c:DG ()
$ e* s ^6 ]3 d2 H. B5 F/ ` - (setvar "cmdecho" 0)5 S2 t0 W6 t7 H9 r6 G) f
- (setq olderr *error* *error* myerror)5 m1 K6 R* k& W; k0 k
- (prompt "\nSelect objects: ")5 Z6 O& Q" _9 t P
- (command "select" "au" pause)- M, p* r& [( W5 f8 p0 f7 A& W: u
- (setq sstxt (ssget "p")
U b: A$ e. B/ U9 F# \ - sslen (sslength sstxt)$ e" H! k6 h$ A
- ctr 0
$ Z' N% v& w" W( H - )
( S" u% K2 e; @( V' P- t8 z - (command ".undo" "mark"); v- b2 X1 L2 _4 d2 L
- (while (< ctr sslen)
# q. t9 o+ C5 s% ?! \# j - (setq listxt (entget (ssname sstxt ctr)); Y- q, U! P* S- t v, F$ n1 Z
- txttxt (cdr (assoc 1 listxt))
, C1 W( S' X! c+ k, i+ A - enttxt (cdr (assoc 0 listxt))( G* M6 ?) ^5 c J
- )
8 W0 j' g, o: m8 | - (if (= enttxt "TEXT")2 u. O. G6 o( s4 f5 I- I
- (progn
4 } v) N5 W, B' X: [ - (setq testxt (substr txttxt 1 3))
/ W% J5 ]0 ~- g0 c - (if (or (= testxt "%%d") (= testxt "%%d")). F: ?& Q8 h4 @) |; X3 ~
- (setq newtxt (substr txttxt 4))6 T6 x! u2 O: z2 Y
- (setq newtxt (strcat txttxt "%%dC" ))
0 S! ~( }9 [0 ~9 \7 l) O/ y, q f( I - )# A a$ T' v! s& T) @6 @6 Z* k
- (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))
/ q$ k& t/ u2 M3 |7 M" V - (entmod listxt)1 P) i7 s2 b; d7 M- Y4 r
- )# y, L J+ Y2 h- k
- )
8 k: z+ x' M/ k3 S2 f; K - (setq ctr (1+ ctr))
( T4 f4 K* B3 n" G6 ? - )
+ M# k: Y6 p+ H6 | - (setq *error* olderr)
* M& ?! K" f3 _9 ~8 A - (setvar "cmdecho" 1)! f9 P0 [* y, h. N+ _: S
- (princ)$ a ] [3 K; M5 z
- )
x! k: O8 L! f; i8 k1 ]
- f! E1 z& K/ S; A- (defun c:PI ()
7 F: A9 h. C) A* ^5 D - (setvar "cmdecho" 0)
& ]0 _* E& v7 K# S( E - (setq olderr *error* *error* myerror): u0 C) ~6 z' K. F6 q
- (prompt "\nSelect objects: ")9 f$ D2 R3 C; R1 l4 v! p
- (command "select" "au" pause)* k) f2 ~& g" q% W
- (setq sstxt (ssget "p")( U' f! v$ _1 @: f1 @
- sslen (sslength sstxt); g( Y: N& W. e2 J4 y1 c3 q; Y% R8 n
- ctr 06 T' ~( V; }" m5 o, P, F4 w
- )
; H# g5 p, x4 x) [$ O( W - (command ".undo" "mark")# K( U* s9 b" v2 y' V3 ~
- (while (< ctr sslen) E+ I0 W7 A w9 v$ s, v6 O6 q
- (setq listxt (entget (ssname sstxt ctr))
$ h( B$ v( A1 F# B8 u - txttxt (cdr (assoc 1 listxt))2 h- G6 A2 q& W$ |, @
- enttxt (cdr (assoc 0 listxt))
2 I( a# a5 }$ L& Z - )
$ H) D& L1 L' U) x/ a - (if (= enttxt "TEXT")
8 R* S7 w0 C5 Q* K" J, b - (progn
. r: b8 F. E+ i6 D- U4 s$ {' |- v - (setq testxt (substr txttxt 1 3))0 [. J/ Y. n* } E8 Q7 r& c z# J* t
- (if (or (= testxt "%%p") (= testxt "%%p"))1 R. ]% n# H" C: _( ^
- (setq newtxt (substr txttxt 4))
0 i% r6 N( j3 y- y - (setq newtxt (strcat "%%p" txttxt))3 y1 h1 ~: _! E2 ` g, p
- )( U* t, t% J) I8 c
- (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))( n" X5 o4 d3 z. J! W7 u
- (entmod listxt) P9 T4 r1 d, y4 y! B/ W& u
- )
" {- K C) d& ]& q0 C6 T - )
2 T, K3 Q2 l- i' V: v R; m - (setq ctr (1+ ctr))
4 h$ D6 L0 x5 s$ r# j! i- d - )
: A7 t& b2 g* \. _ - (setq *error* olderr)
2 W' g7 Y+ O4 y6 a8 `2 _: A9 N - (setvar "cmdecho" 1)
1 t2 x @5 ?2 T# D$ M - (princ)
5 E$ ? b9 ]$ M) Z& x8 G6 f - ). a ?$ c) Z0 o2 L9 P" z' l
- 4 |( s3 {& T' @- \! Q0 \
- (Defun c:CB (/ a)
1 M I: l0 S) z% f# A) `% d, R - (setq olderr *error* *error* myerror)
- a* |) N* ]3 m+ b6 t8 M' E/ m - (setq ocmd (getvar "cmdecho"))
; Z4 k) S) ]* z! q- U5 K& x+ _ - (setq oblp (getvar "blipmode"))
. P+ c4 I& y" Q7 E0 ? - (setvar "cmdecho" 0)2 k) u- E; `, n5 y6 z0 W1 m* F' _
- (setq a (ssget))
3 U) S; Z* o) z# Z0 w - (command "CHPROP" a "" "C" "bylayer" "")
( Y7 a0 F1 k5 x3 `1 w$ y - (setvar "cmdecho" ocmd)
* r3 H( p" k6 l l1 s8 m - (setvar "blipmode" oblp)( B6 \4 s" o0 [9 `5 A t- m
- (setq *error* olderr)
- l1 B% a M; N - (princ)
( p$ t& m; `) l2 u - )/ Q! A+ F0 Q. V6 d2 N
- 9 ^9 A# Y( Y( N2 T9 ~8 `
- (defun c:LCC (/ co43 obj23 la23)1 e4 b% N, E& l2 j7 R5 P, k
- (setvar "cmdecho" 0)1 a: i% \3 W& C) P* M# k
- (setq co43 (getstring "\nNew color : "))
! }) F+ V% a; ]& K) }2 K - (setq obj23 (car (entsel "\nPick object on desired layer: ")))2 f8 L3 S& h8 r
- (if obj23 (progn( a7 R# c7 L/ b1 b2 ?* d3 f b
- (setq obj23 (entget obj23))
" M H8 A) {. w- N. \& W - (setq la23 (cdr (assoc 8 obj23)))' x$ i. a$ c& u
- (command "layer" "c" co43 la23 "")
( U+ V8 c. V: m' q' A) f - )6 s3 `$ z% Z$ s6 j
- )( f! ?0 E: C9 ~7 A6 r( b
- (prompt (strcat "\nLayer has changed..." la23))
y. w6 \. l7 R w: F- t9 f7 [ - (setvar "cmdecho" 1)
( r& t* N5 T% ? - (princ)5 S* \" k. s" C# `# \
- )
$ T2 Z A7 X. T. f - + W( u9 p5 ^0 R: J u6 y( J' B0 U: ~
- (Defun c:RP (/ a)
" N$ p. Q: n+ D8 H/ o* s. X, [ - (setq olderr *error* *error* myerror)
1 I$ ?. U2 B* ?. C. Z - (setq ocmd (getvar "cmdecho"))6 G! j# Q8 H1 U/ q) ^5 U
- (setq oblp (getvar "blipmode"))- o8 _! ^3 X3 |* F" H% U2 G
- (setvar "cmdecho" 0). L. B# x/ k7 }
- (prompt (strcat "\nUSE: Delete object(s) belonging to"
$ i; V2 F# k, y# }/ | } - " the layer of the entity picked...!"))
8 Z% d1 P7 l: F7 p. B& u - (setq a (entsel "\nPick the entity with the desired layer to delete: "))' T8 U Z6 r" G5 y! T# D9 C1 D
- (if (/= a nil)
3 B/ T* J8 }( S$ o - (progn (setq a (cdr (assoc 8 (entget (car a )))))6 C( \$ m) c# f+ j5 p
- (command "Erase" (ssget "x" (cons (cons 8 (eval a)) tempword)) ""))
J# M# o9 D# }* ` - (prompt "\nNo entity selected!"))2 u- F$ I0 F9 `
- (setvar "cmdecho" ocmd)
5 h0 h" ^/ u/ ~. u - (setvar "blipmode" oblp)1 B5 t! W2 y: R$ s/ G% J4 I
- (setq *error* olderr)
+ o# F2 V; Z4 c( J4 n: P - (princ)) _) [3 A7 L& B2 d) z! [
- )7 m7 M5 n1 Q. @) ^% u$ @ c
# }( A+ K% P2 E5 W# T9 b4 s- (DEFUN C:WL(/ SSET NET SSL M)* Q" }. b( @& q( C; d ~
- (PRINC "\nSelect lines :")
' X9 ~' ^( H' _6 g V - (SETQ SSET (SSGET))5 c( |4 r# |( U9 \# b$ G
- (IF (/= NIL SSET) (PROGN
2 F7 I* q+ v2 ^: |( J8 W1 ` - (SETQ SSL (SSLENGTH SSET))
7 U8 G& P' [, ]9 H8 G* q - (INITGET 4)9 H- \6 N( |2 j' P2 o4 U+ |# I
- (SETQ NET (GETREAL "New width : "))
9 c' X% Y% j* Q - (IF (/= NIL NET)% [2 \/ z. u q9 `/ d6 O
- (WHILE (> SSL 0)
# L2 L' ` y! D, E3 [+ ~0 `+ J! q - (SETQ M (SSNAME SSET (SETQ SSL (- SSL 1)) )), q, U, k1 h B" `$ \4 B
- (IF (= (CDR (ASSOC '0 (ENTGET M))) "LINE")
1 `4 ]& E$ d! Z- `$ S0 o: @ - (COMMAND "PEDIT" M "Y" "W" NET "")
( k. G6 F- G0 k, g; P- G - )
( E5 B/ J( g: C! T! O1 g. Z - )
1 n0 u# j9 m1 b7 [& h }3 J2 q - ))), ~1 h4 P( I8 ]8 \' ?) L5 V% z
- (PRINC)
- F0 |: a# z8 Z9 X0 E - )# L" F' |/ s7 l. ^5 @" E
- ! M0 T4 V1 j0 {$ h- m- N* r/ d' l
- (defun C:MML ()4 O$ p% _, n# S2 X
- (princ "\nSelect objects to move to another Layer.")
9 w* D- H# {- Y" m - (setq ss (ssget))
, ]( ~. ?& q H, s& a1 q8 G - (SETQ UL1(GETSTRING "\nLayer to move entities to : "))) q" J) r" k2 ]" l9 p" K
- (setq counter 0)
9 Y3 B4 v: t9 Y, | n - (prompt "Moving to layer.....")(princ ul1)5 \6 S' O( x F2 }
- (setq e (ssname ss counter))" q. C- x* T4 N
- (setq l (cdr (assoc 8 (entget e))))
* b6 z* S X% R - (setq S (ssget "X" (list (cons 8 l))))
8 g C" M8 h* y0 [0 M4 n- H. k - (command "CHANGE" ss "" "P" "LA" UL1 "")
$ M! j# r( ^! I9 e* [: ~ - (setq counter (+ counter 1))
% U1 D; S2 X! _ - (princ)0 [0 @2 n/ l" A" ^; M
- ) : D9 G! C$ o: A% n4 [, L% \
- 9 b; l3 M, g; |( E6 e
- ;;; ================================ GHI CHU ============================
5 I. M3 U2 r. A7 c: `; e6 J& ]# U4 h - ;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========4 X& F2 Y+ f7 |, ^# x
- ;;; =======================Thuong Dung Font Romant.vnh===================
7 [4 D' h! q C& N: z1 O) j - 8 |. q0 Q6 Y. }0 q: Z1 x
- (defun c:RS (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)$ ]: u( h" k" J2 u& J/ H) t& n
- (setq oer *error* *error* err2)
_1 J9 O- m0 W2 N# B3 Q* |5 b - (PROMPT "\n(UNICODE-Verdana)(D)ining room. (S)torage. c(L)oset. (C)onference. (O)ffice. (K)itchen. (B)ath. (M)aster Bedroom. ")1 k. g7 n7 a. N) X( D2 D8 R
- (SETQ Cpt(GETSTRING "\n (ROMANT-vnh)(DD).(SS).(LL).(CC).(OW).(KK).(BB).(MM). (UNKNOWN-font)(oD).(oS).(oL).(oC).(oww).(oK).(oB).(oM)."))- F! R9 \4 V `" z I
- (IF(OR(= Cpt "K")(= cpt "k"))(SETQ CPT ' "Nha` Bê´p"))
! O3 p+ O: K, x0 R, I$ j/ L - (IF(OR(= cpt "B")(= cpt "b"))(SETQ CPT ' "Pho`ng Vê? Sinh"))& u' |) P1 T+ F
- (IF(OR(= cpt "C")(= cpt "c"))(SETQ CPT ' "Pho`ng Ho?p"))( w- {7 ? Z3 }1 ^& s1 g
- (IF(OR(= cpt "O")(= cpt "o"))(SETQ CPT ' "Pho`ng La`m Viê?c"))
/ C; F+ s9 B. @ - (IF(OR(= cpt "M")(= cpt "m"))(SETQ CPT ' "Pho`ng Ngu?"))7 G a v& `4 v) [3 m
- (IF(OR(= cpt "D")(= cpt "d"))(SETQ CPT ' "Pho`ng Bê´p + An"))1 y2 W1 z% f! C- ~" z" A' k
- (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT ' "Nha` Kho"))3 m2 u7 P/ m( {
- (IF(OR(= cpt "L")(= cpt "l"))(SETQ CPT ' "Pho`ng Ðê? Ðô`")). k* ~6 W1 K2 l0 W+ c- D' H% C
- * w. K8 a0 h1 R) s& S& l7 |; h
- (IF(OR(= Cpt "KK")(= cpt "kk"))(SETQ CPT ' "Nhµ BÕp"))
7 m8 |* k9 x3 W1 K2 q0 N6 u1 C - (IF(OR(= cpt "BB")(= cpt "bb"))(SETQ CPT ' "Phßng VÖ Sinh"))
" Z7 n. G* _" G1 \ - (IF(OR(= cpt "CC")(= cpt "cc"))(SETQ CPT ' "Phßng Häp"))
% H% ~; w* i! p6 I - (IF(OR(= cpt "OW")(= cpt "ow"))(SETQ CPT ' "Phßng Lµm ViÖc"))
: h7 J& p+ y }8 V - (IF(OR(= cpt "MM")(= cpt "mm"))(SETQ CPT ' "Phßng Ngñ")); [2 i& D! d# C% Q- h( V
- (IF(OR(= cpt "DD")(= cpt "dd"))(SETQ CPT ' "Phßng BÕp-¡n"))
* H% O: `, a* l Z6 y1 I1 u - (IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "Nhµ Kho")). u7 l6 v* g. S/ O
- (IF(OR(= cpt "LL")(= cpt "ll"))(SETQ CPT ' "Phßng §Ó §å"))
) D; O' o) N6 d2 I: f5 ] - : Q) o7 \1 f6 y& l
- (IF(OR(= Cpt "oK")(= cpt "ok"))(SETQ CPT '"NHA/F BE/M/SP"))! V. w, p( h. e. L( S, R% c% z) j0 C
- (IF(OR(= cpt "oB")(= cpt "ob"))(SETQ CPT '"PHO/F/NG TA/W/SM"))
) f9 J0 A5 A* p; N, Z% {% p - (IF(OR(= cpt "oC")(= cpt "oc"))(SETQ CPT '"PHO/FNG HO/JP"))! }0 f, W; |4 B9 K% i
- (IF(OR(= cpt "oww")(= cpt "oww"))(SETQ CPT '"P.LA/FM VI/E/M/JC"))- [$ c& T8 F) N, d; D1 L4 d7 D( i
- (IF(OR(= cpt "oM")(= cpt "om"))(SETQ CPT '"PHO/FNG NGU/R"))
7 [4 j! C4 G f; f# V9 n% m3 M - (IF(OR(= cpt "oD")(= cpt "od"))(SETQ CPT '"PHO/FNG A/WN"))
/ s6 c! X3 y8 C' v& C! G9 h8 m4 m - (IF(OR(= cpt "oS")(= cpt "os"))(SETQ CPT '"NHA/F KHO"))
7 I+ r8 ?! ~+ [7 v9 C1 ~) V - (IF(OR(= cpt "oL")(= cpt "ol"))(SETQ CPT '"PHO/FNG /DO/M/F"))0 S5 ~8 j9 u, L4 L9 ^% N
- (setq pta (getpoint: _, H6 A% N$ u
- "\nPick first corner. : "))
' E; ?! O: q [1 ` - (setq ptb (getcorner pta* I$ @! g) a6 w0 u) \, v
- "\nPick second corner. : "))+ s! g# i: N8 H
- (setq ptc (list (car ptb)(cadr pta)))3 Y* U- N+ W, ]# F! o: T
- (setq ptd (list (car pta)(cadr ptb)))3 O% O3 v0 Q$ C; c8 v* z& }
- (setq ang (angle pta ptb))
7 l W7 Q( |2 Z2 v: ?- d! ^ - (setq d1 (/(distance pta ptb) 2))
& P2 V$ E0 A( C4 c7 |! n# h - (setq cp (polar pta (- ang (dtr 0)) d1))
. M! W0 l1 p4 E - (setq X (distance pta ptc))
* I4 S5 V2 D7 J( Z& s7 T7 I: m0 l - (setq Y (distance pta ptd))
! p8 n; m3 o, f# `; t: @$ } } - (setq X1 (rtos x 2 1))
0 o1 [' Z X3 k7 r - (setq Y1 (rtos y 2 1))
* d- @, ?% k$ Q: c0 p4 m$ A0 J - (setq rmsz (strcat "(" X1 " x " Y1 ")"))
( D. a+ Q$ @/ |& k/ V; ^, | - (command "TEXT" "c" cp "0" CPT "ROMANT-TEXT" "" rmsz))
. S" W2 l# p6 T) R8 x - (defun dtr (angg)
5 {# o* ^" @ U - (* pi (/ angg 180.0))). \0 ?. l9 }* R% H m# @/ L. ~
- * u( l0 k) I% h! G0 T' C
- (defun c:WS (/ pta ptb rmsz pl1)4 l: f& u- ]: _0 R1 W c
- (setq oer *error* *error* err2)2 z8 x/ k" y8 J0 B+ v
- (PROMPT "\n (RomanT.TXT)floorp(L)an.(E)levation.(S)ection.(M)planFoundation.(C)Found.(K).(P).")* e; F2 k' {9 H) F' g( J
- (SETQ Cpt(GETSTRING "\n (VnHELVH.Vnh)(LL)floorplan.(EE)elevation.(SS)section.(BM)planFoundation.(CM)foundation.(KC)Structure.(PP)perspective.")); E/ w' [9 y; r5 U2 ~, ~2 i$ Y
8 W G7 C8 J; Z- (IF(OR(= Cpt "LL")(= cpt "ll"))(SETQ CPT ' "MÆt B»ng TÇng 1 : TØ LÖ - 1:100"))
2 Q4 [ t6 M7 E# _ - (IF(OR(= cpt "EE")(= cpt "ee"))(SETQ CPT ' "MÆt §øng Trôc ?-? : TØ LÖ - 1:100"))
) S' [: w5 }, o9 [ - (IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "MÆt C¾t A-A : TØ LÖ - 1:100"))
- O; I* F9 Z4 G2 A - (IF(OR(= cpt "BM")(= cpt "bm"))(SETQ CPT ' "MÆt B»ng Mãng : TØ LÖ - 1 : 100"))
7 v9 T) n' _* b/ {8 T3 \ - (IF(OR(= cpt "CM")(= cpt "cm"))(SETQ CPT ' "MÆt C¾t Mãng : TØ LÖ - 1 : 100"))
6 Z$ ] m k+ e& h6 l! R - (IF(OR(= cpt "KC")(= cpt "kc"))(SETQ CPT ' "KÕt CÊu Khung Däc Nhµ : TØ LÖ - 1 : 100"))
; z2 d+ i- n$ `& _2 d% u" Q3 \ - (IF(OR(= cpt "PP")(= cpt "pp"))(SETQ CPT ' "Phèi C¶nh Mét Gãc Nh×n"))& N2 C2 p W, p' F3 b6 `7 v& b' n
1 l% a$ y% q* s8 u. Y6 G0 @4 _- (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"))+ C7 c4 ~) {( P5 k2 A9 c
- (IF(OR(= cpt "E")(= cpt "e"))(SETQ CPT '"MA/W/JT /D/}/SNG TRU/JC ?-? : TI/R LE/M/J - 1:100"))
1 d* x# a. a$ W$ p8 D - (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT '"MA/W/JT CA/W/ST A-A TI/R : LE/M/J - 1:100"))
' \5 p2 G% U. h+ L2 {0 v& K. I - (IF(OR(= Cpt "M")(= cpt "m"))(SETQ CPT '"MA/W/JT BA/W/FNG MO/SNG : TI/R LE/M/J - 1:100"))
( J& ^- ~% e' x P - (IF(OR(= Cpt "C")(= cpt "c"))(SETQ CPT '"MA/W/JT CA/W/ST MO/SNG : TI/R LE/M/J - 1:100"))
2 L. ~4 v; }* @% ^8 a. ?( u2 S - (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"))
" v1 V4 E- B6 m) `/ O/ W - (IF(OR(= cpt "P")(= cpt "p"))(SETQ CPT '"PHO/M/SI CA/R/NH MO/M/JT GO/SC NHI/FN"))+ L" z; e7 l, C/ y! _+ _
- (setq pta (getpoint
) T- H |0 @+ A5 [9 F3 t5 J - "\nPick first corner. : "))
, ]$ e1 M! u$ R% V/ c7 ? - (setq ptb (getcorner pta
( T7 g9 n, x! d& F. }. K - "\nPick second corner. : "))/ e5 ?8 x2 S0 \0 R. t
- (setq ptc (list (car ptb)(cadr pta)))
$ x3 T" }) E8 X W% m - (setq ptd (list (car pta)(cadr ptb)))
' [9 S( f5 t! [# u, H3 d2 A - (setq ang (angle pta ptb))
- r" K3 M4 W- F! B; Z0 H7 O6 V - (setq d1 (/(distance pta ptb) 2))
3 H: {' Z1 P6 Q; N. P/ P& g1 O - (setq cp (polar pta (- ang (dtr 0)) d1))
9 b2 h Y" Z! b( B+ g1 W, P - (command "TEXT" "c" cp "0" CPT "ROMANT-TEXT" "" rmsz))
5 v7 E9 H& E# v$ N8 _. H) ?+ d, e) k% { - (defun dtr (angg)# D$ H7 W' m9 Z u0 |
- (* pi (/ angg 180.0)))
( t/ [- B6 X. j - / W9 i# [* d) k& e; ]- d
- ;;; ================================ GHI CHU ============================
5 z, v. H% O# J+ F( ?7 Q - ;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
7 m5 \2 |! X" O% c1 K3 F, m - ;;; =======================Thuong Dung Font Romant.vnh===================
8 f+ G/ q' r" o8 E/ I - . |: Z" `6 c( B3 R' k/ k# K
- (defun c:RRS (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)% f1 h' O7 H( C8 X' E
- (setq oer *error* *error* err2)
. Z" v; M1 T" t. }8 ` - (PROMPT "\n(D)ining room. (S)torage. c(L)oset. (C)onference. (O)ffice. (K)itchen. (B)ath. ")4 j7 h; C4 H: u1 R" c \: [
- (SETQ Cpt(GETSTRING "\n(M)aster Bedroom. (DD). (SS). (LL). (CC). (OO). (KK). (BB). (MM). "))( ^0 F* a, U) r# i& ]
- (IF(OR(= Cpt "K")(= cpt "k"))(SETQ CPT ' "Nhà B?p"))1 z% q1 k& w6 V0 n+ W Q; |( U
- (IF(OR(= cpt "B")(= cpt "b"))(SETQ CPT ' "Phòng T?m"))
1 U: p0 _4 A3 Z* {6 d7 L7 d - (IF(OR(= cpt "C")(= cpt "c"))(SETQ CPT ' "Nhà H?p"))6 ?& }8 E' Y4 H& F5 D' ^# Y8 P
- (IF(OR(= cpt "O")(= cpt "o"))(SETQ CPT ' "Phòng Làm Vi?c")), d) T4 G! W" }. E- G
- (IF(OR(= cpt "M")(= cpt "m"))(SETQ CPT ' "Phòng Ng?"))
. d/ A+ ~% g, n% _( ?3 d: L$ N - (IF(OR(= cpt "D")(= cpt "d"))(SETQ CPT ' "Phòng B?p-An")), O6 Z9 R- s3 N4 X# u# |
- (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT ' "Nhà Kho"))
! S. E( p2 [2 E* V - (IF(OR(= cpt "L")(= cpt "l"))(SETQ CPT ' "Phòng d? Ð?"))
2 s5 Y0 G8 m" E( J - (IF(OR(= Cpt "KK")(= cpt "kk"))(SETQ CPT ' "Nhµ BÕp"))
2 V8 ~& k% ^3 B- F- D/ s - (IF(OR(= cpt "BB")(= cpt "bb"))(SETQ CPT ' "Phßng VÖ Sinh"))
0 {& U/ C7 b. R) q) B& A - (IF(OR(= cpt "CC")(= cpt "cc"))(SETQ CPT ' "Phßng Häp"))2 d# p- J+ S. I" b" J0 m- ^; H
- (IF(OR(= cpt "OO")(= cpt "oo"))(SETQ CPT ' "Phßng Lµm ViÖc"))" G) v) q% R$ a5 g* b) c* s1 X
- (IF(OR(= cpt "MM")(= cpt "mm"))(SETQ CPT ' "Phßng Ngñ"))! d& ?# x/ i `3 w9 ]
- (IF(OR(= cpt "DD")(= cpt "dd"))(SETQ CPT ' "Phßng BÕp-¡n"))
8 T% |0 [% M& c2 z* ~1 D - (IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "Nhµ Kho"))7 |% ]: a3 N) y+ r( J
- (IF(OR(= cpt "LL")(= cpt "ll"))(SETQ CPT ' "Phßng §Ó §å")) ( T3 F8 e$ D7 w4 e' u3 M" S' C
- (setq pta (getpoint
$ f& k2 G2 G a5 c b& S, @ - "\nPick first corner. : "))8 _' e* ?% J/ L. K
- (setq ptb (getcorner pta4 y+ ]0 Y' |6 U% n
- "\nPick second corner. : "))
O. G M! P3 i- O - (setq ptc (list (car ptb)(cadr pta))): Q- F5 N& s; [
- (setq ptd (list (car pta)(cadr ptb)))' s4 I0 Z& x* {/ G1 M' h1 E4 `
- (setq ang (angle pta ptb))
, ?+ |8 f6 X) {+ K- z - (setq d1 (/(distance pta ptb) 2))( E( u2 S7 {4 |5 A6 F
- (setq cp (polar pta (- ang (dtr 0)) d1))2 r! R% I3 Y: `) G. c
- (setq X (distance pta ptc))
$ f1 M5 Z) B/ ~2 \1 v2 d# S - (setq Y (distance pta ptd))( a% X7 g! g7 l `/ O
- (setq X1 (rtos x 2 1)); |% t9 K( e* Z9 X' z# Q* b
- (setq Y1 (rtos y 2 1))
# Q- U* [+ v$ }+ Q, d; s& Z( k! z- w - (setq rmsz (strcat "(" X1 " x " Y1 ")"))
+ i* d4 @! w2 S; p! I! O - (command "TEXT" "c" cp "0" CPT "text" "" rmsz))
% i, Q( W e7 F6 N - (defun dtr (angg)( L1 |6 P/ B3 a5 U
- (* pi (/ angg 180.0)))/ `5 j6 Z6 x; ?& V9 j3 [% \+ B6 l
- / y* r- D d9 M2 u6 f( e! q
- ;;; ================================ GHI CHU ============================) @$ c: X7 V* k5 n0 ?
- ;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
6 q# P+ S9 M4 T9 |" P* v+ u# v - ;;; =======================Thuong Dung Font Romant.vnh===================
6 P* a9 E, S8 ^/ H0 G* H0 G' @ - ; }6 L& k/ K" l' t' X: J- I
- (defun c:GS (/ a b c d)
1 p# Q" r# h; l( d - (graphscr)
3 @8 i% o% ^0 p u& b4 Y1 u$ r- c2 p - (prompt "\nSelect text to set style....")2 c6 @. \$ l# d% e
- (setq a (entsel))1 v$ ^5 x: O h$ r4 V
- (setq b (entget (car a))): [" E) R) P& e8 a: v, M; ~
- (setq c (cdr (assoc 7 b)))
[ W- s. G" a. K - (setq d (cdr (assoc 40 b)))( I Y& L g0 v w4 [
- (command "style" c "" d "" "" "" ""))0 _, o5 T8 r- ]" m8 y. W- a( O
- (princ "\nType GS to set text style.")- R% K9 [- z( l! w
' N) T* G9 W) c3 p- r% y- (defun c:RC (/ olderr ocmd oblp pt1 pt2 pt3 pt4 l w) _9 O/ y! N* I+ W% C6 |- }
- (setq olderr *error* *error* myerror)$ { S6 p4 j3 h, M/ C) c: o+ M2 y
- (setq ocmd (getvar "cmdecho"))
2 x" ?* [, `' R1 c. q- T# K - (setq oblp (getvar "blipmode"))
: t' w- Y$ J5 g - (setvar "cmdecho" 0)! H1 B' W+ @; c7 {( {6 Z9 z% v
- (initget 1) ;3D point can't be null
3 n4 e# Q/ W* z- Q4 @7 z$ k - (Setq pt1 (getpoint (strcat "\nCorner of rectangle or square: ")))
: V: b' d/ A3 b- _1 S - (setvar "ORTHOMODE" 1)
( ~2 J9 X: X( ` - (initget 7) ;Length can't be 0, neg, or null0 l8 s+ R2 G! j2 S9 t
- (Setq l (getdist pt1 "\nLength: "))5 c# J p) {( ^" k# q
- (Setq pt2 (list (+ (car pt1) l) (cadr pt1) (caddr pt1)))9 u Y7 e% s) T4 K$ ?, P' J% y
- (grdraw pt1 pt2 2)3 Q3 Z$ w* N, h \2 k
- (initget 7 "Square") ;Width can't be 0, neg, or null4 k6 x0 Q1 @3 L+ E1 X4 W
- (setq w (getdist pt1 "\nSquare/<Width>: "))
- X8 C3 S' d, L9 z1 w - (if (= w "Square") 0 `6 T9 n1 R: _+ j0 m! O3 `1 X1 n
- (setq w l), h5 p; ], R3 |; p& m1 e+ g
- ); v. s0 I. c6 F+ a$ T, Z+ ?) M8 X' }
- (setq pt3 (list (car pt2) (+ (cadr pt2) w) (caddr pt2)))
+ D3 ]# J7 n5 g. J) Z5 r6 m& c - (setq pt4 (list (car pt1) (+ (cadr pt1) w) (caddr pt1)))
8 k- V O! Q. r1 v K - (grdraw pt2 pt3 2)
; H% |9 b: S8 }) S0 m- j. g - (grdraw pt3 pt4 2)
; [9 W& E! t4 f - (grdraw pt4 pt1 2)3 l) X: J! S: x
- (setvar "ORTHOMODE" 0)9 J% k, [3 Q, s6 T( z) j3 J
- (command "pline" pt1 pt2 pt3 pt4 "close")
) c# N& _" ? H - (setvar "cmdecho" ocmd)
% V1 u, l. k7 Z, E. N5 g - (setvar "blipmode" oblp)
' ]9 {0 P T1 ~- m4 ^ - (setq *error* olderr) ; Restore old *error* handler
9 a2 N" ]2 I6 S5 P# R4 p - (princ)
7 e- T( y; C7 M2 H - )- o7 l0 G( o2 w+ f( ^6 Y
+ F6 X. ?* G: y, ^) t A- (defun c:SG (/ ent pt1 pt2 ang) Z' Z' I% [) v6 R
- (setq cmd (getvar "cmdecho"))
% k! \2 h) }4 a: r( @7 D - (setvar "cmdecho" 1)0 R* V9 V1 R& V" ]2 ^7 |
- (prompt (strcat"\nSnap angle will be set to angle of line"))5 n) I% m/ V8 d' e# U+ H3 z
- (setq ent (entget (car (entsel))))
% K( g" j- ?1 R' j0 w - (setq pt1 (cdr (assoc 10 ent)))
( ?' T( a! o$ I* q6 n/ L4 i - (setq pt2 (cdr (assoc 11 ent)))
' b1 a# e- b9 s - (setq ang (angle pt1 pt2))
\# s6 R& A! o! `! `4 d - (setq ang (/ (* ang 180.0) pi))
* y+ w; A- m8 I4 w - (setvar "cmdecho" 0)
# m% K; k8 L/ p8 h/ l& x - (command "setvar" "snapang" ang)
# z9 s2 D: y- M! J% e' L - (setvar "cmdecho" cmd)
7 o. J6 d3 P @, ?1 U - )
) j1 [) Y! _6 z' E2 h2 ] - 1 g, c- w7 ?' ~* {# b
- (defun C:TG ()# B/ ^- _- `. X$ s% v
- (initget "Increase New"); n5 g0 M2 z9 Q# a5 ~' _
- (setq ans (getkword "Increase/<New>: "))
( M3 J1 w9 ?# |: R2 C9 e - (modang)
/ l4 F" c2 E* [ - )
. a5 x9 T# Z# e. S, H! }" w - (defun modang (/ ang ss ca e na ssl)9 [+ ?3 V, T9 l4 s. A4 g+ e0 A
- (if (= ans "Increase")
) b* J6 a: G) s: L% }6 p - (princ "\nIncrease angle for text by: ")
6 ^1 ^8 J8 n+ m - (princ "\nNew angle for text: ")
+ A- i2 h1 I! ` - )& Q& w; b$ l1 m1 C
- (setq ang (getreal))
3 d! h% w$ L ]; `" d4 H- R - (setq ang (* (/ ang 180) pi)). W" D" Z# U" C- p1 k" {
- (setq ss (ssget))
7 A( F8 K- ?2 e% D6 w# o# x* Z, j - (setq ca 0 ssl (sslength ss))
D$ ~. u1 n' H0 t# t# d4 Z( Y5 b - (while (< ca ssl)
& P2 o& i7 \& X4 G6 ? - (if (= "TEXT" (cdr (assoc 0 (setq e (entget (ssname ss ca))))))# d% k1 K0 K. v' D4 p* V
- (progn
& ~0 |+ Y3 R" N# j - (if (= ans "Increase")& a+ [ Z- }) x( l
- (setq na (cons 50 (+ (cdr (assoc 50 e)) ang)))* e. ^6 K. J" }6 k2 G1 h* ^& [
- (setq na (cons 50 ang))1 V) R. s3 z( w
- )- K( m/ i1 r9 J$ J& b; h
- (setq e (subst na (assoc 50 e) e))
4 z1 g2 ~' @ i, q! T# i$ o d - (entmod e)) _4 v- B: m% N- b
- (setq ca (1+ ca))
! n0 w0 z" }% G% C+ Z! x5 x - )
# F2 K7 ?& L) M9 c, t - )" ]. F' ]4 _& S7 A
- )0 w# c4 |/ H2 f; W8 ^6 ^1 o
- (terpri)
( `2 e& X5 F. T$ k: Z. S; H - )
/ s8 Z; G3 {, F - - _3 O9 F$ C" Z0 y7 W7 F r2 r# j
- j S( x7 J( ?) K& d# T- q
- (defun c:WL ()
& U' o) `* D w2 W3 A, m- k* v8 o+ b - (setvar "cmdecho" 0)! t; X2 U( T$ N! e( ^: D4 f; ?
- (setq a 1)4 `! f' [6 y8 h1 C5 K
- (prompt "\nSelect Polylines to change: ")
+ d; v8 s7 H5 l, K1 W - (while (/= a nil). k: ~! G: b. {; J5 x2 a& y
- (progn
3 G2 Q9 ~ Y. r6 ]5 m, t - (setq a (entsel))
9 f% Z( \ T/ X, S - (if (/= a nil)* `( P* |' a6 }' R1 w9 f$ _
- (progn
- }: x% d# q C, x" P' ]0 l0 j! l - (setq b (entget (car a)))" b/ ]5 n* A. _( T8 e! _) z
- (setq c (cdr (assoc 40 b)))
- k$ `- f7 O: N' t3 c - (princ c)+ ]* c6 A0 M; a' k& d3 H# W; y' Y
- (command "pedit"a"w""lw""")9 c; {' _8 Q4 F5 Q( D* R
- )))) 7 o \1 \# c) m$ E0 N9 D
- (princ)0 ~- J; O2 I6 E' `
- )" F9 H; j* A9 s) Q, K
6 A( a }$ d/ N- ;;; ================================ TEXT FIT ============================
3 P' |" \5 D: ]' P
* g# w3 i4 I, A/ |8 N( s* \- (Defun c:FT ( ): ^5 R5 }2 P: C8 E
- (defun setsnapang (arg /) (setvar "snapang" (angtof (angtos (cdr (assoc 50 arg)) 0 8) 0 )) )! v5 e# p5 l4 M' g
- (Defun LL-xyz (arg) (CAR (TextBox arg)) )
& N! d6 t V$ ]4 a - (Defun UR-x (arg) (CAADR (TextBox arg)) )6 F, G2 {; O9 I& Z! I5 _( u
- (Defun LL-y (arg) (CADAR (TextBox arg)) )
& o; Q" b& d" E; | - (Defun LR-xy (arg) (List (UR-x arg) (LL-y arg)) )
+ Z' ~$ }/ _& q# ]) f; n - (Setq ename (CAR (EntSel "\nSelect Text to stretch/shrink:" ) )
% z* Q, `, |' @( ?' | - Textent (If ename (EntGet ename)) ) + u2 T+ F! Y5 c3 ^: F
- (If (= (CDR (Assoc 0 textent)) "TEXT")( i& E4 o8 g# b6 E2 t2 Y# ^
- (Progn (initget 0 "Start")9 l q% U# Y) P1 J1 b K' W5 Z8 ^
- (Setq NewEnd (Distance (LR-xy Textent) (LL-xyz Textent) ) )1 @. O) E$ L9 A8 ~
- (setsnapang Textent) ;set snap along text entity
+ T1 q9 p* f+ ~* q. B3 m S - (setvar "ORTHOMODE" 1) ;drag along the text
4 x& Y+ t9 }$ {& S - (setq
6 S6 x; |" i$ }- ? - TMP (getpoint (cdr (assoc 10 Textent)) "\nStarting Point/<Pick new ending point>: ") )( v1 j1 M" C, _8 x; p2 H( @
- (setvar "snapang" 0)
* j1 d& [9 R; w& U* Y' D; m - (cond' m% v- }7 p9 E- a) L- S
- ((= (type TMP) 'STR) ;;new starting point to be selected S* [& V, H2 n% J* |8 r
- (setq Start (getpoint "\nPick new starting point: "))
* c0 C& A u+ _+ U" f1 r - (if Start (progn! i ?$ P1 h t1 V4 L* }+ R
- (command "_UCS" "_E" (cdr (assoc -1 textent)))
) v( I$ _& C5 ]4 o3 P g% v" K - (setvar "ORTHOMODE" 1)4 g) V) c7 H2 T2 r, g3 j
- (setq NewPt5 |) N6 q/ q0 A4 H' J& V
- (if Start' `) h/ {5 n9 e( ?
- (getpoint (trans Start 0 1) " ending point: ") nil ) )
6 ~. o( S Q2 R- N' e - (if NewPt (setq NewPt (trans NewPt 1 0)))
+ T- F$ j3 M( e% d - (setvar "ORTHOMODE" 0)
( J( M O7 }- f; x L% M: \ - (command "_UCS" "_W") ) ) )% y. }$ X. X4 [+ e K+ d
- ((not (null TMP)) ;;new ending point selected& x& E7 {; c6 `3 `( j3 S
- (setq Start (cdr (assoc 10 Textent)) NewPt TMP) )
' j* U+ e: R" v - (t (setq Start nil NewPt nil) ) )+ P6 e0 J6 H- z* N% j
- (if (and Start NewPt) (progn5 s/ Y" f" d# n2 z% t
- (setq Val (Assoc 41 Textent) ;;current width factor0 v! z9 x' I$ c9 N3 M- Q: R
- Val (if Val (cdr Val) 1.0) LTC_%
7 W* n4 y6 m6 O% K# m' _- X - (* (/ (Distance Start NewPt) NewEnd ) Val ), n& ^5 B2 c. x# Y) p O
- textent (Subst (cons 41 LTC_%)
- L9 e; U# t* L - (assoc 41 textent) textent)
0 B W4 q% B! t - textent (subst (cons 10 Start) (assoc 10 textent) textent)
2 D3 u6 K2 U+ C. u2 P0 l) O - textent (subst (cons 11 NewPt) (assoc 11 textent) textent) )
- z) e* L) @5 U: e - (EntMod textent) (EntUpd (cdr (assoc -1 textent))))))) (Princ))
0 U$ t k# H- O3 l1 j9 E& V
, T5 A3 R! r" |1 l4 l- ;=====================================================================
) p4 e; r; z1 ?5 W# V5 y - ;=========================COPY + ROTATE ==============================( ^% I" ~" i" ]! h, i/ ]
- ;=====================================================================
6 \' S- b! a( O) W - 8 s+ F; S! w, T, s$ k. }
- (defun c:CR(/ olderr cm loop ss1 ss2 bp mult lent ss2 lp1 lp2)" M$ g. X* D/ \1 o b( f
- (setq olderr *error*$ p9 {1 D3 Q3 y1 E; N' x
- *error* croerr)
% _; t9 {2 S# Y, u4 S6 J: a4 }$ ` - (setq cm (getvar "cmdecho"))
8 x1 }8 K* _6 L0 _; z5 v3 o - (setvar "cmdecho" 0)6 R2 M. k3 _6 w
- (setq loop t)
2 S/ s3 L# E7 C# Z - (while (not (setq ss1 (ssget))))
, w) A- ]1 ^4 N' }- C - (initget 1 "Multiple")" u4 j; Y& X( M' h3 X' ?- ~# t, H
- (setq bp (getpoint "\nBase point or displacement>/Multiple: "))
2 S, B5 n0 V$ m1 ^( k5 Z6 }- m- ]/ N - (if (= bp "Multiple")
9 u5 T' M2 a$ x S - (progn
: S2 s4 M* L+ Z0 R {: r - (setq bp (getpoint "\nBase point: "))7 N5 L* r* `" | y
- (setq mult t)' [0 \9 N2 j+ M2 Q, O) V
- )* O" S: T# O% k I! O5 O% W
- )2 [+ z% v% q4 {# l: g X
- (while loop
3 ^' O9 b9 a- W' [ - (setq loop mult)) s7 x: Q$ k, N
- (setq lent (lastent)) r& X0 e/ r, a. W
- (command ".copy" ss1 "" bp bp)8 y2 M+ V+ ~: ?" q. w/ ]+ |# q
- (setq ss2 (lss lent))
5 \+ @+ B% n8 m9 Q0 x - (setq lp1 (getvar "lastpoint"))
+ A( x: M) m4 k; [ - (prompt "\nSecond point of displacement: ")
# A I/ X8 i1 m+ j4 u4 m - (command ".move" ss2 "" bp pause) F; ^' r) F7 \4 ]
- (setq lp2 (getvar "lastpoint"))
; r; m5 d/ h. H8 L/ @4 p* t - (redss ss1)8 `+ W: f. j! S& W/ K
- (if (and (not mult)
& b. h4 T5 d. \2 t$ q+ T# M - (= (distance lp1 lp2) 0)9 c1 Z! ?1 D w/ O$ H7 \
- ) ^. u% ? y, r4 o% U1 `+ l$ L
- (setq lp2 (getpoint "\nRotation Point: "))$ D/ b$ {' O! f4 y M
- )
8 j& e: k- A3 C$ T/ M8 Y2 u1 r - (if mult
( _7 `# L" g2 r0 T - (prompt "\nRotation angle ")0 X9 B2 ?# w+ }! R, H- n* U6 Y: \
- (prompt "\nReference/<Rotation angle>: ")
- B% ]) T# D8 X - )
$ I* } n# E0 O$ E: {7 l( l! F; n1 y - (command ".rotate" ss2 "" lp2 pause)
+ a5 H* U/ S8 K* q - )
2 H& x; y- p) b' R# l4 k( ? - (setvar "CMDECHO" cm)7 n4 z) J8 `7 O6 M) W
- (setq *error* olderr) A4 o# X$ E/ {& b: x8 G. j
- (princ)" _3 ~$ x1 P/ k8 D3 \
- )
* L. ^1 Y2 [% ] - (princ)
/ o H N1 M' _- f/ _0 p$ @ - (defun croerr (s) % T* l5 M: C# b8 r7 j& y
- (if (/= s "Function cancelled")
1 N0 p+ L0 Y4 m x5 B/ b: K' o - (princ (strcat "\nError: " s))
: A# o4 p4 K$ Z% Z - )
6 [1 E: x! K! T2 m0 g - (setq S nil): J& j8 m2 Z5 ?( N. U2 y# ^4 R9 C8 h! C
- (setvar "CMDECHO" cm)+ O" W: M9 u( ^$ q
- (setq *error* olderr)
1 R: S3 u6 {( U0 O2 F' u - (princ)2 ^9 b) \7 \2 w% z' Z6 I6 Y
- )
9 U$ L4 z: S h% e% y& q1 j - (defun lastent (/ a b)( p3 s0 e$ w% t9 T! q1 W9 K% P
- (if (setq a (entlast))
! {; b3 _8 n. O* d8 Q - (while (setq b (entnext a))% g$ D0 q1 h& U! [8 \1 T0 y6 g
- (setq a b)* e: n, e' |( A: \; ^
- )
& D$ g7 N4 N$ W' c5 [. n; D - )7 [3 \' f x% E1 |
- a
3 ^1 L9 H2 `+ a6 T5 Y - )9 s, R, t+ J& i7 Q! S- s
- (defun redss (ss / en i)" f0 h' |1 a7 N1 r, c. c
- (setq i 0)/ j# [1 ?. d# g2 ^# O
- (while (setq en (ssname ss i))
& M" c7 T' u" H7 G- {, l2 _ - (redraw en 1)+ Z, e8 ~9 K, a# d; @4 A( ?
- (setq i (1+ i)); w5 }: w. ~. d: p3 g( A; V: |% V
- ); F4 U) N" H$ |" c
- )7 ?: H+ K, r' T) ?& I
- (defun lss (en / sels ed)7 h. v+ B1 }, H
- (setq sels (ssadd))
* {" c$ _: G- n: z2 q - (while (/= en nil)( T, o2 k$ {' |4 c
- (if (setq en (entnext en)) (setq ed (entget en)))
# T) s$ N* K2 K& p - (if (/= en nil) (setq sels (ssadd en sels)))0 B( v$ ^+ _9 f
- (if (or (= (cdr (assoc 0 ed)) "Polyline")
1 E- C. U) c! U6 Q; K- O6 K - (= (cdr (assoc 0 ed)) "Insert")
& X% t( J2 s& ]3 K - )
3 R+ W. d. Y l- V% T - (while (/= (cdr (assoc 0 (entget (setq en (entnext en))))) "Seqend"))
. J' ~, X& w; O2 y1 Q/ }+ O3 O" t - )
4 p" N' e B+ s. n! y; C - )
1 A- H7 {, }8 {! N2 u, |1 P! j$ x% v3 l - sels
; c' k2 _3 P* f& b% { - )
/ t7 Z) F4 J6 j0 l( P; ?
, R8 T( \3 K9 q# z4 p- ;;;; ================== CAC FUNCTIONS DUNG TRONG ACAD.LSP ==================' h1 v) P- f% v. I3 \0 M; t
- / ?+ `5 b. i/ r9 |" A
- (defun c:00 ()(princ "\nChon doi tuong net Defpoints")(ssget)(command "change" "p" "" "p" "la" "Defpoints" ""))
- _" S6 T- j! m - (defun c:0 ()(princ "\nChon doi tuong net 0")(ssget)(command "change" "p" "" "p" "la" "0" ""))* r2 W7 |7 b( u2 h
- (defun c:1 ()(princ "\nChon doi tuong net COT")(ssget)(command "change" "p" "" "p" "la" "COT" ""))$ z% G- R) s5 f9 ^
- (defun c:11 ()(princ "\nChon doi tuong net DIM")(ssget)(command "change" "p" "" "p" "la" "DIM" ""))5 s: C; I: |; C: T) v# o
- (defun c:22 ()(princ "\nChon doi tuong net MANH")(ssget)(command "change" "p" "" "p" "la" "MANH" ""))
7 p, J( Z0 k7 d( z" b - (defun c:33 ()(princ "\nChon doi tuong net NETMANH")(ssget)(command "change" "p" "" "p" "la" "NETMANH" ""))
+ F# u, E; ~0 k' f% n - (defun c:2 ()(princ "\nChon doi tuong net NETDUT")(ssget)(command "change" "p" "" "p" "la" "NETDUT" ""))
- C0 J f8 {$ R, ^ - (defun c:3 ()(princ "\nChon doi tuong net NOITHAT")(ssget)(command "change" "p" "" "p" "la" "NOITHAT" ""))$ e& l8 y- d, J) U' X8 P
- (defun c:4 ()(princ "\nChon doi tuong net TUONG")(ssget)(command "change" "p" "" "p" "la" "TUONG" "")); ]3 R+ T; o' m
- (defun c:44 ()(princ "\nChon doi tuong net KHUNGTEN")(ssget)(command "change" "p" "" "p" "la" "KHUNGTEN" ""))/ p* s, [' C& V& f" [% _" a* l$ u
- (defun c:5 ()(princ "\nChon doi tuong net TIMTUONG")(ssget)(command "change" "p" "" "p" "la" "TIMTUONG" ""))
& h6 x; I2 j$ L0 w* @1 r - (defun c:6 ()(princ "\nChon doi tuong net CUA")(ssget)(command "change" "p" "" "p" "la" "CUA" ""))
" q; O# x4 b0 ?. m& {- d$ ^, N - (defun c:7 ()(princ "\nChon doi tuong net THAY")(ssget)(command "change" "p" "" "p" "la" "THAY" ""))/ h5 [; i, a8 h! v. ^ L3 l2 O
- (defun c:77 ()(princ "\nChon doi tuong net NETTHAY")(ssget)(command "change" "p" "" "p" "la" "NETTHAY" ""))/ k" \7 t, y7 @% _3 J' G6 l+ q
- (defun c:8 ()(princ "\nChon doi tuong net HATCH")(ssget)(command "change" "p" "" "p" "la" "HATCH" ""))* M$ b+ b4 O, U; s) p) ?
- (defun c:9 ()(princ "\nChon doi tuong net TEXT")(ssget)(command "change" "p" "" "p" "la" "TEXT" ""))
: T8 C* @5 d0 b8 r# J - (defun c:99 ()(princ "\nChon doi tuong net CUAMATDUNG")(ssget)(command "change" "p" "" "p" "la" "CUAMATDUNG" "p" "C" "bylayer" ""))
6 Z# U/ Z# E6 O - (defun c:td ()(princ "\nChon doi tuong net THEPDOC")(ssget)(command "change" "p" "" "p" "la" "THEPDOC" ""))% r Z$ E/ a% h/ T- o
- (defun c:ddt ()(princ "\nChon doi tuong net THEPDAI")(ssget)(command "change" "p" "" "p" "la" "THEPDAI" ""))
8 }/ K! T2 f8 o# }$ q - 3 h3 @- T1 A' R7 @" N
- ;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =============
8 e/ r: B- S, P! x& y2 k3 A0 R
# L8 j+ h0 u5 w4 Z0 \- ;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =============+ R, M5 ^ ]& |8 ~7 X& k$ S5 M
, V' Q- I. r7 s- (alert "Using the NetXuatAnh-[ 5940.00 x 4200.00 <pixels> ] command!")& B/ g; ?) K s2 y4 g
- (princ "\nEnter (DEFUN C:netxuatanh () to get to real LAYER command.\n") (command "NETXUATANH")
* t2 V2 C" H4 M& B- }* f# q
8 K. r8 j# \5 W4 N1 ?& k# ?- ;=============== DAT LAYER NET de xuat anh JPG [W x H] [5940.00 x 4200.00] ===DRAW===9 c- b4 a0 N% T& K
- * X; j% y% U7 q% D- ^6 K
- ;(DEFUN C:netxuatanh ()! p: p9 p: E- ?" i. }4 D; E
- (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.6" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "5" "". S' X' r# }' t6 u/ |+ ^3 p
- "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "1.58" ""4 i- r- i- E# I/ k, B
- "M" "MANH" "C" "9" "" "Lw" "0.5" ""4 M& q" ^" I: f1 g( d9 w& X
- "M" "TEXT" "C" "7" "" "Lw" "0.5" ""
5 P9 l! U% @/ {1 T+ v - "M" "DIM" "C" "1" "" "Lw" "0.6" ""
) H9 ^: [2 w4 n2 R - "M" "THAY" "C" "7" "" "Lw" "0.7" ""3 c* C9 J3 Y( G
- "M" "NOITHAT" "C" "3" "" "Lw" "0.5" ""
1 G% e2 t5 T8 @ - "M" "HATCH" "C" "5" "" "Lw" "0.35" ""% @7 H7 @6 M% n( I( I2 o/ k
- "M" "COT" "C" "2" "" "Lw" "2" ""
0 G' Q+ i/ j8 T1 z2 f; f: M: s - "M" "Defpoints" "C" "7" ""! e! W" d5 e: K
- "M" "0" "C" "3" "" "Lw" "0.5" ""
2 j) W9 H* B' n; O, u - ; "M" "1" "C" "1" "" "Lw" "0.5" ""
7 w3 h% l% j u8 N6 S - ; "M" "2" "C" "31" "" "Lw" "0.5" ""# B1 g3 }; A+ Y D3 ~# c
- ; "M" "3" "C" "8" "" "Lw" "0.35" """ J. s' N. P; C4 E9 X( I; B
- ; "M" "4" "C" "4" "" "Lw" "0.8" ""
% h0 J" Z* |% z7 T6 m% s$ S; p - ; "M" "6" "C" "6" "" "Lw" "0.35" "") V, F# {: j2 _: b# {' b- u
- ; "M" "7" "C" "7" "" "Lw" "0.4" ""
1 B- { E0 `7 P6 s% m/ l2 G' n - ; "M" "8" "C" "8" "" "Lw" "0.35" ""
- ^" {! L- Q* @# f - "M" "DAY-DIEN" "C" "3" "" "Lw" "0.5" ""
1 Q$ b: e0 M0 [ - "M" "DUONGBAO" "C" "7" "" "Lw" "1" ""$ w% C" o8 m) ^
- "M" "KE" "C" "8" "" "Lw" "0.3" ""% y: ?# t( [1 H! k
- "M" "KT" "C" "9" "" "Lw" "0.35" ""7 p( S! F$ ]$ \3 s/ Q8 N
- "M" "NETTHAY" "C" "255" "" "Lw" "0.7" ""1 r. }( v9 v9 U8 c2 Z$ p
- "M" "NETMANH" "C" "43" "" "Lw" "0.5" ""
& z) f: z4 t/ |6 H# D/ ~, o - "M" "TBD" "C" "2" "" "Lw" "0.8" ""3 f) ]8 G& ?' }2 ^! I
- "M" "TEXTTXT" "C" "7" "" "Lw" "0.4" ""0 E5 b# ]; z; c2 ~
- "M" "TEXTVN" "C" "132" "" "Lw" "0.4" ""
0 C- ]" @: N) P& j$ D9 Z - "M" "THEPDAI" "C" "3" "" "Lw" "0.7" ""
* W& H7 t4 u% [, q) b - "M" "THEPDOC" "C" "2" "" "Lw" "1.58" ""
& p+ I- W! Z' s D- a- B% @$ s0 m - "M" "CUA" "C" "6" "" "Lw" "0.5" ""3 H- \ e5 ~# f1 j, c0 X: R6 b
- "M" "CUAMATDUNG" "C" "6" "" "Lw" "0.5" ""0 S p% l' O8 U
6 `' S0 K& I: ~& u0 q% e- ;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] ===NUOC===
! F1 M' I2 c! D( m - - S% l' C u+ _! x! X
- "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.5" "". y. ~4 J1 D7 Y9 e" u; [, }
- "M" "4-WateR_IN" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE1" ""
& {- m" u3 q H - "M" "4-WateR_OUT" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE2" "" l; F2 |! o5 H
- ; "M" "250" "C" "250" "" "Lw" "0.35" ""
1 o+ H! w. [! f1 a: v - "M" "KHUNGTEN" "C" "4" "" "Lw" "1" ""
% `+ y- i4 R8 X$ [, k3 ] - "M" "TIMTUONG" "C" "5" "" "Lw" "0.5" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "10" "" )
* B' V9 ^/ y$ r. x r, w - % k- [! Z3 s2 O0 k3 i6 O
- ;=============== DAT LAYER TEXT de xuat anh JPG [DIM] [TEXT] [GHI CHU]======( k: K( C U) J0 y% t- }1 r" d
- ;===================================30|04|2024==============================% A& H/ M. _/ f* e3 P/ ], C# A
5 v; V/ T7 E& |2 j- (Command "-style" "Vni-VietNam" "vn_vni,vns.shx" "0" "1" "0" "n" "n" "n" )
5 a0 O* u- A4 K" W8 A, l% P" x - (Command "-style" "Vni-ROMANS-TEXT" "vni-romans,vns.shx" "200" "1" "0" "n" "n" "n" )
3 n" @3 f$ k" _6 n - (Command "-style" "COTES" "verdana" "" "1" "0" "n" "n" )
/ O1 [+ d& I, [+ U. G) h - (Command "-style" "TRUC" "impact" "0" "1" "0" "n" "n" "n" )' T2 j& u- W+ P' ^2 n {6 ~0 h- X+ @
- (Command "-style" "VNHELVLT-Hoa" "vnhelvh,vnh.shx" "500" "1""0" "n" "n" "n" )
0 N4 J. j2 q: s& b7 H - (Command "-style" "VNHELVLT-Thuong" "vnhelv,vnh.shx" "500""1" "0" "n" "n" "n" )
7 S, f. n$ ^. I" b2 p) J; j# N$ u - (Command "-style" "STANDARD" "Verdana" "200" "1" "0" "n" "n" "n" )
' [0 _. j6 H( K1 M - (Command "-style" "VERDANA" "verdana" "200" "1" "0" "n" "n" )
3 U) G8 |4 u& j% V) f4 G- w# v - (Command "-style" "ROMANT-DIM" "romant,vnh.shx" "0" "1" "0" "n" "n" "n" ), Y# o5 t3 F% z. l1 U Q
- (Command "-style" "ROMANT-TEXT" "romant,vnh.shx" "200" "1" "0" "n" "n" "n" )(princ)' T3 U- E/ h6 z2 t- n' X7 Q- r
0 C% @7 K& N/ E/ q1 Z2 z! X- ;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=6 W' k; d: g9 M$ |1 `1 d
- ;===================================17|10|2024===================================+ B" }# b+ H. I |5 e' i! b* q1 `
- & C, V1 t% i, X5 @" X$ Q; ^3 j3 E
- (Command "DIMTXSTY" "ROMANT-DIM" )8 X0 P$ t% F" I4 }# K% M, ]
- (Command "DIMBLK" "" "Closed" )$ E6 a+ b. M% f' s9 n! U
9 }! b- T& T l q! {/ T- ;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=
4 q/ r* i7 z1 q/ Q2 R - ;===================================17|10|2024===================================9 v0 x, A* r s
- 8 r+ |! z6 [% r' H+ f
- ;(Command "-units" "2" "8" "1" "8" "" "N")
4 ]% \, i j8 }8 L - (Command "-plot" "Y" "" "publishtoweb jpg.pc3" "User 1 (5940.00 x 4200.00 Pixels)" "Landscape" "N" "Display" "Fit" "Center" "Y" "monochrome.ctb" "Y" "")(princ)$ o7 e8 w. \" X9 S& Z# O
- 5 W; A9 E: t/ u7 Q# H( o8 }
- ;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=
/ Q/ J) @& n3 O - ;===================================17|10|2024===================================9 h( E: [! j2 C8 q
2 ?: y, \9 g9 }$ l- ;======== KET THUC - DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =====
( ?- N6 x; `7 T/ H8 l
6 v: n% K' M {. M% J! i" x0 H- ;======================== DAT NET IN & TI LE BAN VE =============================
7 N) n% G9 h' J( y, O& W6 b' W
1 ~$ `( b9 v3 r5 C- ;=================LENH VE KHUNG TEN - Tieu Diet Lenh==================# H$ ~" p$ [& y- u6 u8 }( B
- ;=============== DAT KHO GIAY BAN VE - KIEU KHUNG TEN ================
: J+ u M+ U& \% j; y - ;=============================11|07|2025==============================
0 [, Z' y& J# C E- ^( b. d - ;Ti Le Ban Ve - 1 : 100, v0 H+ M+ s" e! R- L. r
- (Defun c:kta4 ()
# ~) ^1 I+ B; ^0 S% Q - (setq mv_sc 100);Ti le ban ve
, r& @# a3 l$ G - (setq x4 297)4 I3 q/ W1 y& H' F9 q
- (setq y4 210)
2 C2 Y) b8 e7 a7 j( m1 Y - (setq x4 (* mv_sc x4) 8 F8 k, T0 u4 L% a, d. z
- y4 (* mv_sc y4) )
2 l. O. k' r8 U - (command
6 j# A; j1 u9 h# e, `8 R' c8 ` - "LIMITS" "0,0" (list x4 y4)( n! ?8 S" v8 I1 s. r% S7 a
- "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"8 I2 ?8 g* C3 ? p* U8 A9 a
- ;Khung CHU NHAT Chinh
6 \. M6 N1 U0 E; J) o3 D8 N9 s# _ - "RECTANG" "500,500" "@28700,20000"; w8 o8 Z1 e$ M+ ]8 N
- "RECTANG" "700,700" "@28300,19600"
8 a( e7 _! O6 |* t& P - ;Khung Ten Chung
/ F0 u4 @3 {* S; E0 U - "RECTANG" "700,700" "@8000,1250"
5 t7 N" F$ j2 h8 R# i - "RECTANG" "700,700" "@17300,2500"
' }! c7 P3 X6 |7 L, e9 s. t - ;Ten Ban Ve# _& |8 b6 ], b
- "RECTANG" "18000,700" "@11000,1250"
$ ~* N5 H. T* F7 ]. B - "RECTANG" "18000,700" "@11000,2500"
( M, a# |+ T+ B$ m: |, P; X - ;Khung Ti Le + Ngay Thang Nam3 [$ o$ k1 P' c
- "RECTANG" "22500,700" "@2000,2500"
: ]3 [" N1 i; k9 Z* B" z' k - ;Khung CHU TRI. c8 J4 a }6 Z
- "RECTANG" "8700,700" "@3800,2500": b6 C- _) V- u! d
- "ZOOM" "_a" ))
3 V5 `) l" D2 h, _6 O - ;=====================================================================
+ r" \+ {- P# M) q( r+ I; V0 i - ;Ti Le Ban Ve - 1 : 1008 u% E+ I f3 T9 G! v( p, |
- (Defun c:kt4a ()+ }4 E) Z" O8 ~' }
- (setq mv_sc 100);Ti le ban ve
1 ~- `3 E0 x3 [# T% o* T( R4 x; u - (setq x4 297)$ @' W$ v6 m3 y5 D
- (setq y4 210)
0 n7 a* M g7 @6 L# h( } ~ - (setq x4 (* mv_sc x4) 5 o( O R3 g. [6 ]1 ] L
- y4 (* mv_sc y4) )
! i$ O! }" ]: N s k; | - (command 8 W. ~; A: h. k
- "LIMITS" "0,0" (list x4 y4)2 U* H; i; r2 J4 T) a8 P
- "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
; `) S- q0 {& f. p$ ]+ U* P: ^1 [ - ;Khung CHU NHAT Chinh : z1 b/ N Z+ _. J3 ?) R" e
- "RECTANG" "2000,500" "@27200,20000") `" R. {% v0 {9 X( `
- "RECTANG" "2200,700" "@26800,19600", j1 x8 {2 A7 l; F. S
- ;Khung Ten Chung
! I. Z) Z1 \2 x4 } - "RECTANG" "2200,700" "@6500,1250"3 c. W* }1 u* T& r T
- "RECTANG" "2200,700" "@15800,2500"
+ A) T$ P9 t- W d - ;Ten Ban Ve
% D4 t8 g9 Z: Q6 M - "RECTANG" "18000,700" "@11000,1250"
$ t; s9 ]6 D: z. g3 V6 J - "RECTANG" "18000,700" "@11000,2500"8 g p; ?6 m8 [/ c" g) a
- ;Khung Ti Le + Ngay Thang Nam# J( w1 g5 ~5 l% x
- "RECTANG" "22500,700" "@2000,2500"0 ^" A. D+ ^6 `: e
- ;Khung CHU TRI
9 S1 P. R D1 E4 b$ l4 u1 z( U6 e - "RECTANG" "8700,700" "@3800,2500"* D+ ?, l5 n, F [
- "ZOOM" "_a" ))- ]$ M+ }1 Q/ |* y9 T) W# g: V! W' x0 ?
5 T- `1 M2 o7 P! x! L d- ;;; ============================GHI CHU Khung Ten========================5 S1 j. l* b3 r& B
- ;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========5 Q3 W/ h* R$ }( Y/ d" R6 |
- ;;; =======================Thuong Dung Font Romant.vnh===================
( y u8 s, Z3 T$ M% Y. C4 C" n- z& W - ) a* A3 \" ]- P5 {7 ~+ b! |
- (defun c:GhiChu (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)7 y- y1 ~+ \6 M3 M) x
- (setq oer *error* *error* err2)8 }* D, Q! Y, M
- (PROMPT "\nChuTri. ThietKe. KiemTra. TiLe. Ngay. HangMuc. QuyMo. KieuNha. CongTrinh. KyHieu. TenBanVe. Kts. TranNgocThang. ")
% i$ @% {5 Z, \* X - (SETQ Cpt(GETSTRING "\n(CT). (TK). (KT). (TL). (Ng). (HM). (QM). (KN). (CTr). (KH). (TBV). (Kts). (TnT). ")); q; o( Y& j: Y. K$ P4 A- j
- (IF(OR(= Cpt "QM")(= cpt "qm"))(SETQ CPT ' "Hå S¬ ThiÕt KÕ Nhµ D©n Dông quy M« :"))
9 O1 t1 S$ N" {' I$ A - (IF(OR(= cpt "KN")(= cpt "kn"))(SETQ CPT ' "2 TÇng 1 Tum Thang"))
- J6 C) ~, b/ V/ y$ ?4 G8 e, i9 ^ - (IF(OR(= cpt "CT")(= cpt "ct"))(SETQ CPT ' "Chñ Tr× :"))
3 [8 ^; }: s3 D, r: N - (IF(OR(= cpt "HM")(= cpt "hm"))(SETQ CPT ' "H¹ng Môc :"))5 s" H6 m: h \* h
- (IF(OR(= cpt "CTr")(= cpt "ctr"))(SETQ CPT ' "Nhµ ë Gia §×nh - Nhµ LiÒn KÒ"))% C y6 q8 L* m& X$ ?
- (IF(OR(= cpt "TK")(= cpt "tk"))(SETQ CPT ' "ThiÕt KÕ :"))
$ w# l- e: [- K3 i3 ?8 T! \" l: o/ ~ - (IF(OR(= cpt "KT")(= cpt "kt"))(SETQ CPT ' "KiÓm Tra :"))
: `7 k, G0 X" m/ Q4 S9 Y - (IF(OR(= cpt "TL")(= cpt "tl"))(SETQ CPT ' "TØ LÖ :"))0 M6 L* l0 k( L- l. V7 J5 B
- (IF(OR(= cpt "KH")(= cpt "kh"))(SETQ CPT ' "Ký HiÖu :"))
0 {, Q. ^5 q* ]" e3 T% r( Z- k0 | - (IF(OR(= cpt "TBV")(= cpt "tbv"))(SETQ CPT ' "Tªn B¶n VÏ :")) r% ^9 k( x$ L1 j1 r. p5 T6 e
- (IF(OR(= cpt "Ng")(= cpt "ng"))(SETQ CPT ' "Ngµy :"))) V4 E+ y1 k# C+ c2 Z1 x" B4 k
- (IF(OR(= cpt "Kts")(= cpt "kts"))(SETQ CPT ' "Kts. TrÇn Ngäc Th¾ng"))
' B8 g! s; B( ?9 E: p+ ~( k& _" b. J - (IF(OR(= cpt "TnT")(= cpt "tnt"))(SETQ CPT ' "TrÇn Ngäc Th¾ng"))
: I4 M, P, N; b, {6 A$ Z, l; m - (setq pta (getpoint
" ~% p6 s# o: G5 e' k. D7 V - "\nPick first corner. : "))( M! a2 d( b: {! z) k
- (setq ptb (getcorner pta
( p+ { e7 C a* b: g - "\nPick second corner. : "))
3 R: X2 s/ V8 ?$ X - (setq ptc (list (car ptb)(cadr pta)))
8 S1 r3 x, \5 _ - (setq ptd (list (car pta)(cadr ptb)))
1 K* w' O4 k# R" k9 c. p - (setq ang (angle pta ptb))
! M. F% ~* E$ r1 ~1 M - (setq d1 (/(distance pta ptb) 2))
3 m& ]$ E8 N& L - (setq cp (polar pta (- ang (dtr 0)) d1))
2 Y% {; x3 \9 L3 n+ x1 b+ H - (setq X (distance pta ptc))
# x+ a9 A: D2 R3 \- x3 [" \ - (setq Y (distance pta ptd))% ~2 M' {; @9 X0 M! s* N* z. L
- (setq X1 (rtos x 2 1))
' A! i: k$ n! Z - (setq Y1 (rtos y 2 1))
4 i o. M* s! t) w) j - (setq rmsz (strcat "(" X1 " x " Y1 ")"))
8 a% P0 z7 k' s: i' R - (command "TEXT" "c" cp "0" CPT "text" "" rmsz))* Q' O* m/ E- N% z3 \8 ~2 C2 z1 M/ W# Q
- (defun dtr (angg)
4 {; m7 w# i1 ~$ z: b1 Y( B - (* pi (/ angg 180.0)))
7 {' a6 C& h; }; M) d3 t
3 |6 q6 [: e$ e- ;=====================================================================: P9 K: @4 ^/ a" z8 N0 x; U+ m/ e
- ;==========================DAT KHO GIAY BAN VE - KIEU 1========================
& F( |7 x5 [0 s% o c M; `, d& R6 ~ - ;=====================================================================" g* M" J$ L- Z
( z" v! i# x, p: N1 F- (Defun c:a6 ()3 @6 {3 F( T$ O; c. L0 H
- (setq mv_sc 100);Ti le ban ve$ I: O ~. z7 `8 v* B; s
- (setq x4 74.25)
i* w4 {" Q6 M' U9 r' n - (setq y4 52.5)
, s; }) Y7 |/ ]. K- V$ f3 e - (setq x4 (* mv_sc x4)
; F9 X3 Q6 X# y0 q% A5 s - y4 (* mv_sc y4) )4 X! c' f" P F
- (command
% T: H, K# u( _$ n+ ^ - "LIMITS" "0,0" (list x4 y4)' T N0 r' H7 K6 m9 y* U
- "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
. A* y; Y* w1 z/ B* d4 m U9 H - "RECTANG" "125,125" "@7175,5000"/ Q5 w6 T% h* |- M% U6 U' N- k7 M
- "RECTANG" "175,175" "@7075,4900"
' t" K$ P L+ I7 c - "ZOOM" "_a" ))
! e; I' X3 O: k- H - ;=====================================================================
) w/ S T! v; g/ t( z - (Defun c:a5 ()
# Z7 }! e& V. {; V8 } - (setq mv_sc 100);Ti le ban ve5 ?! q4 B4 j' y
- (setq x4 147.5)
6 F4 |& M V( Z( p - (setq y4 104)
5 ?$ @; W1 I& e - (setq x4 (* mv_sc x4)
5 g; a# B: ]5 Z8 p# Z - y4 (* mv_sc y4) )/ v- |6 z3 I; p. b* r
- (command
' P) L' O4 i* e: A/ n7 N - "LIMITS" "0,0" (list x4 y4)* ~# P0 E% m+ L0 G
- "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
+ T2 q. n; R$ o; P) \( u - "RECTANG" "250,250" "@14350,10000"1 e$ I9 K1 J Z. e
- "RECTANG" "350,350" "@14150,9800"
8 {) o6 K4 g8 | u: C2 E - "ZOOM" "_a" ))
m6 E4 j ]3 b - ;=====================================================================& N# |" Q" M/ [* P0 x B# G0 s
- (Defun c:a4 ()
7 O: }% |& v& r. @" s - (setq mv_sc 100);Ti le ban ve- X7 Z* M( V- Y# F6 y
- (setq x4 297)( M# A! v ~7 Z+ O$ A: R8 A
- (setq y4 210)
7 f$ ?2 T8 I. S" s - (setq x4 (* mv_sc x4) ' ]' Z# [. A# ~* C* ]
- y4 (* mv_sc y4) )
9 O) J% g; G9 q - (command 5 n3 K) @- L8 T4 ` z
- "LIMITS" "0,0" (list x4 y4)
( e/ R+ y; c3 C5 { - "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"3 t; b, q1 P2 k# w- o
- "RECTANG" "500,500" "@28700,20000"
7 Z! U# A9 k' q/ K( D" Q) T - "RECTANG" "700,700" "@28300,19600"" ?; _* C8 @2 O1 K2 R
- "ZOOM" "_a" ))
* A, M a% v+ I1 _" c" s/ |% ~ - ;=====================================================================
3 s) T+ s2 w% x7 d H E& o - (Defun c:a3 ()0 O! B, j0 X/ H0 `1 u' d
- (setq mv_sc 100)
5 u: y( v- H( x; l) K+ s1 d) \9 q1 c( C - (setq x3 420)2 }0 Y) }1 `& m5 C
- (setq y3 297)) O" d) z9 [5 @) c. X) W5 l
- (setq x3 (* mv_sc x3) 6 X4 }) Y/ Z# E; S" z V. f3 n
- y3 (* mv_sc y3) )
4 g$ A$ |2 j) \+ L - (command / @/ y& w5 n+ o. @( ~
- "LIMITS" "0,0" (list x3 y3)
) |2 a3 i) Q( g- o1 @* h - "PLINE" "0,0" (list 0 y3) (list x3 y3) (list x3 0) "0,0" "_C"
6 L& L; w% ]; t$ a, p& J' B- L! j! C - "RECTANG" "707.14285714,707.14285714" "@40590,28285.71428571"
* C9 y4 s" e( [/ n - "RECTANG" "990,990" "@40024.28571429,27720"
: Q1 Y k2 B8 x, f - "ZOOM" "_a" ))2 e& b8 ^ x2 L* j7 m
- ;=====================================================================' Q* B3 J; m5 {5 m8 _4 L
- (Defun c:a2 ()
" e1 K( n7 F6 Q1 _* y - (setq mv_sc 100)
6 \6 j8 E0 h; U) s - (setq x2 594)
( p* s T, n3 m% y' s - (setq y2 420)
# Y+ {3 o9 P; P- I - (setq x2 (* mv_sc x2)
3 O5 _5 Z0 L) Q; E8 J - y2 (* mv_sc y2) )
4 Y9 c6 L x( N9 g; [: U! ~: M - (command
, y6 O3 N% I" O* |) H* _! M$ B - "LIMITS" "0,0" (list x2 y2)
* {' n1 @( ~( ~2 N% |0 h6 L% g8 A - "PLINE" "0,0" (list 0 y2) (list x2 y2) (list x2 0) "0,0" "_C"$ O( b- Z4 |, E8 v4 {
- "RECTANG" "1000,1000" "@57400,40000": z9 T8 K, V' i/ O( o
- "RECTANG" "1400,1400" "@56600,39200"
' Z, n* X( M, ^1 y p; Z! ] - "ZOOM" "_a" ))0 T# g1 U" B7 ~. c8 y1 T/ C
- ;=====================================================================* ]1 P, T) G3 P8 Y5 ]3 r! _
- (Defun c:a1 ()
, w/ |6 q. A8 X; I - (setq mv_sc 100)5 e+ \* N- I5 O& M+ u) S% q
- (setq x1 840)
: n+ G! o' b1 i* C* `5 x - (setq y1 594)+ G& h+ [. A( K
- (setq x1 (* mv_sc x1) ( |+ K& `9 p K) J" B9 k9 F
- y1 (* mv_sc y1) )( D4 {5 d# ]5 A7 M0 S
- (command
' E0 Q5 z2 @& V9 e* P - "LIMITS" "0,0" (list x1 y1)
, k8 H, I$ t! e3 V" ~/ r/ @ - "PLINE" "0,0" (list 0 y1) (list x1 y1) (list x1 0) "0,0" "_C"
; D; l- F Q! k2 I2 O - "RECTANG" "1414.28571429,1414.28571429" "@81180,56571.42857143"
4 R9 G% H8 m% k2 ~$ j# g! E3 y - "RECTANG" "1980,1980" "@80048.57142857,55440"
/ Q1 t; p/ Q# Z - "ZOOM" "_a" )). f, ~$ k% O* E% B! C# Q
- ;=====================================================================) `2 i+ N n; X' m* a
- (Defun c:a0 ()
! }4 h1 c# Z! U: X# @+ M3 F1 m - (setq mv_sc 100)
& @$ q) R# v, E: X - (setq x0 1188)( ~7 D' t, X% P! j* a2 T/ K
- (setq y0 840)$ b/ d; O6 f9 X* u* L0 x8 y
- (setq x0 (* mv_sc x0) # \( o2 I1 N/ ~& M1 @* v2 U* S
- y0 (* mv_sc y0) )/ l& O" d% V8 G1 a6 Z `
- (command + }) C. o: b( p
- "LIMITS" "0,0" (list x0 y0)" d: ^) J4 ?) |4 ]6 ~$ ] y
- "PLINE" "0,0" (list 0 y0) (list x0 y0) (list x0 0) "0,0" "_C"* U8 G+ \9 P& Z/ ~
- "RECTANG" "2000,2000" "@114800,80000"
4 V# ^! M" \( \" s6 u/ Y$ i - "RECTANG" "2800,2800" "@113200,78400"
# i v H! x9 _( H' L - "ZOOM" "_a" ))5 W+ A7 `( o. g4 f& Z. k1 {
- $ ~8 x4 e. b- K' k: Z# K: U
- ;=====================================================================
9 E, a1 y- A1 r- o% E - ;=========================DAT KHO GIAY BAN VE - KIEU 2=========================
5 k2 c3 o/ J& O' B+ Y) L3 P3 [ - ;=====================================================================
! [- p- o; b0 Y, \2 z4 e1 _
9 F3 C2 X# Y& e: A1 G# g- (Defun c:6a ()
9 L, z: `6 i. I c. C6 n8 a - (setq mv_sc 100);Ti le ban ve" R. f9 R9 C: K/ [/ A1 ?
- (setq x4 74.25)
/ D! I, {* W7 R( U) ?6 ?: E F - (setq y4 52.5)
1 O, `& v' c) r% s4 R) W - (setq x4 (* mv_sc x4) ! F$ s2 `7 U) m: z% U
- y4 (* mv_sc y4) )4 \% U$ \" c' \
- (command 5 B" n, k V# l% F
- "LIMITS" "0,0" (list x4 y4)0 z) h+ b1 U- h9 _
- "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
* _* ?, N6 r6 b+ R, V8 w+ C - "RECTANG" "505,125" "@6800,5000"
1 ]* e% [( b0 ]1 w0 l' A0 K - "RECTANG" "555,175" "@6700,4900"9 h1 E9 x( {, N# V
- "ZOOM" "_a" ))* N) A1 S1 p H8 [
- ;=====================================================================" o% o8 S0 d0 |. b5 Z# k
- (Defun c:5a ()& @$ q3 h- X# X9 ?& L. s6 I
- (setq mv_sc 100);Ti le ban ve$ m" W# K! V4 ~. V3 q" b2 ^) G7 @
- (setq x4 148.5)$ ]' t5 t) v# y. ^+ L- f
- (setq y4 105)
# S# I" b0 y' U: x; g - (setq x4 (* mv_sc x4)
Y- j3 Q6 l! L: d0 }% w+ F- r - y4 (* mv_sc y4) )3 q2 ?2 I9 I& x
- (command 3 N& `8 I+ ^& k, O
- "LIMITS" "0,0" (list x4 y4)3 ~6 Q' [, {$ m* f" N0 i1 ~: w, Y
- "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
5 o: M" L$ Z4 v% e$ z- \2 ~ - "RECTANG" "1000,250" "@13600,10000"4 y* u, } Z! A( b5 d( c0 h& E& Z
- "RECTANG" "1100,350" "@13400,9800"& \, U6 _' @$ n1 J
- "ZOOM" "_a" ))1 q+ @% [ V/ l, b
- ;=====================================================================4 a6 a. F6 D1 J
- (Defun c:4a ()
- M$ \, [. D# s( o - (setq mv_sc 100);Ti le ban ve( p1 v# q( W$ j* M. c& t% b
- (setq x4 297): f; n" j6 Q# s [& C
- (setq y4 210)
8 q' n1 ~5 t( ^6 S - (setq x4 (* mv_sc x4) . D3 J: ~1 `; D1 |! r/ _
- y4 (* mv_sc y4) )6 q2 E0 [* O; s- J
- (command ! s2 T" f4 o5 k) G) j
- "LIMITS" "0,0" (list x4 y4)
1 a, i( V$ {9 S' |0 r" Z& s, k - "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"1 b: v4 [! e: h7 J5 Y
- "RECTANG" "2000,500" "@27200,20000"
( ]6 F7 J) T: K5 y$ T+ ^& t - "RECTANG" "2200,700" "@26800,19600"$ Y+ s' C' e' A/ h* ?' n
- "ZOOM" "_a" ))
! G9 q- `4 S6 k9 o' T2 q/ H' I$ w - ;=====================================================================9 D" S- q& X. d( Q; I' f/ c
- (Defun c:3a ()
2 o$ [5 l+ l# S: e: J - (setq mv_sc 100)0 ?2 I8 V) V8 L) k# P# w
- (setq x3 420.0428571429)
" G3 D& ~. B' @5 q - (setq y3 297)
% @( i9 _' v G5 C, t. x- Y - (setq x3 (* mv_sc x3)
1 b- ]$ K- M) y9 M: h3 D: Z - y3 (* mv_sc y3) )" M' z' m& Q+ f1 D' z: T
- (command
% D7 L! l( _4 j2 N; L; s& a6 \ {. K - "LIMITS" "0,0" (list x3 y3)* o* }9 c q7 Z1 P
- "PLINE" "0,0" (list 0 y3) (list x3 y3) (list x3 0) "0,0" "_C"
! W4 R3 }. j; U. U - "RECTANG" "2828.57142857,707.14285714" "@38468.57142857,28285.71428571"; Z) l" D; T, l1 P
- "RECTANG" "3111.42857142,989.99999999" "@37902.85714287,27720.00000001"
/ L n5 i. `# r; p, o/ u - "ZOOM" "_a" ))$ u/ ?1 G5 V( P+ h- v/ U
- ;=====================================================================$ n, r) q# m& v: Q
- (Defun c:2a ()
1 @2 K9 g" H+ N - (setq mv_sc 100)3 H% u* @0 A. E/ x/ ?3 A9 a
- (setq x2 594)
5 E1 T) S5 t9 p) n - (setq y2 420)/ _1 A6 q2 A: R Y
- (setq x2 (* mv_sc x2)
9 r. @, ~3 `& {7 s, o: ] - y2 (* mv_sc y2) )
9 v. L7 `, }9 l2 [, S9 D: s - (command - h$ G+ m! F0 ? ]* `( Z
- "LIMITS" "0,0" (list x2 y2)8 ^- ?/ z9 A k
- "PLINE" "0,0" (list 0 y2) (list x2 y2) (list x2 0) "0,0" "_C"
) ~: u8 {2 _( W! X8 r - "RECTANG" "4000,1000" "@54400,40000"
( @6 }0 j! \, k - "RECTANG" "4400,1400" "@53600,39200"$ Y9 q! [% d% L" Z- b
- "ZOOM" "_a" ))
; c0 `$ Y/ H0 B" W! r9 j8 F- t - ;=====================================================================
+ f# ]! ?. J4 z, N5 J - (Defun c:1a ()( ^6 ] q$ h5 w/ N
- (setq mv_sc 100)
% _ Y5 X2 h; z q4 y - (setq x1 840.0857142857)
9 }9 D# U# E E8 x [1 r - (setq y1 594); S+ `0 p! [+ q/ W
- (setq x1 (* mv_sc x1) 5 {) G. P5 U. D/ u+ w: A0 u
- y1 (* mv_sc y1) )6 W% p0 S; K% D6 v! Z& _" I
- (command
1 Z6 R( ~/ o" T6 ?/ ~+ m& R- D7 h% \- b - "LIMITS" "0,0" (list x1 y1)+ d2 C/ h; H1 t. H g. l+ z
- "PLINE" "0,0" (list 0 y1) (list x1 y1) (list x1 0) "0,0" "_C"; x6 n3 Z7 ]- M6 b3 c
- "RECTANG" "5657.14285714,1414.28571429" "@76937.14285714,56571.428571436"' R/ v. [1 x, z* ]3 Z: O; x3 a
- "RECTANG" "6222.85714286,1980.00000001" "@75805.71428570,55440"
3 J: r; P6 l3 z1 I& M- z - "ZOOM" "_a" ))
) P& A# h# K2 N. S& p3 @* k: {2 [, | T - ;=====================================================================: e: Y5 J w" e2 D3 N8 k& d6 x
- (Defun c:0a ()
8 r+ Z9 u, z& U' j- e0 [2 t - (setq mv_sc 100)
6 R% j" U5 l4 C9 {% Z! ^' G - (setq x0 1188)3 ?+ w0 O Z" @2 l/ u& r1 k7 e
- (setq y0 840)$ N; s$ t* ?' j/ X' g3 F
- (setq x0 (* mv_sc x0)
7 U: P" D- u) m0 m* z - y0 (* mv_sc y0) )! W9 F5 U5 K/ L5 L* S* Q
- (command 6 m+ ~7 h* i4 G) W. @" w# m9 s
- "LIMITS" "0,0" (list x0 y0)( N$ _) A% T h9 f' e, S. P
- "PLINE" "0,0" (list 0 y0) (list x0 y0) (list x0 0) "0,0" "_C"
5 v8 Q* `* {8 f- I - "RECTANG" "8000,2000" "@108800,80000"
: U \5 z L" t& j5 } - "RECTANG" "8800,2800" "@107200,78400"3 T8 M3 ?* V1 k; l4 ^ b% y0 @0 Z7 k
- "ZOOM" "_a" ))
$ P; I0 m7 ]7 e8 \
6 a" a8 {" H) c7 Z% E+ ^# V- ;=====================================================================! m! u3 z6 W) X
- ;==================DAT KhoGiay Theo KHO GIAY BAN VE===================
- U2 H$ U4 l; \& m7 V - ;=====================================================================
* q! u( m2 S/ H% N$ g9 D - (defun c:khogiay (/ oldlst a b c d e f g h kho TL)+ L5 u$ I5 g6 K8 E) H
- (command "undo" "be")
t, A" {8 c f' g5 O8 S: S - (setq oldlst (mapcar 'getvar (list "CMDECHO" "OSMODE" "cecolor")))
& ] k8 m) h! ]' Q9 A - (setvar "CMDECHO" 0)
2 x5 C$ d2 m3 F) I \- B - (setq a (getpoint "\n chon diem chen :"))
- o3 k/ B8 r( K" q2 w# o/ U! h - (if (not TL) (setq TL 1.00))
. y0 u3 t2 y% m; ?- y% ? - (setq TL1 (getDIST (strcat "\nScale <" (rtos TL 2 2) ">:")))& F+ W7 s5 F5 u8 X- w
- (if TL1 (setq TL TL1))
9 f" t+ h) E+ q% r - (setvar "osmode" 0)
; ]4 {6 E9 [# y% a; z! ` - (if (not (tblsearch "layer" "Defpoints")) (Command "layer" "N" "Defpoints" ""))- x1 C, U, \8 |3 r! u0 J
- (initget "0 1 2 3 4")$ z8 i; m3 V7 Q+ O6 M1 H# g6 l5 Y
- (setq kho (getkword "\Kho A0 _ Kho A1 _ Kho A2 _ Kho A3 _ Kho A4 [0/1/2/3/4]? <0>:"))
* J( J2 g8 J5 E& X - (if (= kho "0") Y8 B, M) Y; N) E. w
- (progn1 _- b; R2 d7 X
- (setq b (polar a 0 (* TL 1189)))
% P, ? }$ X; @: c1 x6 o* o- J - (setq c (polar b (/ pi 2) (* TL 841)))& P7 U/ e. o7 z% U* T$ m
- (setq d (polar a (/ pi 2) (* TL 841)))
6 R* W1 S9 T5 f/ N. \! X - (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 12 12)))))
6 ?8 b6 i1 b6 U3 G! h5 o, Q - (setq f (polar e 0 (- (* TL 1189) (* TL 24))))3 A6 w) j2 k4 s a: `4 j5 S- R
- (setq g (polar f (/ pi 2) (- (* TL 841) (* TL 24))))
& U4 T0 E( i- g. \# y/ F - (setq h (polar e (/ pi 2) (- (* TL 841) (* TL 24))))7 {1 D, O% Q' Q1 d; D, z# N
- (command "Pline" e f g h "c") 2 D3 S' a! ~6 t- Y s
- (command "change" "last" "" "properties" "layer" "0" "")( B5 o# Z I9 ]8 t% p3 k
- (setvar "cecolor" "4")
: b$ T* b! G) ^. D' P5 D9 K# Q - (command "Pline" a b c d "c")
* r S, x9 v! |3 ]& x+ m( W$ F - (command "change" "last" "" "properties" "layer" "defpoints" ""))) 8 j5 @# ]1 D p- D, h6 e
- (if (= kho "1")2 {' Y/ [+ r8 Q* m- ]
- (progn
* T- H8 C5 P; Z8 \" t+ E' M - (setq b (polar a 0 (* TL 841)))
7 Y% m* K8 x# H/ w - (setq c (polar b (/ pi 2) (* TL 594)))( ^* G1 K e8 t0 V1 x) \
- (setq d (polar a (/ pi 2) (* TL 594)))( E& Y3 K9 L. S6 N& w
- (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 12 12)))))
4 ]2 a5 q; o5 U z" Q - (setq f (polar e 0 (- (* TL 841) (* TL 24))))
' [) J; {& s1 |! K9 G - (setq g (polar f (/ pi 2) (- (* TL 594) (* TL 24))))
F, ^' k2 ? U' V7 O - (setq h (polar e (/ pi 2) (- (* TL 594) (* TL 24))))! n h. [8 `, {4 b U
- (command "Pline" e f g h "c") / x, e1 a! |- x% v" w' m
- (command "change" "last" "" "properties" "layer" "0" ""): ?2 i! @3 K6 W
- (setvar "cecolor" "4")5 E7 O1 N0 c; |. C1 R" ?3 @
- (command "Pline" a b c d "c")
' |. Q; h, W9 q0 F2 \# @7 S$ k1 d% J - (command "change" "last" "" "properties" "layer" "defpoints" "")))8 x% \! {9 _ b( }
- (if (= kho "2")
8 s) k0 o9 @# a$ k |, p+ L$ C - (progn; u: C9 Q* z) h
- (setq b (polar a 0 (* TL 594)))7 j7 `, m- R* u. Y$ P- i9 V
- (setq c (polar b (/ pi 2) (* TL 420)))
2 b$ r+ A6 S" r5 e5 @8 Y) k! ? - (setq d (polar a (/ pi 2) (* TL 420)))
2 V& p* ^- i) E. B - (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 100)))))
/ {) h& ?! f }# s* x2 R; ]% ?' V9 E - (setq f (polar e 0 (- (* TL 594) (* TL 20))))0 R& @; E3 y) K; u6 s
- (setq g (polar f (/ pi 2) (- (* TL 420) (* TL 20))))
# f5 Q* f5 S7 s4 @+ E - (setq h (polar e (/ pi 2) (- (* TL 420) (* TL 20))))) \. \# s; }2 v, `
- (command "Pline" e f g h "c") 2 G, R" d# ]) l; [2 {3 v2 X& C3 X `
- (command "change" "last" "" "properties" "layer" "0" "")0 y: U, n& y9 q6 c& D$ r
- (setvar "cecolor" "4")/ _# V: R, h# S9 s0 a) a
- (command "Pline" a b c d "c")+ U9 j) p4 T3 F$ v; A2 ~7 L4 K% r+ B
- (command "change" "last" "" "properties" "layer" "defpoints" "")))
+ G2 S8 k q% W0 R1 h - (if (= kho "3")
5 w' a! D3 e) l, m, n( z - (progn4 x2 u& s" D6 \5 c2 `3 w
- (setq b (polar a 0 (* tl 420))), _: Y) n, M: f1 F i0 B. d0 \
- (setq c (polar b (/ pi 2) (* TL 297)))3 Y" j. G+ T* V1 z6 F
- (setq d (polar a (/ pi 2) (* TL 297))) T' d! q4 g5 H8 W: f; {( N
- (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 100))))), \) F4 f* y. ], n- c/ q" m' _) t* u
- (setq f (polar e 0 (- (* TL 420) (* TL 20))))' Z7 f) q2 m& R+ f0 I% o
- (setq g (polar f (/ pi 2) (- (* TL 297) (* TL 20))))- g h. H, h% s7 e9 s4 | h2 D/ J
- (setq h (polar e (/ pi 2) (- (* TL 297) (* TL 20))))! @8 t0 w4 B2 I: O
- (command "Pline" e f g h "c")
8 [' Q9 ^2 p1 ~/ D6 r5 } - (command "change" "last" "" "properties" "layer" "0" "")
# q6 w# b G _3 ~ b3 c+ t - (setvar "cecolor" "4")
& ~! ^7 V& J$ p5 |: M# h) Q - (command "Pline" a b c d "c")
. r& K4 e$ q+ `7 ^$ @+ l$ o% v - (command "change" "last" "" "properties" "layer" "defpoints" "")))& f8 J6 F8 x+ z1 Y1 D/ b
- (if (= kho "4")
4 W; L$ v# G0 v# U% r3 J8 W - (progn+ ]. d8 f+ G( T6 d% n; O
- (setq b (polar a 0 (* TL 297)))
5 r) t' K- \: C2 a3 ?7 a" S2 [# `# I - (setq c (polar b (/ pi 2) (* TL 210)))
9 {8 U. z. |0 y( B( k - (setq d (polar a (/ pi 2) (* TL 210)))
/ y# o# @2 N5 C* X - (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 81)))))# C9 |0 ^! ~6 s
- (setq f (polar e 0 (- (* TL 297) (* TL 18))))' T6 V, M7 G: k! n
- (setq g (polar f (/ pi 2) (- (* TL 210) (* TL 18))))
, e D$ V( d3 l8 t0 t* z - (setq h (polar e (/ pi 2) (- (* TL 210) (* TL 18))))8 D" R& Q0 `; h1 H; i t+ E) i- Y( L
- (command "Pline" e f g h "c")
# e! |: l- |# k% v) q3 _ - (command "change" "last" "" "properties" "layer" "0" "")
: [9 G T9 z& B% h9 E - (setvar "cecolor" "4")
: f: [1 c2 R0 P) E+ x - (command "Pline" a b c d "c")% ^9 F) m( E; h7 x, H6 {. f. D; P6 Q
- (command "change" "last" "" "properties" "layer" "defpoints" "")))
3 E9 i+ H% D/ T& w) T' g* o+ J! t' { - (mapcar 'setvar (list "CMDECHO" "OSMODE" "cecolor") oldlst)/ \& r4 J) d7 v3 \* ~* E
- (command "undo" "e")+ I$ q+ r' h! R. S2 |$ W
- (princ))# b+ i/ `- u% N" J1 n, D
- ;=====================================================================
# H' _. G+ P. N% f - ;==================DAT KhoGiay Theo KHO GIAY BAN VE===================
5 P g4 I9 j9 X- V6 ]+ | - ;=====================================================================
0 W. W5 L7 x: \( H( x - * N/ l4 j+ D% o& U. ?9 x
- ;=====================================================================) e4 v9 x s! [9 i3 q1 L5 i
- ;===================DAT Ti Le Theo KHO GIAY BAN VE====================
, `) B+ ?" F4 `9 t1 `9 J. d - ;=====================================================================
# s D- R$ n8 M$ B* A1 L- e! {
. U: @) e- W6 p9 }! t# q+ Q5 u: V7 T5 G- (DEFUN C:SA6 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.1" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "5" ""+ k/ B8 @2 G1 C1 M' D
- "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.3" ""9 p% D% I: a) T4 i7 i: I) V: B
- "M" "MANH" "C" "9" "" "Lw" "0.1" "": q5 p* O' w, T' G
- "M" "TEXT" "C" "7" "" "Lw" "0.12" ""
+ E. ~6 T( B9 z, P9 G. n Z; C# @5 g - "M" "DIM" "C" "1" "" "Lw" "0.12" ""
8 Q! r9 s8 Z9 k! t* q. M - "M" "THAY" "C" "7" "" "Lw" "0.2" ""9 }5 W0 R& s$ W2 F. L
- "M" "NOITHAT" "C" "3" "" "Lw" "0.12" ""
+ K9 c+ }: ~( z( K - "M" "HATCH" "C" "5" "" "Lw" "0.1" ""6 x- u- \/ o9 l& Z
- "M" "COT" "C" "1" "" "Lw" "0.3" ""
) c( v* C: K$ \/ |; f - "M" "Defpoints" "C" "7" ""7 W# \2 ^4 l- B) v, k& @0 n% k
- "M" "0" "C" "3" "" "Lw" "0.12" ""
. c" l) f% K* R& R9 B* c2 R - "M" "CUA" "C" "6" "" "Lw" "0.12" ""
7 \# P, L" _( t2 Z3 q: W4 E8 i. ]& F& y - "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.12" ""8 U2 ^' Z0 d1 l h
- "M" "TIMTUONG" "C" "5" "" "Lw" "0.1" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "3" ""))% X4 v+ o* O5 G5 x5 Y$ @5 ?3 K
- (DEFUN C:SA5 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.12" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "10" ""0 Y' N" T3 c% o# B1 j3 G
- "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.4" "" n* K; z4 z) N7 ^: |
- "M" "MANH" "C" "9" "" "Lw" "0.12" ""
3 }& o/ P! ~8 ?+ R - "M" "TEXT" "C" "7" "" "Lw" "0.12" ""( j, K! |! d; S8 x9 j; i# @9 C
- "M" "DIM" "C" "1" "" "Lw" "0.2" ""
# z" b/ Z% y8 O$ | - "M" "THAY" "C" "7" "" "Lw" "0.2" ""7 M5 w8 ?; D9 ^0 T6 G& [
- "M" "NOITHAT" "C" "3" "" "Lw" "0.2" ""
& e5 S1 |2 d! s. o - "M" "HATCH" "C" "5" "" "Lw" "0.1" ""
" a9 b# `' U; M8 |1 L s$ C; D: \ - "M" "COT" "C" "1" "" "Lw" "0.4" ""7 ]! o" b- Z" K; H1 }% y7 p) F
- "M" "Defpoints" "C" "7" ""
0 {+ s1 S+ L- D* \5 | - "M" "0" "C" "3" "" "Lw" "0.2" ""
" \* S4 h9 O. L$ @: i) y) v1 q - "M" "CUA" "C" "6" "" "Lw" "0.12" ""$ X: [* P3 X" v6 H. E* `9 t+ e
- "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.12" "") `/ o6 H7 n. \1 K. w( ^0 U
- "M" "TIMTUONG" "C" "5" "" "Lw" "0.15" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "5" ""))
$ X& k" x' J( t" \1 V- z* n, q/ N - (DEFUN C:SA4 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.2" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "20" ""
5 C' F- J6 { }( f, v( ` - "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.6" ""
" }) t: e% Q) R8 y' U1 e3 m - "M" "MANH" "C" "9" "" "Lw" "0.2" ""
( c) P) R, Q5 Y - "M" "TEXT" "C" "7" "" "Lw" "0.2" ""# f( s! v1 s, ~
- "M" "DIM" "C" "1" "" "Lw" "0.25" ""# q W5 ~7 O6 e% h9 U6 l) ~
- "M" "THAY" "C" "7" "" "Lw" "0.35" "", _. Z6 h# ^* x% t% q3 I
- "M" "NOITHAT" "C" "3" "" "Lw" "0.25" ""
( a3 D' j* ]( A) l - "M" "HATCH" "C" "5" "" "Lw" "0.15" ""
6 R Z8 }$ g( I; v* Z( j0 Q/ u - "M" "COT" "C" "1" "" "Lw" "0.6" ""- W9 r, D; e n
- "M" "Defpoints" "C" "7" ""
" p( p4 q5 C. y4 B7 o/ @8 H - "M" "0" "C" "3" "" "Lw" "0.25" ""
% @5 K' A; Q y9 ` - "M" "CUA" "C" "6" "" "Lw" "0.25" ""! j) `3 [, K# I
- "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.25" ""
8 Y. K0 c2 A8 d# P C% P - "M" "TIMTUONG" "C" "5" "" "Lw" "0.2" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "10" "")), l+ w' i2 }" D& s7 z. x) V" k+ u% t( ]# s, q
-
; K5 m3 ~7 ~$ m% b0 n' [ - (DEFUN C:SA3 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.35" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "30" ""
) G+ z9 o0 L- q$ g9 F/ d - "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.7" ""
" w7 f; g# z' Z - "M" "MANH" "C" "9" "" "Lw" "0.25" ""
2 j: d" [" \2 C8 ]/ p, O* B - "M" "TEXT" "C" "7" "" "Lw" "0.2" ""+ f, q& B' S" W% `
- "M" "DIM" "C" "1" "" "Lw" "0.35" ""
+ w+ L% z+ Z6 |2 C - "M" "THAY" "C" "7" "" "Lw" "0.4" ""3 f$ u3 \. Q1 A0 r8 A8 ]
- "M" "NOITHAT" "C" "3" "" "Lw" "0.25" ""
% A% F+ H# l9 q2 v7 O6 ~ - "M" "HATCH" "C" "5" "" "Lw" "0.2" ""6 i8 n# y. e( z- E
- "M" "COT" "C" "1" "" "Lw" "0.7" ""
3 z. v! m7 S# [# ?) u2 b - "M" "Defpoints" "C" "7" ""6 z% H$ X( t1 P7 |# E
- "M" "0" "C" "3" "" "Lw" "0.25" ""
& @) M# i, G$ O6 ?+ O - "M" "CUA" "C" "6" "" "Lw" "0.35" """ m2 N& U$ t! L. F% }
- "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.3" ""# I. }# g4 v( n
- "M" "TIMTUONG" "C" "5" "" "Lw" "0.25" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "20" ""))(PRINC)
! k# Q, R1 \7 x& u/ n, ]* q - ' p6 o* k) a/ C W& ~ O; g& b1 B
- (DEFUN C:SA2 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.35" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "45" "": ~: Y/ ^- O2 A! R+ P
- "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.7" ""2 b; o/ Z9 |0 J; A8 {+ X) c e; b8 d' Z) P
- "M" "MANH" "C" "9" "" "Lw" "0.25" ""
! j, t. j" l' _; Z' \ - "M" "TEXT" "C" "7" "" "Lw" "0.25" ""
! W/ t, g1 S+ q( Y# k& n" r - "M" "DIM" "C" "1" "" "Lw" "0.3" ""
% j- R1 }0 S0 C, Z S( I) @ - "M" "THAY" "C" "7" "" "Lw" "0.4" ""
: A: Y, h! t9 X& Q7 p. u - "M" "NOITHAT" "C" "3" "" "Lw" "0.3" ""% E/ `9 K0 F/ e2 h2 I ]
- "M" "HATCH" "C" "5" "" "Lw" "0.2" ""3 P$ I2 ~. t+ [8 ^
- "M" "COT" "C" "1" "" "Lw" "0.7" ""% C9 \* c, g4 b1 ^1 r0 k: I
- "M" "Defpoints" "C" "7" ""# c4 |% L( p1 [2 U P6 o' s; s
- "M" "0" "C" "3" "" "Lw" "0.35" ""9 I# B9 T3 S7 R( o
- "M" "CUA" "C" "6" "" "Lw" "0.35" ""! L" f% M; b/ o! _( s, K$ |+ n
- "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.3" ""$ _9 t% d R% x1 `2 \& ^
- "M" "TIMTUONG" "C" "5" "" "Lw" "0.25" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "30" "")), u1 `/ a$ d2 q' ]+ f$ G: `: t) G
. p+ w' N0 t$ |1 Q+ g- (DEFUN C:SA1 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.4" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "60" ""
! N+ B- i$ W3 x6 c! ^ - "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.85" ""- S* w+ F$ B0 I- O+ Q# I
- "M" "MANH" "C" "9" "" "Lw" "0.35" ""
# o0 a9 G* {# D7 ^ - "M" "TEXT" "C" "7" "" "Lw" "0.5" ""
1 e, e2 [5 U" a8 R - "M" "DIM" "C" "1" "" "Lw" "0.35" "", S" f7 I l K) m0 y$ G, J% O
- "M" "THAY" "C" "7" "" "Lw" "0.4" "" ?6 y6 I I) D# O3 O* P
- "M" "NOITHAT" "C" "3" "" "Lw" "0.35" "": C% S9 N/ S! R' K2 d; N
- "M" "HATCH" "C" "5" "" "Lw" "0.25" ""
& H3 c! [9 t. F4 d. O$ i8 f7 h - "M" "COT" "C" "1" "" "Lw" "0.85" ""
' y6 T4 z$ P+ t1 G - "M" "Defpoints" "C" "7" "") O! m- m, Q* I, r
- "M" "0" "C" "3" "" "Lw" "0.35" ""! [, N3 T5 D9 D# a: B7 {, |
- "M" "CUA" "C" "6" "" "Lw" "0.4" ""
- Q: K% E2 N" ^6 T6 _: G - "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.35" ""
/ M; U: N9 e5 Q5 J) k/ z8 J - "M" "TIMTUONG" "C" "5" "" "Lw" "0.3" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "40" ""))9 F+ h9 y- c. D. F. b0 z& H
-
2 p% N3 j# o& a; o, s - (DEFUN C:SA0 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.5" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "85" ""* U* M# f1 b6 I# O4 ?/ W: A
- "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "1" ""
- w. G- k5 t/ L2 O8 d# N/ k - "M" "MANH" "C" "9" "" "Lw" "0.35" ""0 ^/ _7 c. Q/ {* @) m7 u/ M9 G; {
- "M" "TEXT" "C" "7" "" "Lw" "0.5" ""
9 r- K/ m7 e) ] @/ O8 k - "M" "DIM" "C" "1" "" "Lw" "0.35" ""
( A5 B0 P8 N/ B& `, B+ E7 F) N - "M" "THAY" "C" "7" "" "Lw" "0.5" ""
* b6 [5 G& u+ Z" ~% k! g2 V* u - "M" "NOITHAT" "C" "3" "" "Lw" "0.4" "": p# A0 K) p" f5 i4 y
- "M" "HATCH" "C" "5" "" "Lw" "0.35" ""( K% z3 V8 Q+ P4 A3 } g* S% y6 O- y
- "M" "COT" "C" "1" "" "Lw" "0.1" ""
2 R& a v/ A5 S3 W2 }: L! s - "M" "Defpoints" "C" "7" ""2 o& c4 Z- W v$ M
- "M" "0" "C" "3" "" "Lw" "0.5" ""
2 I+ ?: E" V2 q6 o9 N - "M" "CUA" "C" "6" "" "Lw" "0.5" ""
! ?) J& j4 ]& P* Q1 G - "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.4" ""
( [+ k' u0 s6 O; y- _6 B. b - "M" "TIMTUONG" "C" "5" "" "Lw" "0.35" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "55" ""))3 T! q1 @: H: x. u7 c: S& R- o k* W. A
- (DEFUN C:O () (COMMAND "OFFSET"))3 r: [! g: w! T( L( Y! {$ x
- (defun c:s1 () (command "surftab1"))
- c, Q& o* c7 ]: s - (defun c:s2 () (command "surftab2"))
7 B, |2 v' O! ~8 p5 C, | - (defun c:ep () (command "explode"))
' j3 q7 Q3 a) n5 s - (DEFUN C:QS () (COMMAND "AUDIT" "Y" "purge" "all" "*" "N" "QSAVE"))7 U0 e, _) D5 e/ A, w
- (DEFUN C:QV () (COMMAND "QSAVE"))9 c$ m9 \1 F4 g* U) }! j- {' e
- (DEFUN C:S () (COMMAND "STRETCH" "C"))% d6 r9 T3 L2 F; Q+ \3 M
. c0 c+ t% b2 x: L- ;************************** CAT DIM **************************0 J$ r0 a& s! c/ c8 z
( N# a E7 t' G: x& E- (DEFUN C:DC (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI PT13I PT14I
5 _5 `, j: i" I1 t" R0 O - PT13N PT14N O13 O14 N13 N14 OSM OLDERR PT10 PT11)' ~# u( E% E. x7 A' N3 K
- (SETQ CMD (GETVAR "CMDECHO")): c8 I# `4 b/ q a/ N% `4 h! f* K
- (SETQ OSM (GETVAR "OSMODE"))/ z$ f3 H% C5 p1 y4 ?
- (SETQ OLDERR *error*8 X8 T/ n: Q1 }# b' N
- *error* myerror)1 Z& E6 t' h' E8 `3 P& e/ F* Z
- (PRINC "Please select dimension object!")2 r1 N% {, X# @4 w; O2 @
- (SETQ SS (SSGET))! ^ `; U& e {2 R
- (SETVAR "CMDECHO" 0)
3 h' |, W; c V - (SETQ PT (GETPOINT "Point to trim or extend:"))
" R H" |# z/ F0 W# N7 { - (SETQ PT (TRANS PT 1 0)) \9 u# T5 j8 b5 E8 h
- (COMMAND "UCS" "W")# z& L( q1 Q7 c2 c* I
- (SETQ LTH (SSLENGTH SS))
" A5 {) c @0 l1 _; } - (SETQ DEM 0) F7 o. p7 `) O- m
- (WHILE (< DEM LTH)8 _ f o h' n. z) N; Y
- (PROGN
~2 p0 s9 `3 c( g - (SETQ DS (ENTGET (SSNAME SS DEM)))
, T* ]5 K$ j9 q2 O - (SETQ KDL (CDR (ASSOC 0 DS)))
5 K. f3 K% {4 D" Y' F4 ` - (IF (= "DIMENSION" KDL)
2 X! _; ?# W; R - (PROGN" u7 A) t' l4 `- N
- (SETQ PT10 (CDR (ASSOC 10 DS)))5 e# K! h, e ?, J. c; @7 [
- (SETQ PT11 (CDR (ASSOC 11 DS)))/ e- U) \8 Z3 r
- (SETQ PT13 (CDR (ASSOC 13 DS)))$ o8 U+ h1 s! P. o; K
- (SETQ PT14 (CDR (ASSOC 14 DS))); M5 c3 D( |7 f; A4 \
- (SETQ N70 (CDR (ASSOC 70 DS)))4 H9 S$ v Z: R* A# ?; Q8 t5 U5 d
- (IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))
2 `. Z% f9 J% h2 d( o3 g* M - (PROGN
+ Q0 m5 L; `; q P# L3 _ - (SETQ GOCY (ANGLE PT10 PT14))# s* Z# J- s1 _3 F
- (SETQ GOCX (+ GOCY (/ PI 2)))
! x8 G8 x) S' V8 r5 b - )# |( J9 h3 R5 ]3 @
- )
( P. Y I5 h* K6 b - (SETVAR "OSMODE" 0)6 ~. \5 n' C" n) J) X9 {1 T8 ^
- (SETQ PTI (POLAR PT GOCX 2))& Q. [4 R1 g d+ A: ~& m; v% a
- (SETQ PT13I (POLAR PT13 GOCY 2))
0 O, P2 [. ]. ]4 Y- a4 N; _4 _ - (SETQ PT14I (POLAR PT14 GOCY 2))0 m9 p/ k4 @# I9 X; g) f
- (SETQ PT13N (INTERS PT PTI PT13 PT13I NIL))
3 i) K5 _' ]' I: Q1 @ - (SETQ PT14N (INTERS PT PTI PT14 PT14I NIL))
/ v% [/ d% n( N9 H% E0 ^& E - (SETQ O13 (ASSOC 13 DS))
- _5 e1 B( ?4 q: v( j& s2 x - (SETQ O14 (ASSOC 14 DS))* ?; m6 v! e3 a6 {6 y R( [" t
- (SETQ N13 (CONS 13 PT13N))
0 h- a0 q# K# s0 w4 h( p5 v8 | - (SETQ N14 (CONS 14 PT14N))6 D; S4 V _; \4 X# v+ ~
- (SETQ DS (SUBST N13 O13 DS))( X& i6 ?. L x7 I6 A( _/ Z5 _
- (SETQ DS (SUBST N14 O14 DS))4 x3 S( r/ s; V9 }6 f% b
- (ENTMOD DS) O h/ p7 L0 N& P% g8 a, @
- )- r+ u. C9 \* E
- )
2 ]( y8 o u; {6 x! `1 @/ Z - (SETQ DEM (+ DEM 1))$ g" R% s* B8 q
- )0 {! @+ d4 H( a; b1 l' i3 o, Q2 ]
- )) [2 \7 V" m% z
- (COMMAND "UCS" "P")6 F# t! d. c L6 A+ o; P$ ^
- (SETVAR "CMDECHO" CMD)
( z+ Q1 k& {" D$ C - (SETVAR "OSMODE" OSM)
1 c" d" f& _8 V, U) S# N - (setq *error* OLDERR) ; Restore old *error* handler7 m8 `5 [0 w* z' p* I4 [$ A1 V
- (PRINC)1 x; g" j7 K, \0 y `2 P
- )
3 Q# V7 J0 w' e
, W4 n$ f% C* S- (DEFUN C:BD (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI
7 _8 i2 c/ V- ^' _: Y# C - PT10 PT10I PT10N O10 N10 PT11 PT11N O11 N11 KC OSM OLDERR)6 K6 d0 y! F* k( J) y
- (SETQ CMD (GETVAR "CMDECHO"))
D+ e) _9 H5 z* y - (SETQ OSM (GETVAR "OSMODE"))
0 i. ?- W3 r' y- ?$ A( m2 Y - (SETQ OLDERR *error*
- Z- @2 s8 b5 i4 |" U, ? - *error* myerror)( c: t: G" w% l0 R2 ~# r- s
- (PRINC "Please select dimension object!")8 v% k, @7 Y# [3 @8 n5 U* G
- (SETQ SS (SSGET))& M" o* s I/ M7 f0 D& x9 Q! O
- (SETVAR "CMDECHO" 0)* `% Z+ Z; f9 L8 R1 I) P* [
- (SETQ PT (GETPOINT "Point to trim or extend:"))
' [4 I9 X! O* o L. T4 m - (SETQ PT (TRANS PT 1 0))
' u) s) B+ u& Q* w! i) y& u - (COMMAND "UCS" "W")! }$ p, G$ |$ Z$ C( ~, n
- (SETQ LTH (SSLENGTH SS))/ g o& Y) ?$ Y7 R: Y
- (SETQ DEM 0)! ~, A0 b5 v/ [0 z2 e
- (WHILE (< DEM LTH)4 E9 f* A# p6 i' L
- (PROGN: O) w8 b' v& T. H2 j/ \4 n
- (SETQ DS (ENTGET (SSNAME SS DEM)))6 \# B( z% w% F/ } K b4 L
- (SETQ KDL (CDR (ASSOC 0 DS)))
0 I% S( v3 h5 p' S; ? - (IF (= "DIMENSION" KDL)
4 v% q4 A' l j V9 p5 o - (PROGN
; q. \) \* ?+ |$ I1 W - (SETQ PT13 (CDR (ASSOC 13 DS)))
1 K- k0 O- U0 L- A* q# T. a; w - (SETQ PT14 (CDR (ASSOC 14 DS)))
$ ?+ f7 f K2 } - (SETQ PT10 (CDR (ASSOC 10 DS)))8 G5 o- ^) o6 Q2 \
- (SETQ PT11 (CDR (ASSOC 11 DS)))
+ k8 P- V: v0 ?3 t h8 e; N - (SETQ N70 (CDR (ASSOC 70 DS)))
; o, ~7 \# i# u3 c - (IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))
- p% u- T% }1 ^' N U) `" y - (PROGN
8 F$ S/ @. y( k- j5 l6 c! V - (SETQ GOCY (ANGLE PT10 PT14))3 Z! J" [3 C5 i7 K* M7 A* f
- (SETQ GOCX (+ GOCY (/ PI 2)))
/ s* h, f3 N: s0 `& @ - )2 C) [- m0 {. A/ n7 k& h# X
- )
# |: i4 ?, q* r: q! ] - (SETVAR "OSMODE" 0)
) b% v @* I# i M- O% |! i - (SETQ PTI (POLAR PT GOCX 2))1 n8 e" O" r7 j+ b5 y: f: r
- (SETQ PT10I (POLAR PT10 GOCY 2)): `6 f8 K: _ A
- (SETQ PT10N (INTERS PT PTI PT10 PT10I NIL))
. H( g( G5 P$ }" x: ]1 \ - (SETQ KC (DISTANCE PT10 PT10N))
# }4 W6 T8 b) M( {; j* ?2 @6 ` - (SETQ O10 (ASSOC 10 DS))
n5 M2 S* ^( }) j - (SETQ N10 (CONS 10 PT10N))* n* f& J$ @ u# j4 G- R* y
- (SETQ DS (SUBST N10 O10 DS))
# `! F) g' J8 d O- F - (SETQ PT11N (POLAR PT11 (ANGLE PT10 PT10N) KC))- i0 H h I1 h4 z# r& W. {
- (SETQ O11 (ASSOC 11 DS))
4 y% T, j" y2 r$ k) G - (SETQ N11 (CONS 11 PT11N))3 V) d3 Q1 Q* S+ C
- (SETQ DS (SUBST N11 O11 DS))) `3 `$ O" V1 @ n
- (ENTMOD DS)$ [+ }0 |1 x$ ^9 k1 o5 U* M; f
- )
# e8 c, S/ T0 Q! C, } W. S% U$ M - )4 T0 b) _- y6 o7 K! ^5 W
- (SETQ DEM (+ DEM 1))5 y! \8 A5 o/ R/ v$ T5 s4 N
- )# q3 X& x- m# A, ? U) T7 n8 g/ p
- )
9 r( R5 [) a* K4 u - (COMMAND "UCS" "P")
/ q$ p) k. O+ i - (SETVAR "CMDECHO" CMD)
/ d* k1 V4 N! e) Y& P - (SETVAR "OSMODE" OSM)( |( Y! N/ v5 U, o8 m: u
- (setq *error* OLDERR)
4 c( ^7 m0 I% e2 C: T4 a" N8 y - (PRINC)
4 ?; Z* D1 U+ E. z/ k - )
6 N& X7 ^! e! H8 G. j+ Q. C1 ~ - 3 d5 D# ^" `, f6 ]4 R) \% N: `
- ;;; ================ BAT - TAT CHE DO GACH CHAN TEXT (TU) =================
) f! K6 k% C+ H8 w: Y - , b. }5 d M; Z7 w( _5 \/ P
- (defun c:tu () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can gach chan ")8 G. \- y; L1 Z
- (prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")) g2 k9 `/ Z8 E U z
- sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt
6 P5 d1 I, |: b" b' K* r( D - (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt)))
5 v% S) Q' o( C- L( ^0 m - (if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%u")1 z2 e; Y% b) a2 F# j3 H3 u
- (= testxt "%%U"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%u" txttxt)))
* Y6 J0 k) O; T) y2 p* W - (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))
% Q. w# P! a J' J: a! p5 B/ m - (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
# g6 O7 W/ }3 ^% I7 R' }: ?0 t - 9 @8 M1 O. P7 R
- ;;; ================ CHEN COT (TUU) =================
& J! k/ }' p! `+ S" F6 e) r
' {$ l$ J- j E) R9 J2 q' n2 L- (defun c:tuu () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can chen cot ")) `7 U% d7 X6 U {
- (prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")
2 E- C9 P5 i' `0 X - sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt
8 v& M4 N2 T( O - (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt)))
. \7 c7 L0 n8 Z. p, }1 G - (if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%p 0,000")
% ^! c6 ?/ T6 J# L/ l6 J* N, n2 e - (= testxt "%%P 0,000"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%P 0,000" txttxt)))4 V/ o, P+ v# t! Z; `; U. n
- (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))4 W1 b% v% |; y% m
- (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))9 Y: H) v8 y* u3 I
" K. p1 t( t! \# A& A3 y- ;;; ================ CHEN KY HIEU THEP (TP) =================& [& O/ [) d6 M: @( d5 c
- - d' W# X$ |" d6 f1 C1 D
- (defun c:tp () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can chen ky hieu thep ")
2 y, q4 j# N" e - (prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")
A0 O, t- j3 O$ q - sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt( I3 B Z0 u, @4 j2 E+ p! }
- (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt)))
5 J$ S0 m8 U3 _8 r( |! m) u- P# k2 K9 ] - (if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%c")
R, ? n0 l; k; r( n- `+ r( U. C - (= testxt "%%C"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%c" txttxt)))
: t" K4 z9 T8 e9 ?; H - (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))/ g& `. J5 P; ]6 Y1 n6 g
- (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
6 H" ~& X" U0 Y
7 H* ?, Z, b" `0 b: r- ;=========================== TAM TUONG (TAM) =================================- m9 Z3 H2 T5 y( ~9 m, q
6 N! D1 L# O8 w- (defun c:tam(/ data_m)
% ?/ S# Q/ v3 ?; ^2 u* q - (defun import_data(/ i)(setq data_m (ssget))(if (= nil distan_m) (setq distan_m 110.0))
. h" C. x# ?% v - (princ "Distance (")(princ distan_m)(princ "):")(setq i (getreal ))(if (not (= nil i))
) T7 o! i0 a* X5 M8 M S; ~# Y7 K, F1 h - (setq distan_m i)))(defun process(/ ent check)(defun p_check()(setq check 0)
8 {9 G$ I+ k3 z - (if (= "LINE" (cdr (assoc 0 ent))) (setq check 1))(princ))(defun p_d_offset
& _$ ]% g' R4 O* d3 H& J - (/ p1 p2 p3 p4)(defun makeline(/ e2 e5)(setq la (list (cons 0 "LINE")(cons 5 (cdr
- K) l% q% ]; [" b. t. p0 f" a - (assoc 5 ent)))(cons 8 (cdr (assoc 8 ent)))(cons 10 p3)(cons 11 p4)))(entmake la)(princ)# H' ~% `3 f* u3 s3 F4 h
- )(setq p1 (cdr (assoc 10 ent)) p2 (cdr (assoc 11 ent)))(if (not (= p1 p2)) (progn (if$ Z) q- v2 ?& q" ^
- (< (abs (- (nth 0 p1) (nth 0 p2))) 0.000001) (progn (setq p3 (list (+ (nth 0 p1)
9 Y: I8 W! u1 j! e- v8 v4 F! { - distan_m) (nth 1 p1) (nth 2 p1)))(setq p4 (list (+ (nth 0 p2) distan_m)(nth 1 p2)9 |- ?9 }7 ?6 n- B* U ~
- (nth 2 p2))) (makeline) (setq p3 (list (- (nth 0 p1) distan_m) (nth 1 p1) (nth 2 p1)))7 q* ?3 X; M9 y7 j3 H+ Y
- (setq p4 (list (- (nth 0 p2) distan_m) (nth 1 p2) (nth 2 p2))) (makeline)))(if (<
# b3 [, J0 s( y( B& U0 j - (abs (- (nth 1 p1) (nth 1 p2))) 0.000001) (progn (setq p3 (list (nth 0 p1) (+ (nth 1 p1)% N* a& Q" t3 Y9 c
- distan_m) (nth 2 p1)))(setq p4 (list (nth 0 p2) (+ (nth 1 p2) distan_m) (nth 2 p2)))
9 ]# g" F( Q% _# ?8 u3 p - (makeline) (setq p3 (list (nth 0 p1) (- (nth 1 p1) distan_m) (nth 2 p1))) (setq p4
( n/ w# e7 r. Y" V3 ~3 i - (list (nth 0 p2) (- (nth 1 p2) distan_m) (nth 2 p2)))(makeline)))))(princ))(if (not. h3 ~1 i; S' k6 s G
- (= nil data_m)) (progn (setq i 0)(while (< i (sslength data_m)) (progn(setq ent (entget+ ? o- m- b8 N, G, x
- (ssname data_m i)))(p_check)(if (= 1 check) (p_d_offset))(setq i (+ i 1))))))(princ))
/ j; P5 |, A' M0 I# ~7 { - (import_data)(ai_undo_push)(process)(ai_undo_pop)(princ))3 k" `0 p) _7 z. Q: w
' c& x+ A* @, C5 e, Z6 z! {4 n+ i- ;============ GHI CHU PHI (T1) ================
1 r6 {) g- ^9 }4 e: w
* C1 e! U9 b* c2 X- (defun c:DuongDan ()(setq D1 (getpoint " Diem thu nhat: "))(setq D2 (getpoint "Diem thu hai: " D1))# L" F% v+ H' e1 C# D
- (if (> (car D2) (car D1)) (setq D3 (polar D2 0 16)))(if (< (car D2) (car D1)) (setq D3
% o( z1 k/ w# p2 r* a+ z6 \' y - (polar D2 PI 16)))(if (= (car D2) (car D1)) (setq D3 (polar D2 0 16)))(if (> (car D2)* e3 Z2 a: w# F) b+ r6 P" |
- (car D1)) (setq D4 (polar D3 0 3.2)))(if (< (car D2)(car D1))(setq D4 (polar D3 PI 3.2)
9 P7 Y, c% L* h' _8 M0 b* j r: n4 [ - ))(if (= (car D2) (car D1)) (setq D4 (polar D3 0 3.2)))(if (> (car D2) (car D1))0 X6 v# n- e: P" b @) O1 i
- (setq D5 (polar D2 (/ PI 9) 3)))(if (< (car D2) (car D1)) (setq D5 (polar D3 (/ PI 9)+ f, `, ?# c, L+ L
- 3)))(if (= (car D2) (car D1)) (setq D5 (polar D2 (/ PI 9) 3)))(command "color" 1)
' F- ?8 J3 o8 |) f7 K0 q* t - (command "line" D1 D2 D3 "")(command "circle" D4 "3.5")(command "color" 7 )
# G, F# t+ N- J6 Z5 ] - (command "text" "m" D4 2.5 0 "1")(command "text" D5 2.5 0 "%%c6a150")# B, q# `# J1 K c; ^- k( w' F* v
- (command "ddedit" pause))
% }( [/ K! L$ C6 S7 @. x! D5 M, N$ m' [ - : ^) F& \( Q0 Y1 s/ s [4 e: g
- ;;; ========================== Join (J) =================
- ?5 t& y' |& Q" x
+ |5 w e" f; N$ m/ w- (defun C:J () (Setvar "cmdecho" 0)(setq m:err *error* *error* *merrmsg*)(setq sset (ssget))- i. C$ p4 T/ x
- (if (null sset) (exit))(setq kt (getstring "\nJoin all (Y/N) <Y> ? "))
; |. L0 ]4 m9 ^$ p4 k" D2 I - (setq ssl (sslength sset))(setq temp (entget (ssname sset 0))etype (cdr (assoc 0 temp)8 T3 \8 F. D5 t9 g" |
- ))(cond((or (= kt "Y") (= kt "y") (= kt ""))(progn (cond((= etype "POLYLINE"); S( {" ~6 M& x4 E. a& e: a# r
- (COMMAND "PEDIT" sset "J" "all" "" ""))(if (or (= etype "LINE") (= etype "ARC"))
+ L2 `* ~9 a: m9 `6 L" M7 R, {5 G; i - (COMMAND "PEDIT" sset "" "J" "all" "" "")))))((or (/= kt "Y") (/= kt "y") (/= kt ""))' L' c, K) Q( f& K$ s* T% x4 {7 N
- (progn (cond((= etype "POLYLINE")(COMMAND "PEDIT" sset "J" sset "" "")) * C+ x+ {7 @& p( N3 z4 a
- (if (or (= etype "LINE") (= etype "ARC"))(COMMAND "PEDIT" sset "" "J" sset "" ""))))))
6 m% m% K; Q9 e( v - (setq *error* m:err m:err nil)(princ))
% M. l* z2 W! {3 i - & F) ?7 \& H& e! p" h9 U
- ;=====================================================================6 a+ E% B' i! w! \* f& h4 S
- ;;; DOOR.LSP 1.0, Copyright (C) 1998 by CAD Department, HUCE.
5 S1 W7 W; y4 a% f - ;=====================================================================% D2 s2 h6 [4 S
- 1 D& l7 I2 O4 E$ L7 C {
- (defun C:D1 (/ p1 p2 p3 p4 side dis wid ang angsile old)4 m) t( z1 l4 w3 B6 L0 J+ l0 L' Q2 _
- (setq old (getvar "OSMODE"))
. ], n% ]: T3 c: }
! |7 U d3 @+ n1 W$ i/ d; A- (setq p1 (getpoint "\nStart point:")) b; d% e; l1 d9 ~& x7 t6 L
- (setq p2 (getpoint p1 "\nEnd point:"))! t7 [( i# C, f4 i8 E6 k. @
- (setq side (getpoint p2 "\nOpen side"))
7 F1 W( @3 o# u- [ - 2 R. \3 V0 }. E: p; F
- (setq dis (distance p1 p2))
+ a4 z9 J1 r) C8 s4 X P - (setq ang (angle p1 p2))
3 O: i7 l( Z0 z& z4 g - (if (< ang (angle p1 side))% P, \( e5 m& \2 y+ E z
- (setq angside (/ pi 2) )3 _) M; ~; p2 e/ v* y' c
- (setq angside (- (/ pi 2)))8 Y: {2 e6 x1 [; d2 ], g
- )
4 ]- C; z# z) g - (if (>= (- (angle p1 side) ang) pi)( M- ?+ n; W# D6 Z- T1 l( @% G
- (setq angside (- (/ pi 2))): Q* P7 G" x" `$ s
- )
0 R- x+ z& z7 X6 l% b- k( E; }; g - (if (>= (- ANG (angle p1 side) ) pi)
' ~2 i3 @. i1 ^7 ]7 x- g - (setq angside (/ pi 2))
/ U: T- d+ e) w* K8 W# E6 B - )
, s& N+ i; |3 C - & I2 c' ^+ n. f) Q8 z) @
- (setq p3 (polar p2 (+ ang angside) dis) )
& l8 t4 I, i( t/ O* `, j - (setq p4 (polar p1 (+ ang angside) dis) )9 F! u1 q- T( W7 R! r) ?: x9 Y
- (setq wid (/ dis 15))
7 E* s+ f. d1 K+ d* h
; U; S8 C; L+ Z! [% s( P6 D- (setvar "OSMODE" 0)9 i! D( @9 a' S H: x2 I
) G: C& W2 Q- ]5 l4 O- (command "PLINE" p1 "A" "D" p4 p3 "L" p2
' J; O7 A) f$ q- ?, S, x2 e - (polar p2 (+ ang pi) wid)
; ^' A7 B L7 x& ? \& K - (polar p3 (+ ang pi) wid) * T1 B6 ]( `4 \- c1 s5 H* x
- ""), Z& J7 P& u2 \( s u; E3 k: A
- 1 i9 _5 E/ V5 M" i+ N& u
- (setvar "OSMODE" old)
4 `/ L' `8 e* C, ^: S - (princ) t2 t( W% W6 J1 Q5 e+ Z5 o( i0 K
- )
+ @2 g$ P. }4 t N
/ c5 }9 z% x/ M, ?- ;=====================================================================5 v4 t' M+ l* a. C, U# W$ l3 Z
- 1 e8 s; r# j8 S
- (defun C:D2 (/ p1 p2 p3 p4 side dis wid ang angsile old)" e1 M q1 D9 t9 B7 }! X k
- (defun cua1 (pt1 pt2)
( |! n7 R) K/ |/ w9 D. y3 r - (setq p1 pt1: [6 o! d2 [% c! @1 @* M' \
- p2 pt2)4 }1 o! f4 v* {
$ l# Z$ S4 X* E% Z/ H. t2 y3 Y; g" j2 ?- (setq ang (angle p1 p2))
) m- _6 W) v) V+ {: d9 d1 M/ E - (if (< ang (angle p1 side))
% r% \: q6 ], h8 l- r - (setq angside (/ pi 2) )
! {( @3 z9 @/ l/ G2 b m( n - (setq angside (- (/ pi 2))), Q1 o7 D/ v9 v& s
- )$ Z: m0 K0 ?6 U* K4 w7 `
- (if (>= (- (angle p1 side) ang) pi). D/ m& D; t0 @8 O0 w- S
- (setq angside (- (/ pi 2)))
3 \" T4 A- q7 x% }; y - )7 m$ _" `, X# ]% n+ h8 y
- (if (>= (- ANG (angle p1 side) ) pi)
; L! b- O3 y* r: [+ Y - (setq angside (/ pi 2))
& O5 U. U$ ~3 r4 y - )
+ p, [: J0 V, _2 n: h - " P, J/ w- }2 Y/ |& e$ V
- (setq p3 (polar p2 (+ ang angside) dis) )9 e; o# e' D0 ]: R8 \* T; M" j
- (setq p4 (polar p1 (+ ang angside) dis) )
2 @) L6 l6 n4 m) E, m8 c! c - (setq wid (/ dis 15))
; d# x: _# X+ b0 Z
5 K" W& Q3 ?+ d& y7 G- (command "PLINE" p1 "A" "D" p4 p3 "L" p2 & I$ @9 c2 P' F4 O5 Y* P
- (polar p2 (+ ang pi) wid) 2 ~3 y! n8 Z! B% ~% q
- (polar p3 (+ ang pi) wid)
4 o$ J F3 W0 E, Q4 `1 ]9 s - "")
2 I4 D$ M/ i2 ?; O7 S7 { - )
+ d$ Q5 L- ^' h - ;=====================================================================; s. p+ w! w; j7 ]4 ~0 ^# u0 U' Z
- (setq old (getvar "OSMODE"))
0 q1 ?. X4 R0 n% w) Y) o' a
w6 [% l1 E( Q3 r+ k6 J+ d h; X E- (setq p1 (getpoint "\nStart point:"))
# F3 V; r, B# G9 s3 W9 W. M - (setq p2 (getpoint p1 "\nEnd point:"))+ e# y7 k: d p X
- (setq side (getpoint p2 "\nOpen side"))
# v7 q7 j* w2 \/ k+ b2 Z4 d8 N1 ]1 ], w
, x4 p+ ?; b' b3 z. O3 w2 R+ F- K- (setq dis (distance p1 p2))
2 P- w! v6 b# b2 g' m4 ]3 V L - (setq dis (/ dis 2)): Q9 i1 d- p' f; U& |8 S, U9 [: o
- ?$ I4 Z; G; w- G8 I- (setvar "OSMODE" 0)
8 z3 \; U; j) ?9 V5 | - |. y9 Q6 ?0 }
- (setq p1 (polar p1 (angle p1 p2) dis))
! z6 }+ q' \1 L& d - (cua1 p1 p2) ; ^7 v$ ~/ A" t: ~
* x5 }0 u; v/ V" C$ [6 {- B+ U* o- (setq ang (+ ang pi))6 Y9 k/ h0 ]5 B
- (setq p2 (polar p1 ang dis))
- p/ ]$ x5 k* G - ; (setq side (polar p1 () dis))4 H; f9 h: |8 f* Y
- (cua1 p1 p2) 7 u2 C4 K) ^4 s+ }3 M( P* @
$ o- ]* I2 t$ D1 u- (setvar "OSMODE" old)
5 \( w0 I5 k0 Q - (princ)/ v( |; J1 j, \7 v2 `' `+ P: W
- )
9 @5 ~3 F. }! e6 O% V# x
" P" z, s% e1 N+ B+ _) D3 ~- ;=====================================================================
' b6 N3 N0 y2 y* H/ A- `9 N - ;"Glue" text strings. All adopt first's properties.( n/ C: ^! l' d: g" ^- p
- ; Author:. W; w( j0 Y+ `! u
- ; Henry C. Francis
- k- N0 p3 `% p% A - ; 425 N. Ashe St.
8 Y. l" u% @' P, c$ N0 A - ; Southern Pines, NC 28387
9 d1 d. t2 K ^6 Z+ k. v- y! T - ; http://www.pinehurst.net/~pfrancis$ P, @& c5 W! e2 ^7 }! w$ x
- ; e-mail hfrancis@pinehurst.net6 r, o; I H4 G' V+ d
- ; All rights reserved.; W; H9 I3 a) v1 o& \9 h9 p
- (defun c:gst ( / ename ent1 ent2 old1 oldsl old10 old11 old40 old50 newstr newsl new1 new10 new11)
, Z. g4 r, V" o7 c/ m; U; x. E# u$ b - (while
/ d. Z$ h5 y5 r a: h( _ - (not/ {: m$ i, |" R8 a
- (and
" R! x- D. G8 P; G" i - (setq ename1 (car(entsel "\nSelect first text string to join: ")))4 g2 }. @! c0 y y6 Y# K
- (setq ent1 (entget ename1))
- ~1 a# E; z n - (eq(cdr(assoc 0 ent1))"TEXT")
6 s% M, j6 e6 Y$ y4 c$ a: ] - );and# `: O- Y; w' {1 O3 y# {" t
- );not j2 f9 g, D4 q) Z/ g5 G1 ~3 p% U
- );while
- I0 u8 p1 @* h% u, l - (setq old1 (cdr(assoc 1 ent1))) C& b7 z% E1 O4 @7 \
- (while' O& e- h3 [1 ]' G
- (not2 B4 N3 x6 G% t; K3 j
- (and# h9 K. [1 J) {0 j8 M+ N) q7 W
- (setq ename2 (car(entsel "\nSelect second text string to join: "))); p {. n# E2 L9 \+ G+ E& q
- (setq ent2 (entget ename2)). ?; _* [1 I& @- N, E' C$ |
- (eq(cdr(assoc 0 ent2))"TEXT")0 V1 r- H" \/ k9 N
- (not(eq ename1 ename2))8 a: D2 N# k+ e# [3 u- D# k
- );and) U) c& o0 G# T& d$ t
- );not
# A9 R0 B( c; a! r - );while, r4 a) r8 S" V% t
- (setq old2 (cdr(assoc 1 ent2)))
( ]6 Q# \+ F9 p2 T3 }/ g - (setq new1 (strcat old1 " " old2)
) d: B, c* ]7 S0 @' g, n5 S' |) C+ ` - ent1: s, \$ _; r# C8 f9 Z9 L6 V/ ~/ z
- (subst (cons 1 new1)
2 w6 u$ j) G `( \: t2 L: } - (assoc 1 ent1)" ~3 K% X6 o& V9 G& b
- ent1)# g5 j- S, R" Z; @
- );setq
4 b, g b* Y, d4 }: @ - (entmod ent1)5 D8 |& y4 f% o
- (entdel ename2)
9 l: ?" d. z8 z: G2 \0 O - (princ)* ?0 o$ Y! n; u7 F
- );defun
6 J% Z# }4 ^9 [% N
) {4 P* O T0 [& o- T1 B; g, m+ {- ;=====================================================================) s+ R( Z& o$ S: a; V
0 P4 F/ f4 u: s7 L/ x- (defun c:nt (/ g1 g2 ss1 olderr nterr l i temp e1 e2 new old dd dc)
' `! y5 `5 a" H% F% k2 y
! m, D5 y# O! d: W- (defun nterr (s)5 B& y) T# w9 i9 s7 ^: r
- (command "_.UCS" "" "_.UNDO" "E")
( D8 N0 U* P( w. s! E0 @$ E - (setvar "cmdecho" 1)0 h! G/ y9 t$ b0 t' K+ b
- (setvar "blipmode" 0)
, T3 H: S8 s/ }4 x# n0 l& A# p - (setq *error* olderr)
% a: ? j! w7 _8 k3 O+ I% p - (setq g1 nil g2 nil ss1 nil e1 nil e2 nil olderr nil 3 O% S8 H% C; B4 @: ^
- nterr nil temp nil i nil l nil new nil old nil dd nil dc nil)9 A& W. X$ i0 G
- (princ)9 p: @5 m/ c b* Z' v
- )
% B8 g" j' t' d
- T+ K6 ?2 I0 G: n p- (defun tim_in (dt / p01 p02 ktra)' z, z* }8 ^2 r; U0 M; |
- (setq p01 (cdr (assoc 10 (entget dt))))1 z3 T; m( w: R: Z* Q2 L2 i: {
- (setq p02 (cdr (assoc 11 (entget dt))))1 G4 i9 l( V. g
- (setq ktra T), D- P* ?; C* l, U5 p
- (if (and (> (car p01) (car g1)) (< (car p01) (car g2)) + b7 v0 n% X+ V# i. E
- (> (cadr p01) (cadr g1)) (< (cadr p01) (cadr g2)))/ v9 q4 y8 H* l
- (setq ktra nil)" q9 W8 G% q) U6 I& k5 v: E1 M
- )$ j0 l$ f, t( W
- (if (and (> (car p02) (car g1)) (< (car p02) (car g2))
7 |' S4 d4 f. ] - (> (cadr p02) (cadr g1)) (< (cadr p02) (cadr g2)))& H2 G5 w2 o0 [' L Z* r
- (setq ktra nil): Q: o1 y, U2 W8 P% I+ B @
- )
7 A/ G# O k8 U/ F# v - ktra
7 v5 `4 M: u: u9 d' y7 _7 {8 i' a( c - ) q* W/ j! m1 ]- y! X8 Y& F& i
$ r1 O" J! k9 Z6 o$ n; l! M5 J+ j- (defun timdt (dt1 dt2 / p01 p02); h( }" h% G: K* X- q
- (setq p01 (cdr (assoc 10 (entget dt2))))4 ^: H" T$ S; I; \, W* D& K
- (setq p02 (cdr (assoc 11 (entget dt2))))
/ S1 k A" G' v$ S+ ?2 o - (setvar "ucsicon" 0)
. O% `+ q( Z1 \7 @) q7 T* p - (command "_.UCS" "E" dt1)
# G# n% r% q1 x0 c* R - (setq p01 (trans p01 0 1))( F' ?/ I- g3 M
- (setq p02 (trans p02 0 1))
' v0 Z! U) D0 \ - (command "_.UCS" "")
2 P2 l. T) t5 n' e6 x+ g8 _# T" U - (setvar "ucsicon" 1)
' P; t* ^7 S. p5 z7 M9 J, k - (if (and (equal (cadr p01) 0 0.001) (equal (cadr p02) 0 0.001))
2 J7 E% o8 _1 E; l* M* T5 l6 @ - T
$ ]7 ]2 m- p9 |6 ]& ^" k - nil
# M0 W* G7 T2 `2 E/ p5 t; G% n# B+ M; x - )9 w0 @# a2 i5 W
- )
* C# b2 J3 t, d2 F, o1 k - 4 `# c+ Y# P3 }2 H# W$ |! {
- (defun tim_out (dt / p01 p02 kt)
$ B1 N' |4 |; D: L; _, L - (setq p01 (cdr (assoc 10 (entget dt))))
- R$ s4 w* Z% }" h/ ?: Y - (setq p02 (cdr (assoc 11 (entget dt))))
& u: m# X# d8 \6 R! g - (if (and (> (car p01) (car g1)) (< (car p01) (car g2))
1 P9 l1 K4 D, O# l - (> (cadr p01) (cadr g1)) (< (cadr p01) (cadr g2))): Y! Q' _* `6 H7 q0 ]! z
- (setq kt p02)
5 }/ L/ T6 A0 u. t- `7 x - )4 C% ~% [$ i2 Q5 Z5 |: A, U X
- (if (and (> (car p02) (car g1)) (< (car p02) (car g2)) , j7 h: h( ?" J4 w3 d! X- H$ t
- (> (cadr p02) (cadr g1)) (< (cadr p02) (cadr g2)))# M$ K8 \- X+ S" W
- (setq kt p01)4 X6 r3 S; b- u& f- I
- )' Y9 m" B1 x3 X) ~
- kt ! X) x8 H* H# H% v
- )8 {& Y) w$ L/ D" d
: s5 X2 v5 K/ J1 U* u- x$ z% ~- (setvar "cmdecho" 0)4 ~2 L0 R( w ?3 @
- (setq olderr *error* *error* nterr)% a5 R( m) ^/ m! ^7 x3 Q, h: u
- (command "_.UNDO" "G" "_.UCS" "")
0 l/ z$ P7 A) Y$ u# m# o; P& K8 V - (while (null ss1)- |. g5 P& T6 j0 y, ?
- (princ "\nChon tuong muon noi...")4 N$ ^- Q& y' B7 H% w1 x
- (initget 1)! h, T0 h0 J2 A; r# k
- (setq g1 (getpoint "\n>Goc thu nhat:"))
6 G {& P, V3 @/ \( E! u+ j - (initget (+ 1 32))
6 l: F' i% a; H/ o - (setq g2 (getcorner g1 "\n>Goc thu hai:"))
, Q7 b+ d9 @' M - (setq ss1 (ssget "c" g1 g2 '((0 . "LINE"))))
' y/ [9 o3 h j6 j7 i) [4 Y% p9 K. U - (if (null ss1) (princ "\nKhong tim thay doi tuong!"))
% U1 l4 C6 l# Y - )( w7 O: T# Z. V+ w" l1 G
-
' h/ B2 y3 h3 O) a - (setq temp (list (min (car g1) (car g2)) (min (cadr g1) (cadr g2)))
- a/ b- Q# O/ }" P- A1 W" h, } - g2 (list (max (car g1) (car g2)) (max (cadr g1) (cadr g2)))' e0 U% \% P+ ^/ J/ A* W
- g1 temp)3 x4 G2 \1 S, \1 c2 i: B+ ~/ @
- (setq ss1 (ssget "w" g1 g2))
" J1 `$ Z+ L8 n2 B - (if ss1 (command "_.ERASE" ss1 ""))% [# Q0 T- h) S
- (setq ss1 (ssget "c" g1 g2 '((0 . "LINE"))))* ]1 k! I- Q7 @( |
-
: _, s) X: S6 ~3 @6 k - (setvar "blipmode" 0)
% n9 x$ b g% u' r; {1 Q0 H9 [ - (setq i 0 l (sslength ss1))
5 p4 b& v8 G3 y% Q - (while (< i l)9 ?' B4 v& x4 [9 N6 Y, U
- (if (tim_in (ssname ss1 i))
* V7 N/ u7 K3 f% x. n9 t6 ^. K - (progn . H" l: S! @3 P! }/ I2 C* ~
- (ssdel (ssname ss1 i) ss1)
8 h- N% V% s$ @+ Y: {! ]) M - (setq i 0 l (1- l))
6 e1 [2 J+ k) Q; f7 Z+ t - ) / q$ v8 {" W4 A% Z$ L, L
- (setq i (1+ i))" y( R6 [4 s8 c' r4 d! ^
- )+ u: K M% `! U) N. V' R
- )
5 Y3 H* z9 d8 Y1 X+ {' ?: H, R( S - (setq l (sslength ss1))/ N$ ~" i* l; Z0 Y6 z* y
- (while (>= l 2)
. j7 a5 k& I. \5 v - (setq e1 (ssname ss1 0))0 e, Q2 F2 H* B/ Q$ p' l
- (ssdel e1 ss1)
' q; ~/ O' E( y - (setq e2 nil i 0 l (sslength ss1)). Q1 m& B C; R% j% O0 [
- (while (< i l) 5 H4 [% W: J. @5 q
- (if (timdt e1 (ssname ss1 i))
" s% z" m7 B, u- q - (progn
3 J$ W& ?! f; Z7 ]6 W. O - (setq e2 (ssname ss1 i))
; X" N- D. R0 r2 s' Z1 i - (setq dd (tim_out e1))$ d, L3 B3 |* K9 i7 S7 u
- (setq dc (tim_out e2))1 G i! }9 ~% o4 r( M3 e; f
- )
+ v/ Y! ?) J2 s& O - )
?- |$ t& B, y2 `5 d - (setq i (1+ i))
6 N' W2 z- m3 D& u, u# ? - )
) J8 H A! n; d# ~& c - (if e2 (progn
; o3 y- b+ m# J& f2 @+ p* ? - (ssdel e2 ss1) $ a( K7 R/ S8 ], Z! [
- (command "_.ERASE" e2 ""), ? l9 [" w9 `, J
- (setq temp (entget e1))1 E# A/ u, d- s$ X. Z6 i8 y
- (setq old (assoc 10 temp))
+ ^5 C) Z6 D4 R2 r& `+ ] - (setq new (cons 10 dd))/ p6 |* U& m2 S: p) j+ [0 c/ W
- (setq temp (subst new old temp))
' B! r* N0 }, C9 H - (entmod temp)4 k! o( l, z2 R& e
- (setq temp (entget e1))
1 I; I' X$ W. e4 ]: m - (setq old (assoc 11 temp))" m% L- Z( J, d
- (setq new (cons 11 dc))
2 N) q* c- l* b1 |/ t$ X7 {5 o - (setq temp (subst new old temp))
& I9 ^5 s" b2 |) ?: e/ K5 | - (entmod temp)
2 s' c1 M# [5 i, l2 b0 Q+ l - (redraw e1)" y8 N6 q$ f. Y+ U5 d
- (setq l (sslength ss1))1 t* Z/ y8 m% u# E) ^. z# ?
- )
0 W2 \8 X, ]; F1 ^ - ), I, j4 r Q1 t
- )/ C, X4 b3 f+ Y9 \
1 o9 u7 Q. A8 A( W0 |+ {- (command "_.UCS" "" "_.UNDO" "E")0 u) [0 K: d V8 O2 K. C4 D
- (setvar "cmdecho" 1)& F& \/ B4 x6 M* ]$ ]( g
- (setvar "blipmode" 0)
8 D3 S' U8 m! ~. Q - (setq *error* olderr)8 k9 g3 s3 ^5 A" w6 Z
- (princ)' R! L+ A9 @4 a. h W& N2 ~8 E
- )' K& C" ~4 @# S
- ;*********************************************************************+ p! I9 Y# F! W; {' m- D
- (defun ketthuc ()4 P7 S) `# r9 C0 Z) p: b- m( d8 d
- (setvar "cmdecho" luuecho)
7 U, }! ^6 c* h7 b - (setq *error* luu! w* W* ~" Y5 Q1 @) C
- luu nil
) ?" V ?; k/ G. D* j, q - luuecho nil$ H; V: R$ {" ^6 K. a& C
- );setq
; r1 d* K! Q1 f I$ F - (princ)
9 Y1 x) G7 w6 O7 v; V- q - ) * b* R' w$ P* O$ g
- ;*********************************************************************
& q) d3 _- C) x4 O: h) j# \1 I3 h! | - (defun modau (), S( K& m/ R# A
- (setq luu *error
2 l& u7 g) G/ [8 A ^ - luuecho (getvar "cmdecho")
. W3 {. \: K* l+ y) i3 \( c0 | - *error (ketthuc)( }( p, b7 n( L5 T$ ], v' B
- )
! f z) ~" u1 h* Y - )) t* S! i, A( [* H0 ^
- ;*********************************************************************9 U! e: L4 a9 i# Y& l% a
- (defun xulytext (text / kytu ma sokt luusokt lui )
' `- ~, d( I/ b# T) O) ?, T! q - (setq kytu (substr text (strlen text)); N3 J, f/ \. o
- ma (ascii kytu)
& B1 P) X2 J1 q - sokt (read kytu)
$ z0 o/ q0 S0 o$ p$ g( _. L - lui 1) W: l: W+ `0 C- }
- )! Z3 I9 F9 t5 O; o4 J
- (if (numberp sokt)
5 d+ U3 k/ w8 m/ ~; S - (progn
; O2 o) d4 `2 T+ d l R5 G! h, M - (setq luusokt (1+ sokt))" y" z3 f: n" f3 h
- (if (and (numberp sokt)
) c4 [" |6 N% N' T2 b) A. k: L - (> (strlen text) 1)% d5 I' n! R* g, n
- ) # W6 f# I# V0 z; \ a
- (progn
7 k+ J4 c" b( ~- Q! G* W8 J - (setq kytu (substr text (1- (strlen text)))
) B! ?6 Z2 P4 ?# i, o" V# T; ~2 u7 ]6 r) B8 g - sokt (read kytu)
4 k9 l' m0 M" l) E - )3 _' @8 n0 A L, [9 \% x$ r" p
- (if (numberp sokt) 6 D/ u( o" H9 m+ n, N+ D
- (setq luusokt (1+ sokt)
% K( o( m5 k5 W9 O - lui 2% O# _2 ?* R) R) f
+ R b4 [3 q* B5 W; x8 a4 \- )! L1 k* m. f+ w9 [1 @
- )2 d. F! ~' U+ Y( i: I
- );progn
1 \& ]; n! s' | - )5 G$ e# [; x I( h+ u1 j! x
- (if (= luusokt 100) (setq luusokt 0))$ j9 k4 W6 d3 L, v
- (setq kytu (rtos luusokt 2 0) \2 _+ X( C: e. a2 u
-
6 d( d( k& }1 h; a$ |& N3 ~ - text (strcat (substr text 1 (- (strlen text) lui)) kytu)
2 S" c: i4 V# E: G- F) S - )
- z- [+ r: P1 Y; x/ C# A+ K - );progn
- ~% g' H! A; y - (if (or (= kytu "z")
' C5 R9 _/ f; t - (= kytu "Z")
- m. P# ` ~% F$ g5 ?1 Z1 ^7 O - )3 d5 T+ G1 d/ \* |, Y9 g
- (setq text (strcat text "0") J! z0 O% ~& P Y( W0 ^ Q3 e* s
- textxl "0"
+ f6 B! e; ~: E3 v4 ] - )
8 v: _- d0 D8 a3 v+ S' y; r# r" t1 h - (setq ma (1+ ma)
! [5 ~- M# X( ]2 [# U - text (strcat (substr text 1 (1- (strlen text))) (chr ma))
8 ^- z& U. K5 n: u$ ]+ M% [0 s( q- R - )
* v8 q" m* a/ y. T2 }9 i. l - );if
0 \$ z+ s- Z' d2 W) F$ C' d - );if
( b' ?6 }# m7 S/ r5 V3 ~# r - )
, d# A! p& X4 S! a8 @" d - ;*********************************************************************& P0 K; b1 v4 E( E, Q) c* W
- (defun doitext(tendoituong / chuoi doituong thoat tam dsach kieu text vitri10 vitri11 dem canle)
" s1 A& d- K/ b& b - ;Neu doi tuong la text thi tiep tuc8 y- `- H$ u1 r' A+ g X
- (setq doituong (entget tendoituong)1 \3 _( v% E9 h$ m) P
- kieu (cdr (assoc 0 doituong))* `# ^, z! n& y: ~3 i/ k) [
- canle (cdr (assoc 72 doituong))9 k; N3 Q4 O- X
- ) , h6 c6 z, M) V* V3 a! J. Q& s3 `
- (if (or (= kieu "TEXT")
; j4 v2 A6 _9 \: [1 n2 r1 t) X - (= kieu "MTEXT")
- l t" y% z2 c0 t - )
; b( o+ p: ]) M1 C - (progn; s' [) n% R6 R6 y4 M: f. E2 k
- (setq textxl (xulytext textxl)
( M; A" f, U+ ~* y4 S+ }+ I - text (cons 1 textxl)
5 t* ?% l% C2 R; Q9 y. b - vitri10 (cdr (assoc 10 doituong))' Z0 z5 `4 A" C# I+ n
- vitri10 (list (+ (car vitri10) (car vitrilech)) (+ (nth 1 vitri10) (nth 1 vitrilech)))
' `$ W9 ?0 w2 j& z& Z - vitri10 (cons 10 vitri10)% t; C4 A! s8 \" W* q
- vitri11 (cdr (assoc 11 doituong))6 k# i1 v4 f% i2 g( i5 H
- vitri11 (list (+ (car vitri11) (car vitrilech)) (+ (nth 1 vitri11) (nth 1 vitrilech)))- p! Y+ n( s) y/ z' L
- vitri11 (cons 11 vitri11)
' M2 m& `6 l, M$ E - dem 0% p' t/ R8 ~8 M& M9 p
- dsach nil( f6 z5 E+ ^% U8 m J1 Z1 [
- )
: y6 A- F! N( c/ U$ D u8 B6 k - (foreach tam doituong
$ ~2 L5 c2 m+ q: i0 @: D0 q5 E7 ?+ _ - (cond
6 _, ]) N% C$ U3 @& P* I0 N - ((= (car tam) 1) (setq dsach (append dsach (list text))))( Y7 p1 b2 ]7 k; m+ Q$ i$ E- W& m( O6 L
- ((= (car tam) 10) (setq dsach (append dsach (list vitri10))))
/ s% v T U' [2 Y: c7 [+ o - ((= (car tam) 11) (setq dsach (append dsach (list vitri11))))2 X6 [9 f: B8 N- h( a7 M9 I
- ((setq dsach (append dsach (list tam))))4 `' o2 ?' d3 e
- )
3 K, u9 e6 j2 G* @1 v - )
% Z! e+ x% M$ [8 x5 F u( x# l - (entmake dsach): ?. N3 u& l& [( R
- );progn
$ V' U3 c7 u, x8 M$ S - );if4 K, m' A+ U1 h4 Z/ j/ |+ @6 F
- );
: Y9 [- a$ K4 a: Z6 \, n! f - ;********************************************************************** R0 k( t) F# W& ]- Y- A' t. t
- ;sao doi tuong cu sang vi tri moi
; y X& e; O+ ~0 K& f' d0 y* H
6 c+ f8 D1 }% M1 h- (defun copy_dt (tendoituong ) L" |) @# _) [; E' ^9 Q t& }
- (command "copy" tendoituong "" goc toi )2 W7 ^0 g0 A; s- U! A
- );defun
H1 z1 X+ o0 ?9 q |! b i" n - , b2 V& C3 E3 m
- ;********************************************************************** o' t, S1 K( ~/ \
9 H8 n3 X6 J. N- (defun c:ct ( / cumdt dodai thoat dem ten doituong textxl dem goc toi)
+ I2 g& F9 Q/ |+ M+ @$ w, q0 | - ; Khoi dau cua chuong trinh7 a% y# |" e/ R* l' W
- (princ "\nCopy Inteligent...\n")# U3 A: F9 Z, l. ?3 m. s7 v
- (setq luuecho (getvar "cmdecho")7 w0 _& E4 ]. r/ x, L$ n
- luu *error*
) J2 v2 q$ e5 u6 J! i- C! o" C" w @ - *error* ketthuc
$ v8 l/ d; g- u) X; w9 A - cumdt (ssget)) B" T& z1 o7 Q" W* C
- dodai (sslength cumdt)
1 g; Z" f5 E x/ k! [2 m q. X w - goc (getpoint "\nSelect base point:")
, w+ {+ |2 r; H+ h- @5 r, f - thoat nil
( {- L) V; U3 O: w8 E - dem 0
& A& a5 J1 }' p - textxl nil: \3 @" B7 S6 K
- );
( F5 c- H! u. ^) D, h/ F' a - (setvar "cmdecho" 0)- a' H% E) H- d; L" K' X& l! I
- ; Loc ra duoc ong text de xu ly
! a' n$ Q* V5 f3 Y - (while (and (= thoat nil)2 Q. ~) W$ s+ x
- (< dem dodai)
" F# ~. i+ p% j! i/ @ - )
* ?2 D$ L$ @9 e+ I% R) _3 C# K - (setq ten (ssname cumdt dem)
) P6 e' [5 \4 g) i! a( W - dem (1+ dem)) i& R& m0 ^& T7 h5 c
- doituong (entget ten)
0 b, i! t" h# @/ Y5 U! z - kieu (cdr (assoc 0 doituong)) : T' @ I: v* D6 G: k9 l8 r
- )
) K+ f% s3 I1 ]) h; Z% [( m$ G( J -
/ R# w0 P- {* E) h) Z3 s* M - (if (or (= kieu "TEXT")
0 l- [& P/ ^: { - (= kieu "MTEXT") ; a$ `0 G6 t1 o2 D6 `: {
- )
2 T \. z4 W5 q$ b! o' A4 t8 K - (setq thoat T) x9 U* T/ X# U5 R
- textxl (cdr (assoc 1 doituong))
6 y7 ?+ v4 `1 g; ^ - )# d7 k- \( Z: J
- )
$ a3 W8 g! p" o$ J - );) x2 w4 c/ C2 }. Z$ g
- (while T - g; U3 w6 F! {; u& J t2 D# q0 U
- (setq toi (getpoint "\nSelect next point: " goc)( l2 H- F5 p' t; Y2 U6 L
- vitrilech (list (- (car toi) (car goc)) (- (nth 1 toi) (nth 1 goc)))9 Z1 ?, v6 V2 Q
- dem 0
+ Y/ L: d N) k7 @* u9 b - )
5 U7 _1 C, I7 k. S0 O9 C0 {6 h - (while (< dem dodai)
+ [- z$ j2 N7 G4 J. E7 C - (setq ten (ssname cumdt dem)2 M+ U1 L, ]; Q6 G
- dem (1+ dem)
+ i' I) M7 ^: y- E - doituong (entget ten)
' W Y1 }; \7 O/ @ - kieu (cdr (assoc 0 doituong))
, p, F0 Y' g/ e! b4 p - )1 H- j, b! _& l+ y
: S5 a1 j) B% F9 ?$ x( L6 W9 V- (if (or (= kieu "TEXT"). K+ {- K9 k4 P7 L
- (= kieu "MTEXT") 5 Q( Z9 |& G1 n% z
- )& L( M9 t" p0 V* i W s' q
- (doitext ten)" c& ~) g* T: c5 ]; B
- (copy_dt ten)
6 K# q* J/ O1 H+ }8 U7 `4 r- W - 6 t2 ]( R8 P) {9 W1 R& F& s
- );if
' Y7 r% B; g) h( @ - )
$ B% `% P8 V1 ~" @ - );while* J1 ~' n B* p3 Z# c8 {: f7 _2 h
- (ketthuc)1 S* i- A; i/ Y) y' t* \
- );defun
" T6 A3 I* i/ G3 S/ `; Y+ j - (princ "Type \"DG\" to start")
/ w# B9 {2 _- O+ f, s - ;Note: bien toan cuc: textxl vitrilech
- `2 K" n' X* a% d
3 p- M }2 e; \2 V/ E1 ]/ f- ;=====================================================================' w# s- V! y' G# N" H
- ;;; PLJOINFUZZ.LSP8 U6 A* K5 y; s7 I- T f
- ;;; Joins lines, arcs and polylines using a fuzz distance
, t3 f+ e9 \6 \( T- S- o9 k - ;;; If only one object is selected it tries to join to all objects that are possible* }" Y) S/ V* H; j" k; U) _7 z
- ;;; By Jimmy Bergmark
4 |" a* N# V5 f" @ - ;;; Copyright (C) 2003-2004 JTB World, All Rights Reserved1 i/ V) M, t1 f* V! F6 F: E1 l
- ;;; Website: www.jtbworld.com5 Q, }3 e$ m) v
- ;;; E-mail: info@jtbworld.com* C# Y2 a. Y' j& W
- ;;; Tested on AutoCAD 2002,2004 and 20055 w3 c# R5 C% L3 @
- ;;; Latest revision made 2004-11-11& e: l+ M2 ~0 @% |
- ;;; Minor code cosmetic change made 2004-11-13
) r: t6 K1 A. \3 L) r* r - ;;; Bug corrected 2004-12-235 U: E& J% q+ w/ W' T
+ N8 P; S2 v" H( M& w& i% L" v- (defun c:jf () (c:pljoinfuzz)) ; this line can be commented out if there is an existing command called jf
5 Z7 r/ e' R/ g9 y8 k4 y* o - (defun c:pljoinfuzz (/ ss1 entLine objType oldcmdecho oldpeditaccept fuzz okObjects)3 h0 p" v2 p+ Y9 z, z1 X$ g% A% C# q
- (setq oldcmdecho (getvar "cmdecho"))
0 _. }: d. I' b. A - (setq oldpeditaccept (getvar "PEDITACCEPT"))
% `6 ^: @' R5 k- i - (setvar "cmdecho" 0)
# q4 c/ W" u, A4 h% Y - (setq A2k4 (>= (substr (getvar "ACADVER") 1 2) "16"))
+ x) \7 d5 B: ^; v9 b! ] - (if A2k4 (setvar "PEDITACCEPT" 0))" I6 N: M# e# V1 L% j( @
- (setq okObjects '((0 . "LINE,ARC,POLYLINE,LWPOLYLINE")))
+ O' R, H. M( ? - (princ "\nSelect object to join: ")9 C; M- B9 K. P+ m$ f1 g' R5 d
- (setq ss1 (ssget okObjects))* r7 a/ z8 \/ k' D
- (setq fuzz (getdist "\nFuzz distance <0>: "))3 \5 A3 t5 @1 \, e) t$ z
- (if (= fuzz nil) (setq fuzz 0))
) C3 H; j& R$ d) s - (if (/= ss1 nil)- {. S3 l( r% }. q6 [7 ?/ h
- (progn
- a* ~1 R! I2 R+ Z - (setq objType (cdr (assoc 0 (entget (setq entLine (ssname ss1 0))))))
; A/ i" R" z% D - (if (= (sslength ss1) 1) (setq ss1 (ssget "X" okObjects)))0 n l. I, J! w& H1 s6 Z9 B
- (if (member objType '("LINE" "ARC"))1 m) e5 Q9 `! o
- (command "_.pedit" "_M" ss1 "" "_Y" "_J" "_J" "_B" fuzz "")
) ~1 ]+ H) Z( @+ r5 U - (command "_.pedit" "_M" ss1 "" "_J" "_J" "_B" fuzz "")
9 f1 D9 ], v* n' Q' O - )
1 x# Q% O% r9 P; n+ ^ - )) L s2 q2 F; ?, c& X, ^6 r
- )6 K- w% C6 H9 ]: w: m6 N
- (setvar "cmdecho" oldcmdecho)
# b9 ]% N' w* B/ L* i - (if A2k4 (setvar "PEDITACCEPT" oldpeditaccept))
- u" S6 F% X( m" r4 W9 j7 s3 g - (princ); V1 E! V, \5 p8 v1 Q4 Z
- )
* V: X8 K; u% ? - " |: L" s# j% ?+ P
- ;===========================VE CAO TRINH===========================
* M* J. D& E; O - % T p8 J, g2 t" y: Z
- (DEFUN C:Cotcao (/ CMD PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 NPI TX DX DY TL OSM OLL
- Y7 M" M# c1 G0 v& F) s5 i0 M - CRST RSIZE TSIZE STR PRMT FCH NBC OLDERR)4 z! a4 T4 A$ V
- (SETQ OLDERR *error*
0 t8 y1 [) d4 t - *error* loisb)
7 f; {, i/ ^/ P1 `/ S; j% O) a( {7 W - (command "layer" "m" "dim" "c" "" """")* U# |+ R) K. D |& i6 ~5 |
- (SETQ CMD (GETVAR "CMDECHO"))/ D( |5 z F& X- G' f* F
- (SETQ NBC (GETVAR "CLAYER"))" c# g( A1 Y8 j# z
- (SETQ OSM (GETVAR "OSMODE"))
# d5 Z( o( d5 r5 P - (SETVAR "CMDECHO" 0)
) Y/ N9 K9 y7 o( u - (SETQ PT1 (GETPOINT "\nDiem cao trinh:"))
7 @5 M/ j6 U" D( b( L6 ~9 Y( g - (SETQ TX (GETSTRING "\nCao trinh:"))) r) }+ ~/ E4 P5 `) @$ y* c
- (SETQ FCH (SUBSTR TX 1 1))
# f% }) @% }3 \0 o( Z% w - (IF (= FCH "@") (SETQ TX (STRCAT "%%P" (SUBSTR TX 2 (- (STRLEN TX) 1)))))7 g# i. n% u/ Y' p6 K: }# |' ]
- (SETQ CRST (GETVAR "TEXTSTYLE"))
" M3 c! c$ i' j2 {; d# k. h/ V - (SETQ RSIZE (CDR (ASSOC 40 (TBLSEARCH "STYLE" CRST))))! e5 h" K2 h- a" n5 [
- (SETQ TSIZE (GETVAR "TEXTSIZE"))! R6 p% b& p( {( Q6 }6 A
- (SETQ STR (RTOS TSIZE 2))
" E8 }/ b/ J9 ?, m - (SETQ PRMT (STRCAT "\nText height <" STR ">:"))& C5 m# m8 {" p, D3 Z
- (IF (= RSIZE 0) T/ o/ B8 C/ l) h: d) f% W5 W0 |7 f) K
- (PROGN
& U5 K/ X: C- y+ x) ]2 _0 x - (INITGET 4)
- l7 o$ E( u7 k4 u - (SETQ TSIZE (GETREAL PRMT))8 ^" y$ O/ S5 B+ R0 q- _. ]
- (IF (= TSIZE NIL) (SETQ TSIZE (GETVAR "TEXTSIZE"))5 V4 l5 R! L& a8 U; c' C- n1 C' O
- (SETVAR "TEXTSIZE" TSIZE))4 x+ Z; o$ J( o% Y, C; i* N& c
- )
: w3 V; S8 F7 k- n - )
- w5 E0 p5 f( Q2 f( U% d - (PRINC)9 H7 u( \' `; N" z$ _( Y; {- z/ e
- (SETQ TL (/ (GETVAR "TEXTSIZE") 2))
: o: f) P4 M. e; p0 w, n" ]+ \ - (SETVAR "OSMODE" 0)/ i' k) s, L* e# ~
- (SETQ DX (CAAR (CDR (TEXTBOX (LIST (CONS 1 TX))))))/ `! A) a; a; C+ }
- (SETQ NPI (/ PI 2))% e. l. _4 Y0 E
- (SETQ PT4 (POLAR PT1 NPI (* 1 TL)))" O5 Z. c h. ^ H; s X; d
- (SETQ PT2 (POLAR PT4 PI (* 2 TL))); } a6 s. T+ C% D9 ?4 S
- (SETQ PT3 (POLAR PT4 0 (* 2 TL)))
5 u/ U7 l; @. t. r - (SETQ PT5 (POLAR PT4 NPI (* 5 TL))) b" `) G8 C8 x2 q3 s
- (SETQ PT6 (POLAR PT2 NPI TL))7 g1 C) E, \* f
- (SETQ PT7 (POLAR PT6 0 (+ (* 3.7 TL) DX)))
- n7 x8 y* f2 M$ U - (SETQ PT8 (POLAR PT6 NPI (* 1 TL)))$ w6 f5 M" E) O5 e- d, H
- (SETQ PT8 (POLAR PT8 0 (* 2.5 TL)))$ ^; T* i" }5 i
- (SETQ PT9 (POLAR PT1 pi (* 2 TL)))
4 W. P1 p0 v! V; ^& X - (SETQ PT10 (POLAR PT1 0 (* 2 TL)))
+ S) H: o! | ^9 z0 l - (COMMAND "COLOR" "7" ""). F3 j% J$ H* o
- (COMMAND "STYLE" "COTES" "Verdana" "" "" "" "" "")
5 k' }8 d) G+ `+ Y: K" @% O3 t - (IF (= RSIZE 0)(COMMAND "TEXT" PT8 TSIZE 0 tX) (COMMAND "TEXT" PT8 0 TX))
) ~/ C3 F: W+ n" |% x - (COMMAND "COLOR" "BYLAYER" "")
- D+ A9 M2 }. N. k - (COMMAND "SOLID" PT1 PT2 PT4 "" "" "pLINE" PT1 pt3 pt2 "")
/ Z8 v' o4 b; P - (COMMAND "COLOR" "BYLAYER" ""), ~ k" L0 H c- O2 t
- (COMMAND "pLINE" PT1 PT5 "" "pLINE" PT6 PT7 "" "pLINE" pt9 pt10"")) |/ {8 o: }2 x' P; D
- (SETVAR "CLAYER" "0")$ W7 h$ ^) J9 d
- (command "ddedit" pause)) Z5 w; y5 C. X# R
- (COMMAND "COLOR" "BYLAYER" "")
( M; X* S0 q9 m% p: {. q! S5 } - (SETVAR "CMDECHO" CMD), G: z4 E; U7 i: }+ d+ c
- (SETVAR "CLAYER" NBC); g. I3 A& k( y, g: K w) i
- (SETVAR "OSMODE" OSM)
f! k9 T% A* {7 L( K - (PRINC)
w- m( }$ Y+ |, q - )
0 K6 ]5 |% k4 ~. t% h( Y( L# h. A - 6 J9 x( b, w; \/ c
- ;;; =========================== VE NET CAT CHEO (GC) =============================! P! X" _) s) M2 u [# t( E) K
-
, y! J6 Y, X& u" u6 c# x* j - (Defun c:G1(/ p1 p2 p3 p4 p5 p6 p11 p12 l ang)
! _5 i5 ^- k* z, ^) o$ g - (setq x (getvar "osmode"))7 g0 @+ |* O0 X8 D7 v. ]4 |
- (setq p1 (getpoint "First point : ")4 T9 K, `: n# K U4 A6 L. m6 h6 ?
- p2 (getpoint p1 "Second point : ")); u- N1 L7 `$ n) L+ V( g5 x9 u
- (setq l (distance p1 p2))
5 ]0 z" e6 G% n* T - (setq p11 (polar p1 (angle p2 p1) (/ l 5))& B z7 Z: o$ `2 N
- p12 (polar p2 (angle p1 p2) (/ l 5)))$ v; T2 b( B' ~% U1 `0 R( \" i+ W: g
- (setq ang (angle p1 p2))
3 }' V7 u I: d! x) |. d% ^# W - (setq p3 (polar p1 ang (/ l 2.5))
" P" K3 n% I9 H- O* V' y - p4 (polar p3 (+ (/ pi 2) ang) (/ l 5))
, b& O9 N+ {; J4 Q - p5 (polar p3 ang (/ l 5))1 O+ r$ e' ?$ o C5 _( d7 K0 [/ P) a
- p6 (polar p5 (- ang (/ pi 2)) (/ l 5)))1 B* l" d; m9 z( T
- (setvar "osmode" 0)
% o; \5 m8 _( m& ? ^+ N - (command "pline" p11 p3 p4 p6 p5 p12 "")( d% i3 V7 p" ?4 K" w7 ^& X7 ] J) W
- (setvar "osmode" x)
) M$ j2 u, a1 |% e - )
0 f, F0 c# X6 ]( a - ;----------------------------------------------------------------------------------
% v9 M k3 E3 f7 v- \ - (Defun C:G2 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6
4 d1 n$ c+ N3 ^1 p& A$ j - pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE"))/ G! m* u; T' }3 q" A1 J
- (setq ps1 (getpoint "\Chon diem thu nhat: "))! ]0 w- u. e/ i* I7 G
- (setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))( o, d3 ^# J* k
- (setq sb 50.0 sh 200.0 se 20.0)
, P& A* q. R: S8 ]0 y' W1 Q0 V - (setq ang (angle ps1 ps2))9 T1 _& l+ {0 w. l) v! `
- (setq pf1 (polar ps1 ang (- 0.0 se)))
9 Z- H3 k) I( E8 t; t - (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) ))( F+ T6 _ o# |" A4 u. b
- (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))
1 S( M; e8 q0 `, Z4 B3 G+ } - (setq pf5 (polar pf2 ang sb))4 T2 T% k+ n, c0 p
- (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0))) C2 ^" Z1 p$ R! f! K5 \
- (setq pf6 (polar ps2 ang se))
( L h4 k- Y( Y4 N4 ~3 T9 {1 r) _ - (setvar "OSMODE" 0): U# N* N4 C2 o
- (setvar "BLIPMODE" 0)
: G7 c5 x; O( R9 B - (command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")
3 c- p3 O6 N1 B/ F- V. c - (setvar "OSMODE" 703)
+ ]2 b- L0 Y7 Y, w8 Z. ]* ^ - (princ) )
+ z2 L" i1 [, ^" l - ;----------------------------------------------------------------------------------
2 M' `/ ^% X1 e& D* S' g0 ` - (Defun C:G3 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6
% C, R/ ^. J6 K - pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE")), A) H% T1 ]1 d+ M1 j% R, h) S0 n
- (setq ps1 (getpoint "\Chon diem thu nhat: "))
+ V/ N" d* n/ H% A - (setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))
( o, j) v$ n- Q7 y3 y# } - (setq sb 100.0 sh 150.0 se 20.0)
7 G8 ]$ f, }# G) v7 W1 e V$ z - (setq ang (angle ps1 ps2))! D& r' ~. o3 f6 k
- (setq pf1 (polar ps1 ang (- 0.0 se))) z$ \. ~, J9 W' B" W
- (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) ))
! Z9 d j4 ~* x# K - (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))4 E/ P& [2 [' F
- (setq pf5 (polar pf2 ang sb))
; P, l6 `. | {& j - (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0)))9 B: {* M" E% [2 B2 ?3 w. [2 V/ r
- (setq pf6 (polar ps2 ang se))
3 [' ]) I3 Q. G. b5 t2 | - (setvar "OSMODE" 0)) W" r/ V% _1 ?6 \+ z& i
- (setvar "BLIPMODE" 0)
% E2 N V2 q. c0 I6 @" p: n - (command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")
+ U2 F; |2 U9 E$ E5 P, E# i" P, W - (setvar "OSMODE" 703)
, x) E7 n$ _" Z* x" `) t* ] - (princ) )! f" A% u. O" y; z$ {9 J' u
- ;----------------------------------------------------------------------------------
5 l- _ v: |# B: J! i - (Defun C:G4 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf62 s4 M3 v' f# X% z4 c$ O
- pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE")) O* i1 J4 \6 n( Q' T( x
- (setq ps1 (getpoint "\Chon diem thu nhat: "))) ?. L1 ?. s9 g, j3 E8 F* a/ F
- (setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))
2 Y# |" V' d: o3 d - (setq sb 100.0 sh 250.0 se 20.0)
5 u1 ~# k3 C" G, \8 D& z' n - (setq ang (angle ps1 ps2)): }" L3 L/ ?( q) e4 }
- (setq pf1 (polar ps1 ang (- 0.0 se))): e2 y$ [: W& F9 N3 X8 _0 K
- (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) )); O: C8 v' `7 ^
- (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))* }; _/ ~. i+ n; u/ D0 W: Z/ K
- (setq pf5 (polar pf2 ang sb))" O" C l( J7 Z7 R! w. q
- (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0))); L q) |4 I. j, z, x% T8 ~6 l/ a
- (setq pf6 (polar ps2 ang se))
; b S6 V' L3 v3 m$ N - (setvar "OSMODE" 0)
! V& f+ [$ c c# B5 |8 H+ d9 s - (setvar "BLIPMODE" 0)
( g Q+ L- {0 S9 c - (command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")% k* C$ R9 }* k" Q: Q3 H8 O: B$ b: w
- (setvar "OSMODE" 703)1 q/ w! M5 t# G/ W! Q3 C( ?+ f5 x
- (princ) )
$ i* y/ B/ G' ~; A A - 9 k& B7 G0 z( l
- ;==================================================================================2 E, e4 Y8 x3 s) D: M& J4 O
- (defun c:ang (/ ent pt1 pt2 ang)9 y1 U% F0 b7 s+ }9 _
- (setq cmd (getvar "cmdecho"))
: U- l9 D9 g3 M: b - (setvar "cmdecho" 1)
: r2 n. U) Z: u! u' d3 U! J - (prompt (strcat"\nThay doi truc toa do theo duong thang chon truoc"))
- z& q( r D3 _ - (setq ent (entsel "\nChon duong thang:"))5 {% F8 n j, E1 X
- (if ent
3 f5 O' V# q. l: H3 J' z9 l - (progn0 j; ]: D1 m z$ S- C1 \" y8 K
- (setq ent (entget (car ent)))
( ^$ k$ h3 r+ g1 o! b( ~# b/ A3 o$ l - (setq pt1 (cdr (assoc 10 ent)))
7 l$ a$ H% |% r0 ^& r - (setq pt2 (cdr (assoc 11 ent)))
/ f, ^' K% @( W& f, B. j - (setq ang (angle pt1 pt2))
3 q, @0 C' D/ k; v, e/ g - (setq ang (/ (* ang 180.0) pi))
: E1 X8 d7 @2 u* L+ @1 x* m8 H' [: H - (setvar "cmdecho" 0)/ s3 k2 _: Q8 x C# p# h" P* J
- (command "setvar" "snapang" ang)
6 r" _7 @3 l R- S3 ?4 Y% `* Z7 s7 ? - (princ "\nGoc cua truc toa do moi : ")0 r. Q; d8 [) _# S5 \! @+ [) C; ?
- (princ ang)
U( e/ \: J1 x# {, O q2 e5 {2 m. d - )
3 i6 r. j2 I, i: x# x5 l - )
6 H* c/ |* ^1 Z0 N( H - (setvar "cmdecho" cmd)1 x4 c2 r5 {7 {4 q6 P
- (princ)
0 A' X2 }* H2 w$ f - )
0 d9 u2 S: N* x/ N7 {3 A - ;==================================================================================
2 Q! C9 G, `$ T7 g4 k6 S0 r - ;============================== KY HIEU DOI XUNG ==============================
6 \- p2 D$ w) N' e: h4 \. J - ;==================================================================================9 g; o4 S+ M7 c* r# M& w( h" P
- 1 d5 C! M0 g' z
- (DEFUN C:DX (/ CMD OSM OLDERR PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 PT9: p9 p' I2 v; o: h6 }0 G) S
- SZ G45 G135 G90 G180 SS loi); T6 K1 [3 Q. X1 [6 f" S- c3 k2 c
- (defun loi (s)% D3 C: k1 G# D$ \& W5 _
- (if (= s "Function cancelled")
# _& Y# j- i% k4 o5 ]2 d - (princ)& E; ^: {% r* z4 E* |" W: F
- (princ (strcat "Error:" s))5 @) h- R, e& o$ R ^2 g
- )5 ~% h0 s9 Q0 D
- (SETVAR "CMDECHO" CMD)
6 P1 d9 g% j+ t& c' y' B8 z - (SETVAR "OSMODE" OSM)
# N- }, h0 T, d- i- }* a3 N2 D- i - (SETQ *error* OLDERR)3 `/ m2 y" r% |/ x |# C
- (PRINC)
2 o( G5 y7 O, ] - ); f% n1 P, y$ A$ t. A
- (SETQ CMD (GETVAR "CMDECHO"))! V9 M5 V- v& j" a9 C
- (SETQ OSM (GETVAR "OSMODE"))
$ p$ b) m" M$ [9 j+ F6 D) M+ F - (SETVAR "CMDECHO" 0)- f0 Y Z7 C! u; L( ^1 u( M
- (SETQ OLDERR *error*
& P! W$ o" q2 v - *error* loi), \/ Z+ ?8 Y7 _
- (SETQ SZ (GETREAL "Size <1>:"))5 `+ p) v/ _, M2 k
- (IF (= SZ nil) (SETQ SZ 100))% N' S$ k6 _" m! X" I. h0 P: o
- (SETQ G45 (/ PI 4))
% B9 N3 @: {6 B+ [ - (SETQ G135 (* 3 (/ PI 4)))
) S, p' m6 e, b4 \ s7 S$ G7 b, k - (SETQ G90 (- G45 (/ PI 2)))7 M$ D) P- c3 U3 f8 A3 M$ x# |
- (SETQ G180 (+ G135 (/ PI 2)))1 H M7 k8 T4 |
- (SETQ PT1 (GETPOINT "\nDiem doi xung:"))
' g4 w! x6 \9 R) Y: B c - (SETVAR "OSMODE" 0)
- ]4 h8 r7 c4 C; f4 y9 V - (SETQ PT2 (POLAR PT1 G45 (* 2 SZ)))$ T) V4 {+ d* Q$ E
- (SETQ PT3 (POLAR PT2 G90 (* 2 SZ)))+ M9 T/ R x* d) d
- (SETQ PT4 (POLAR PT1 G45 (* 1 SZ)))) s: F3 |+ h- A' R: D/ T" k
- (SETQ PT5 (POLAR PT1 G135 (* 2 SZ)))' S. R" [2 U+ p
- (SETQ PT6 (POLAR PT5 G180 (* 2 SZ)))
3 x& P# n/ W0 Y( x - (SETQ PT7 (POLAR PT1 G135 (* 1 SZ)))8 S7 D) b2 c3 K" o) I2 p
- (SETQ PT8 (POLAR PT1 G45 (* -0.7 SZ)))$ p# e9 `9 s0 y( m
- (SETQ PT9 (POLAR PT1 G135 (* -0.7 SZ)))- j. {. w' n# e" l
- (PRINC "\nGoc quay:"), u" v7 j/ ^/ N7 R
- (SETQ SS (SSADD)), F! c1 S/ D3 ]. F: ~2 }2 } ]
- (command "layer" "m" "Dim" "c" "" """")0 I- V3 I( q! U+ _5 Z
- (COMMAND "COLOR" "1" "")
+ Y8 d. `4 Z+ R& P$ O" d - (COMMAND "LINE" PT8 PT2 "")/ q! h% r! j1 R, `' U( _
- (SETQ SS (SSADD (ENTLAST) SS))* E u1 _9 T9 W6 C: \# [
- (COMMAND "LINE" PT9 PT5 "")0 s( w- W. }% ~( f$ s- ] i) `) p
- (SETQ SS (SSADD (ENTLAST) SS))
5 y0 d1 {; A/ v( P7 j: y8 Z+ U* i) I! C& ? - (COMMAND "COLOR" "1" "")
% I" x5 h2 J& T' Z" _9 _8 Z - (COMMAND "SOLID" PT2 PT3 PT4 "" "")
5 j! ^3 {9 i( Q7 Z - (SETQ SS (SSADD (ENTLAST) SS))
3 J8 x/ y/ m, Q' |4 `1 S. y3 J - (COMMAND "SOLID" PT5 PT6 PT7 "" "")
+ {, O# @2 g' \: a - (SETQ SS (SSADD (ENTLAST) SS)); p. s, F8 y4 S
- (COMMAND "ROTATE" SS "" PT1 PAUSE)
0 R; l* M8 W) x, m9 U+ P - (COMMAND "COLOR" "BYLAYER" "")
: S* i: r# }/ |7 J0 l# J; f - (SETVAR "CMDECHO" CMD); Q! z- _+ _# u3 X6 v* @
- (SETVAR "OSMODE" OSM)4 ]0 \0 e0 U1 Q* {" ^7 D6 s1 Y
- (SETQ *error* OLDERR)% l* {3 d9 h/ V- D4 c* T
- (PRINC)) A1 C0 h$ o0 L/ v/ m
- )
" b; _6 f# ?& |
2 R1 _3 y! ~7 Q+ N! L- ;==================================================================================1 [% T- [6 [# E, X% J! L
- ;================================= KY HIEU TRUC ===============================5 t8 D' S# l& ]+ U- M
- ;==================================================================================
4 d5 @! K/ L* I) f- S7 m - 8 [ s- X, u, ^3 r+ A
- (defun C:vetruc ()
( U) O+ E4 V( `/ V2 E - (setq bk (getvar "USERR3"))6 w! I- O1 {3 N1 ~! M
- (if (= bk 0)7 p2 ^5 }" Q9 r8 L' B7 m+ @7 q
- (progn, S% P8 F Y j+ m7 e7 j
- (setq cont "1")
! ?. S8 r/ t. i5 W$ e% Z5 i9 g - (setvar "USERR3" 1); B$ k" n" D" M
- ): K/ W7 }1 m6 S) O8 X
- (setq cont (rtos bk))
; K4 B( f) `; |6 H - )
% B2 T8 \* F7 d- ~5 X - (setq pt1 (getpoint "\n Nhap diem dat:"))
! \& a* ?, G a4 U$ U" @1 Q - (command "layer" "m" "Dim" "c" "" """")" f( S: P/ i( \+ }6 O
- (command "osnap" "")& q% |9 F0 X; ?/ V. H, ~
- (COMMAND "COLOR" "7" "")
2 a3 z- M0 Z# J( r$ z1 J - (command "circle" pt1 150 "")
) X- }4 A6 ~! O; o9 O: I+ K - (setq pt2 (polar pt1 0 150)), w( _. G2 w( y- |$ q
- (setq pt3 (polar pt1 (/ pi 1) 150))2 Y+ r) {" W1 P/ y' J2 P6 a
- (setq pt4 (polar pt1 0 300))
) R7 [1 W/ Y& N, h - (setq pt5 (polar pt1 (/ pi 1) 300))" t7 n6 w _% [& I0 `% A% _; Q
- (setq pt6 (polar pt1 (- 0 (/ pi 2)) 150))
) z, {7 g3 `: i/ k% |7 l9 M, a - (setq pt7 (polar pt1 (- 0 (/ pi 2)) 300))1 J/ P: @2 z1 E
- (setq pt8 (polar pt1 (/ pi 2) 150))/ n# g* }$ {% W @
- (setq pt9 (polar pt1 (/ pi 2) 300))
9 ?* {% M% X7 U' E - (setq pt10 (polar pt1 0 150))
9 r( `( }: R' m$ o* G! W8 D0 U. q - (setq pt11 (polar pt1 (/ pi 4) 150))& Q; j5 x7 o2 u8 ]
- (COMMAND "COLOR" "BYLAYER" "")) `4 E0 c+ y/ ?4 T
- (command "line" pt2 pt4 "")4 [2 i- j* C3 x% w" s1 ]
- (command "line" pt6 pt7 "")
1 p# I# ?4 e. V: g( M - (command "line" pt3 pt5 "")
8 h7 b5 Z' f# I5 ]7 A6 | - (command "line" pt8 pt9 "")
) ~# p, ^* K# T0 ?" b9 ^9 b - (setq dk (strcat "\n Size:<"cont">"))
9 B$ ^7 _2 Y. M8 _; J1 E5 N! | - (setq bk (getreal dk))7 j X, B' H0 J
- (if (= bk nil)0 Q/ o& g, D: ?
- (progn8 L9 P" J9 I% s
- (setq bk (getvar "USERR3"))" q2 r1 U" O: F9 @& i1 E. C
- )
6 n' N- _/ N6 E8 I - (setvar "USERR3" bk)) G% q( [) O+ x& a3 R6 x
- )3 k+ Q, ^) `0 O
- (command "scale" pt4 pt5 pt7 pt9 pt11"" pt1 bk"")+ m/ {! I7 R' `$ h% Z- ?+ l4 t
- (COMMAND "COLOR" "7" "")+ s& ^7 I; m3 ~5 k0 P9 [, j
- (COMMAND "STYLE" "Truc" "impact" "" "" "" "" "")# V/ J' k# ]1 i5 e) ]
- (command "text" "j" "mc" pt1 (* 150 bk) pt10 "A" "")
3 m3 }6 M8 _/ a! u& F0 r8 \: c - (COMMAND "COLOR" "BYLAYER" "")
9 W# X! U+ M9 H; I; E# k - ). X! M+ h k$ E. y* Q5 S' c% i
6 _# l& w% @/ T9 m- [5 b4 W( b- ;=====================================================================
, ]2 @" p. A- s- d( x$ I# O3 N - ;CA - Reverses the case of text. (Upper to Lower and Lower to Upper.)
8 a& Q% s! y7 C. b+ i5 d2 C - ;( k2 j/ e/ H$ t" z S
- ;Jeffery P Sanders
1 n, M) o. U6 y3 ^: `1 v2 x - ;
/ T7 y; g- m5 P' Q9 E* J+ A) _ - (defun C:CA(/ en enlist tx newtx cnt tp asc note)( D, h* Y2 g5 a* @3 }/ z
- (setvar "cmdecho" 0)
3 Y( z# ]1 `7 z9 S, J - (if(setq en(entsel))
$ A3 B1 U( U* u - (progn2 X8 F. ]" v4 `" R# `4 W# o9 E
- (setq enlist(entget(car en)))" v! Z: F& v+ O. Y; t7 q
- (if(= "TEXT"(cdr(assoc 0 enlist)))6 b2 T5 \/ O0 g' [, h
- (progn
) c8 F8 x7 ^5 } - (setq tx(cdr(assoc 1 enlist))
1 O$ Z8 K* q0 G: v - newtx "" cnt(strlen tx)- |% }/ L5 U4 S% x1 s
- note "\n...CASE Reversed. \n "4 d B) T' R7 n$ t. N1 j3 ^6 i
- )8 R- x2 Q% L4 [6 P9 Q
- (while (> cnt 0)
+ v2 r% M. b. O* V - (setq tp(substr tx cnt 1))
0 Z4 ~$ I* H8 O, P - (setq asc(ascii tp))
% l9 l, Y9 \' ? Z* ^# e: J - (if (> asc 96)
+ n1 {6 O+ K4 D0 r9 z - (setq tp(strcase tp))( A4 X: R. ]0 G/ O1 D
- (setq tp(strcase tp T))
+ L) Z8 u2 E/ V; u/ @ - )
P3 d; t: H' Z+ _8 k/ m" C% M8 r% V - (setq newtx(strcat tp newtx))! Z! }# |: M5 y3 {1 K
- (setq cnt(- cnt 1))' e; K+ n7 i4 L7 r+ }
- )
* e$ E. x& h! G1 D7 ]" J- v - (setq enlist(subst(cons 1 newtx)(assoc 1 enlist)enlist)): T1 J% k* d6 u- [7 X
- (entmod enlist)
9 \% L$ C% d9 N6 y( l: P# H: F% g - )
- \, \, Z K8 l o - (setq note "\n....Text Only Please. \n ") L P n; K C* j- X% u
- )4 Q9 ^- _3 t' R* w/ Q
- )
5 O4 R( P5 G* @) H: D - (setq note "\n....Nothing Selected. \n "); R& c! c2 Z0 b( K0 K& k
- )
% s6 Z. ~4 E2 f) J) P8 g% j - (setvar "cmdecho" 1)
, I, K. @8 p. L- w& ~, S- y! F - (princ note)1 v' S) t1 L, W* A: G. ?* z5 L
- (princ)8 s5 b: L3 `' V5 z
- )0 B5 ?$ q0 c, c+ p- o# c" n8 S
- $ d2 K. Y$ @. z6 h- ~9 n5 I
- ;=====================================================================# ^: ]6 \* M( L5 {% }/ @
- ;==================== NEW TEXT STYLE UPDATE ==========================0 d8 `% S8 R' y/ S$ q# T* m. p
- ;=====================================================================
9 k. l& q/ c6 x! X( j ?/ C* T - ! `0 ] |; p2 C2 s, w
- (defun c:nS (/ tdt ssdt sodt index)
9 X/ ^; r' b; |, e5 S - (defun ObjName (ssdt /)% h! H) i7 T, G4 E6 y- J9 I: D
- (cdr (assoc '0 (entget ssdt)))4 U. H+ y6 {; H- F
- )
Q; m. p" o% ~$ w( f# U5 J - (defun MoPL (ssdt /)3 ^. S) W: N/ x' C: I
- (= (cdr (assoc '70 (entget ssdt))) 0)2 R, d. p4 a; A' C
- )
) a }& p( ]8 r$ J- Z - (defun NoiPL (ssdt /)
$ s* M$ D; P0 N3 {% P - (if (MoPL ssdt)
9 _# V7 }+ p0 @1 a: ~ - (command ".PEDIT" ssdt "J" "All" "" "X")3 Q/ R1 M7 B" O/ T, C* q6 R3 \/ s
- )
; ?4 {/ C) k' Z3 l - )- c' |1 j) J& S7 k, O
- (defun NoiLC (ssdt /)
0 }1 v# @4 g! ?' v5 J - (command ".PEDIT" ssdt "Y" "J" "All" "" "X"), l. A! ?7 x! _6 E1 q0 d7 I4 U
- )1 p/ ?+ _- Q- L; ~+ o$ w
- (setq" k: R0 f$ e1 K1 k3 Q7 p
- tdt (ssget)
) ]. z n, v* x1 t - sodt (sslength tdt)* o+ ?; z7 [1 y# L6 W, E+ |. c
- index 0
, A' w3 _3 E6 ` - )% C& Y1 ]' q/ w4 M
- (repeat sodt
& I' R- y) y' g+ Y% j! Z8 c9 O - (setq* H u& A: r. ~1 ^
- ssdt (ssname tdt index)- H/ d5 B7 @' p7 a% E& g0 N
- index (1+ index)
" s2 m( z! h A0 ]9 E6 X7 H - )( b( T. q8 R# @: k7 L8 a8 W' V
- (if (or (= (Objname ssdt) "LWPOLYLINE")0 k0 e9 v8 p- ?2 a
- (= (Objname ssdt) "POLYLINE")* Y4 K, @& ~2 t
- )
$ \/ G& R- }8 @8 U9 P1 X - (NoiPL ssdt)( S. E! m5 ~( [6 U2 a9 |. |1 e0 C
- )
. G! J0 c' Y+ j- l# V# Z i - (if (or (= (Objname ssdt) "LINE") (= (Objname ssdt) "ARC"))
8 I7 U& b+ G: Z) i. r - (NoiLC ssdt)
! |( e1 M' N4 y - )
( k7 a" z, L3 d& x - )$ S$ B: M; \) b: \* G/ W
- (princ)
, C$ k3 T7 H: u. A# ?5 \ - )
2 H7 C2 v& g1 Z5 m- h* [2 O
% U2 y$ w+ k$ ?, A) o- ;=====================================================================
( X3 g2 [* c8 R) D( x) r3 p' @+ f: k - ;;; AREAM.LSP
$ Y! r I( M/ c8 a' O! Z6 k, G: [$ z - ;;; Function: Calculates the total area of selected objects
# C. b% k) A% K% J - ;;; By Jimmy Bergmark
! [! @* r) L9 j, N3 w - ;;; Copyright (C) 1997-2006 JTB World, All Rights Reserved# X7 u) X, [+ w4 E
- ;;; Tested on AutoCAD 2000# N Q9 k' G0 ]8 i3 V
8 V/ I* Q9 D! o$ ]& M0 G( x- (defun c:ea (/ olderr oldcmdecho errexit undox restore ss1 nr en tot_area)
* _: z! G1 c: m6 | - (defun errexit (s)! F6 A5 J0 C, @7 E1 n
- (restore)
- o" j$ E9 o* R6 J7 }& u$ c - )+ Y" k( r/ R- V. T" S, _6 Y
- 2 H) y6 P+ y. O, C, ~9 q
- (defun undox ()
) Z5 o q* n3 j& i; E - (command "._undo" "_E")
' n- `- N& g5 x3 X9 F% C/ P - (setvar "cmdecho" oldcmdecho)3 X5 t9 H& A/ A0 |
- (setq *error* olderr); F; G1 |2 { ?0 W" B
- (princ)
! y9 a' j W& _+ t) `/ G - ); ]& i. F9 h" K: @; A# O( p p0 ~
- * }3 R0 z9 P) z2 [3 d9 T0 R" b3 L
- (setq olderr *error*
# u# m0 H" B/ x+ u% M$ d - restore undox
; J+ N2 T) ?( ~9 x& Z6 k - *error* errexit
$ ?* V7 N, K$ I - )
. ~ L6 A- P" H - (setq oldcmdecho (getvar "cmdecho"))
& ^, u0 G% {. b/ K0 x2 N - (setvar "cmdecho" 0)' D5 U, }/ y& c. a5 R% x. p
- (command "._UNDO" "_BE")
/ i5 _. {- k/ b# R5 T - (if (setq ss1 (ssget '((-4 . "<OR")+ D9 o; f8 }4 s$ y, q0 F
- (0 . "POLYLINE")* H1 G* G; D! h: x: i2 c" J
- (0 . "LWPOLYLINE")
1 o1 _. l4 G% {3 f - (0 . "CIRCLE")
0 W3 ?$ a* w0 l2 V7 B - (0 . "ELLIPSE")& B/ A6 q0 K" F W( S6 _
- (0 . "SPLINE")0 Y1 {- M T( c9 _# a3 S
- (0 . "REGION")9 P N9 U( a* c, L+ ^
- (-4 . "OR>")
, ]2 I2 P' m, B% v' Z - )
$ c- ?) e' S/ V' i2 a' c o8 _( d, k - )
9 a6 j. Z! k# F; }+ p; F" g- ]( O - )4 r5 V. r3 X$ X+ u
- (progn
( P% G4 E" z4 F0 N - (setq nr 0)( i* x% j5 R3 R7 q& M
- (setq tot_area 0.0)
$ \3 L/ u( U2 B- g - (setq en (ssname ss1 nr))$ I; F1 X+ ?9 A4 ?
- (while en8 n0 f; S# z9 e7 S
- (command "._area" "_O" en)
8 |+ S; B1 g( S2 h. @ - (setq tot_area (+ tot_area (getvar "area")))
) b7 K5 r* F2 b" |; r, z9 G - (setq nr (1+ nr))6 N' X9 v. F4 z) A+ @. Q. E
- (setq en (ssname ss1 nr))" |# e, P. v: a: b0 Q6 L
- )/ O$ \" r# W+ S t" v3 J
- (princ "\nTotal Area = ")
+ L- p4 T6 j8 _( v( f% w7 t7 P( _ - (princ tot_area)
2 K0 J/ _ ~1 q/ Z& O% d5 S - )9 E8 X$ W$ A# x& y' f; h
- )
' L% _1 H0 A8 O" X8 V - (restore)
8 R7 F' i% w' d! _* O9 _8 G - )4 N8 [0 c: w5 J# P2 t
- / i5 v" y- B4 L
- ;=====================================================================% l* {+ Q0 w# ~- R
- ;;; By Jimmy Bergmark: n3 w0 {) e- M9 m; Q' D
- ;;; Copyright (C) 2008 JTB World, All Rights Reserved4 h* b1 d4 _, P' m: h2 M
- ;;;
- P7 ]) z7 Z4 z% o8 d - ;;; Created: 2008-03-315 o4 l$ r w! g! H# q1 e. r
- ;;;
8 p8 {: N m, K2 y - ;;; Convert Attribute definitions to mtext6 t2 F) m9 B1 d9 A
- ;;;; z* G& b: { O# a; A1 }1 H) R
/ A$ Z4 r2 p3 `- (defun c:ATB (/ eset1 blkcnt en enlist tag1 ht pnt vl space)
7 R0 R' y w# k, J. F# ?8 ?& T - (setq eset1 (ssget (list (cons 0 "ATTDEF")))$ W7 ^% C; {8 S) j: v, S$ M
- blkcnt 09 [- b5 Z% ?' o" B0 |( a# O
- )
# Z& [) p6 C/ h1 p# N - ) G2 ]' l6 D! P- V
- (if eset1
% k% K2 a: `8 ~9 i$ n! H - (while (<= blkcnt (- (sslength eset1) 1))0 W+ K3 J \, T9 }) w8 R
- (setq en (ssname eset1 blkcnt)$ S. x8 c6 I: V6 {$ @1 S
- enlist (entget en)8 k5 {6 t% v) L
- ht (cdr (assoc 40 enlist))) D/ p9 ~; D) Z; T, k( H/ B) m
- pnt (assoc 10 enlist)
! g A( F5 B/ y& ~. R6 r- z - pnt (subst (+ ht (caddr pnt)) (caddr pnt) pnt)
6 g- a; @' D" K- z# A' e$ P9 ] - space (cdr (assoc 67 enlist))
. E/ n. x w4 J - )% P4 J. a& [0 e$ w. ^) a
- (setq vl (list
$ C4 @- Z; J w1 z; ?- v0 y - (cons 0 "MTEXT")
- U' |; a J/ ]9 `6 _4 f9 g( M - (cons 100 "AcDbEntity")
|6 _# {/ r U* g4 q: A - (cons 100 "AcDbMText")$ S' N% c( Y* U2 u* o. f4 O) }
- (assoc 7 enlist)
$ C) _* ]: q, t* d - (assoc 8 enlist)7 ^ y9 s6 I. \
- pnt( s! F; s0 R+ r* f* \' m
- (assoc 40 enlist)
. C% z2 [/ N1 T: c! j3 S- ^% s* p - (cond ((assoc 62 enlist))
4 K' C8 A6 G; v- |& }1 a - ((cons 62 256))/ ~ I$ h) E& t: j+ [# S
- )
% J+ I' }5 d. A7 n - (cons 1 (cdr (assoc 2 enlist)))" A0 P/ l$ G# U4 A$ F4 Q* I2 Q% d% s
- (if (= space nil)
- | w5 R: N! B; V2 Y& k. a. V - (cons 67 0)+ M# w# d" b# c: D# D
- (cons 67 space)
+ L/ o2 q8 g0 j t% D - )
, K6 b3 f( m w9 M. e- @7 V - )% {& q8 R% D) O( s( J# z
- )! M! p# {& N- H
- (entdel en)
- Q. o9 D& P C. r3 e% L ` - (entmake vl)
% J6 n6 r, v; p5 q" N- V - (setq blkcnt (1+ blkcnt)). [- x8 R' p; i- C
- )& Y: E: q9 S% d0 t6 i- I
- )
9 L/ Z% ?5 F1 P$ g% G; j! a - )
0 d/ y* R' U/ m9 J! e - ( m g+ C" V3 g& A, I/ ]2 _# Y* ~# t
- ;=====================================================================
% t$ C: H5 @9 u
& D3 v: B4 }4 f6 \# m/ m9 h- (defun c:xxx ( / cumdt dodai thoat dem ten doituong textxl dem goc toi)' \" L% b }9 t4 i5 ]& U
- ; Khoi dau cua chuong trinh
3 M( _+ [% P5 A3 D2 ^ - (princ "\nCopy Inteligent...\n")# p2 Z: j5 F+ @6 i9 @& ^. Y
- (setq luuecho (getvar "cmdecho")
0 O- [$ M U) x - luu *error*
Z* ~2 K, I3 F _- Z - *error* ketthuc
5 x( U! i/ w5 ^) X/ O5 O - cumdt (ssget)
* x3 f* |$ { K$ C) u - dodai (sslength cumdt)7 \- D& x& C) x6 u
- goc (getpoint "\nSelect base point:")( e3 v3 f# B& M+ g% G. s& [5 l3 u
- thoat nil
! ~; Z$ F9 g; r4 z/ Y) Z0 p1 H - dem 0
* {% L/ T" n* ]7 ~2 b - textxl nil0 Z, I x5 S5 t6 z! }* i: d( Q4 m
- );* r9 {4 ?1 J7 q% R: j' W7 T; \: i2 ~& w/ \
- (setvar "cmdecho" 0)
: Q$ U* |0 t' J: R( Y" p* C - ; Loc ra duoc ong text de xu ly
! P+ F8 b" h/ C" N I& e1 T2 m - (while (and (= thoat nil)
' S3 Z) D4 l" s) b - (< dem dodai)( f" K0 {/ L/ o( u% I1 y: o J4 _
- )2 `3 T ]8 ^2 J. D
- (setq ten (ssname cumdt dem)
, |( N7 d/ e. J0 T9 z3 S0 t - dem (1+ dem)
" D M A% }- l" q. o0 ^6 d - doituong (entget ten)
. q6 e2 G+ R: A& U0 v0 r0 T - kieu (cdr (assoc 0 doituong))
) j2 K: m" o) j. I, `# ~ - )
( F6 w9 I M* B( `' x: n8 F -
9 o4 [; T. p& I( R& V- W+ k9 c - (if (or (= kieu "TEXT")
4 g& q, R: _+ b! p6 M+ {, X - (= kieu "MTEXT")
! G# P9 `9 L8 K2 b - )- b$ U" r! k8 n- G' ^4 d+ }/ F! I7 u: c
- (setq thoat T
4 v: n# T, W& n! m7 R - textxl (cdr (assoc 1 doituong))
0 d0 w, D; \9 v, P6 k0 r - )1 `, m4 X4 t, r4 k9 z2 A5 Q- P
- )
; v+ r. s [+ k9 O ^3 V, T - );
" F0 L5 r5 A9 s/ f+ o5 U - (while T t( W/ H+ {! Y8 q l( }
- (setq toi (getpoint "\nSelect next point: " goc)
! H; d4 Z7 [/ B. T1 c: T - vitrilech (list (- (car toi) (car goc)) (- (nth 1 toi) (nth 1 goc)))
0 w7 ?# a# n! r- @! D' O2 A - dem 0
7 Q/ e7 g2 h3 M. m: `9 O& T - )! o: N/ p# {% [4 c' j/ c) Z3 S" a$ O# K
- (while (< dem dodai)
9 g. f, y0 p7 |9 ]# o/ D - (setq ten (ssname cumdt dem)$ o$ p0 ~8 w6 s2 o) I( T8 }
- dem (1+ dem)7 R* n- x! y; X! `5 t' r" \$ L& s
- doituong (entget ten)
9 ?8 q, S) I! b. n8 ? - kieu (cdr (assoc 0 doituong))
8 S8 |. w/ o$ ^/ ]3 |, B* w+ I - )' a( l+ L2 R6 w: ?, m3 L" F+ P
1 I( F& Q) \" T$ p6 e$ s/ K- (if (or (= kieu "TEXT")
" `* Q ?* _, v+ o - (= kieu "MTEXT")
7 o( }/ Z1 d1 s! j; o r - )
+ G. \4 C( m L: K8 R2 K0 U0 c - (doitext ten)
[. u1 y" s4 b4 e0 O U1 b5 l% l6 T9 W - (copy_dt ten)0 l- x% X( `1 s' j6 W% D# \9 n
! [- K' L, u; B0 z* ]9 W( v. V) l- );if; ]& F5 ~2 w* k. e( J3 ?
- )
; i! I, ~% x! @# X. o% w - );while" g1 E( B% Z. j) C& C9 ^
- (ketthuc)* T, K+ j) Q9 ]5 e+ L5 c. H
- );defun, j" A7 i$ C+ w: {3 o% p7 ^
- (princ)
$ ~( m7 o+ k. r' I+ @: U. q& n% ` - " O2 J6 [6 l4 R0 D1 e
- ;=====================================================================+ O- l: }& F G9 \& `
- ;;; By Jimmy Bergmark u# g3 s: G- N, N7 r e, J
- ;;; Copyright (C) 2008 JTB World, All Rights Reserved
* m6 v0 D5 I3 o+ l - ;;;
# ?0 w h9 y. t+ U9 i - ;;; Created: 2008-03-31, L- A$ r, [6 J4 }; t
- ;;;* J- I# t* k& x
- ;;; Convert Attribute definitions to text
- z8 ~% n: r0 i# B7 T - ;;;$ b3 D- }3 K: x& m" s% Y1 {
- 6 s9 r/ e4 } W1 V. m( ~, P
- (defun c:ATT (/ eset1 blkcnt en enlist vl space)8 E1 `5 e4 u: L6 U5 y- b
- (setq eset1 (ssget (list (cons 0 "ATTDEF")))3 Z( V( V2 [& T% k
- blkcnt 0, M+ v) s" s- a
- )3 \# i. z F" G8 R7 ?, A
! @4 G& d4 J2 W6 q0 T) a9 l- (if eset1) m3 C5 y& z2 B. z$ P: h
- (while (<= blkcnt (- (sslength eset1) 1)), l6 ?, D+ C& a% Y S+ h
- (setq en (ssname eset1 blkcnt)$ j9 a' ~* K- ]
- enlist (entget en)1 ^0 q, d0 _9 ^! e6 l9 g9 x; s
- space (cdr (assoc 67 enlist))1 S+ A9 w/ \- h$ _4 q- r
- ). A1 h5 I9 @8 U5 z
- (setq vl (list
6 d1 V0 ]# d- s5 T* H - (cons 0 "TEXT")
# A5 U1 l5 c' s% I2 R+ r: [ - (cons 100 "AcDbEntity")
0 E0 ^% ?$ q! b* A, e1 s$ k" F - (cons 100 "AcDbText")
" T, N# D# U) ?7 i+ }, y - (assoc 7 enlist)5 v6 ?8 [. M& Z) r6 p. U' w# x
- (assoc 8 enlist)7 S- P. r5 ]/ J2 _5 A: `
- (assoc 10 enlist)3 f0 v* G& Q# \. i* j- L, N6 y3 [: B
- (assoc 40 enlist)) b7 A- u8 h1 J% W- K
- (cond ((assoc 62 enlist))5 o- p- d" s, r) `3 a5 V2 j( g0 c- E
- ((cons 62 256))
4 e) ^' X. m- ^- \ - )2 [5 j0 i* }: g O: n3 c
- (cons 1 (cdr (assoc 2 enlist))). E0 h1 X ]# }7 C: K
- (if (= space nil)$ i" Q7 e/ M& Z4 @. [
- (cons 67 0)
% } O- w/ B: S9 Z. O/ N/ j - (cons 67 space)# f# U4 p; W; y) ~! o0 h
- )4 |9 Z% P: p+ }' t
- )) @+ B n: `' }9 U
- )
! v, e3 c, {. H - (entdel en)
6 Y$ d( W! |5 v% B( V2 Z - (entmake vl)7 }% w9 f: G" _ \/ r
- (setq blkcnt (1+ blkcnt))
6 x3 l* B# {! o* m3 @ - )
% g( z# ^3 Z- l9 r, \ - )
5 \8 Y/ l) P6 a7 @, ], d/ `2 l - ). `2 {9 ~: K9 r$ J* v/ v
- ;=====================================================================/ Z3 n% L s0 ]6 x# N
- ;============================ Doi Truc ===============================& C/ q3 d7 k* p. F$ V
- ;=====================================================================6 [& G3 b6 a7 x9 l1 g5 N
" }6 y1 z! a( I- ;=====================================================================# `+ i3 B5 m+ l/ m% d
- ;=============== FUNCTIONS GA 1+3+5+7+9+11+13+15+17+19 ===============
" w4 x$ u1 F+ O, s' y+ r - ;===================================================================== e; J+ o! R! d% c- E. j
- (defun c:ga1 ()
- \- u3 ?( i# @( z% d4 R2 J8 q - (setq a (getpoint "\nChon diem: "))2 {$ f7 M+ T4 q& B0 G! R% E& }0 |
- (setq b (getpoint a"\nChon diem: "))
+ i! `: @9 u) g3 l- X - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))3 G8 }' z8 c4 N1 R' g; `
- (command ".circle" c a)
5 _8 {+ Y7 K+ B5 `1 M - (command ".line" a c "")4 Z. H* @3 L4 h m" J
- (command ".array" "last" "" "p" c "1" "" "")
) c6 l& \1 U$ P! s' |+ B* n9 r# [ - (princ))9 S+ M m2 g2 b- s( M* P |
- $ Y/ u( z2 j6 H" r9 a& r
- (defun c:ga3 (); B9 S1 y( _& s* R3 ~0 W/ y+ M
- (setq a (getpoint "\nChon diem: "))& P8 u) K3 o# F* i( E7 F
- (setq b (getpoint a"\nChon diem: ")). W# w; L8 g: n" c8 r: [: @* X( d
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))( {' Z6 }1 N: } g( Z
- (command ".circle" c a)3 }6 l, d8 Z4 F6 a, x/ L1 A
- (command ".line" a c "")
- }/ p- O) P. T( w2 a# L1 {) h - (command ".array" "last" "" "p" c "3" "" "")
6 J. t5 _* G6 `% j# `0 t - (princ))& S0 I) F& t7 n( g, p
; S Z. [9 q! w, ?- (defun c:ga5 ()
% B ~+ i1 ~. r$ ~4 V! P - (setq a (getpoint "\nChon diem: "))
" ]9 Q, D# x3 P) ` - (setq b (getpoint a"\nChon diem: "))% j: ?( ~& F3 n
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
/ h/ H8 J1 V, s% r" w9 f - (command ".circle" c a)
( F% @/ g0 b( X - (command ".line" a c "")$ J; [& i6 y0 a; \
- (command ".array" "last" "" "p" c "5" "" "")1 H8 a O, Z. }5 {
- (princ))" S( a6 }3 j1 U1 I& N: B) d7 x s+ ~
- 1 P5 N8 _+ f2 ^
- (defun c:ga7 ()
9 B1 h7 A8 q( N2 Q3 U - (setq a (getpoint "\nChon diem: "))
' t1 `8 c. g! _ - (setq b (getpoint a"\nChon diem: "))
! p- P/ ^% V9 G - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))) y+ o/ i) k+ a, A
- (command ".circle" c a)
; `0 J( s- Z3 ?0 ?8 |1 a - (command ".line" a c "")
, n: m* s2 G' h+ n* M - (command ".array" "last" "" "p" c "7" "" "")# }3 e# \7 p! Z- ]. B: u
- (princ))6 j! t& S) q, k: G9 I
- # l% n: u b$ h5 Y1 m( t
- (defun c:ga9 ()
2 m) p- ~ o6 l6 | - (setq a (getpoint "\nChon diem: "))1 Q7 N3 m( q6 I9 o/ V0 |
- (setq b (getpoint a"\nChon diem: "))
. i6 S' ~. w7 w - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
5 Q6 G* U i* k$ q - (command ".circle" c a)8 m' ]2 E% U& R3 O
- (command ".line" a c "")
' O6 S4 `- p# I0 B7 [! h+ g - (command ".array" "last" "" "p" c "9" "" "")
$ `% R5 u2 \) r7 \2 ] - (princ))" M$ ?' k- V& J( r
- 1 W" a( B8 `" `3 Q5 J d
- (defun c:ga11 ()5 H) V6 p; q$ K+ r# N/ @! X" L" m
- (setq a (getpoint "\nChon diem: "))
% E8 P6 p/ _6 @5 l - (setq b (getpoint a"\nChon diem: "))8 @4 x! \/ e$ w) U, \: X
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))( a+ r0 I+ ~& `! y9 {
- (command ".circle" c a): B7 Y8 f5 p7 m1 p% w( d! W/ ?5 o
- (command ".line" a c "")5 C% r& e: I% V: i8 u/ N
- (command ".array" "last" "" "p" c "11" "" "")6 n: e1 L% m/ D T. @& ?' J4 h
- (princ))
8 r8 J7 S* m. w5 v3 Y5 U - , ^6 m1 v! E: W
- (defun c:ga13 ()
* q+ N) ?: x% V: \% J8 T# s - (setq a (getpoint "\nChon diem: "))
7 v) n3 m. D! X, L( h - (setq b (getpoint a"\nChon diem: "))) W9 {9 A) r; L! [& K9 ~0 K, V U
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
; l3 d, I `, Y& L0 s% j - (command ".circle" c a)- u" A8 H$ e2 A- j: c; k2 l2 l, H
- (command ".line" a c "")
6 D% w" K O1 h* W1 H/ ] - (command ".array" "last" "" "p" c "13" "" "")
' h5 A' N( _1 n' b9 j) [4 w w - (princ))% h, T' ^* p1 x. l
- : W9 J& R6 p3 d* e. i7 |
- (defun c:ga15 ()
0 ~4 w) X5 X! R2 ~( R2 n' [ - (setq a (getpoint "\nChon diem: "))
7 C+ F( p; T# I5 ?. b3 K2 c' ~ - (setq b (getpoint a"\nChon diem: "))
$ K: u+ `- i( W* Y( B/ @- a1 r; u - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
* k1 h, `! f; r - (command ".circle" c a)' e5 x; \0 A( C: ?- N
- (command ".line" a c "")0 u( C( |" Z8 {9 Y% J& I0 {
- (command ".array" "last" "" "p" c "15" "" "")/ r' T( f& ?4 w$ g" Q( E* E" e
- (princ))
4 [$ N7 j# _* C8 f" M
. d+ x+ M9 l, t6 `5 c- (defun c:ga17 ()& C/ i$ q1 o6 {4 p5 U _, k
- (setq a (getpoint "\nChon diem: "))7 A& ]# }6 \& V b7 j; h9 S& R
- (setq b (getpoint a"\nChon diem: "))1 [; _6 S6 H. ?) X" R& `, F: f
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))) X) R" B' r7 ?( t. @/ j9 ^
- (command ".circle" c a)
* D5 U% n! f0 o% ^ n - (command ".line" a c "")/ G- t+ _, q2 S4 @7 p; B+ Q" ^* l
- (command ".array" "last" "" "p" c "17" "" "")
0 S2 Q" w; r) `% R. s - (princ))1 G. a+ R" e$ ?6 y% d
- - ]0 L) }' W( Z1 S
- (defun c:ga19 ()
+ E0 o% m& B) C0 ?" u - (setq a (getpoint "\nChon diem: "))+ z7 n8 F! C' a! u- o1 h3 L
- (setq b (getpoint a"\nChon diem: "))) D$ e0 x2 i+ N$ }. ?. H
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
: `5 V6 X! U1 J }) Q. r! t - (command ".circle" c a)
9 e! h' }# c* I X - (command ".line" a c "")3 ^% P' W- I3 {+ u3 c
- (command ".array" "last" "" "p" c "19" "" "")1 c2 b# p+ M3 L# d( z
- (princ))9 L" [, ^9 b9 I: w, i# a
5 i6 X0 e, J, |- n8 l- ;=====================================================================
8 b" k& T# `9 Q" R# B - ;============== FUNCTIONS GA 2+4+6+8+10+12+14+16+18+20 ===============
A( k4 X+ Y @/ o3 U) E! z. n9 w# [# y - ;=====================================================================
& G( F: P+ s( T - (defun c:ga2 (): A/ [8 I8 e" I& D5 k2 U8 M6 f
- (setq a (getpoint "\nChon diem: "))! v: O# ~% C; d/ V' z: M
- (setq b (getpoint a"\nChon diem: "))6 ]3 g% i7 ~. {0 z! i+ g
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))4 I5 S# C1 j, N! l6 E& z
- (command ".line" a c "")* I& c! W* z. A1 p# k$ V
- (command ".array" "last" "" "p" c "2" "" "")5 V; r B/ u- D2 p
- (command ".circle" c a)+ q# q* h/ E! }2 x
- (princ))5 H! U7 D/ H: p
9 ?$ M0 ^* O7 d- M5 ]- (defun c:ga4 ()
/ w _% |- r6 | - (setq a (getpoint "\nChon diem: "))1 ?5 F L$ C9 x$ q! ^3 h
- (setq b (getpoint a"\nChon diem: "))9 ]* w: R3 i. P1 E
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
/ K/ E4 G. a) ` l2 {( R3 n8 C - (command ".line" a c "") }7 U% U' a, T3 Q8 B2 F
- (command ".array" "last" "" "p" c "4" "" "")! w5 x% o t/ x- r. s4 S
- (command ".circle" c a)
$ q1 S0 L- F) e4 A( f4 l - (princ))
8 k0 Z! Q9 x9 Q% M9 ^
* y; V0 @1 L2 _9 d- (defun c:ga6 ()
- g% H& J. K6 l6 W+ E0 K8 n - (setq a (getpoint "\nChon diem: "))2 i) a2 [' G& K" u3 g
- (setq b (getpoint a"\nChon diem: "))
6 \( x# \8 b* J7 u - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))! q5 d: N% d) \# l
- (command ".line" a c "")" e0 H& v+ \( C, l1 e
- (command ".array" "last" "" "p" c "6" "" "")
; y/ w: J2 S4 E7 J% G; | - (command ".circle" c a)9 \3 _% r5 j6 f
- (princ))# P0 K: D, U0 d/ g, B/ C
/ m9 P1 x' U0 F1 l# X- (defun c:ga8 ()0 Y7 u& Z2 a0 B/ P
- (setq a (getpoint "\nChon diem: "))
; y2 K$ Q, T3 Q, T6 \ - (setq b (getpoint a"\nChon diem: "))3 i: z8 L# s( s- Q6 e! d( {
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
5 k1 ~, r4 u0 k' Q1 _5 K& | - (command ".line" a c "")
7 L3 N2 O- _. i8 Z - (command ".array" "last" "" "p" c "8" "" "")
% V; c% O' p' d2 i! w# g5 ` - (command ".circle" c a); e/ I% Y: {' C
- (princ))6 L6 U* O# Q5 q! c2 @
- 2 L* T4 x. w( |8 u4 E. ]
- (defun c:ga10 ()
]$ A2 ~8 D% V. k( {1 K# j - (setq a (getpoint "\nChon diem: "))1 q) }$ g( u7 `. P) l7 N
- (setq b (getpoint a"\nChon diem: "))
4 T, j" H0 B0 J, L3 m - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
7 |& k' M$ ?+ f; o# ~+ p" L v - (command ".line" a c "")! E+ @8 s* h& H* T# g6 d
- (command ".array" "last" "" "p" c "10" "" "")
4 n8 x# i9 j. S) v+ I9 L' N& N - (command ".circle" c a)
8 F+ N4 n+ G' @7 D - (princ))
8 j" c+ Z z: E8 k/ o
8 s/ J, F6 [* J# C; f, `- n. i- (defun c:ga12 ()0 e8 b8 [# T5 F
- (setq a (getpoint "\nChon diem: "))
8 Q$ J+ C! n# S. I) B6 ^4 Z - (setq b (getpoint a"\nChon diem: ")); }+ o- U; a6 C- S
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))% t \; w8 n/ W6 f
- (command ".line" a c "")5 ^8 P7 p- k1 g3 k" i
- (command ".array" "last" "" "p" c "12" "" "")
. u. e& Q8 V1 _2 E7 ?: s9 w - (command ".circle" c a)+ @3 ]. _5 N$ d7 j% ?' P
- (princ))' r4 I+ f0 q7 n1 H7 [7 w* J" r
- + v7 p9 p9 J ]2 `& g) b" J
- (defun c:ga14 ()( d* r. S5 M' m6 b3 W
- (setq a (getpoint "\nChon diem: "))
5 _1 O8 D% C5 F5 \9 E8 G3 w - (setq b (getpoint a"\nChon diem: "))
9 D" G e0 F' e7 P& L+ S2 X5 [# C - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
$ \5 }, G9 e! \ - (command ".line" a c "")
/ U% Y7 U4 C# m* t% b: S7 H# `- \ - (command ".array" "last" "" "p" c "14" "" "")
1 r' j$ |/ ~. u P" M - (command ".circle" c a)" j* F) g, E- {" w* e/ ]% j
- (princ))
c: {) N9 q5 m1 \ - ! L8 R/ U7 T& P$ a) F5 W6 l6 A
- (defun c:ga16 ()
! y( V9 T) ~3 E# r - (setq a (getpoint "\nChon diem: "))
+ z' d4 P+ D6 p - (setq b (getpoint a"\nChon diem: "))
4 Y. {* R4 K8 x8 k$ L - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))5 o7 i* o* j+ F5 t$ A! B
- (command ".line" a c "")
, j0 a7 w) e% Y - (command ".array" "last" "" "p" c "16" "" ""), W; z$ Y/ \( i6 f s
- (command ".circle" c a)
0 r$ ~! y9 h+ ~8 b _7 K" U% r% J - (princ))6 @+ k) t9 b" G$ b9 C
- K" b \, X8 D/ _! O# j, ~
- (defun c:ga18 ()
& i) s# F: q: ~: Z. {, J' m+ N: D8 Y - (setq a (getpoint "\nChon diem: "))' y1 s7 c" j0 ?9 b; {; O
- (setq b (getpoint a"\nChon diem: "))1 L1 ^- j* ~: w0 I0 u. ^$ Y
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))) p- ?' _( N2 _( R
- (command ".line" a c "")
3 z3 d# T- D3 c' u2 b - (command ".array" "last" "" "p" c "18" "" "")7 V) X' `% \4 U+ c, k1 v) l
- (command ".circle" c a)
, O% L p/ U2 ] - (princ))
" X8 V7 e8 J( g4 b( k
# m& m+ i3 ~. N: r7 y" n- (defun c:ga20 ()
. \) M4 P% Q6 D! |/ E: C0 ^+ l9 j - (setq a (getpoint "\nChon diem: "))* I5 B2 e1 e% k5 j( f
- (setq b (getpoint a"\nChon diem: "))5 R+ T* C" M* D/ b- n6 s
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
3 o' G Y$ D. F/ o. m- ]* P - (command ".line" a c "")" I; X4 u4 l0 {$ I1 C
- (command ".array" "last" "" "p" c "20" "" "")
* t" S: }, v3 h( @ - (command ".circle" c a)$ b \8 T) ~' {2 P
- (princ))
- `& i* n8 W) J; _' r' V5 N6 y/ A+ z - ! m' m# v% x/ j# _
- ;=====================================================================4 S ? }) f, X# m, C% D P
- ;============== FUNCTIONS GA TUY THICH : EVERYTHING IF ===============
6 e+ o2 W2 l* j. d3 Z9 P% |0 N - ;========================== 06-11-2016 ~ 18h00 =======================/ B& U5 M2 v) i' x
- ;=====================================================================
! f3 a3 V# o! k - (defun c:ga ()
) `: g8 B; r* Z( J& H5 l# T0 k - (setq a (getpoint "\nChon diem: "))4 i, W" }( c; O( _& c0 U- B. w
- (setq b (getpoint a"\nChon diem: "))
0 [. Z& x( I, w/ M* X - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
; A9 j" Z5 ~" W+ n/ z - (command ".circle" c a)* m- z7 u2 P; L* h* C3 e
- (command ".line" a c "")
1 Q, ^6 ~. _$ [0 {/ t - (command ".array" "last" "" "p" c "NUM" "" "")% @. g' f% h2 O
- (princ))
5 l% v9 B3 ~) t1 Y% @, ^( W - J3 C* N. a4 x
- ;=====================================================================/ e8 g/ p# [- U$ L) j/ s
- ;=========== FUNCTIONS HOA THI TUY THICH : EVERYTHING IF =============8 e6 O% j3 I$ K: P" x& f1 t
- ;========================== 06-11-2016 ~ 18h40 =======================& s) N& _8 ^& A1 @
- ;=====================================================================3 ^( B4 {2 O9 B0 k$ a% a+ g5 r$ F9 r
- # f X1 q( l- I2 F
- (defun c:hoathi ()
2 |- @( z L7 f! b9 l0 a - (setq a (getpoint "\nChon diem: "))
; t! P- N3 a* w# q& S7 ? - (setq b (getpoint a"\nChon diem: "))$ I0 P8 ]+ a3 T% Y
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))); S& U/ R+ ]9 L: ~. X
- (command ".line" a c "")& ^2 {& B: S* A7 y7 ~
- (command ".array" "last" "" "p" c "NUM" "" "")1 L, R+ \1 n& J- p" ~9 T
- (princ))
# \+ f$ C3 l$ `4 p) Y
$ L2 i1 ]; J- F: m" ~# N- ;=====================================================================/ G; i; N2 P* z/ l( G9 a
- ;============= FUNCTIONS CUNG TUY THICH : EVERYTHING IF ==============
' c- z0 x6 W9 p t; G - ;========================== 03-11-2024 ~ 19h33 =======================; }- h' q+ Z$ X, k* Y- i
- ;=====================================================================1 s2 C$ N. {& G* M5 {& Q
- / |* ~ P3 {& c/ }
- (defun c:cung ()/ A9 o& |# r' n4 S1 c" H/ {& r5 H
- (setq a (getpoint "\nChon diem: "))# ^+ D: R6 \/ `- \6 F$ m/ J
- (setq b (getpoint a"\nChon diem: "))$ { q" a, c o+ b+ u4 j
- (setq c (getpoint a"\nChon diem: "))0 W* y, v5 b+ g# f/ D& v; s
- (setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))2 c. A/ X" L1 p( W
- (command ".arc" a b c "")
6 X# d$ Q! D2 C" `3 C/ ^7 V C% ]8 | - (command ".array" "last" "" "p" c "NUM" "" "")
7 d) a. w6 H" w# b- t4 S! B - (princ))1 w# T" R8 L8 V/ x
- , T, `- Z6 ^# A) \. [8 Y, I0 q# ?) H3 Q
- ;=====================================================================
( ^ @2 t: n y! z `. c( P* L9 r! R - ;============ FUNCTIONS HECLOIC TUY THICH : EVERYTHING IF ============
3 @+ o$ [% I- Y2 a' m1 s - ;========================== 03-11-2024 ~ 20h02 =======================
z4 F5 @. l, V - ;=====================================================================
1 W8 ~6 e: p5 p- N I" s& G
6 J% ~( N; p6 U- g% L; C: \9 q- (defun c:hecloic ()3 F) b# O% K# ?7 a
- (setq a (getpoint "\nChon diem: "))+ g( H* G6 q) n1 ?. j3 z( D
- (setq b (getpoint a"\nChon diem: multi "))
8 m: u( G0 G9 e- D& C$ X - (setq c (getpoint a"\nChon diem: "))(princ)
* @5 A3 M# S! K/ f# m% F - (setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
T) O4 R* o3 G9 `1 v* Y - (command ".arc" a b c "")
+ z8 M4 ]+ W+ R$ H - (command ".array" "last" "" "p" c "NUM" "" "")) J; I: i4 Q5 b) S* [
- (princ))
! f7 g/ C5 i" ]5 J - ) L- P, Z$ O) N7 _4 K+ m
- ;=====================================================================2 c8 k U' |* ~3 l! u7 H
- ;============== FUNCTIONS GAY TUY THICH : EVERYTHING IF ==============
" J# q1 e" A# h1 T4 v - ;========================== 03-11-2024 ~ 19h38 =======================
2 [9 I J9 w4 f1 d" `3 p) k - ;=====================================================================
/ I J; h8 a7 D1 w; T" L, A, m - ! m5 a( J8 v5 |' A
- (defun c:gay () o/ P! t+ B! j
- (setq a (getpoint "\nChon diem: ")). o( O% Z+ |5 g
- (setq b (getpoint a"\nChon diem: "))
7 O9 [( H4 [" Z* M - (setq c (getpoint a"\nChon diem: "))(princ)
( r+ ^- H2 f$ H! j - (setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
' m* m7 E; s9 S0 c+ B* f+ }& n - (command ".pline" a b c "")
) e: o/ E+ l5 q. K3 I - (command ".array" "last" "" "p" c "NUM" "" "")7 a/ Y: I. O, C Q, p
- (princ))
$ a8 k( k# F+ n8 m2 j4 @ - 1 O H( Y: A$ F* n
- ;=====================================================================5 i, P9 J3 p! }! V" `
- ;============ FUNCTIONS HECLOIT TUY THICH : EVERYTHING IF ============4 V2 B, O$ o1 y K1 a
- ;========================== 03-11-2024 ~ 20h02 =======================( ~" F# O# F- x8 A
- ;=====================================================================
$ E4 L5 O0 l3 u& x% c B - ( A5 Z0 O+ W u/ T$ V1 J
- (defun c:hecloit ()
- a/ q* s3 r0 e" { - (setq a (getpoint "\nChon diem: "))
9 C1 ^& z, M# k* c& E6 ^+ s9 A" y - (setq b (getpoint a"\nChon diem: multi "))
- w& }6 h* `+ n D) { - (setq c (getpoint a"\nChon diem: "))(princ)+ F8 w. J! r9 d( N3 y7 F; |* r
- (setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))# L& \' S! a8 D |8 k: d# h
- (command ".pline" a b c "")6 ?! T/ e" F( G* [4 \. e( p- `% a: w
- (command ".array" "last" "" "p" c "NUM" "" "")
9 d6 S l" z/ E* C! }3 l) X9 l - (princ))
" Z6 _! b) `% ^4 |
+ A& Y5 \% V3 K( b$ J# x- ( `/ q& y: P7 V
- ;;; ============================ Merge Hatch =============================
% |7 o/ _& A8 f3 Z7 g0 O! ]( g9 I - 1 @2 G6 ^4 Q- ~% ]7 X* g
- (defun c:mh (/ ss entht sl i dt dtht)
3 b! c, l: b `; r" k6 n e5 R6 o - + C6 x c7 {8 Z2 p
- (princ "\nMerge Hatch - free lisp from CADViet.com")# P. E" Z/ G# ?& o" b
8 i) t6 e0 @5 D6 {- (setq
. I6 q+ G( Y) ^9 b# R% A - ss (ssget '((0 . "HATCH")))7 ^3 R7 U$ t; w {, y& `2 K% o
- sl (if ss+ t$ U, E0 U" {' Q# X1 z7 f
- (sslength ss)" M) G. j5 `8 P" C+ [ v! _& ? U& [
- 00 i A4 ^6 }- b. `- [% h
- )
+ l; o4 ?# X2 M% B6 z - i 0# t+ C( w: [" h8 R
- l 0" U9 v! z6 w2 H) N/ j1 \7 r, e
- )
; [, ^- \% B- d+ w8 b
6 O B' b: n. t- (repeat sl
. t( {: n% }1 C' h1 R - (setq4 o8 c0 S4 r: Z) g# W, C& a
- entht (ssname ss i)
' A S, L0 q, G7 s/ B - dtht (getbdata entht)8 Z( P9 b( k/ m& d% z& u& h
- dt (append dt dtht)
" c9 ?: O2 A- _3 L0 A0 K5 { - l (+ l (cdr (assoc 91 (entget entht))))1 J: }/ J, z$ e
- i (1+ i)
9 _4 r: j" K3 L - )
* I0 b8 ]( V+ h - ), u: m/ v7 |/ k; F" H: X0 C8 u
- : ]) H. _% X, i
- (setq ent (ssname ss 0)
7 h3 N2 t, z( G0 X! K - ss (ssdel ent ss)& L- a x/ N; Q& @% W& |1 }( f
- tt (entget ent)0 }9 e1 W* y& I! Y0 O j
- duoi (member (assoc 75 tt) tt)0 K: }6 _ ^2 F+ |! z& b* g: z
- dau (reverse (member (assoc 91 tt) (reverse tt)))
5 V6 J3 p+ O* C! t% N - tt (append dau dt duoi)
0 Y/ u( Q3 f$ O( k: {# T - tt (subst (cons 91 l) (assoc 91 tt) tt)+ `( G) z& D# d$ t. r f
- )4 i' Y; Z& j/ Z2 L/ K3 c4 x! B
- (entmod tt)
- k3 O7 c) N0 m+ [ - 9 L P& q7 f( L
- (command ".erase" ss "")
$ G( O; I) c7 k' u) \( c7 |7 F9 n1 e - (princ)6 |( `" z/ D' @: C, b. v3 K, I
- )9 L) S" N w7 }
5 x2 d, s R2 c8 V- (defun getbdata (ent)
k# z0 ?: @5 M0 i( X4 p4 F - (setq tt (entget ent)
% ~. s4 q% d/ v/ P0 e5 t - tt (cdr (member (assoc 75 tt) (reverse tt)))
' t: {% H4 R0 N2 e. |6 ] - tt (cdr (member (assoc 91 tt) (reverse tt))); i7 A7 k: G8 ?
- )
1 p$ g+ U. |! n. d: }! W - )
, A: K' i) @6 _/ k
; b/ a2 Q$ x! Q/ o
8 F" s% ?9 T* f Z- (princ)
4 Q A" s7 c$ |. B, w
# h7 h6 j; l* }2 v& N0 A/ x0 G+ N) k- ;;; =========================== CAC LENH LAYER ==============================
- a0 g4 L9 T; N8 h - ;;; =========================== Layer hien hanh =============================
- o& |# P3 G6 l - % \0 H1 a3 j8 `3 P9 F
- (defun layset (/ LAY) (setvar "cmdecho" 0)% V. k( H; ?4 T% g* O2 u7 o9 n
- (setq LAY (entsel "\nPick vao doi tuong muon Layer hien hanh la Layer cua doi tuong do : "))' h+ d: q0 G: J; n* U
- (if LAY (progn - R, ]2 Q; J% m+ s' @
- (setq LAY (cdr (assoc 8 (entget (car LAY)))))% @ i% G9 i) M
- (command "_.layer" "set" LAY "") (princ (strcat "\nLayer : " LAY " da la hien hanh.")) )
0 U9 q6 x7 l+ L) _6 J" E1 c9 L - (progn
% L% M3 ~8 k* L- N - (if (not ddlop) (load "ddlop")) (if (setq LAY (ddlop))
8 W) r9 u3 x a+ ]) o$ K - (progn
' g/ o1 z& Q' U- K - (command "_.LAYER" "ON" LAY "THAW" LAY "SET" LAY "") (princ (strcat "\nLayer : " LAY " da la hien hanh.")) ) ) ) )(princ) )
$ }8 j9 D1 E+ M9 k5 Z - (defun c:LLL () (layset))(defun c:LAYSET () (layset))$ d- K* M8 {: b
- $ v' @3 p; @$ j: ?3 @% j5 o% j: L. w
- ;;; ================== Cap nhat doi tuong vao layer hien hanh ==================
$ H% c+ R4 S2 e8 ~ d/ I) ?* M - ! O+ t V9 m& p3 x1 C, p
- (Defun LAYCUR (/ SS CNT LAY) (setvar "cmdecho" 0)0 H% L' _3 R8 L! y# Y! |
- (if (not (setq SS (ssget "i")))
, b% L3 i W2 Q/ n( T' j - (progn (prompt "\nChon doi tuong cap nhat vao layer hien hanh: ")+ W" B# f: W1 G! v
- (setq SS (ssget)) ) )8 m) }* F9 l# K+ U
- (if SS (progn
: o- _6 ~5 B$ _- j$ p+ } - (setq CNT (sslength SS)) (princ (strcat "\n" (itoa CNT) " doi tuong tim thay.")) (command "_.move" SS "") # v6 V7 p; Z* U& Y9 _
- (if (> (getvar "cmdactive") 0)
3 X# b' S5 ?3 } - (progn
3 _4 z/ x" ?* y1 A! {; y( Y3 \( O - (command "0,0" "0,0") (setq SS (ssget "p") CNT (- CNT (sslength SS)) ) ), W5 A5 _% u3 C @7 L7 b
- (setq SS nil) ) (if (> CNT 0) ! v9 b: [; [2 v- k/ a5 K
- (princ (strcat "\n" (itoa CNT) " doi tuong tren layer LOCK.")) ) ) ) s+ v6 c1 H' p
- (if SS (progn, j* |6 N5 C7 P$ y4 S
- (setq LAY (getvar "CLAYER")) (command "_.chprop" SS "" "_la" LAY "")+ `8 S: K: G+ }! s& s2 V: e
- (if (= (sslength SS) 1)- h/ o6 A4 r* c( `
- (prompt (strcat "\n1 doi tuong da cap nhat vao layer : " LAY " (layer hien hanh).")); y: Z& H6 E* D3 \
- (prompt (strcat "\n" (itoa (sslength SS)) " doi tuong da cap nhat vao layer : " LAY " (layer hien hanh).")) ) )) (princ) );end9 e$ l: Y# u# _* P" P; J# Q& U
- (defun c:LAYCUR () (laycur)) (defun c:LHH () (laycur))/ z6 V; I7 f0 N! L2 o E
- - n u+ o: Z! D6 |- A
- ;;; =========================== Layer Iso ===================================2 N" v; L3 E3 R B- W d" v
1 q* r, ^7 w8 l; X4 Y- (Defun LAYISO (/ SS CNT LAY LAYLST VAL) (setvar "cmdecho" 0)% _& `, k8 B% K; [
- (if (not (setq SS (ssget "i"))) (progn6 F& z( o# }' g' ^& }
- (prompt "\nChon doi tuong tren layer(s) muon lam viec doc lap: ")
' q% b* p+ _. L0 L ~" v, J3 p - (setq SS (ssget)) ) )
$ `0 u/ Q* b3 ?, P+ t$ C4 w - (if SS (progn (setq CNT 0)$ t% Z8 o0 \ t8 H2 ?6 `, b
- (while (setq LAY (ssname SS CNT))
! {- T# `! R6 _1 p/ z - (setq LAY (cdr (assoc 8 (entget LAY))))% c) R: x5 Z N! U
- (if (not (member LAY LAYLST))+ _; \9 h+ v! Q( N0 O
- (setq LAYLST (cons LAY LAYLST)) )0 k/ W% J3 G2 i* u0 L
- (setq CNT (1+ CNT)) )! @9 [2 Z+ ~2 m; ^# d; n
- (if (member (getvar "CLAYER") LAYLST)
2 j0 g8 M+ ]5 p - (setq LAY (getvar "CLAYER"))
# h F" J/ y6 `! `/ v! ]7 s+ G - (setvar "CLAYER" (setq LAY (last LAYLST))) )3 C% }1 e% G; f1 _% N) }* a! L% d
- (command "_.LAYER" "_OFF" "*" "_Y")& A! S2 _3 ?+ k& ^4 n- Q( }
- (foreach VAL LAYLST (command "_ON" VAL))
& k" {: x2 f/ @ _, ?( T - (command "") (if (= (length LAYLST) 1)" `+ \9 c. ^ h I6 P
- (prompt (strcat "\nLayer " (car LAYLST) " da tach ra."))
5 e9 i& Q6 ]3 G; G$ {( ] - (prompt (strcat "\n" (itoa (length LAYLST)) " layers da tach ra. "* ?6 }8 K( [/ B4 m) J; K( _( @% W
- "Layer " LAY " la hien hanh." ) ) ) ) ) (princ) )- e; _) c. Z0 J. y% x
- (defun c:LAYISO () (layiso)) (defun c:LI () (layiso))
- j/ V8 n h7 x$ p. r: a
3 u, s- Z! `! g2 o" T5 a5 y1 \- ;;; ========================= Layer Match ==================================! x7 z+ v% o( o$ I/ M" ], P4 {$ r
3 ~* g( J# U$ \9 S! W8 ]! a8 \- (Defun LAYMCH (/ SS CNT LOOP LAY ANS)
( K6 _ e& Y' A. _/ C+ f# E - (setvar "cmdecho" 0)- V) j2 J- H$ O* Q
- (if (not (setq SS (ssget "i"))) (progn2 K& G h! j2 i3 A: K2 ?2 L; N
- (prompt "\nChon doi tuong muon thay doi Layer : ")
: k; R6 l* T* K. B, N* x - (setq SS (ssget)) ) )
, y1 d; h- c- J. l$ d o - (if SS (progn
! I6 g. A$ d& w9 e" g! h' \7 A - (setq CNT (sslength SS))
( f! H% n2 h& W* W - (princ (strcat "\n" (itoa CNT) " found.")) (command "_.move" SS "") " l, p% {( \- |. M9 E0 }
- (if (> (getvar "cmdactive") 0) (progn
4 J, i% G8 x% _ - (command "0,0" "0,0") (setq SS (ssget "p")
/ v" t/ W" W. S) ^) q9 F - CNT (- CNT (sslength SS)) ) )
' |; S: o9 D6 M' o0 @7 H% @ - (setq SS nil) ) (if (> CNT 0)
# ?5 G6 g4 y f- I4 ]7 G6 t5 H - (princ (strcat "\n" (itoa CNT) " tren layer LOCK.")) ) ) )
) d; I' |4 j+ A( } - (if SS (progn/ ~7 t# N- U5 w! M2 b) X9 L' r+ y
- (initget "Ten") (setq LAY (entsel "\nTen layer/<Pick doi tuong>: ") LOOP T )
7 W3 { Z& N- P" r! D7 e - (while LOOP (cond
5 ]& ?. s( j9 a( p/ k9 B' G2 R - ((not LAY)
3 o2 u# y9 l) W( e, d - (prompt "\nKhong chon doi tuong.")
, `! S: h& b! b- _7 e - (prompt "\nSu dung layer hien hanh? <Y> ")
% A, t/ A* _. Q: K - (setq ANS (strcase (getstring)))+ f0 E( s# e/ x- f9 p
- (if (or (= ANS "") (= ANS "Y") (= ANS "YES"))
o* M2 {0 }* b9 t5 d - (setq LAY (getvar "clayer") LOOP nil ) ) )
* @4 M7 ~. C+ h- Q/ e5 y - ((listp LAY) (setq LOOP nil) )
3 m7 {3 G$ U; _6 w4 l - ((= LAY "Ten")
2 j$ T1 Z5 @' ?" D0 ^0 R, j - (setq LAY (getstring "\n>Nhap ten layer: "))) P- a# `. V8 X6 S( r# N+ a( R
- (cond
4 k* m/ c4 j) j - ((tblsearch "LAYER" LAY) (setq LOOP nil) )
3 Q' H; P# @( F2 _) P& D - ((/= LAY "")0 g' p1 S* j) K0 ^9 Y
- (prompt "\nLayer chua co trong ban ve. Tao layer moi? <Y>: ")
; p8 W1 j/ w$ X, B, ^7 E - (setq ANS (strcase (getstring)))0 g( r& w; E! d: C0 N
- (if (or (= ANS "") (= ANS "Y") (= ANS "YES"))* F, \+ w3 T4 ?( B* M a- Z" l; G
- (progn+ B$ m& g% T$ G4 { d2 Z6 y4 |4 f, Q
- (command "_.LAYER" "NEW" LAY "")- x/ l2 l- v n& @6 b0 O) |' }1 T
- (setq LOOP nil) )2 V- j& ^' I* T* `9 E( p; I
- (prompt "\nLoi ten layer.") ) ) ) ) )
* j, K. d! I) I - (if LOOP (progn (initget "Ten")
# |, G: d5 Z% Q* q% Y" ` - (setq LAY (entsel "\nTen layer/<Pick doi tuong>: ")) ) ) ); while LOOP
, `* w2 ]0 o* S' s- z) _$ f' a8 [ - (if (listp LAY)3 u( K- o* H6 Q" R& d$ p
- (setq LAY (cdr (assoc 8 (entget (car LAY))))) )7 L; E) ~ \1 @/ O
- (command "_.chprop" SS "" "_la" LAY "")$ G) }8 H' m( J
- (if SS (prompt (strcat "\n" (itoa (sslength SS)) " doi tuong thay doi toi layer " LAY )) )2 u) A9 Q: {+ R0 W" a. G4 X- G" Y
- (if (= LAY (getvar "clayer"))
! b' y% U3 P- N - (prompt " (layer hien hanh).") (prompt ".") ) ) ) (princ) )
) L. v" T6 h/ S, L - (defun c:LAYMCH () (laymch)) (defun c:CLL () (laymch))
& G- A" ]+ s% `0 a
4 [+ i2 Y+ D& t" U0 i' Y1 b' p6 s' w- ;;; ============================ Layer OFF =================================
3 _9 _; S; d% Z0 R" c c8 ^& ^% Z - 9 W+ i$ y2 H' u2 C: h
- (DEFUN C:LJ (/ SSET SSL ENT LAY I MODE)
# z d) y2 n0 ^# B. m9 F% S - (SETQ SSET (SSGET))
( K& E7 o/ s3 c7 { - (IF (/= NIL SSET)
7 r' R; f8 F/ }# U( J) R - (PROGN
7 I( S1 b+ [1 v' c - (SETQ SSL (SSLENGTH SSET)), z6 d* M- C0 f4 J
- (SETQ LAY "")5 P1 o4 b; a4 I# n1 D
- (SETQ I 0)
6 [4 e+ Q. T! P2 W - (SETQ MODE 0) 5 |: [0 j, w5 _& m
- (WHILE (< I SSL)
|+ g! M: L- c }, |5 o" x - (SETQ ENT (ENTGET (SSNAME SSET I)))6 V: e0 A4 }, `# X8 X) g
- (IF (= (CDR (ASSOC '8 ENT)) (GETVAR "CLAYER")) (SETQ MODE 1) )
! B! g# G* ]) e9 [0 h - (SETQ LAY (STRCAT LAY "," (CDR (ASSOC '8 ENT)) )), ^- |* a7 D# }; [) j1 q" X8 r% P( ^
- (SETQ I (+ I 1)), x1 Q5 Z. Z2 R: p: U0 s. H7 q
- )
0 s) ]7 a; r3 x& G, m g/ L) Y - (COMMAND "LAYER" "OFF" LAY "")% ^! }8 W7 E: b- Z% B* o8 Q5 @
- (IF (= MODE 1) (COMMAND "") )
! x, O* k4 o! O, T7 ~; @3 }% b9 L. [ - )
7 i2 K2 c4 b$ P - )
I" I w' K* {0 f+ b: ] - (PRINC)
0 s, Z( X; m6 H* b2 d8 J D) ]2 r - )9 b5 i- \1 z9 i9 e
- ! i! A) T% A# N
- ;;; ================================ Layer ON ==============================+ `/ w' o; O/ b( H; C4 D; Q
/ X3 L5 \" Q3 P3 n H- (Defun LAYON () (setvar "cmdecho" 0)
9 ?6 w* F3 [# n2 g& Z - (setq Lay loff1) (setq Loff1 Loff2) (setq Loff2 Loff3) (setq Loff3 Loff4) (setq Loff4 Loff5) (setq Loff5 Loff6) (setq Loff6 "0")
0 q0 `) g2 ]- ~0 z# J - (Command "LAYER" "ON" Lay "") (princ (strcat "\n Layer : " LAY " da ON.")) (princ))
6 T$ Z2 t0 k$ k/ o5 E - (defun c:LAYON () (layon)) (defun c:LOO () (layon))$ H3 g t. c/ U$ M" w2 Z3 M. D4 H
- (Defun C:LO () (setvar "cmdecho" 0) (Command "_.LAYER" "_ON" "*" "") (princ "\nDa ON toan bo cac Layer !") (princ))
, c& a5 e* O1 _% @- { - 6 G' ^9 }8 `* E( i
- ;;; ============================== Layer Freeze ===========================* V* w* M4 w7 w& n- v
- : X& |( c, L$ A' z
- (Defun LAYFRZ (/ LAY TEMP)(setvar "cmdecho" 0) 3 h! H+ X- F% o6 s( y8 V- H
- (prompt "\nChon doi tuong tren layer(s) muon FREEZE: ") (SETQ SSET (SSGET)). k* [, K! T# D9 v c5 y
- (IF (/= NIL SSET) (PROGN
$ ]* H" A( C7 S Y. H- e7 r/ [* _3 _ - (SETQ SSL (SSLENGTH SSET)) (SETQ LAY "") (SETQ I 0) (SETQ MODE 0) & L6 `/ x, o3 H; p9 k5 c s
- (WHILE (< I SSL)
" V0 }( W$ i% i% K2 c9 ^ |0 \ - (SETQ ENT (ENTGET (SSNAME SSET I)))$ w. v F4 y1 o( {& [
- (IF (= (CDR (ASSOC '8 ENT)) (GETVAR "CLAYER")) (SETQ MODE 1) )
, Y* ]/ w* f6 y6 K3 i; {$ }, @ - (SETQ LAY (STRCAT LAY "," (CDR (ASSOC '8 ENT)) )) (SETQ I (+ I 1)))
4 E/ C7 Q* f6 { - (COMMAND "LAYER" "FREEZE" LAY "")
5 P/ f, ^1 F$ F) u$ p0 E( i - (IF (= MODE 1) (COMMAND ""))))( k! Y J$ B6 c: i2 i
- (setq Lff6 Lff5) (setq Lff5 Lff4) (setq Lff4 Lff3) (setq Lff3 Lff2) (setq Lff2 Lff1) (setq Lff1 LAY)7 T0 n- }" e g* B! [
- (princ (strcat "\n Layer " LAY " da FREEZE."))(setvar "cmdecho" 1) (princ) ). P- E% w/ F3 j- G! t. ^! p
- (defun c:LAYFRZ () (layfrz)) (defun c:LF () (layfrz))
- ]. `3 C% Q d' N9 Z6 g6 U5 @# T - ; `2 g1 F6 r; l! C7 L" Q5 h! ^
- ;;; ============================== Layer Thaw ===============================% Q0 `' K) B" |, B* \: O0 ^3 c! N
- & B. g3 F& s: }5 j# O
- (Defun LAYTHW ()* T2 ]. j8 H8 ] V, F; `, X
- (setvar "cmdecho" 0)
2 k4 l1 g' O' g( k2 t) L: t - (setq Lay lff1) (setq Lff1 Lff2) (setq Lff2 Lff3) (setq Lff3 Lff4) (setq Lff4 Lff5) (setq Lff5 Lff6) (setq Lff6 "0")' }( F) `, M7 V$ Q
- (Command "_.LAYER" "_THAW" LAY "")
1 V; f* l/ {9 F5 W8 E - (princ (strcat "\n Layer : " LAY " da THAW."))
0 J& A3 i" D8 h7 D ^) B - (princ) )& H, \8 v, E4 n0 a" T
- (defun c:LAYTHW () (laythw)) (defun c:LW () (laythw))
9 I" ?3 c3 C; ?! G - + B+ n% w$ J% S# ~6 q* g" `
- ;;; ============================== Layer Lock ==============================
1 `6 _, c0 p$ d" F s
' F: G$ a& D* C* O- (Defun LAYLCK (/ LAY)" E4 n5 }' f7 j6 T) i/ R2 y# W
- (setvar "cmdecho" 0)
# X* K5 l t4 U! j: z4 \ - (setq LAY (entsel "\n>Pick doi tuong tren layer muon LOCK: "))
/ D1 y7 |/ G% U$ I1 h - (if LAY. k) Z ^/ G0 Q
- (progn
+ \0 u8 @6 R7 Q/ t& i6 @9 X - (setq LAY (cdr (assoc 8 (entget (car LAY)))))( D6 g$ ]1 i8 R' N0 V
- (Command "_.LAYER" "_LOCK" LAY "")
1 F* V1 m# w4 ~# D' y# S - (princ (strcat "\nLayer " LAY " da LOCK.")) ) ) (princ) )6 ?/ u; i1 e& Z9 T" Y' S5 Y) U
- (defun c:LAYLCK () (laylck)) (defun c:LK () (laylck))* V* ~0 R: _% y+ F2 c4 Q
- k1 C& _3 l4 N* V @
- ;;; ============================== Layer UnLock ==============================' ^4 d4 H( X" a' w) l( v
9 H7 W$ l* i9 \* n' O/ P4 V2 X- {- (Defun LAYULK (/ LAY)# D$ r* ]! E5 a2 r
- (setvar "cmdecho" 0) O. g1 r* B/ l5 A3 e) E* }
- (setq LAY (entsel "\n>Pick doi tuong tren layer muon UNLOCK: "))# g! _7 G, I, H9 R4 [6 u7 F
- (if LAY6 l9 n$ \/ Z- Y! d/ s7 M! F1 s
- (progn
5 W' _& G( |% s' Q( C - (setq LAY (cdr (assoc 8 (entget (car LAY)))))
+ c1 Y# Q9 S; r( r7 h2 y% T5 U - (Command "_.LAYER" "_UNLOCK" LAY "")
* y6 q0 b# T& D - (princ (strcat "\nLayer " LAY " da UNLOCK.")) ) ) (princ) )& S! h" q- a5 A/ a$ _6 r9 ?2 P% n
- (defun c:LAYULK () (layulk)) (defun c:LU () (layulk))
, P' ^& m. \: Q
9 Y& T7 h/ b0 b; ^& V9 Z. q- @5 E- ;;;===================== Delete all objects of Layer ========================
$ B) \. ~7 n* |9 o$ r; m - . x. c& i2 _1 U3 [! T$ N
- (defun DELAYER (/ ocmd L S)
& Y1 S* c4 C6 q* ? - (setq ocmd (getvar "CMDECHO"))
6 V1 y7 ?+ e/ D) K0 `1 b+ \ - (setvar "CMDECHO" 0)
. U, W& ~$ `; p; Q - (setq L (strcase (getstring "\nLayer(s) to delete: ")))1 b3 r+ ? a: N- ?, |. N
- (setq S (ssget "X" (list (cons 8 L)))) , g) u1 Z4 G& W3 f) [" s" _3 A* c
- (if S 4 E& d8 _; e) [/ X- V0 q1 c0 [
- (command "ERASE" S "") 6 Q8 ^! x T" H. ~ G _
- (princ "Layer empty or not a valid layer name.") )
& `0 f% G5 ?( E - (setq S nil)
6 C# }! D* s6 ?% h - (setvar "CMDECHO" ocmd) + m% X+ G5 @- t9 u
- (princ) )
/ }- p0 }8 r7 U8 P* j J) _ - (defun c:DELAYER () (delayer)) (defun c:DELLAYER () (delayer)) (defun c:DEL () (delayer))0 n8 P+ j" ?1 H- C8 `6 u
2 F: E3 A' V6 z( Q* U4 W2 @- ;;; ========================= HET CAC LENH LAYER ===========================
+ t$ D3 G$ k: b' l% y - 8 n% c4 w5 t. `
- ;;;====================== EXTEND NHIEU DOI TUONG ===========================2 v, O8 @$ ^% l* W: K
/ j/ q# ]( Y; Q- c- (Defun C:EET ()
5 z7 F! Z3 R( D - (Setq CVAR (Getvar "CMDECHO")) (Setvar "CMDECHO" 0)
3 K* G4 L/ J v. ^! x& _, V, ^ - (Prompt "Chon doi tuong dich cua EXTEND :") (Setq CUTEDG (Ssget))
% }' H) K2 a. J" C - (Prompt "Chon doi tuong de Extend :") (Setq SS (SSget)) (Setq LEN (SSlength SS))% X( y# W0 Z0 @1 Y5 ?4 N! ?
- (Setq I -1)& g! a/ X \( o# v9 v4 y
- (Setq SIDE (getpoint"Chon phia de EXTEND")) (Command "EXTEND" CUTEDG "")
0 U3 S7 X, x. P. S - (Repeat LEN
! a+ q6 Z: m' \5 n - (Setq I (1+ I))
2 d9 f6 k7 J) u; O9 @8 z - (Command (List(SSname SS I) SIDE)) ) (Command "")8 O: G% u ]( Z+ e2 k
- (Setvar "CMDECHO" CVAR) (Princ "Da Extend xong moi ban lam tiep") (Princ) )$ u$ y# @9 M! `% A7 u7 d0 ^* M
- ( n6 {8 k s' Q4 `7 D7 _# \! b. \/ y
- ;;; =============== EXTEND 1 DOI TUONG THEO KHOANG CACH ===============) B+ V$ K3 F/ L; x& U0 x
8 Q! v1 W- K2 o7 y" h3 V0 S- (defun c:ETT () (setq os (getvar "osmode")) (setvar "osmode" 512)
4 z: [4 ]0 J+ i3 ~ - (setq pt1 (getpoint "\nKich vao 1 dau doan thang can EXTEND "))( E8 X8 r7 l9 n% v$ o
- (setvar "osmode" os)" @6 d% D6 f% ~, T9 i* h; V
- (setq dis (getdist pt1 "\nKhoang cach can EXTEND :"))
# q- M# S8 ]2 S: b7 g - (command "circle" "endpoint" pt1 dis) (command "extend" "last" "" pt1 "") (command "erase" "last" "") (princ))
! ~4 ?' e2 @0 o" I, z8 r0 R - * L3 C! x: A: K# C, E
- ;; ================ Change width of polylines =========================
! g% Y2 X6 v- r6 [
9 S1 Z7 E: C% ^. ?0 K {- (DEFUN wp (/ a b sophantu sodem list1 ha:wid)
5 q" h( t D# d+ o+ G+ E1 s/ A - (PRINC "\n Chon doi tuong can thay doi do day (Width) !") ' y: {" _" |) Q) n" {
- (setq b (ssget)) - ?: r; j, @ t$ g& p6 z4 A. L6 Q
- (setq sophantu (sslength b)) ; }# {/ g0 ~1 D: U
- (if (null ha:wid) (setq ha:wid (getvar "tracewid"))). G7 G: G' g' S
- (princ "\nDo rong polyline <")
6 o1 o3 T5 R& d7 D1 \ - (princ ha:wid)
: B; g. p- P$ v0 z* F# f# Q - (princ ">: ")* w2 C7 l& h( f7 P1 F* ~8 Y/ M
- (initget 4)9 r/ @# J& P W" j( [* z* u! V) F
- (setq ha:wid (getdist))
, S0 Y! N \' c1 x; A$ [ - (if (null ha:wid) (setq ha:wid (getvar "tracewid")))
! v) B" v# p; {+ {# r( j - (setvar "tracewid" ha:wid)0 R) W3 g$ E. k X1 `8 ~
- (setvar "cmdecho" 0)
9 s8 Q( m e, t8 `- r* x; s, R- F - (setq sodem 0) % Z0 g% l$ y; d
- (repeat sophantu) p3 _8 u1 z5 m* d
- (setq a (ssname b sodem))
0 e9 ^& i* o5 L6 z8 E - (setq list1 (assoc 0 (entget a)))
2 P+ \' u U; G - (cond
: q( }6 j4 H! ^" Y/ I1 ]( e4 c+ @ - ((= (cdr list1) "POLYLINE") (command "_Pedit" a "w" ha:wid ""))
6 F6 U/ ?' s; P% R# p! O - (PROGN (command "_Pedit" a "" "w" ha:wid "")) )
% h6 y/ ^& U6 t8 H) l - (setq sodem (1+ sodem)) )(SETVAR "cmdecho" 1)(princ))2 H, [6 s% I- j6 N( K+ P
- (defun c:wp () (wp)) (defun c:pw () (wp))" s4 n, a$ t3 ?, C
- 0 J9 R5 C9 F: l1 h2 p% N, d" P% O
- ;; ================ Change radius of circles ==========================: U+ N1 M! m; x) R
- 1 s; D9 m% S4 i5 ~. j7 Y) c
- (DEFUN C:CHR (/ SSET SSL M RD I) (PRINC "\nSelect Circles :") (SETQ SSET (SSGET))
8 X/ e) ]' L# u1 J) p' {) V - (IF (/= NIL SSET) (PROGN (SETQ SSL (SSLENGTH SSET)) (INITGET 4 "") (SETQ RD (GETDIST "\nNew radius : "))
5 s* R% m/ ^0 f9 H - (IF (/= RD NIL) (PROGN (SETQ I 0)
- n( k3 ]) Y/ H) j - (WHILE (< I SSL) (SETQ M (ENTGET (SSNAME SSET I) ) )3 R1 k. k# |+ U' H0 b
- (IF (= (CDR (ASSOC '0 M)) "CIRCLE") (PROGN8 R1 i! O$ O( K; v
- (SETQ M (SUBST (CONS 40 RD) (ASSOC 40 M) M)) (ENTMOD M) ) ) (SETQ I (+ I 1)) ) ) ))) (PRINC) )
4 n' r! F2 V; \9 V$ x" W - 9 l C* P u) R0 w) Z! |# y
- ;;; ============================== TEXT Hight ===============================
' G" I3 f% D" E# }" M2 A - * I% Y) Q( {) O: B
- (defun texthght (/ ent hght)
, j* y1 X8 Z( D( \ - (setvar "cmdecho" 1)8 H$ f- D9 l7 z i
- (prompt (strcat"\nSelect text entity with required text height"))
8 H$ C6 W; E) y* X - (prompt (strcat"\n.")); R; w$ a7 C7 k) L
- (setq ent (entget (car (entsel))))
; K: p/ X% d% h' y - (setq hght (cdr (assoc 40 ent)))
( C; b' w% L) h - (prompt (strcat"\nText height now set at "))(prin1 hght)! {# r, M& |, C! z, {
- (prompt (strcat"\n.")) ) X ~0 ?; }- `7 @4 u+ T
- (setvar "cmdecho" 1)$ n- z$ P/ }* `; T& I- t" I2 T
- (command "DTEXT" PAUSE hght "") )
: ]: ]1 K* V. g) h3 L3 C - (defun c:teh () (texthght)) (defun c:texthght () (texthght))
% e. w' ]" `: @, v( w! l - 9 S& A+ q0 x G0 J7 z
- ;;; ================ BAT -TAT CHE DO GACH CHAN TEXT =================
# N a O0 `5 B! P* P8 u3 y - ! f8 h9 {8 g3 n, q* `
- (defun c:tuu () (setvar "cmdecho" 0)
/ c: _& R& u1 Y( j1 Z0 U - (prompt "\nHay chon dong TEXT can gach chan ")
4 T2 y- X7 ]/ H: |( j$ Q9 ~' u' { - (prompt "\nSelect objects: ")
/ ]$ s9 v6 L* E2 O# ]) D/ A4 w - (command "select" "au" pause)
9 L; S8 N! h% A) _" K - (setq sstxt (ssget "p")8 o7 f% L6 x j" z% l& H
- sslen (sslength sstxt)
" G0 ^, q8 f8 i - ctr 0 )
. }) Q# g1 h/ {4 `6 o! n+ Y - (command ".undo" "mark"), D. f# z& [8 |2 @) [. e2 t9 I
- (while (< ctr sslen)# M; v& g1 P$ G$ U i" Q
- (setq listxt (entget (ssname sstxt ctr))
& o+ r# s; \$ t9 Y6 B0 d - txttxt (cdr (assoc 1 listxt))
' n; e8 T, y# e - enttxt (cdr (assoc 0 listxt)) )
* s4 C W" C2 ~. Z: Y# u6 k- W - (if (= enttxt "TEXT")' ^5 |! g- `4 A- L7 T
- (progn. V1 f. ? b6 K7 U! ^
- (setq testxt (substr txttxt 1 3)); X, V$ g+ \. h* b$ t
- (if (or (= testxt "%%u") (= testxt "%%U"))( B y! j' m' Z* m
- (setq newtxt (substr txttxt 4))7 N5 k. g$ ?; s
- (setq newtxt (strcat "%%u" txttxt)) )* K0 G: g& a8 [( p. W, W
- (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))6 g' D9 J( [0 Y( C9 ^
- (entmod listxt) ) )
: n- a! X/ G" g1 j4 D" g9 ^# O. B - (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))* b( y2 U2 t- q7 L
- - g2 d! E+ B+ t( j2 z
- ;;; ================ BAT -TAT CHE DO GACH CHAN TEXT =================, a' o% |$ m6 F" c3 S* P5 u
6 G, o+ @3 m+ S o- (defun c:tob () (setvar "cmdecho" 0)3 C$ Q1 l |! @- v* O
- (prompt "\nHay chon dong TEXT can gach tren dau ")
/ C6 O5 F$ c" S; g: E - (prompt "\nSelect objects: ")
0 b' a/ n9 D9 i2 D ?9 E: y - (command "select" "au" pause)
' o& n& q9 P( u1 x c - (setq sstxt (ssget "p")) N ?' E' H- M- Q9 s
- sslen (sslength sstxt)
) L4 W# j, m: W3 @ - ctr 0 )- W5 z6 m% s$ r1 ]/ M% M s
- (command ".undo" "mark")' Y( I' Q8 Y- {( X
- (while (< ctr sslen)
* ~2 `7 ~: T' E8 X: H7 t" P - (setq listxt (entget (ssname sstxt ctr))1 g+ O6 k4 J2 B+ x" {) l
- txttxt (cdr (assoc 1 listxt))
% i( s: q( c% L! @; q - enttxt (cdr (assoc 0 listxt)) )
) x6 C* t2 H9 l - (if (= enttxt "TEXT")5 _+ D2 m/ K9 J& `
- (progn
4 D# K, H9 y! q/ @# a - (setq testxt (substr txttxt 1 3))7 j0 u' j9 W$ ?- y5 K( T8 X
- (if (or (= testxt "%%o") (= testxt "%%o"))
5 i+ I( m. R, n2 W" h( s( \ - (setq newtxt (substr txttxt 4))8 {/ H! h8 q- [$ Y# X( U( s7 g* Y
- (setq newtxt (strcat "%%o" txttxt)) ), d1 @; ]0 f9 k8 B/ r
- (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))* d3 v. g' P. y- U0 J; ]7 S
- (entmod listxt) ) )
8 \' H j. W8 n; ?5 j/ S1 M7 H/ a - (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
6 R' S: S2 k6 m; O1 w - + f9 m. B+ H9 H; y# ~( F
- ;;; ========================== Tim & thay the TEXT ==========================( k% r/ a! e6 m5 B' c& j) D8 {/ O
- , G* S% I9 n/ r/ R* w- a. a7 G8 n; G" G) K
- (defun frstring (str search replace / str1 str2 index find)
1 U, f, W! E3 V1 l s$ K - (setq index 0) (while (<= index (- (strlen str) (strlen search))) (setq index (1+ index)). I- @ J3 }9 J0 T
- (setq find (substr str index (strlen search))) (if (= find search) (progn (setq str1 (substr str 1 (1- index)))7 d! Y5 R$ M, }$ x" a; \- d
- (setq str2 (substr str (+ index (strlen search)))) (setq str (strcat str1 replace str2)) ) ) ) (setq str str))
5 Q- [: E4 e# @ V. n. O - (defun hai (/ dial)# k" }% d9 q3 l, P x. E7 d
- (setq dial (load_dialog "hai.dcl")) ;;goi dialog( L9 T. t) }% q0 L+ L9 o
- (if (not (new_dialog "find" Dial)) (exit)) ;;( \. x! i% P9 x, I' L& T1 {
- (mode_tile "find" 2); Tao dau nhac tai hop thoai
; c) x5 p' k: g - (action_tile "find" "(hai1)")1 `2 S5 b, ] o3 I3 N- x" Z
- (action_tile "replace" "(hai2)")& t( f+ ~: N! j$ F8 e: f+ t* L
- (action_tile "cancel" "(done_dialog) (exit)")) `# C' s& I J: U5 g! L
- (start_dialog)
! n* {) L8 @4 r8 I2 z8 H5 | - (unload_dialog dial))2 d" s0 B! ]# U! F
- (defun hai1 () (SETQ str1 (get_tile "find")))
- b. b( B5 j7 D" I7 z - (defun hai2 () (SETQ str2 (get_tile "replace")))3 L3 P% o" F* }
4 H( \& B- K4 I( O7 A+ g" A- (defun c:TTT (/ a str str1 str2 newstr taphop sodem)2 q" Z% y0 x8 j% P9 R1 Y
- (hai)/ \) ]. U/ B# p0 K) ]1 y
- (if (or (null str1) (null str2)) (princ "\nDu lieu khong hop le")
7 s6 k) d9 m w" r& {- L( V - (progn6 b5 g$ P* }4 p& k4 g
- (setq taphop (ssget '((0 . "TEXT"))))
6 f# W& j2 s( h0 H - (setq sodem 0)
( D1 X& U" O- W Q& r+ `* X - (if taphop: K$ ~, I P# J. R- G
- (progn
" G5 K) |' n; W$ z |+ a - (Repeat (sslength taphop)# [" P8 H, f* K8 p' @# ?
- (setq a (entget (ssname taphop sodem)))6 H# U7 i, R D; ^" T/ I
- (setq str (cdr (assoc 1 a)))
6 }7 a i: X' X$ @+ B! X - (setq newstr (frstring str str1 str2))
1 x+ i# B0 `/ G6 v. N5 s; f& C0 ]/ \ - (setq a (subst (cons 1 newstr) (assoc 1 a) a))" K. i, I+ J5 `: f3 \/ o
- (entmod a)
0 N5 T& u3 K5 l3 f, t% @ - (setq sodem (1+ sodem)) ) )
! }. \$ j- X7 {7 Z; l - (princ "\nNone "TEXT" selected") ) ) ) (setq *error* olderr) (princ))
3 S \- @6 O) `7 m$ F+ a! Q$ p - $ D& ^( c. c" i7 R
- ;;;============================= CHTEXSTY.LSP =============================' M3 v$ C6 R1 B4 Y9 U
- 2 Y0 Y6 F, N8 I. o1 B+ Q5 O
- (Defun C:TXS () (Setvar "Cmdecho" 0) (Initget 1 "SE ST ")' z$ C* g( C) a2 I8 `: E( O
- (Setq G (Strcase (Substr (Getkword "STyle/<SElection>:")1 2)))% I9 N6 _8 u0 \! m! u$ c, R# O
- (Cond ((= G "SE") (Setq A (Ssget)) (Setq B (Sslength A))
. q' m Q/ e/ D, J; |0 x0 U - (Initget 1) (Setq C (Getstring "\nEnter new text style: "))
/ ]2 D6 A5 z5 B - (Extang C) (While (> B 0) (Setq B (1- B)) (Setq D (Ssname A B))' X3 l/ n. g& i1 b! l6 m& I6 S
- (Setq D (Entget D)) (Setq E (Assoc 7 D)) (Setq F (Cons 7 C))
4 `& Y: t& M( o# Q7 h7 E# m b. K* x2 j0 j - (Setq D (Subst F E D)) (Setq H (Assoc 51 D)) (Setq I (Cons 51 J)): K7 U2 J& e. R3 A6 X0 K
- (Entmod (Subst I H D))) (Setq A nil)) ((Or (= G "ST") (= G ""))/ n* v+ {$ ~5 I
- (Initget 1) (Setq A (Strcase (Getstring
+ p9 X+ i2 y0 f1 l0 g* x. W( s - "\nEnter text style to change: "))) (Initget 1)
! _# [% Y2 S- k7 G - (Setq C (Getstring "\nEnter new text style: "))(Setq D (Entnext))
' {1 b1 K0 u" K1 d/ R: P - (Extang C) (While D (Princ ".") (Setq E (Entget D)) (If
9 I+ {5 J: v1 m: ]& K& S! R8 P }# X - (And (= "TEXT" (Cdr (Assoc 0 E))) (= A (Cdr (Assoc 7 E))))
2 {! V: w2 G5 L - (Progn (Setq F (Assoc 7 E)) (Setq G (Cons 7 C))
: h9 s) X9 b' d& e - (Setq E (Subst G F E)) (Setq H (Assoc 51 E)) (Setq I (Cons 51 J))
7 }# e9 @2 o, M$ H' l& t9 R - (Entmod (Subst I H E)))) (Setq D (Entnext D))))) (Princ))* r8 s* ]4 h7 D4 S
4 Z7 m/ m) H' U1 P- (Defun Extang (A) (Setq A (Tblsearch "STYLE" A))
" R+ m! O6 s8 |; O6 x6 x' a - (Setq J (Cdr (Assoc 50 A))))1 {. s( J# m3 r& V0 x, L9 T; ~: O
& Z7 { G$ w0 L* ^. {0 t' ^- ;;; ============================ DRAW CLOUD =============================% D7 {5 G1 ]5 G0 R% j& D
5 t, ?. L3 i, \# ?, ]+ C- (defun CLOUD (/ pt1 pt2 arc1 cnt ss la) (setvar "cmdecho" 0)
- {- m# R; {! H - (prompt "\nVe cloud (may) khong khep kin - Tu khep kin ve diem dau!")
1 i' O( e6 B8 H9 d, U - (setq la (getvar "clayer"))
/ s7 K1 d u9 h3 ^7 t4 z# q - (command "layer" "m" "cloud" "c" "5" "" "")" I/ |, S& ^) v9 c( {4 z" F' i
- (setq pt1 (getpoint "\nEnter first point of Cloud: "))
0 C5 p7 O ^( ]' ~3 l - (if pt1 (prompt "\nProceed in a COUNTER-CLOCKWISE direction..."))
: M5 I0 J( W6 }3 R - (setq cnt 1 ss (ssadd))
# |* @$ i1 o3 f" G; n" g% B - (while pt1 (setq pt2 (getpoint "\nEnter next point - and close: "))* }( t; v8 @* I& ?9 |% t
- (if pt2 (progn (command "arc" pt1 "e" pt2 "r" (/ (distance pt1 pt2) 1.75)); r( M8 `8 Y4 V
- (if (= cnt 1) (setq arc1 (entlast) cnt 2) (ssadd (entlast) ss)) ))
Z( W+ l# F2 G0 F% Z- ^2 \ - (setq pt1 pt2) ) (setvar "highlight" 0) (if (> (sslength ss) 0) c: m0 }% S3 G' n& a1 s& Q
- (command "pedit" arc1 "y" "j" ss "" "x")6 F3 N% f0 ]. Z# t% I( u; ]+ r
- (if arc1 (command "pedit" arc1 "y" "x")) ) (setvar "highlight" 1); v& D( |+ R+ F) z, B& j
- (command "layer" "s" la "") (setvar "cmdecho" 1) (princ))
$ \: r7 G9 J% N4 ~ - (DEFUN C:CLOUD () (CLOUD)) (DEFUN C:CLO () (CLOUD))7 G7 V( X$ v0 U. g. b( v
! V- V' B+ m# ^# J7 o6 F- ;;; ================================ Funtion-Dulieu ========================
- f) V, k/ ^% @0 Z$ J( D- U - ;;; ================================ Funtion-Dulieu ========================
/ X0 y9 w8 }+ R* {1 N: P1 _ - ;;; ================================ Funtion-Dulieu ========================& b0 J3 j( ^/ r T" E
- % }% z5 l5 D, @9 r" h$ Y
- (defun ha:nhap (kytu thamso) (princ kytu) (princ thamso) (princ ">: ") (setq key (getint)) (if key (setq thamso key)) (princ thamso) )
' K0 o/ s' n4 s0 O1 S4 e5 D - (defun ha:thoat () (reinit) (setq Temp "Da thoat khoi chuong trinh"))
6 o7 B, u' G7 b, s2 i9 O* ?( s - (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))
! m/ I) U) q( T% Y" I: @ - (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) ) R8 K4 Q+ @; i& s$ N6 ?
- (defun hauon (hauon1 hauon2) (command "fillet" hauon1 hauon2))- k1 Z4 ^' E7 w6 J" S9 \" w
- (defun init () (setvar "blipmode" 0) (setvar "cmdecho" 0) (setvar "angbase" 0))
" j/ S) [9 _2 E6 G# _+ e - (defun reinit () (setvar "cmdecho" 1) (setvar "osmode" 0))2 E [8 w) Y6 y/ [: ^9 J% ]
- (defun tichvecto (vecto1 vecto2) (apply '+ (mapcar '* vecto1 vecto2)))# w4 J# c5 L }8 J
- (defun vectophap (v01 v02 / vectochiphuong) (setq vectochiphuong (mapcar '- v01 v02)) (list (cadr vectochiphuong) (* -1 (car vectochiphuong))))
. C4 Y9 V, I2 u - (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)))
) `) T! d( o" i* d5 g - (defun dtr (dtr) (* pi (/ dtr 180.0)))
% A3 f, o2 _9 H D7 y7 s - (defun rtd (rtd) (* 180.0 (/ rtd pi)))
$ L( C; u0 M( K3 b* a- I F
9 F. c; `2 v; N2 T- ;;;==============================PROGRAME===============================+ `: M# G+ J. t
- ;;;=====================EditDiM Hien Hop Thoai Dep======================
6 x7 C: Q _2 j' t- S - ;;;==============================PROGRAME===============================
B3 ]/ t2 t' S- B+ C
, S8 W7 S7 d0 S2 o- ;;Dth Edit Text, Dimtex & Attributes(Chu Co Thuoc Tinh)& B0 H7 U+ J: z" A5 k- J5 V
- ;;Chay Cung Du Lieu.Lsp & Hai.Dcl9 I7 J0 O1 ]( e- @0 j
- (Defun Hai_Edim (Chon / Dial State Str Oldlis Dimdefault Pt10 Pt13 Pt14 St Ang Dis Pt Hc)3 g2 \! P# v' Q$ \' |: i ]; J
- (Setq Oldlis (Entget (Car Chon)). `& I$ `4 m* ~) R1 d
- Pt10 (Cdr (Assoc 10 Oldlis))6 Z2 y# P3 H9 J3 `8 @9 u8 ~- A4 J
- Pt13 (Cdr (Assoc 13 Oldlis))
4 Q+ _- `7 h0 @1 v1 O/ l: E - Pt14 (Cdr (Assoc 14 Oldlis))4 ]( I0 v+ s4 u9 F, m3 `
- St (Cdr (Assoc 70 Oldlis))
0 B2 H U {1 a) E' m% Z# B2 E - Dimdefault (Cdr (Assoc 1 Oldlis))
8 Q& D3 t5 w" O0 T - )
/ g7 I5 z( Z, Q, J1 w( s - (Cond
* t) ^4 W; ~! O# ~4 t - ((Or (= 32 St)(= 0 St)(= 160 St))) W% v4 o3 ]! t: M
- (Progn
U! E% t+ {* J6 x. J - (Setq Ang (Cdr (Assoc 50 Oldlis))
0 g# v1 ]; Z8 [. R; S- `; f' n1 n - Pt (Polar Pt13 Ang 500)/ z) ~- A, g; W0 t
- Hc (Lay_Hinh_Chieu Pt10 Pt13 Pt)
2 g8 i5 W% N1 Z# V& i# a - Dis (Rtos (Distance Pt13 Hc))' V* S/ v: x* \( X8 |! a) b
- )5 C+ q4 N O. Y% u
- )5 H! H. Y/ T& V* R4 ~. P2 [+ n5 a
- )
/ \3 J( U! b' V$ J. j - ((Or (= 33 St)(= 1 St))! @: S' U+ B' B* V& a; G
- (Progn(Setq Dis (Rtos (Distance Pt13 Pt14)))))8 L1 B, d/ f" Q# v$ F. }3 K6 U
- );;End Cond
! L. [ f% b! o - (If (= Dimdefault "") (Setq Dimdefault "<>"))
! V; W# s& \. C8 P - (Setq Dial (Load_Dialog "Hai.Dcl"))
. v2 ?! N0 k; c# _ - (If (Not (New_Dialog "eddim" Dial)) (Exit))
5 i$ d: P1 [: @; z& e - (If (Or (= 32 St)(= 0 St)(= 160 St)(= 33 St)(= 1 St))
9 G( n3 z$ U- a8 Q2 |/ b$ m: q - (Set_Tile "text" Dis))
1 x9 W! l9 W4 F* z. d- ^$ H+ R - (Set_Tile "ha:edim" Dimdefault)" b7 O! }$ p- s# }" S2 ^ O9 I# p
- (Mode_Tile "ha:edim" 2); Tao Dau Nhac Tai Hop Thoai
8 z! N6 H2 o, e/ G4 C( W3 j2 | - (Action_Tile "ha:edim" "(Setq Str (Get_Tile \"ha:edim\"))(Done_Dialog 3)")
/ s9 g* {1 Q- @6 D8 k) K' ^( ^ - (Setq State (Start_Dialog))(Unload_Dialog Dial)
; r! ^9 T2 C" [7 I5 S% m - (If (And Str (= 3 State)). }, A+ D+ m2 |- [# n* Z
- (Progn* p4 S& g+ L5 _# L7 D
- (Setq Oldlis (Subst (Cons 1 Str) (Assoc 1 Oldlis) Oldlis))(Entmod Oldlis)))0 p3 Y: P( w5 {9 E/ t
- )
% N/ z( u( P% Z# y2 G" _& R - (Defun C:EH (/ Chon Name )3 T) R0 o+ Z5 T
- (Defun *Error* (Msg)
$ K# @$ F0 w9 b) x- C3 m - (Princ "\nerror: ")(Princ Msg)(Princ " ")
- U4 t, J$ N: F3 V* ?6 M - (Start_Dialog)(Unload_Dialog Dial)- X1 D/ N6 x6 w+ l
- (Setq *Error* Olderr)(Princ)
0 Q" k7 b! @& y* T3 C* c- U - )- {0 Z' n$ g8 U" L+ e; y
- (Setq Olderr *Error*)" K' F1 q6 \0 D
- (Setq Chon T)3 B- s5 u" m. Q) L/ X$ [
- (While Chon+ Q4 F2 \" Q9 ]& I
- (Setq Chon (Entsel "\n\n\nSelect Text, Dimtext Or Attributes To Edit..."))
' p* ~3 D0 [" f: ~* f" p0 L - (If Chon/ ~( v3 L2 h+ q2 C& D1 f" U6 @
- (Progn
5 D( i% o, }- b! r3 s - (Setq Name (Cdr (Assoc 0 (Entget (Car Chon)))))7 K4 y; Y( X& |$ _1 x* T' Q) V
- (Cond
6 ?: S% b. T& q4 K- t: H - ((= Name "INSERT")(Command "Ddatte" Chon))6 ^" ^5 }9 o2 x0 F* U# r7 x4 T
- ((Or (= Name "TEXT") (= Name "ATTDEF") (= Name "TOLERANCE") (= Name "MTEXT"))(Command "Ddedit" Chon ""))1 N/ R+ o# y5 V6 v$ e" g h0 z7 U
- ((= Name "DIMENSION") (Hai_Edim Chon))
1 A6 p. j: d% s' o' ~ - )
, O9 ?; t% C" A2 \ - );End Cond$ r, I# B0 H- A' n x* |/ n
- );End Progn
& x) o6 ^' f' s1 F% q, N - );End While3 C6 Y: m, ]0 I" P
- (Setq Olderr *Error*)(Princ)
+ w( |! |5 o( Y6 X5 S2 V8 R! d, d% t - );End Program6 @2 P* i3 t3 R
- l( O/ z4 k8 `8 w6 q
- ;;;====================DDeditDim=====================3 E0 u b, p3 q
- ;;;=====================Hai.DCL======================+ F3 C5 u7 }; [+ y. g) T1 v/ {/ ?
- ;;;====================DDeditDim=====================+ q1 A/ x; l' F B
- + Q7 }8 ^: j% ^9 m& w
- ;;Dth Edit Text, Dimtex & Attributes(Chu Co Thuoc Tinh)
. h! D6 K R# ?5 l - ;;Chay Cung Du Lieu.Lsp & Hai.Dcl
( }! Q, i- S1 C$ V - (Defun Hai_Edim (Chon / Dial State Str Oldlis Dimdefault Pt10 Pt13 Pt14 St Ang Dis Pt Hc)0 ?. d( {# \" }8 N$ @
- (Setq Oldlis (Entget (Car Chon))
; ~0 m9 I2 e& T - Pt10 (Cdr (Assoc 10 Oldlis))
; ~* p7 ]* c! A7 l$ d - Pt13 (Cdr (Assoc 13 Oldlis))
, }$ S+ c% ^2 [2 W8 W- ^4 L' S5 f( W - Pt14 (Cdr (Assoc 14 Oldlis))
7 `# J% Y, |$ ?1 u1 ?, e* T" z - St (Cdr (Assoc 70 Oldlis))6 W& f3 A6 \% M* _
- Dimdefault (Cdr (Assoc 1 Oldlis))
- `8 E! ]3 E+ R. R; {7 } - )9 F# v* b0 M4 S( o
- (Cond2 M* O7 `2 T- ]0 H' s+ s5 y4 U- o
- ((Or (= 32 St)(= 0 St)(= 160 St))
: t& k4 R; v. p: |/ v" `0 I" t' k - (Progn5 G4 O+ @. H: l
- (Setq Ang (Cdr (Assoc 50 Oldlis))7 s. H I+ q b0 y# b9 o
- Pt (Polar Pt13 Ang 500)9 u$ }, x% V4 V, l9 M
- Hc (Lay_Hinh_Chieu Pt10 Pt13 Pt)1 D- `) i% h# @9 h) _
- Dis (Rtos (Distance Pt13 Hc))* I. Y2 @0 v; D6 R
- )4 l, \ v- L0 V& X$ C: n
- )
; i: B: i# M. e# p" y1 a9 e - )# Y0 Q- S/ g5 d# C8 D0 \
- ((Or (= 33 St)(= 1 St)), X/ l4 C2 H+ g& p4 O1 l1 {$ s# H
- (Progn(Setq Dis (Rtos (Distance Pt13 Pt14)))))( z) w# w/ p; Q: p
- );;End Cond
; U% a# |6 i3 L6 e# X' j" }1 s - (If (= Dimdefault "") (Setq Dimdefault "<>"))! S7 v. ]9 `1 B: x* ~
- (Setq Dial (Load_Dialog "Hai.Dcl"))4 w3 u; q& b8 {7 {6 A
- (If (Not (New_Dialog "eddim" Dial)) (Exit))
# Q: |1 P5 U, ]; W" o; G - (If (Or (= 32 St)(= 0 St)(= 160 St)(= 33 St)(= 1 St))/ n4 E P2 d9 V7 y9 I% T
- (Set_Tile "text" Dis))
% d; D1 e! S m' ]! Q - (Set_Tile "ha:edim" Dimdefault)
8 j, Q5 J2 V0 e7 r - (Mode_Tile "ha:edim" 2); Tao Dau Nhac Tai Hop Thoai& `2 I, }" f0 @) Q3 e9 t# _
- (Action_Tile "ha:edim" "(Setq Str (Get_Tile \"ha:edim\"))(Done_Dialog 3)")
# F6 Z- Z6 n. `8 r - (Setq State (Start_Dialog))(Unload_Dialog Dial)
% ~% B% e: u$ o- O1 z7 j Q! y3 A5 z - (If (And Str (= 3 State))
8 ]3 o* h- d! w0 K$ d8 z, ^4 | - (Progn5 G, o( T! I8 e/ D4 H7 U6 `
- (Setq Oldlis (Subst (Cons 1 Str) (Assoc 1 Oldlis) Oldlis))(Entmod Oldlis)))) s4 Z# u) p \- ]# {
- )" I; I% d; M! s0 M- }8 d+ z
- (Defun C:EH (/ Chon Name )
3 p: Q4 y' E5 w9 I7 f
) m6 N; Q5 L$ e+ Y- ;;;********************Du Lieu********************0 v5 f l6 T2 S' i1 t
* Q; [5 Y% i' O0 d- (Defun Ha:Thoat () (Reinit) (Setq Temp "Da Thoat Khoi Chuong Trinh"))
: t# q1 @1 v: J' t V2 I" Y1 j - (Defun Hacat (Hacat1 Hacat2 / Hacat3 Chon)
" ^( ], S' D/ I* b! _5 c - (If (And (/= Hacat1 Nil) (/= Hacat2 Nil))2 ^% D; J8 z2 C% ~
- (Progn
! u8 _; `% A! ~6 R0 b - (Setq Hacat3 (Polar Hacat1 (Angle Hacat1 Hacat2) (/ (Distance Hacat1 Hacat2) 2)))1 X; D1 O; r. R- D1 C. l! Z
- (Setq Chon (Ssget Hacat3))0 w3 i3 i# q7 L
- (Command "Break" Chon Hacat1 Hacat2)( h' X1 w- g8 |; ?& {/ u+ I( W
- )
1 L9 U3 K* z$ U1 q - )3 p/ v5 E! O* m. `+ R
- (Princ)' ^$ ]" b4 Y1 c* p' { s
- )
! e' o4 S# ^% `2 O# g, N6 r. n - ;;" b+ [' L8 g# ^
- (Defun Hauon (Hauon1 Hauon2)(Command "Fillet" Hauon1 Hauon2))
- F( X% R* Q3 H* P+ `) i) T - ;;7 C/ C) z+ l1 s- r
- (Defun Taolop (Mau Lop / A)(Setq A(Tblsearch "Layer" Lop))(If (Null A)(Command "Layer" "_N" Lop "_C" Mau Lop "")) (Setvar "Clayer" Lop))3 k9 ?- c, L, t+ Q& T
- ;;! B9 w4 y/ e6 X
- (Defun Init ()(Setvar "Blipmode" 0)(Setvar "Cmdecho" 0)(Setvar "Angbase" 0))
/ T* t: o7 ]7 P% Q! |& G- B2 K/ F - ;;% ]3 Q! x f- o3 g$ V# N0 t1 }
- (Defun Reinit ()(Setvar "Cmdecho" 1))
- \& k; ?: R# s {9 j( W4 V- b - ;;
2 ?! v+ W z7 R" B k" d - (Defun Tichvecto (Vecto1 Vecto2)(Apply '+ (Mapcar '* Vecto1 Vecto2)))
: G) a4 W) `' ?# }; a- f+ e - ;;
' W2 c' Q1 T0 Z$ p @ - ;;Cho 2 Diem Tinh Ra Vec To Phap
" y9 C) Y! y: p, K& j - (Defun Vectophap (V01 V02 / Vectochiphuong)(Setq Vectochiphuong(Mapcar '- V01 V02)) (List (Cadr Vectochiphuong) (* -1 (Car Vectochiphuong))))- z5 x: K: s2 u# P# s
- ;;Xac Dinh Vi Tri Hinh Chieu 1 Diem Len 1 Duong Thang
& {% \8 H' c$ d2 U8 j0 E7 Q - ;;Da Biet 2 Diem Thuoc Duong Thang
& S, F) T, z2 H- x; e' w9 }- L. S - (Defun Lay_Hinh_Chieu (Dc1 P1 P2 / Hc Dc2)
* k; g) I1 I6 n* b* L0 m) W9 ~6 r - (Setq Dc2 (Polar Dc1 (+ (/ Pi 2) (Angle P1 P2)) 100)
; E& u& g( A D, R - Hc (Inters P1 P2 Dc1 Dc2 Nil)))
) E: t9 T- L" P9 m% S9 N - ;;Xac Dinh Khoang Cach Tu 1 Diem Len 1 Duong Thang ^) T0 w- `. _
- ;;Da Biet 2 Diem Thuoc Duong Thang! ?+ f) N! Q. F9 b' \% S X- x# i
- (Defun Khoangcach (Dc1 P1 P2 / Dc2 Hc)
2 z `* v3 s3 F5 Y& r. h - (Setq Dc2 (Polar Dc1 (+ (/ Pi 2) (Angle P1 P2)) 100)7 X( `( a/ o: ?3 T( ?; ?# T
- Hc (Inters P1 P2 Dc1 Dc2 Nil))8 u* t7 r( H# y- \8 L
- (Distance Dc1 Hc)' d- l+ s/ J; i8 Y: G4 S
- )) J5 L( R$ s& I3 a7 x) ^- p
- (load "nhapcua.lsp")' ]: V& j* T, ?
- (Defun *Error* (Msg)' y# b5 |& y; G/ w `
- (Princ "\nerror: ")(Princ Msg)(Princ " ")
/ q' ?. r: \7 S - (Start_Dialog)(Unload_Dialog Dial)
% Y. l! {+ A( O3 K8 } - (Setq *Error* Olderr)(Princ)
: k* i O+ _1 V9 M0 {2 `! K- B0 N - )
6 U, u$ |- @1 a# d: i4 B - (Setq Olderr *Error*)9 ~6 C$ t5 j4 y' G7 c5 l4 j( d4 U
- (Setq Chon T)
9 r* e' r5 W9 N0 X) a9 p9 ^: y - (While Chon0 Y- Z0 K0 c% `2 ~
- (Setq Chon (Entsel "\n\n\nSelect Text, Dimtext Or Attributes To Edit..."))( H) ^$ [) Q+ w8 G6 e5 Z; k3 m
- (If Chon
# h+ I1 N7 k0 [' t c& P* Y- U - (Progn
0 m% d& e6 }$ y- N* Q) G5 A - (Setq Name (Cdr (Assoc 0 (Entget (Car Chon)))))
" y" \5 _: W3 a# A8 U/ y3 [0 ` - (Cond
+ N5 T1 v! F) J9 h - ((= Name "INSERT")(Command "Ddatte" Chon))- J) q' Z% b+ r6 W' I& i
- ((Or (= Name "TEXT") (= Name "ATTDEF") (= Name "TOLERANCE") (= Name "MTEXT"))(Command "Ddedit" Chon ""))3 i, @/ v* g6 y: a3 k) \
- ((= Name "DIMENSION") (Hai_Edim Chon))
" L6 r" w6 Y+ v. z' J' B6 c - )
/ X+ n. |% u; A% { - );End Cond
7 T3 m0 ^2 ~. {2 w" N9 X3 z - );End Progn
6 b" s. w- y8 H# C6 k - );End While' }2 L/ P- O. A3 V
- (Setq Olderr *Error*)(Princ)
3 M# e0 `: O9 q - );End Program
7 a" T' Q1 ^. Y( ?7 | - & s+ j _' e' t9 }: G
- ;===================HAI DCL Nhapcua.LSP De chay Hop Thoai EditDiM===================% q+ E9 u, v' V$ |- O% e& }2 H
- ;====================================Nhapcua.LSP====================================
( R! n' u& u% m. w; r% y& ~ - ;===================HAI DCL Nhapcua.LSP De chay Hop Thoai EditDiM===================
1 w6 U" N5 T8 Z; q
# E& L- ?% @, J3 X) e- / N6 J: q) P4 x4 i
: |9 T P6 v- ?5 `/ U- ;*******************;*******************;*******************;*******************3 D! u6 l. u( K/ T( } X: X8 R
- ;****K E T C A U****;****K E T C A U****;****K E T C A U****;****K E T C A U****) U% }! Q% x' X m
- ;*******************;*******************;*******************;*******************
u. @# {. J8 U - $ V/ _ {% i5 ^0 t/ A- t/ R
- ;VE HINH BINH HANH8 v0 O) Y1 d. Y T1 U) X) y
- 3 q1 }- M0 |8 }3 N$ B: v
- (defun c:binhhanh (/ p1 p2 p3)0 \! d3 T* T* k' N
- (setq p1 (getpoint "\n Nhap diem thu nhat:"))9 t+ h0 v- K+ I; u4 [" O
- (setq p2 (getpoint p1 "\n Nhap diem thu hai:")). x& k, F$ D9 W
- (setq om (getvar "osmode"))$ O# P! g5 }+ G
- (setvar "osmode" 0)
& b& [+ `& C B. }- g" `+ [' }8 [ - (command "line" p1 p2 "")# p' |+ ]( r; ~' R4 P
- (setvar "osmode" om)8 q- q4 @9 ^$ g! l8 ~2 H: M* `
- (setq p3 (getpoint p2 "\n Nhap diem thu ba:"))/ g! x# s, r% X1 B4 p! C) q: E
- (setq a (angle p2 p1))
8 C3 g* k6 N) { H* | - (setq d (distance p1 p2))
/ W# R% p$ z- B: @1 U* E - (setq p4 (polar p3 a d))
* A0 ^' ^# j0 @2 L) W' V0 p - (command "OSNAP" "none")6 R) I! ]8 n5 T- c
- (command "erase" "l" ""). ^3 h% n. F8 |! |8 R6 u
- (command "pline" p1 p2 p3 p4 p1 "")* l. f( o3 b1 L. O8 P
- (setvar "osmode" om)0 @' |4 S% b8 e% ?/ J- C
- )
% {; c" @+ j$ p) [/ G- V
8 I4 v b) \/ a$ F1 }: |* W- ;VE LUOI COT
2 |8 c& t# x3 }: I4 w0 Z
. w( {8 j, n s6 _. [6 `- (defun c:LuoiCot ()
. K( z) V' P6 |+ r; Z - (setq om (getvar "osmode"))' Z# [" S3 D; P9 K: v/ s
- (setvar "osmode" 0)
1 T5 a! Q1 {% I - (setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))
% o9 i* K$ @0 m, J8 C) z e, l# C - (setq p0 (getpoint "\n Chon Basic Point:"))
# t0 P$ m; N6 N3 l: [ - (setq nc (getreal "\n Nhap chieu ngang cua cot : "))9 i2 [* u* Y* Z9 B& \" U
- (setq dc (getreal "\n Nhap chieu doc cua cot : ")), K' }8 v; q6 n; Z: v2 E( C; @
- (setq p1 (polar (polar p0 pi (/ (* nc hstl) 2 tile) ) (* pi 1.5) (/ (* dc hstl) 2 tile) ) )
, v2 K, a& m/ z4 f2 n - (setq p2 (polar (polar p0 0 (/ (* nc hstl) 2 tile) ) (* pi 0.5) (/ (* dc hstl) 2 tile) ) )/ U) ?6 p7 D3 k4 @2 y' G
- (command "rectang" p1 p2)
; e0 \" Q: Z3 ] - (command "hatch" "solid" "l" "")
6 x( w/ l: H1 z |6 q$ D- L - (setq bcn (getreal "\n Buoc cot theo phuong ngang : "))
0 C* ]1 F2 n/ E7 i; U - (setq nn (getint "\n So buoc cot phuong ngang : "))! v9 l. b( U. }
- (setq w1 (polar (polar p1 pi (/ (* nc hstl) 2 tile) ) (* pi 1.5) (/ (* dc hstl) 2 tile) ) )
7 n4 `' `+ }$ S# t6 h' N - (setq w2 (polar (polar p2 0 (/ (* nc hstl) 2 tile) ) (* pi 0.5) (/ (* dc hstl) 2 tile) ) )" W2 e& p5 m6 u& J6 h# u+ u
- (command "select" "w" w1 w2 ""), ]) v, y0 S0 |( L, a6 B" j
- (command "array" "p" "" "r" "1" (+ nn 1) (/ (* bcn hstl) tile) )
+ z( \& e X; P( C - (command "line" (polar p0 pi (/ (* 1000 hstl) tile)) (polar p0 0 (/ (* (+ (* bcn nn) 1000) hstl) tile) ) "")$ y# J) m7 L" U$ R
- (setq w1 (polar (polar p0 pi (/ (* hstl 2000) tile)) (* pi 1.5) (/ (* hstl 2000) tile) ))- ~4 z1 o2 y) {" R, F
- (setq w2 (polar (polar p0 0 (/ (* (+ (* bcn nn) 2000) hstl) tile) ) (* pi 0.5) (/ (* hstl 2000) tile) ))/ g9 l4 `- E% c( C) b5 |# R
- (command "zoom" "w" w1 w2)* k- _# w' @# P! B' M- k/ S
- (command "select" "w" w1 w2 "")+ m+ z! W4 O$ }
- (setq bcd (getreal "\n Buoc cot theo phuong doc : "))& Q& }' Q: e' g
- (setq nd (getint "\n So buoc cot phuong doc : ")); [+ H( x( X+ |9 _
- (command "array" "p" "" "r" (+ nd 1) "1" (/ (* hstl bcd) tile) )& l b4 {) A$ q& ?
- (command "line" (polar p0 (* pi 1.5) (/ (* hstl 1000) tile)) (polar p0 (* pi 0.5) (/ (* (+ (* bcd nd) 1000) hstl) tile)) "")/ o2 F" j" D( G4 ]# W; k
- (command "array" "l" "" "r" "1" (+ nn 1) (/ (* hstl bcn) tile) )
- Z( g# G/ N9 l8 L7 G# E8 r7 v - (setq w2 (polar w2 (* pi 0.5) (/ (* (+ (* bcd nd) 2000) hstl) tile)) ) 5 c: _1 a5 L; W- |& U
- (command "zoom" "w" w1 w2)
0 W2 q B$ S0 I7 b - (setvar "osmode" om); ^* u1 n- R$ _8 |
- )
2 c* ~% `7 m4 ^! [; D: u7 X - : o& [! N5 C( r+ W
- ;VE CUA DI7 D" O3 f8 V n2 q
- ) ]# V; }! I/ \9 e( e
- (defun c:cuadi ()
1 S/ ?5 z+ n# j. v0 O2 i9 i# k- ~ - (setq om (getvar "osmode"))
& l' |; R4 D1 R" x% m - (setvar "osmode" 0)! P) J1 q9 {/ x: ?
$ E8 ^) {+ ?, s+ S- (setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))
5 X e: w$ x1 f5 e - (setq b (getreal "\n Nhap be rong cua : "))
8 j1 X7 I5 Z" b) F) J - (setvar "osmode" om)
/ s3 w: a! p' ]7 `. _9 F7 } - (while (< 0 1)
* k8 v$ W' y1 U9 s' Z0 ~ - (progn
N) i1 m0 J8 H% I: i - (setq p0 (getpoint "\n Chon Basic Point:"))
$ _( g4 v& I9 ]+ a - (setq p1 (getpoint p0 "\n Chon diem de xac dinh huong cua cua:"))1 ]$ h. i* k& e1 d
- (command "osnap" "none")0 g- r; F1 i3 U( _
- (setq p2 (getpoint p0 "\n Chon diem de xac dinh huong mo cua:"))
1 L. v$ ]% W. z; Y% r/ g/ y - (setq a1 (angle p0 p1))
, X0 y7 S* v+ F6 G K) @4 ] - (setq p1 (polar p0 a1 (/ (* hstl b) tile)))
' b6 o! i, D" E+ z0 S* U - (setq a2 (angle p0 p2))+ }$ v* K1 \% ^$ Q6 `, Y
- (if (< (- a2 a1) pi) (setq a3 (+ (/ pi 2) a1)) (setq a3 (- a1 (/ pi 2))) )
6 u+ ?7 s) j- F3 |* s! d* V+ O6 O - (command "pline" p0 "w" "0" "0" p1 (polar p1 a3 (/ (* hstl 40) tile)) (polar p0 a3 (/ (* hstl 40) tile)) p0 "")! B) q3 ?4 g0 `+ F* c' |
- (command "rotate" "l" "" p0 (/ (* (- a3 a1) 180) pi))
. W) V& C$ J% Q P - (command "arc" "ce" p0 p1 "a" (/ (* (- a3 a1) 180) pi))
1 D, O1 n2 K1 t" T0 }8 b - (setvar "osmode" om)
$ n# ~* U& H; b. R* _8 F - ))% S. D1 e; X6 S' M I: X5 J
- )
& c3 Z. q" \4 q; E2 n1 w
" G* t3 }$ P* i; U1 ~6 p5 K- ;VE CUA SO5 `% t j: |& r2 u3 {
- % q" a; u3 _- q* P8 l1 ]5 N: W9 e3 ?
- (defun c:cuaso (). C K3 Z( j. J# l2 _% v. n
- (setq om (getvar "osmode"))# d0 ~& w; {# R) ` d- F; c
- (setvar "osmode" 0)
6 Q2 g# j2 H6 Q8 C! M - 0 ~4 X$ D6 B, x: u! F" O9 f
- (setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))
( T# h" P) `1 { ] n; z0 J. { - (setvar "osmode" om), q0 Q" H9 i3 j8 v) _9 q9 x
- (while (< 0 1)& Q1 ]1 u1 C3 A. Z& b
- (progn6 O. x: `3 J# `" I; I
- (setq p0 (getpoint "\n Chon Basic Point:"))6 P7 N/ B! x/ [" n5 k
- (setq p1 (getpoint p0 "\n Chon diem de xac dinh be rong cua:"))
1 H, }: K/ m2 P) D8 c( m - (command "osnap" "none") e+ \9 X V* f2 Z! n
- (setq p2 (getpoint p1 "\n Chon 1 diem o trong nha de xac dinh huong cua so:"))' j2 ?) [7 t$ F6 f2 {$ B
- (setq b (distance p0 p1))4 y% R4 D3 z5 P/ E
- (if (< b (/ (* hstl 600) tile)) (setq du 50))8 X8 k% v3 B+ Z9 ~5 K
- (if (> b (/ (* hstl 600) tile)) (setq du 150))" f2 u8 O) o& _# Q) @% `5 J- V
- (if (> b (/ (* hstl 1800) tile)) (setq du 200))
5 }' R. S+ m; }/ ?8 N9 B$ U+ n - (setq a1 (angle p0 p1))
, u m F( P! K" k" u: R& J - (setq a2 (angle p0 p2))5 r+ d2 K" W1 ~
- (if (> a2 pi) (setq a2 (- a2 (* pi 2)) ) )
; m6 f0 U) C; Y1 w - (if (> (- a2 a1) 0) (setq a3 (+ (/ pi 2) a1)) )
+ a. @: V. k7 w( c" V - (if (> (- a1 a2) 0) (setq a3 (- a1 (/ pi 2))) )9 j1 i9 t5 Z$ `1 m! U, O$ b( f
- (command "pline" p0 "w" "0" "0" p1 ""). R2 y4 w0 x; F& z; @. k \
- (command "pline" (polar p0 a3 (/ (* hstl 50) tile)) (polar p1 a3 (/ (* hstl 50) tile)) "")' {3 G9 w8 ?3 w! D( d' ^
- (command "pline" (polar p0 a3 (/ (* hstl 100) tile)) (polar p1 a3 (/ (* hstl 100) tile)) "")
* h' E* E; G! t2 G, {+ n& U- d - (command "pline" (polar p0 a1 (* (- du) (/ hstl tile))) (polar (polar p0 a1 (* (- du) (/ hstl tile))) a3 (* -100 (/ hstl tile))) ( F# |0 b' K0 V) Q8 [+ J% T
- (polar (polar p1 a1 (* du (/ hstl tile))) a3 (* -100 (/ hstl tile))) (polar p1 a1 (* du (/ hstl tile))) "")
% v. s8 @4 t; b6 \$ C! K - (setvar "osmode" om)
' G0 p8 |9 i- @7 c - ))
( F5 N8 K/ Z( G1 j - )5 K* j& I0 l& M% P# s
4 O. f( X5 D, ]- ;;;=== General Utility Functions ===
$ s0 h! i& V0 M( h6 M/ X8 U) k, h9 y - 5 L. B# {5 V) R* n% T5 g
- ; R12 compatibility - In R12 (acad_helpdlg) was an externally-defined
8 i/ _7 I' c4 X) d. ?" V - ; ADS function. Now it's a simple AutoLISP function that calls the
+ U, v& j7 \6 V8 X" Q8 }- R- F - ; built-in function (help). It's only purpose is R12 compatibility. ! [5 q$ b' A# V! H9 g
- ; If you are calling it for anything else, you should almost certainly 6 d& h$ A5 K: c
- ; be calling (help) instead.
/ o9 w+ y5 Y5 b7 t+ q - ' k/ H2 `6 y- u& F& C+ V
- (defun acad_helpdlg (helpfile topic)
+ \/ `! j/ M& u; a, A - (help helpfile topic)
, F8 j/ D% z. I% }" | - )
: i, R8 G; | O" y* |5 @# r
( X& \! @# M+ p" `+ ]; O5 K
$ B& T- }4 t% P) @( a3 x- (defun *merr* (msg)0 C0 i9 F: T0 U9 {) G1 T9 q
- (setq *error* m:err m:err nil)
( i9 Y" b3 n+ u/ Z1 b/ L) _: Z - (princ)
9 B. v* N' e9 r L - )& x- k2 Q- v& _. h
- * `1 W: }. S) l* Y$ M) I* `
- (defun *merrmsg* (msg)
, p5 `' h9 }4 F5 }. Y" L- {. { - (princ msg)
: v( Y+ |2 O i7 v/ u - (setq *error* m:err m:err nil)# Q' _1 ^- C; ~
- (princ)
: O( B$ H1 a( ?5 y. |% Z' V6 t1 M: T, T - )& G9 z& Y# K! o) w) L4 j
* }8 y1 ? U1 o( J/ N, K7 I/ V- ;; Loads the indicated ARX app if it isn't already loaded
5 E' U2 m: |! K! i2 X7 I - ;; returns nil if no load was necessary, else returns the
d) s, Q1 i' G/ V5 ^$ z/ t - ;; app name if a load occurred., o0 ~* q$ t9 c1 l% h. X+ \
- (defun verify_arxapp_loaded (app) H/ {( T S J; l0 W5 m
- (if (not (loadedp app (arx)))5 a6 U" m( e R/ S6 _* S& p b
- (arxload app f)* }: e* }8 n' E& L9 P
- )5 W$ `7 V; r E: t
- )
$ w* `' r( S5 l L& _
" E) }+ d4 W, a$ q2 ~9 |- ;; determines if a given application is loaded...
, y9 a6 ?' L+ v c' s - ;; general purpose: can ostensibly be used for appsets (arx) or (ads) or....
+ `. ?$ l$ z$ ^7 [. K* l. g - ;;
2 \, ]& _' v) x3 S% I - ;; app is the filename of the application to check (extension is required) k6 n. s. k1 Y" D. N
- ;; appset is a list of applications, (such as (arx) or (ads)
9 {# I* a/ @, a% Y6 d% i - ;; 5 f% R+ o* z, t9 }. k5 n* D+ ]0 E( `
- ;; returns T or nil, depending on whether app is present in the appset s; h7 w/ u+ t, J
- ;; indicated. Case is ignored in comparison, so "foo.arx" matches "FOO.ARX"
' d9 @2 q: l2 _" ]/ X9 s: e+ C - ;; Also, if appset contains members that contain paths, app will right-match+ T5 i* X9 d6 b9 V' r# O
- ;; against these members, so "bar.arx" matches "c:\\path\\bar.arx"; note that! w& h( u# x0 ~$ M
- ;; "bar.arx" will *not* match "c:\\path\\foobar.arx."' \; k7 C2 }' U4 i- s: b5 Z; ^
- (defun loadedp (app appset)
- c6 Q& r6 N9 z0 Q% _' ` - (cond (appset (or $ M" P- [ Z/ L" L, {
- ;; exactly equal? (ignoring case)) K/ c k7 g2 u$ K5 u- W
- (= (strcase (car appset))
! m/ R! `! C; O( [6 O n! o S9 H - (strcase app))$ c F' H+ c) v& t. h T6 p6 c
- ;; right-matching? (ignoring case, but assuming that$ T T S" R6 @* _( u0 D3 E* `% ~
- ;; it's a complete filename (with a backslash before it)
# Y6 l- O* R1 }2 U4 t& n! p( z6 x - (and 3 t8 ~7 w5 i8 L
- (> (strlen (car appset)) (strlen app))/ q* t% N7 h" n7 _8 `0 V
- (= (strcase (substr (car appset)
: C( S" ?3 Q1 ^6 h- e - (- (strlen (car appset))
( o1 {3 n# I+ \, i* a - (strlen app) 2 W% n" w9 L9 r1 C: `! ]5 [
- ) - X8 M2 G7 z! V1 [& ]/ H4 F! T
- )- `/ N( J( w! l) z9 k
- ) ! Q8 Z: c- ~/ h2 D U( R
- (strcase (strcat "\\" app))
3 e( Z6 x3 N; ]' c8 I - )# j- B9 r$ P0 J2 O2 G7 H" m
- )
. h6 E z. _ |4 Z - ;; no match for this entry in appset, try next one....
/ J/ g; i& G4 o1 a5 g9 b - (loadedp app (cdr appset)) ))) A$ g! e! |' [9 c
- ). b k* U; x: f# g
* l/ |' i& K' f' L- 3 i) u( ]7 Y5 L+ D5 c5 L
- ;;; ===== Single-line MText editor =====
% c% W: f6 |- F d7 T y - (defun LispEd (contents / fname dcl state)
$ J* L9 `: @) e - (if (not (setq fname (getvar "program")))
) l3 Q9 i y$ ]- g" y7 T3 ?& n - (setq fname "acad")
) |, F* ?7 F* c1 e% ]- r Z+ x - ), i' b; P6 X) T9 z
- (strcat fname ".dcl")3 M5 E* k& [" Z
- (setq dcl (load_dialog fname))5 i0 |: A( f6 F& d2 s W
- (if (not (new_dialog "LispEd" dcl)) (exit))
9 j5 a4 ]0 E2 ^8 O - (set_tile "contents" contents)
9 M0 \0 g: k) `+ F - (mode_tile "contents" 2)
, F! r. n9 h; }& c, f# j( b9 w; B - (action_tile "contents" "(setq contents $value)")
0 z3 Q. j) E9 ^+ C - (action_tile "accept" "(done_dialog 1)")
) F0 ]6 W, Y; w( l - (action_tile "mtexted" "(done_dialog 2)" )1 s1 _- s7 _$ j T* c4 i
- (setq state (start_dialog))
+ J) `; ~4 k, G7 C8 m: Q - (unload_dialog dcl)
# o$ h. @" a: H4 ?" ~4 P; L3 |) ? - (cond I, }6 O# M2 O% c$ W* ` g2 f) O
- ((= state 1) contents)! ]$ V0 p7 i$ u- {8 o1 a
- ((= state 2) -1)# C! e8 ^$ D0 b& U
- (t 0)0 y. q+ m3 C& D
- )8 ~% A- V+ O2 ]- `+ T) Z
- )5 b' |6 O l; H/ V9 J0 n
- " d" @( m" W8 o5 t" f
- ;;; ===== Discontinued commands =====
) T, Z5 |) |( ]* Y$ [ - (defun c:ddselect(/ cmdecho-save)
4 E8 X& e- W7 V - (setq cmdecho-save (getvar "CMDECHO"))
; R0 R+ M' r3 l8 ]2 Q - (setvar "CMDECHO" 0)
& z9 @( e, H2 M4 e4 t8 I2 s - (command "._+options" 7)& y. ~2 U6 ?& m: j- L
- (setvar "CMDECHO" cmdecho-save)! @$ e- y0 E( ~4 u B
- (princ)1 R/ O- O" L# ~* Y
- )
5 k8 Y& T( t; N; x/ l- @' w - 4 P' X1 `$ V: L( o# ^8 c. F$ X
- (defun c:ddgrips(/ cmdecho-save)! J9 Z) s& [2 B! r
- (setq cmdecho-save (getvar "CMDECHO"))) P7 }+ @2 a0 s9 \
- (setvar "CMDECHO" 0)0 o! `& u$ K W4 z1 a3 {
- (command "._+options" 7)
# C9 D! _# J; r- B ] - (setvar "CMDECHO" cmdecho-save)
" W4 m0 Y! {" h. U3 e+ O9 M% r - (princ)" l) Z: y, a6 u: K
- )
, v6 e/ [/ l1 i* z5 K - 8 c3 V+ ~' P: x: @6 r. k
- (defun c:gifin ()8 N9 z7 Y0 s' \. W6 v2 D( h+ f
- (alert "\nThe GIFIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")
% ~$ \" n) `4 e - (princ)5 _. z5 M' t0 s4 P% Z ^- e
- ). W6 j% S4 j8 f
0 x: v( ~# c2 n# A: S- q1 t- (defun c:pcxin ()' M1 q2 m8 ?6 V p, `, b/ c
- (alert "\nThe PCXIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")7 g8 m) r0 p% J7 X
- (princ)
5 |) T' N: N8 t2 K2 A; s% @. q: | - )
, g4 w) E7 v9 M0 R1 @' | - ; }) N* w) p/ ], p/ J# E
- (defun c:tiffin ()
' I0 U- C3 |" z8 s: a5 T; U* U - (alert "\nThe TIFFIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")
- C/ d# |, r, n! ]9 ~( d3 R - (princ)
3 Z" T% _0 ~/ Q2 Q - )
; n( n! W0 e- F/ `6 [% ` - 0 q' w a- c2 r5 E1 p
- (defun c:ddemodes()
. p- h! |/ T. ]5 h) P; {; j - (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.")
m+ }0 V: Q# o4 C1 m - (princ)" j/ e6 K( J9 i9 k
- ). r* P1 `, o: Q0 Q2 _ ~9 P
- N0 P% F. j. \2 E. @2 R, ^4 [
- (defun c:ddrmodes(/ cmdecho-save)
. d8 S6 j- i# p$ r - (setq cmdecho-save (getvar "CMDECHO"))- |# z2 e2 N5 i5 \) g0 ]
- (setvar "CMDECHO" 0)
9 [' s6 W' Z4 x* \5 h# W+ w - (command "._+dsettings" 0)
3 b# E$ o, `8 g6 ]- e) j3 d! X - (setvar "CMDECHO" cmdecho-save)+ D; t) ^ h' `
- (princ): ~1 a, I" z$ u, `1 K3 G, G' X
- )
# Q( q# w3 o9 f3 e' K
0 g# s" K% x8 A- ;; HPCONFIG
( O. T$ ]. \' d) q1 f/ Y1 r5 U - (defun c:hpconfig (/ hlppath)
# s; @+ f z( b# L - (if (not (setq hlppath (findfile "acad.hlp")))
6 t' @( r' D# ^. ?2 P - (setq hlppath "")): D/ g9 R$ k2 [# \9 t; \( g0 H4 Z* o
- (help hlppath "hpconfig")
3 L( j9 g- }" Z6 |) o0 y. f - (princ)
$ I+ V/ R" l9 g1 F( e - )
: X& S# _; Y2 B! o
6 \+ h: l4 b0 j6 y% ~- ;; OCECONFIG/ y6 n% S3 b& `- H3 ?+ ~( j
- (defun c:oceconfig (/ hlppath)
' R7 v& {0 O- z - (if (not (setq hlppath (findfile "acad.hlp")))+ Q4 c" m1 T1 i; a( N4 q7 A; R
- (setq hlppath ""))/ B/ F+ K( A! N
- (help hlppath "oceconfig")* A9 k6 C+ p9 _ r( q7 k
- (princ)
( i2 f/ ]- `8 C - )( Y9 G T* a7 h/ U+ ^
- , M) r2 j- i* ?& j/ ]
- ;; CCONFIG
/ q! V9 d- d n% V) @6 E% X: b# K7 \ - (defun c:cconfig (/ hlppath)
. r @0 ^5 o- G$ }' v$ t - (if (not (setq hlppath (findfile "acad.hlp"))); ]) ~; H# {& ?2 V) ~
- (setq hlppath ""))+ ~8 F" h: G4 `8 [1 R! l$ U
- (help hlppath "cconfig")
2 h: X2 n4 H' W. i - (princ)* }" _; v3 x' {+ J) ^+ V
- ). V2 |% G0 D x5 k* }
6 @, A ^- Y1 k5 U9 ^- ;;; ===== AutoLoad =====* z. m5 X, J) K; w$ ^5 m: j
" b( T- f0 s* l6 S- ;;; Check list of loaded <apptype> applications ("ads" or "arx")
+ i8 s, g1 h8 x0 u9 W+ Y/ u - ;;; for the name of a certain appplication <appname>.
2 E. l& g7 ^0 Y4 O5 Q - ;;; Returns T if <appname> is loaded.
( m( R- L' `2 a1 [2 F. m
- `2 o5 `% `) j o- (defun ai_AppLoaded (appname apptype)2 w+ d* }& o! q; t3 R
- (apply 'or
$ y3 j$ e6 c m# K - (mapcar
# K1 e; o, Y5 t% T: v: W - '(lambda (j)5 R0 Y0 J$ Z5 Y
- (wcmatch
/ f% k1 y. e* u - (strcase j T)
* v- C2 g' D+ q% ?( ], Y - (strcase (strcat "*" appname "*") T)& H9 |8 a& d$ x
- )
; \0 E9 x6 E6 w E: _; V - )9 C7 x; X0 [# y( D
- (eval (list (read apptype)))/ N1 j8 g' m+ q& B, r& |( [
- )* n! ^( b0 W5 N+ U. K/ P8 c
- )9 i1 U4 E" ^" o8 o9 E' G8 X, ^% l9 i! Q& c
- )
2 r; U% W2 o: _
. C) H. I) Y% l7 C. M- ;;
; i+ f: @" e {' g- w - ;; Native Rx commands cannot be called with the "C:" syntax. They must * R# N# o0 i/ C& K
- ;; be called via (command). Therefore they require their own autoload
, O# U4 m6 J2 L& O! g9 t$ Q - ;; command.. v9 ], v7 m% K) \. Z
2 W# O7 }% m! h! {1 g3 Q0 C' I- (defun autonativeload (app cmdliste / qapp)' R. J) u2 Z& a& t
- (setq qapp (strcat "\"" app "\""))2 [8 w+ {- {6 L8 Z! u7 l& q4 ~
- (setq initstring "\nInitializing...")) Y3 k) O! U2 @/ l: y$ X) x
- (mapcar3 M+ r1 y( ^* k
- '(lambda (cmd / nom_cmd native_cmd)
, H; q, J( v$ F! T# D - (progn$ d! i) M8 t! L9 @/ ~/ v
- (setq nom_cmd (strcat "C:" cmd))
+ M% M9 z$ w; v# D% [1 j3 l2 q - (setq native_cmd (strcat "\"_" cmd "\""))
; g/ O! h. B4 k" O' b, H" ^( C* w - (if (not (eval (read nom_cmd)))
; x9 d0 N1 e4 o* s+ m0 A* l - (eval) n3 l2 i% w0 Q8 }
- (read (strcat
1 c: ]; s8 U! t6 N4 w - "(defun " nom_cmd "()"4 M$ b: e, e8 b2 \* L8 K" n
- "(setq m:err *error* *error* *merrmsg*)"
0 v4 b8 U9 E% m$ X! z2 a - "(if (ai_ffile " qapp ")"; B+ g6 e. {& c
- "(progn (princ initstring)"2 X7 I6 \7 j4 P- @7 @2 V! [
- "(_autoarxload " qapp ") (command " native_cmd "))"
0 L( j( g$ `8 ?9 T - "(ai_nofile " qapp "))"$ H, z0 M3 b. |+ O5 x
- "(setq *error* m:err m:err nil))"
3 s! C3 o' W$ }7 u4 ]2 d - ))))))
7 K# o1 a" J2 F1 O6 P! v6 s - cmdliste), l* K2 x7 { M% h
- nil
' V' O' [4 }& [8 I5 w |8 p - )% v# d: t2 ^+ z: o8 W: e& K
- ) l2 a+ x, {9 h& h8 g2 R+ |
- (defun _autoqload (quoi app cmdliste / qapp symnam)2 A+ Z0 W6 J Q6 _
- (setq qapp (strcat "\"" app "\"")) v {* h1 O* f; W8 r
- (setq initstring "\nInitializing...")
* S9 R' B! T @6 u! O/ [9 X: } - (mapcar5 e$ y( }" v/ C9 {6 O
- '(lambda (cmd / nom_cmd)5 N/ }2 {7 M: y5 S8 U! k& X* |% z
- (progn
, x" s) r. Q+ n( q1 ~ - (setq nom_cmd (strcat "C:" cmd))+ i$ |- T; d7 I9 h/ Z
- (if (not (eval (read nom_cmd)))
/ J9 D/ L$ h. L5 j - (eval
' e1 W$ o' B7 y+ |: `( m4 G4 ` - (read (strcat
6 U3 R1 F {8 l& K$ k - "(defun " nom_cmd "( / rtn)"
/ f2 L# Q7 H) G: _ - "(setq m:err *error* *error* *merrmsg*)"7 i3 n# b. [! D @( `
- "(if (ai_ffile " qapp ")"3 L7 X2 F7 ^# q
- "(progn (princ initstring)") d- @! ?8 ~! m. r1 ~- V2 }
- "(_auto" quoi "load " qapp ") (setq rtn (" nom_cmd ")))"
4 _* m3 X2 Z% X& @/ J+ K - "(ai_nofile " qapp "))"
9 e+ A5 k5 @6 @, N& V - "(setq *error* m:err m:err nil)"
B1 v8 K( `# b/ A/ c; u - "rtn)"
2 k5 Z2 v4 R" X' T/ v: l - ))))))
- P5 M8 V; ^* X% _: n' y - cmdliste)
- U% t9 q, C- r& p% h - nil8 s3 Q) @& Z( S+ I( c
- ), x" L5 _* `2 L* z0 e# p
) x9 G: S! w' J* G0 E- (defun autoload (app cmdliste)
' S- B" Y% M2 u" w2 ]# [6 w; W - (_autoqload "" app cmdliste)
! g: P3 Y7 c1 Y' f. t - )
) m. X% ^! X. G7 \
% r6 L- a4 ^* h4 a, w" [- (defun autoarxload (app cmdliste)+ F$ J0 [. l+ x7 ^: S+ v% }
- (_autoqload "arx" app cmdliste)
* h0 f" f& Z3 r - )
2 l5 l+ l. \! s3 o# s3 t - + ?: l8 j! s- @
- (defun autoarxacedload (app cmdliste / qapp symnam)
7 K' F2 [6 i1 R7 B/ _ A1 D - (setq qapp (strcat "\"" app "\""))" w$ z9 u1 b1 V; S) C) _* i, @
- (setq initstring "\nInitializing...")1 ?1 j: Y7 G* [+ ]
- (mapcar
$ O# Q( l1 s# ~5 J- Z - '(lambda (cmd / nom_cmd)1 x; S( }4 X8 q& w# k
- (progn+ ^7 ~9 W1 D3 D% M. l
- (setq nom_cmd (strcat "C:" cmd))- z! \3 x# J4 U6 h. r# P
- (if (not (eval (read nom_cmd)))2 n: I7 u' t% E# Z4 i5 ~+ H2 |
- (eval
: T' J. C x% i( t+ ] - (read (strcat
; A5 ^+ c9 p, e* \1 U% N7 F - "(defun " nom_cmd "( / oldcmdecho)"3 m0 G+ d: z/ B% c) I# f. Z
- "(setq m:err *error* *error* *merrmsg*)"
0 A% _" K# A1 G% s c$ M - "(if (ai_ffile " qapp ")") u( A% R% F( B; q" c$ O
- "(progn (princ initstring)"4 O# x* {) [6 ~2 y4 m8 d! V
- "(_autoarxload " qapp ")"1 s% y, B; O6 G( |% b E: T
- "(setq oldcmdecho (getvar \"CMDECHO\"))"
6 x2 k$ b8 e' k6 N/ N, L* `. `. F - "(setvar \"CMDECHO\" 0)"
1 ~+ `. M. z- R9 y4 g* P - "(command " "\"_" cmd "\"" ")"
2 \8 O* `$ \2 \& ? - "(setvar \"CMDECHO\" oldcmdecho))"
9 R7 u7 ~ L4 W% P. K) ^0 L2 q; ] - "(ai_nofile " qapp "))"3 z- ]0 ] v s: t/ w
- "(setq *error* m:err m:err nil)"
7 a/ j1 W* M' W. G' m0 ?$ z3 U - "(princ))"% z9 y' `; D$ @2 w# k
- ))))))
6 U8 z' I+ @2 E - cmdliste)
- t+ f3 t+ ]1 I - nil( V0 ]8 N6 I( i2 S9 p
- )
) b4 K* w* w8 l' L' g. Y- D - ; Y* N4 ?0 s" f! L
- (defun _autoload (app); L2 b) E8 o3 G& t5 w; f/ K, s
- ; (princ "Auto:(load ") (princ app) (princ ")") (terpri)
' [9 Q# U. X# J* h _3 A - (load app)
6 o1 P( R4 Z4 _! i3 |1 r - )! f; W! w; w5 Y9 Y" B f
1 A* O' D, x" i" u- W6 o- (defun _autoarxload (app)2 Z" T$ i% X: p9 ^7 O
- ; (princ "Auto:(arxload ") (princ app) (princ ")") (terpri)+ J0 c+ P; A; p6 C
- (arxload app)
" _6 D& z7 n" c( P5 F; Z+ H, [ - )
% D M2 G/ [: L: b
( f! i) h G7 j j1 E, K- (defun ai_ffile (app)
! \' T2 H/ M9 v- Q - (or (findfile (strcat app ".lsp"))8 R' \( ^3 O* m$ v# ~
- (findfile (strcat app ".exp"))1 U/ x z+ p) Z4 U- `/ r7 M' M
- (findfile (strcat app ".exe"))
) k! F9 K) k9 R - (findfile (strcat app ".arx"))
0 z, C/ {3 p; } - (findfile app)8 I8 k1 n/ O% ?( S
- )
& K4 k4 f, N- f8 k - )
6 X |4 a& H7 w; {7 }
( E' x7 ?1 ^4 j0 e! E0 J- (defun ai_nofile (filename)' T( y$ z, Q6 t4 s/ O& E
- (princ' g5 R4 p1 S! B% Z' c2 g$ a& z M
- (strcat "\nThe file "
s, |5 y: f! W) Y: ~$ c4 u' y$ S - filename
( }1 [- x" {9 p- ^4 ^8 d W - "(.lsp/.exe/.arx) was not found in your search path folders.") v0 j6 p( D& E% Y T( t2 w( G
- )
; `0 J [& y- t. p* \9 K - )
4 M! z3 w4 ?6 r- D/ k( N2 V - (princ "\nCheck the installation of the support files and try again.")
" a! ^, |8 W, s6 u4 T; I# ~ - (princ)
$ q x3 g i" }3 ^6 {0 K6 I - )
, c" e' g; J* u# }, s9 [/ t: L( A$ ?
% ]3 Q8 c! N I i& K# M" W6 t- ' S( q$ i, r; |7 q0 t
- ;;;===== AutoLoad LISP Applications ===== v. X1 L( N, C8 {
- ; Set help for those apps with a command line interface
, W4 d. H$ E/ X& T% i- E1 c
# {3 E1 f+ i( `. `- i- (autoload "edge" '("edge"))
* [0 ]9 M. i; Z* } - (setfunhelp "C:edge" "" "edge")' \3 q; o# v( b$ y6 ~; ^
- 3 V8 _3 h. d; v/ v; I
- (autoload "filter" '("filter " "filter"))* p, W$ B3 y+ t$ K4 n
& s1 Q$ P! M% D) `" y f- (autoload "3d" '("3d" "3d" "ai_box" "ai_pyramid" "ai_wedge" "ai_dome"9 p2 D$ G* ]7 T- ^, H" n
- "ai_mesh" "ai_sphere" "ai_cone" "ai_torus" "ai_dish")
4 e- o5 J# z2 J - )* g, F0 B% ^0 |2 {2 K) j% N
- (setfunhelp "C:3d" "" "3d")$ m3 J' \2 `* S4 h; C2 H+ _+ z5 ]
- (setfunhelp "C:ai_box" "" "3d_box"). i7 h. X, L b; l
- (setfunhelp "C:ai_pyramid" "" "3d_pyramid")1 r) H, D m+ `- L" t
- (setfunhelp "C:ai__wedge" "" "3d_wedge")4 x, P4 ^/ S0 e, g7 q4 X
- (setfunhelp "C:ai_dome" "" "3d_dome")
! c8 M* H0 Q& P - (setfunhelp "C:ai_mesh" "" "3d_mesh")
7 l; M1 h+ `$ h4 X( a e( \9 O - (setfunhelp "C:ai_sphere" "" "3d_sphere")" O! t' b" c; r& h1 V& }
- (setfunhelp "C:ai_cone" "" "3d_cone")
' u. a% _- q3 v& Q - (setfunhelp "C:ai_torus" "" "3d_torus")8 A6 x3 B0 E O, s6 |' X2 E
- (setfunhelp "C:ai_dish" "" "3d_dish")
6 l* ~0 [; U4 ?# m5 t! ^
8 J: ] s7 E3 W- (autoload "3darray" '("3darray")); t; w( k K$ r0 }1 _
- (setfunhelp "C:3darray" "" "3darray")
8 C# _7 n+ j5 G z
: o8 N$ N! M: b. U4 f7 G- (autoload "ddvpoint" '("ddvpoint"))6 p/ Z% b/ r" ?( C% L5 @7 f' x" T
* Y( V4 {$ J) T9 @, L; p- n6 m1 ^: Y- (autoload "mvsetup" '("mvsetup")); u# G5 M; V' R/ z3 Z
- (setfunhelp "C:mvsetup" "" "mvsetup")
1 ?" A$ n5 H7 q - / Y8 o- G/ I: u! L; _
- (autoload "ddptype" '("ddptype")), C0 B* F! D# J Y
( c: g3 O4 N! E: s! M) Q. u6 {- (autoload "attredef" '("attredef"))
% I4 V8 V- L( F- v1 E! `! r - (setfunhelp "C:attredef" "" "attredef"); r+ e' z; k2 G% a
6 f1 |6 m9 C* V5 j: w. p. p$ F- (autoload "xplode" '("xp" "xplode"))
. O* R: P, V" {6 I- A - (setfunhelp "C:xplode" "" "xplode")
T5 W" _6 W0 U* j$ F# d: R - + O* [6 a$ j1 H
- (autoload "tutorial" '("tutdemo" "tutclear"
4 }: s9 z" b' _ - "tutdemo" , i5 ^8 v) }7 w0 j9 V' X
- "tutclear"))7 ~6 e. ~ y' x, b& v
' R& V, Z1 k. G9 P- ;;;===== AutoArxLoad Arx Applications =====. l5 x9 B5 u( Z
( O6 P1 V) g# X) a- (autoarxload "geomcal" '("cal" "cal"))
: G' L2 k% K1 F2 J - 9 t( g! ` B s7 \9 i& D7 R
- (autoarxload "geom3d" '("mirror3d" "rotate3d" "align"5 p2 o; ?- \- Y* k/ B! {6 j# A# H
- "mirror3d" "rotate3d" 3 x' s' z; e& p: S3 B9 k
- "align"))7 @* g3 q/ ]+ s% |; X
; k, [8 a) L" f V- s( |: {. U- h& m- * L; k0 v! o1 l, o& }. U( I: L
- ;;; ===== Double byte character handling functions =====
: L6 N2 I. S% i
+ {/ ^' F( ^) J* J! V. Q- (defun is_lead_byte(code)
& c9 t4 c. f- [' j - (setq asia_cd (getvar "dwgcodepage"))- r9 f# [. v" n) W; J5 u
- (cond0 U7 x) X# d* l( z4 Q4 K
- ( (or (= asia_cd "dos932")8 z9 Q9 f0 `+ b8 h* [8 h; j
- (= asia_cd "ANSI_932")1 O. z. |( n" S1 J" e; N
- ) Z1 @2 I! ]9 B$ C. M2 ^
- (or (and (<= 129 code) (<= code 159))
9 t9 Q, n, K1 l6 h7 J4 y3 y' j$ O - (and (<= 224 code) (<= code 252))
& Q1 f6 z' w: G) v - )& r/ y8 R6 }) s; c9 L
- )$ X7 v# t$ w& l5 ^& A$ k- z! p& J
- ( (or (= asia_cd "big5")
% I7 {, v1 F$ c u: ]; T6 _) V - (= asia_cd "ANSI_950")
) |8 l& T& u# _, y( \ - )
- n* A0 N; Z k; E- C _; H4 R3 V, k - (and (<= 129 code) (<= code 254))
2 H' Q v+ s. i! h - )2 Y. w. e* h ^8 W$ G- y! [
- ( (or (= asia_cd "gb2312")# @8 l" u+ @. S+ Z
- (= asia_cd "ANSI_936")
3 `' b' ]6 K3 w2 z- T6 k8 i n - )
+ I& y' d" [9 t( I$ S$ Q) u- f7 g4 Y - (and (<= 161 code) (<= code 254))$ z- {! ] e( w8 T
- )+ A6 ?9 e3 `2 _# z/ l. d/ S) ?
- ( (or (= asia_cd "johab")
6 |$ j5 B, X' |# D, U* _- C - (= asia_cd "ANSI_1361")* X" w1 c1 k2 B, N
- )* i/ v3 x# f( ^" C- w
- (and (<= 132 code) (<= code 211))
* [, y# s: u/ E6 y* t - )$ P1 h2 w9 p. [6 |5 `+ l2 |
- ( (or (= asia_cd "ksc5601")
2 c4 X i# n/ B6 I; k - (= asia_cd "ANSI_949")
" z" [! U6 H0 I; H: Q: P" C% ~, o - )
/ ]: }2 @2 j4 I, a& A, {2 ^ H* d - (and (<= 129 code) (<= code 254))
, U) p# q' T; w) R$ h6 j+ i. `9 h - )1 n0 i* d) B4 q; t+ L* E
- )
: V& F) y4 X$ r2 U - ): z+ M. W& ?, R
- & |( w: a) R1 R
- ;;; ====================================================
( ?: e: A6 C/ ^0 ?8 l( B, T1 @ - 3 ?' K7 n- M% V- i$ ]" j
- # N# d( @+ i. }4 T/ I
- ;;;
" c5 P- x6 M1 n* {: n! V% Q; e - ;;; FITSTR2LEN
! R! v% i" k6 l - ;;;
( R# j7 M/ w3 n: Z( | - ;;; Truncates the given string to the given length. ) M+ t2 C q1 W& I' P4 z
- ;;; This function should be used to fit symbol table names, that# {- D% F' i1 O9 D3 a" G
- ;;; may turn into \U+ sequences into a given size to be displayed+ U F% y0 ?! H7 C: `; l
- ;;; inside a dialog box.# s- \: r+ r; k2 n
- ;;;
' m: c' p% a: ]& s3 } - ;;; Ex: the following string:
5 ~" R. ?: ?' M0 j - ;;; {* Y4 f* |$ X- d$ q& Y: V6 V: l8 Q& P
- ;;; "This is a long string that will not fit into a 32 character static text box."
# `; B6 p( \2 j' U4 R - ;;;
% O; s8 z# N0 C2 |: I6 S% p0 O$ A; P - ;;; would display as a 32 character long string as follows:
, |. h# h7 K/ e, a - ;;;9 Q! U2 H/ K: Z) t$ b. P
- ;;; "This is a long...tatic text box."
0 `& d8 h$ S, }7 t) x - ;;;
% c4 q# k: G& q6 Q6 t9 L
$ G" Z4 a6 l4 U8 m9 b0 v P- (defun fitstr2len (str1 maxlen)
. u; r( x* U: y4 Q2 B; f( l - ( D# V2 _. x& a Y# q
- ;;; initialize internals
+ ^8 G& Q* q1 R ~* Q2 o - (setq tmpstr str1)! ~( }6 R) E! w! e# c
- (setq len (strlen tmpstr))1 {2 z, x" X* {' f' {/ m
- 6 `, ~# k+ D/ c1 {; u2 q( a" U
- (if (> len maxlen)
5 R5 z: n2 _2 g( c5 x - (progn6 `5 p4 P5 j' W% H
- (setq maxlen2 (/ maxlen 2))4 J4 H: i* o# U3 ]
- (if (> maxlen (* maxlen2 2))- z: R" {; ^' E3 @) W- j
- (setq maxlen2 (- maxlen2 1))
0 m/ U% P# m+ R2 \2 W+ B - )
7 \0 j! i8 `( u+ I- n1 {2 e& m - (if (is_lead_byte (substr tmpstr (- maxlen2 2) 1))" a: v. ]( ^2 E( U! e$ _1 X" B/ N
- (setq tmpstr1 (substr tmpstr 1 (- maxlen2 3)))+ B* P* Z7 n. M0 ?
- (setq tmpstr1 (substr tmpstr 1 (- maxlen2 2)))8 g$ i; B, z- Z) b' T/ |
- )) h6 c3 B7 O9 ~1 x* b0 R
- (if (is_lead_byte (substr tmpstr (- len (- maxlen2 1)) 1))
9 q0 F- c: E% H' @; R - (setq tmpstr2 (substr tmpstr (- len (- maxlen2 3))))
5 |- [3 M+ u% L# t8 V `, h* k - (setq tmpstr2 (substr tmpstr (- len (- maxlen2 2))))) S& D5 G+ Y* c- f" r) H E! k
- )
. u6 T" L1 ^% J* S+ j2 u& C - (setq str2 (strcat tmpstr1 "..." tmpstr2)). W( ]" |1 n* d# i) y
- ) ;;; progn a' p0 S( D$ S
- (setq str2 (strcat tmpstr))
) P; E8 N1 u7 C4 s - ) ;;; if. a1 i" O b9 b- ^5 o, z/ `: i+ c H
- ) ;;; defun& X4 w J8 k; `( v0 s5 a9 }
- 8 Z) G" ]. w4 G
- $ o9 S9 z' J8 t$ m2 h; r) H+ j
- ;;;* W1 Z' T& z o3 Q4 u& @2 @/ l* u
- ;;; If the first object in a selection set has an attached URL
2 }4 y0 |, y( j- M4 D - ;;; Then launch browser and point to the URL.1 ]) Q a* f5 ?$ ?1 @
- ;;; Called by the Grips Cursor Menu m6 p' b/ p5 U2 F* t7 U- z- [: e
- ;;;9 V M/ ]2 F6 j3 b
- 4 T; v( f" j- P. c6 e& M
- (defun C:gotourl ( / ssurl url i)
. A# b8 E& E" P, @ - (setq m:err *error* *error* *merrmsg* i 0)4 b+ k; h D. l0 L* K1 F
- 4 s, D* e+ l- g( [5 s. C; w5 z, O
- ; if some objects are not already pickfirst selected,
2 t( j' w- A0 o8 f* L0 e& Q - ; then allow objects to be selected
! \8 v( E" l8 b0 M
9 H- s0 F; y, Q8 i% y1 L+ }- (if (not (setq ssurl (ssget "_I")))7 A$ s5 j1 K! b( v
- (setq ssurl (ssget))* j) |" _& a2 u3 Z+ H: v- D1 [
- )5 G7 A. ^+ A- b
- 9 |( j$ N$ `2 x" e4 w( I& A `
- ; if geturl LISP command not found then load arx application
( g y/ c% R$ @$ _ - - y5 q# ?* w" y M. k$ J/ Y) _" M
- (if (/= (type geturl) 'EXRXSUBR). N# X1 Z! p! L1 M7 Y& s) W
- (arxload "dwfout")& r) y( D+ \0 y3 m
- )4 J1 ^. k" _ ]: m
-
- `5 m2 B( N# B3 U5 n - ; Search list for first object with an URL- k; n( `& j/ a
- (while (and (= url nil) (< i (sslength ssurl)))
+ b# ^4 d- k% }% w# N; M8 N( [ - (setq url (geturl (ssname ssurl i))
: ?+ ^+ ~* v# ~" e3 r8 e. x8 ] - i (1+ i))
5 C" _) v" x5 q5 g1 z# C! _ - )$ E% p# |& Z0 ^ b% M1 u+ u+ R& f. Z
- . |/ L. I3 i6 ^7 ^
- ; If an URL has be found, open browser and point to URL) J. b; t3 [7 s. N# a
- (if (= url nil)
% J6 y2 T( S0 E) A - (alert "No Universal Resource Locator associated with the object.")
& a. s; L+ O. W9 h7 {( u- b- d - (command "_.browser" url)
1 H5 e R* r4 L4 Z - )0 |) L, x3 ]& b
4 \: L9 ^4 w) p& j: s! d; }- (setq *error* m:err m:err nil)
# }% N! r5 \; E8 R5 H7 | - (princ)
- j$ v1 m# ~" V. c - 4 [9 p$ B& Z/ \3 B
- )
4 K- _. P5 @8 B* N! g/ ]
! B) U6 z, ^( x% x5 |- ;; Used by the import dialog to silently load a 3ds file
( l' T8 A6 k+ o - (defun import3ds (filename / filedia_old render)
3 d# t4 D% Z( r. w W( K$ V& m - ;; Load Render if not loaded
3 `7 f0 Q% k) F9 I/ S. b" @' C: [ - (setq render (findfile "acRender.arx"))! t' z5 b7 I% v
- (if render1 d/ V: c# ?$ a7 Y" U. |$ X' A' A8 Y
- (verify_arxapp_loaded render)
8 a7 l6 X! G- W l - (quit)
, v% e$ y3 [) x {6 K6 M1 w - )
1 E; l: W0 y* G0 A9 b M& p
# o( G# t2 H7 k$ v" ~5 b- ;; Save current filedia & cmdecho setting.8 R* l# L# @) B8 F$ L
- (setq filedia-save (getvar "FILEDIA"))
7 M# p( b" _5 k9 q - (setq cmdecho-save (getvar "CMDECHO")); {& M7 j# }. \' Z/ M) v
- (setvar "FILEDIA" 0)
5 }9 o* w7 d- F8 h4 v, p4 B0 L2 C - (setvar "CMDECHO" 0)$ Q0 T. E6 I2 s1 u
- : u- g( I7 U' e+ ~3 e4 A
- ;; Call 3DSIN and pass in filename.
3 H# p9 {" `, k# R - (c:3dsin 1 filename) ~7 S/ X# d) B8 d; N) G
- 0 h4 m8 H& [3 L' v; ^. M4 c
- ;; Reset filedia & cmdecho
" [$ D. D9 E, H; U, f4 X0 X - (setvar "FILEDIA" filedia-save)+ b5 n9 o M. M* u9 m+ R5 l" I1 @
- (setvar "CMDECHO" cmdecho-save)
. t8 v/ p- d2 M2 `) B' D1 R0 v - (princ)
% t; f3 E) ~4 n4 U - )
# p8 P) C8 ~3 U. c" L+ T - $ V4 u4 F- i# d- u9 L8 d& U
" U7 X$ z( U, a9 p- ;;;=== Menu Functions ======================================2 Z8 R" a( \* s+ \ n4 M$ j% @
- & B1 ~2 F( U! n" s8 c( B
- (defun ai_rootmenus ()/ v/ j" a. Y1 R- _; a3 z
- (setq T_MENU 0)5 K/ h6 k0 \/ m, Z: E1 j
- (menucmd "S=S")
0 K# L; d v& h+ p9 K% F - (menucmd "S=ACAD.S")0 Z, H) ~: p, j+ G3 g
- (princ)
' P! |* ]9 O; t3 w - )
4 U5 T" \$ J# ~! n$ d - 0 r) [' `) `: `* _
- (defun c:ai_fms ( / fmsa fmsb): {( M9 D. f& ?) |1 R" W* R
- (setq m:err *error* *error* *merr*)! n" H- C: j+ ?2 E+ y4 j
- (ai_undo_push)% q% {" u% W5 O" H# X; ]
- (if (getvar "TILEMODE") (setvar "TILEMODE" 0))
1 M0 R8 p3 W" P( C" @5 _ - (setq fmsa (vports) fmsb (nth 0 fmsa))
0 P! }4 d j* I - (if (member 1 fmsb)3 ^0 D0 d. f: h4 Y" U6 Q
- (if (> (length fmsa) 1)' }4 T9 j4 f9 I0 h: _
- (command "_.mspace")- v; c+ G/ @( \+ E- o4 E4 [
- (progn {& r) @& l3 {+ V9 ~+ c! \
- (ai_sysvar '("cmdecho" . 1))
! C* t! k; U( h. _2 r - (command "_.mview")& E% K4 g# C a/ O* z: s% |
- (while (eq 1 (logand 1 (getvar "CMDACTIVE")))
8 w, k( E9 ?5 f) V - (command pause)) x# u0 i8 B4 A
- )( `- j" k M. Z% [. q0 {" {- I! c
- (ai_sysvar NIL)
' v; M7 E3 f6 q+ u: h: d1 B - (command "_.mspace")/ L0 U! `& R5 e1 a3 Y" H/ J! P
- )8 G& F+ ^4 k+ o- @
- )
, k. ^ x+ c# z3 R. m - )
6 Q" \/ t H7 P: n9 E( x$ q+ W% z - (ai_undo_pop)+ P" ~7 M8 S$ e2 q" f# K% p
- (setq *error* m:err m:err nil)9 M2 w7 X6 ~3 ^! Y, ]
- (princ)2 A7 ]6 U3 u& {6 {% [0 P
- )% @4 B/ T( K. O3 M6 t4 F2 q3 w
- + c& t6 B5 l$ Y/ _5 P' e0 g" X
- (defun ai_onoff (var)
- y. @, _0 x! x2 D% Y - (setvar var (abs (1- (getvar var)))). l+ B9 b- J4 J) D
- (princ)
: I) E8 Z# k) r5 o/ f1 S - )
4 ]0 R/ k( _8 R4 i) ^
3 m' I) R4 r: @ @+ d- ;;; go to paper space
) s5 ~6 K+ w: Z5 M- E7 X - (defun c:ai_pspace ()3 b% H3 m" L, ^: C4 _: j b
- (ai_undo_push)
% ~2 u4 P/ W# z - (if (/= 0 (getvar "tilemode"))
* E& a5 i P& [7 `( }/ H - (command "_.tilemode" 0)
/ u1 W; F8 A1 K4 q8 g( I - ) D. \% ]$ b: q# {
- (if (/= 1 (getvar "cvport"))
, A Q/ [( y4 G$ f O7 u) h& L - (command "_.pspace")% M* L& U$ J& i' ]2 M; x2 W
- )
$ J) {0 y9 s1 j/ W* a - (ai_undo_pop)7 ]& u* Y; h% r; h+ Z! X
- (princ)/ P. t8 t* |. Y% A
- )
3 [% \: M) x3 w+ P4 u - * x9 @$ F \/ O0 c& T: ~$ B
- ;;; go to tilemode 1
* B: n3 k$ O: _4 J! y- } - (defun c:ai_tilemode1 ()8 _' _9 d3 u, |: Z
- (ai_undo_push)0 q1 s6 e5 ~% H ]" X
- (if (/= 1 (getvar "tilemode"))
% t! g Z% B6 I% } - (command "_.tilemode" 1)7 s# T6 p f" j0 M: L! f
- )
, [" B2 D- p0 v - (ai_undo_pop)- b2 M" O( k4 O- ]9 B: u
- (princ)- s2 y, m0 ?: ~. P& b: X
- )+ C) C4 O- M. m$ H/ X$ t2 R
- 8 d7 P7 ]1 w3 k5 a' m- C. M( }4 O% Z5 I
- ;;; Pop menu Draw/ Dim/ Align Text/ Centered) h+ `) ?" A6 O) I2 `
- ;;; Toolbar Dimensions/ Align Text/ Centered
; R& i# E4 V( o2 G+ \$ b
0 ^5 {9 }7 M4 u4 z5 Y" L* ~: l8 t* I- (defun ai_dim_cen (/ ai_sysvar ai_dim_ss)
* u: e7 c! _4 N( M - (setq ai_sysvar (getvar "cmdecho"))+ X. Z) F$ y4 [! _, ~
- (setvar "cmdecho" 0)
5 U% Q8 l( r% i/ q, I1 E- n8 v - (cond
; M' q; K7 A, q) _7 Z C% ^# {/ Y - ((setq ai_dim_ss (ssget "_P" '((0 . "DIMENSION"))))+ q: O/ I+ e# u. ^' j. z* ^" E* V
- (command "_.dimoverride" "_dimjust" 0 "" ai_dim_ss "" / `% w0 B, d# C
- "_.dimtedit" ai_dim_ss "_h")3 W0 p1 b+ V8 Q( y: ~
- )
- |& ]* l1 U! @ - (T nil)
, @0 O4 h6 ~7 C$ u1 L - )% g# L' X2 @+ q
- (setvar "cmdecho" ai_sysvar)
1 i+ r* ]% y1 \- u) J2 _ - (princ)
. E ]/ w! C! a - )! H! H) q" p! o r- Z
) h o6 i, F! p# K U- ;;; Shortcut menu for Dimension Text Above
$ N% b6 E; g4 }# c0 C9 z - ) H9 T* A2 C% E8 J- f
- (defun c:ai_dim_textabove (/ ss)
3 U* M; ^/ @ ~% l! D4 d; b2 a - (ai_sysvar '("cmdecho" . 0))
! D# i6 u5 M) t8 q& p - (if (setq ss (ssget "_I"))8 u, a; q0 o" n/ t3 _% D
- (command "_.dimoverride" "_dimtad" 3 "" ss ""); P, m3 ]( A+ r7 b& ^- k
- (if (setq ss (ssget))) {- y2 x5 N. E4 R+ L1 C2 T
- (command "_.dimoverride" "_dimtad" 3 "" ss "") " g8 M9 l5 u: X% {8 Y
- )6 f; d& Z( ]0 w* X, I1 b
- )* ?( k% t( z5 E( b! B3 w
- (ai_sysvar NIL)
; w; u G* X# e* M7 J4 x - (princ)+ B( ~/ z/ `- U' C j9 t6 W
- )# z: G1 z( @) f2 q: ?" K
% E4 z1 F! x' ?3 Z* z0 p( h- ;;; Shortcut menu for Dimension Text Center ! ?2 j' S3 S& B
- 5 o( S/ K; |! U1 ~/ \2 f! ~
- (defun c:ai_dim_textcenter (/ ss)% Y$ {' w& n; [2 v- U
- (ai_sysvar '("cmdecho" . 0))$ f% ^6 J0 T* h w; r
- (if (setq ss (ssget "_I"))
% H% t" S3 t4 [4 ~" U- Z - (command "_.dimoverride" "_dimtad" 0 "" ss "")' M( L! D7 }/ Q/ c# k% N
- (if (setq ss (ssget))3 ~. O7 D8 \1 i2 i
- (command "_.dimoverride" "_dimtad" 0 "" ss "") 0 F# y! a: Q7 Q- i! H0 `
- )
" Z, _$ o9 ^+ g- \. ^: c$ u - )! X+ S1 v7 H$ e4 H/ J3 C/ Q
- (ai_sysvar NIL); ^7 T, g. I i5 P/ B f1 P
- (princ)3 b2 S# r8 g+ Y, W6 \7 `" f3 ^
- )
( \' j5 G. g$ Y4 P% s. c( S* H
2 F0 |4 u: I) X- ;;; Shortcut menu for Dimension Text Home
7 J( n7 l; o- ~& d; a: U' i - $ Q. W1 y w0 v8 p% J+ t8 w
- (defun c:ai_dim_texthome (/ ss)( ~! N! {- }4 T% [
- (ai_sysvar '("cmdecho" . 0))$ r h+ b8 E/ E O. a! B
- (if (setq ss (ssget "_I"))
. ^' m9 @$ W, k( ~2 a( j0 p0 i - (command "_.dimedit" "_h")
& h3 H6 d1 Z U. s d - (if (setq ss (ssget))
" Q7 b' S; ]: `6 o& r9 c. ? - (command "_.dimedit" "_h" ss)
( K$ v- P% U: Z, \; i' e - )0 `5 T9 o. Z2 V8 U6 M- q6 z+ F
- )+ H5 b3 u% _* B, W9 N
- (ai_sysvar NIL), t0 z8 _# y p, F; L/ E1 \
- (princ)3 q( J/ q7 J" J& I
- )$ W2 R1 e. k0 p, z6 [; L
- k/ k7 f0 o( H/ i# Q1 @
8 q! z# i/ [+ P" K7 X- ;;; Screen menu item for CIRCLE TaTaTan option.
( V( e- {3 \9 c$ z5 g v5 _* D - ;;; first, get points on entities
, a0 c$ m) l' e5 X5 B& j+ C - (defun ai_circtanstart()
* Z' f1 \ ]2 v7 j j2 _+ z - (setq m:err *error* *error* *merr*)( r0 F$ x! n* t3 B9 w
- (ai_sysvar " g0 [0 H6 E4 x5 ]5 M9 m
- (list '("cmdecho" . 0)
% K& a( y$ ~% }9 B; N6 C% D8 O - ;; make sure _tan pick for CIRCLE gets same entity$ G% K2 L% B g7 D, e" H
- (cons "aperture" (getvar "pickbox"))
; X) b& o: f* \2 ` - )
+ _/ T9 O! }0 A; T# w# l/ n8 [ - )
5 G4 j3 v" H4 R6 o4 T& q - ;; prompts are the same as CIRCLE/TTR command option
: x, ]: D" {+ E% W- B - (setq pt1 (ai_entsnap "\nEnter Tangent spec: " nil))
9 p: U3 D0 p, v - (setq pt2 (ai_entsnap "\nEnter second Tangent spec: " nil))
3 _/ J; b& m+ B4 Z - (setq pt3 (ai_entsnap "\nEnter third Tangent spec: " nil))
1 p8 ?' ^9 Z+ e3 L! w; f - )
; ?) m5 @0 h- [8 T, G. J; ^4 \ - ;;; Command-line version4 j8 P& `- C; D Q( Y+ i+ }
- (defun c:ai_circtan (/ pt1 pt2 pt3)
' I9 Q; P4 j4 s: ^1 R - (ai_circtanstart)
: F7 B+ J% W4 l7 h. Y/ \ - 0 P7 N$ a; t" K Z3 q6 T1 @2 d( S
- (ai_sysvar '("osmode" . 256))+ M6 @5 _ `* A2 V% F
- (command "_.circle" "_3p" "_tan" pt1 "_tan" pt2 "_tan" pt3)
, O' a& B+ X O; U" v - & L% c( l) k2 m. {7 d" r
- (ai_sysvar nil) m" R6 B/ p% o. J, n6 `% x1 R; u
- (setq *error* m:err m:err nil)
0 l+ V) s. u; @# |2 c* F7 I - (princ)
( ~7 d. x2 h8 M2 j- @5 O- \: c - )' K4 U- e1 q' h: T
- ;;; Use this if CMDNAMES == CIRCLE
2 A, O- C/ Q) y" S& s" w$ b - (defun ai_circtan (/ pt1 pt2 pt3)) n" d! ]2 d* M) t
- (ai_circtanstart)9 J6 s& }% L9 v
- 7 b5 C& g- a- _
- (ai_sysvar '("osmode" . 256))- H( u/ O, }- c4 b
- (command "_3p" pt1 pt2 pt3)8 U/ x; B+ I4 |
-
6 f( P ], c$ D! W" ^; f - (ai_sysvar nil)
. N- y1 Q$ ]( v$ e/ r) d - (setq *error* m:err m:err nil)
9 O6 G' y9 Z# g& g b - (princ)- ~3 ?& Y7 m8 W {: j
- )6 t' l0 B. A# A5 i# e& i( Z
- 6 \! B7 h! Z9 y6 y
) I) y% O" K3 I" W; N) X
4 o9 H6 S; Y& A4 ?+ H# G- ;;; Shortcut menu Deselect All item.
9 G) W5 J- n0 b1 \' l0 C' s7 u6 b
: H& k4 p: |2 q* v- (defun ai_deselect ()! ^$ P& U) R8 [
- (if (= (getvar "cmdecho") 0) ;start if
/ h1 R# L7 c% a- R5 ] - (command "_.select" "_r" "_all" "")
" q+ |5 I) ]8 X. o2 C - (progn ;start progn for cmdecho 15 K3 B/ p# c! G: j( b$ i! [
- (setvar "cmdecho" 0)
- ?' j2 G. R5 i8 [& G7 `0 H - (command "_.select" "_r" "_all" "")" {) N; }. d I9 {8 S* y, C
- (setvar "cmdecho" 1)
$ C! k! X+ j4 a& O9 m - ) ;end progn for cmdecho 16 e! b" u# ~3 b {# h3 s# D+ m
- ) ;end if
, [+ p3 ]: ?& l# O; g9 p- H2 n2 l+ G - (terpri)
: Y l- H/ b' \) k* ?/ @ - (prompt "Everything has been deselected")6 m6 ?! D O6 a) p, F) b5 s3 ^' q
- (princ). s) C' y, s( }* C
- )
9 @( ]/ x* s. ^4 O' R. G
# D/ {; P- [* G0 F* @: q2 U0 v- M- ;;; Command version of ai_deselect to be called from the CUI5 R' v y# u% l- w8 k
- ;;; so it gets properly recorded by the Action Recorder
6 n- G" v9 I6 r h4 C9 z: M# n: U - ;;;
_: e0 b2 D+ Z% Z4 L6 F9 V - (defun c:ai_deselect ()
2 h3 Y( V0 H$ g; W, m' J% q+ V - (ai_deselect)+ O" V, B' {4 w E S" V1 A
- (princ)
" ^% f( {7 H3 M/ J8 U" { - )
: q8 ?" j6 u3 x2 r: q+ [5 N1 A - 8 E: H7 ?4 H3 P! N0 s
- ;;;# }+ ^0 L# t5 \! n6 ~( m
- ;;; Enable Draworder to be called from a menu0 T% f( C- i! {7 p
- ;;; Checks for Pickfirst selected objects3 L, B0 u, C9 k K- _1 A+ P
- ;;;
0 E; m8 z" [. q& m - " x! i) Y, C% v0 V$ l( ?
- (defun ai_draworder (option / ss )
2 ]/ t1 V* t( W! ~% \
) ?# a* h: \. E- (setq m:err *error* *error* *merr*): A7 \0 d4 [1 c
- (ai_sysvar '("cmdecho" . 0))
4 I5 T; z/ c2 [5 D+ n+ K. j2 k% L - % W% Z7 p" U3 j c' o( v
- (if (setq ss (ssget "_I"))
7 n3 E' S% S2 h9 m9 e; t - (command "_.draworder" option)9 d) B' N# `( C4 Y4 c$ [# V$ W
- (if (setq ss (ssget))9 ]7 m1 a: d4 _! J% o8 q
- (command "_.draworder" ss "" option)3 G; p$ j4 N# A. y0 _
- )8 ~9 \0 S- P" i$ Y
- )
( w! a# a. L0 p* ` - (ai_sysvar NIL); b7 g1 b0 ]/ f( ]
- (setq *error* m:err m:err nil)
+ u2 E. }3 ^- r* Q' o; Q: W
1 H8 R0 C: F& A- (princ)! \. o1 W" g: j+ Z
- ); w% \5 |4 s/ m; W; H
& F( ]+ _; U; ?: E9 ]: }$ M3 `4 Z- ;;; Command version of ai_draworder to be called from the CUI; _. x w$ B/ ?
- ;;; so it gets properly recorded by the Action Recorder0 s5 ^6 {! ?: i& h3 `. f# H
- ;;;
( F R, s2 _! q* k - (defun c:ai_draworder ()3 b* x9 I+ c0 p8 u7 {8 f
- (initget "Above Under Front Back")/ `! S" K% x1 G" d. a% y
- (ai_draworder (strcat "_" (getkword))). e. \! u( `' i! c# R4 a
- (princ), q. W1 @6 t# z2 b4 v& O+ U
- )
% F8 K5 [/ B9 g3 S1 V+ N# J7 [( Y9 P8 ^
7 f* L" P& b* E2 D5 u# K: ?1 k: m- (defun c:vlisp ()
" D7 w J) d# B: y - (if (/= nil c:vlide) (c:vlide))5 Z( G9 u$ E" a% ?) ~' z( R
- )
6 Z& d4 T+ p& {' n; G! Z - - s( }- s5 d7 j. M s
- (princ "loaded.")& Z: T! U V# U
- V# P$ y& G6 J- M/ ]
- ;; Silent load.& }( G6 _. }7 J g) O
- (princ). N' J# P5 O" X9 V, r( L
! S/ M8 C E. l; r2 u1 Z% {) \- ;;;----------------------------------------------------------------------------; J% B& ?" c' `% O( G
- ;;;
# B& |6 m ^% A0 c - ;;; DDCHPROP.LSP Version 0.5
) @$ P6 w* C+ B# r& `7 t8 w - ;;;
4 Z5 R- @- g& i T, j - ;;; Copyright (C) 1991-1993 by Autodesk, Inc.
! i6 M; |2 E- l/ ?. t0 ^ - ;;;
9 U3 S5 k8 _' d- w Y - ;;; Permission to use, copy, modify, and distribute this software; B m2 A# d0 O/ C+ a( M7 k
- ;;; for any purpose and without fee is hereby granted, provided
6 I* H1 d. x8 z0 j* Z: I1 U' q! g* j - ;;; that the above copyright notice appears in all copies and that, A/ I- B* M" c2 Y: s; X
- ;;; both that copyright notice and this permission notice appear in
8 W% k+ S9 p7 g. x& u( k - ;;; all supporting documentation.
1 \3 b' c7 V/ w7 t1 } - ;;;
7 ~% y& K$ g+ n5 I7 J+ ^ - ;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
1 y; S: H, b. [" o8 q, z8 q - ;;; WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
1 J+ q3 f: \5 n: w5 j. G - ;;; PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.% Z f! {0 e+ g) I9 L* d
- ;;; T: n" `# L- F; p3 q8 V
- ;;; 2 February 1992
( i7 R' g# X# W* c9 n! d5 ~ - ;;; C7 c6 y1 _2 y
- ;;;----------------------------------------------------------------------------6 t0 ]6 _7 G+ }1 B V0 d1 G5 Y
- ;;; DESCRIPTION8 f5 U6 t# ?" U- A# l
- ;;;----------------------------------------------------------------------------, ~! z6 e8 O' i" I! u$ ^
- ;;; C:DDCHPROP is a dialogue interface for the CHPROP command.
0 v7 g6 p- D6 i - ;;;+ \! i, C; _; ?! E7 Q' k- ~
- ;;; The command looks similar to DDEMODES. The main dialogue has an image 3 l. J3 A5 c5 l, G- m0 s+ }! A
- ;;; tile, 3 buttons (layer, color, linetype), and an editbox (thickness).
9 n) m0 k7 l: A/ K; W - ;;; The 3 buttons each launch a sub-dialogue containing a list and edit box. ) m, W+ {; a# a. s7 U$ ^0 R2 t6 D) X* K
- ;;; The dialogues are all defined in the DDCHPROP.DCL file.3 o7 C7 R/ D% v
- ;;;* f: |, |! I6 n, o
- ;;;) o8 A2 M q2 @0 B
- ;;;----------------------------------------------------------------------------' ?) D4 {# y/ y1 S7 _5 a
- ;;;----------------------------------------------------------------------------
C5 U) s. D6 d - ;;; Prefixes in command and keyword strings:
R1 J' r, G: B. p4 n1 O# s# j - ;;; "." specifies the built-in AutoCAD command in case it has been % m B, J% A! G$ a8 q8 U
- ;;; redefined.
/ i+ |' w9 E) x - ;;; "_" denotes an AutoCAD command or keyword in the native language7 |# }2 v* V; y G$ D5 X
- ;;; version, English.9 Y" f1 d/ e. U+ {; v) S' h7 Y6 C
- ;;;----------------------------------------------------------------------------+ l! m6 g9 d: q6 N' d3 Q$ W8 L
- ;;;
# U0 y- ?2 k2 T6 ?5 } - ;;;
: @! n5 \6 w& k1 j+ K5 S$ Y - ;;; ===========================================================================
- H$ y$ d/ U+ E - ;;; ===================== load-time error checking ============================0 n. \( z! y* J* Z6 {
- ;;;
. I5 t" R$ b( J2 [- J- p - 6 a* o: i; T: Y/ B/ a' Q
- (defun ai_abort (app msg)2 S2 V! N+ v$ A) e! i
- (defun *error* (s)
% n2 G$ C; i8 t' u# G- b0 T: ?) D - (if old_error (setq *error* old_error))7 h5 u2 P6 c' c( n5 U& G6 @
- (princ)2 x3 u5 ~9 a, X
- )
2 [4 h+ f6 f# k3 q+ t - (if msg
7 y- y: J# N# N. l! t2 w6 D - (alert (strcat " Application error: "$ N) b9 v9 F/ m& E" J
- app
" F; i6 e* I/ M0 h: m; T, S - " \n\n "
6 a9 g+ V- k6 G7 }( E - msg
# W# s" [6 A. I! H; Q - " \n") c9 @" v5 r5 n% k
- )6 r0 R {. m4 W8 J! ]9 P
- )6 J. x9 }7 C. i; u9 [4 W0 K! y* ?
- )
% c$ g& ^: Y# c2 Z4 g1 U5 k, ] - (exit)$ P0 J9 O) ?7 O) M. R f# D
- ). T. u- d8 L; z: M$ `3 }
+ r8 `7 t) z, y: U9 Q+ y- ;;; Check to see if AI_UTILS is loaded, If not, try to find it,
4 N$ z% c C# i - ;;; and then try to load it.4 z) |% o6 K G6 x' [0 i; z2 ^" B
- ;;;4 v, |) p7 C6 A' K6 H! L& P
- ;;; If it can't be found or it can't be loaded, then abort the% g; c. b( A) }+ o0 h( P, Q
- ;;; loading of this file immediately, preserving the (autoload)
8 f1 v3 P2 l! q3 i - ;;; stub function.
: L8 P) T/ I4 d% `0 H( Y. U
$ b) E2 N+ n: ~& A# z- (cond
: ^' B2 @- w R8 s( I0 c4 } - ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.8 _: [/ w& u: m% ?
- 2 z7 V& ?# ]6 s8 S* u
- ( (not (findfile "ai_utils.lsp")) ; find it1 w3 j" L R! v' t7 x9 ?# Y: v# r
- (ai_abort "DDCHPROP"+ Q1 R' D R- t. C' Z1 T" a
- (strcat "Can't locate file AI_UTILS.LSP."
8 ^/ J( o0 M5 S) a# @ - "\n Check support directory.")))
: N$ M+ B" L0 b8 c6 i j - . m/ ?- \: W+ M s, C
- ( (eq "failed" (load "ai_utils" "failed")) ; load it
8 y) e Y# Y# X) c P$ G4 R - (ai_abort "DDCHPROP" "Can't load file AI_UTILS.LSP"))2 r1 w, L# E2 U& e2 c+ h6 E. g
- ); }/ O3 n8 q# T' l
/ w5 ? j& _* [& G3 X& K; y; U N5 J- (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP$ d, t4 h" C- I# `9 H
- (ai_abort "DDCHPROP" nil) ; a Nil <msg> supresses9 F+ B s0 t5 \1 ~6 b6 y1 Q8 B
- ) ; ai_abort's alert box dialog.$ x# y1 Q/ n( y
- / k; u9 F, n% K( i
- ;;; ==================== end load-time operations ===========================
' I0 R5 d z, Z4 b/ |& W! y
& u+ D3 [2 |0 t: ~# O- ;;; Initialize program subroutines and variables.
8 ^9 ^! m; ~* o ?3 [" { - 4 L' S3 O5 z8 f) r* s
- (defun ddchprop_init ()
. k: P# a+ f: H
5 g. Z/ H2 |$ k6 F- ;;
0 b$ ?3 M' p5 z# K6 o" c - ;; Define buttons and set values in CHPROP dialogue box 0 I0 _- e( W' o, m- `
- ;;
( a, ]# h! k3 F8 L$ v- [* @& N0 M - (defun call_chp ()
6 y) C3 N! l( t# L - (if (not (new_dialog "ch_prop" dcl_id)) (exit))
5 p% A. p- n, N4 A" \7 r( X: ` - (set_tile "error" "")
- N; U" G3 u, b; H2 Z! B - ;; Set initial dialogue tile values2 I6 m/ O, g- Y; y0 r4 Y
- (set_col_tile)
/ C6 R5 W1 E% @2 t, P, \; D! ? - (if (= lay-idx nil)
2 z& P3 P- P, t E# G, n - (set_tile "t_layer" "Varies"). Q ]0 p( x: U; m/ \
- (set_tile "t_layer" (nth lay-idx laynmlst))$ A6 ]2 D- b+ [/ C( v' g
- )3 a. R* a. A. Q2 ^1 _4 c( O" |
- (cond % R, x# Z$ f. j* W y4 g+ _
- ((= lt-idx nil): u$ c- N3 \+ c
- (set_tile "t_ltype" "Varies")
9 Y# [8 r( a5 ] |( y! x, n - )/ S2 g1 k# O0 t' q
- ((= lt-idx 0) ; set tile "By layer & layer linetype"
+ U* p: y7 O7 k/ S4 M7 S. `, a - (set_tile "t_ltype" (bylayer_lt))
+ _- E: b4 U- z. _. J3 s- {9 x9 T9 [ - )
3 [3 r; O, S4 p D8 G2 N6 F. z3 J- R - (T . y1 E1 f8 {9 ]( b( K7 u/ P0 V
- (set_tile "t_ltype" (nth lt-idx ltnmlst))
; Y6 Q# M C" F3 g) \ - )
. u8 M; h$ |+ B/ |# o* ]) E/ f4 ? - )
% K* D. J. L0 v - (if (or (= ethickness nil) (= ethickness "Varies"))" K+ y+ }. n3 S6 J5 e* s& X
- (set_tile "eb_thickness" "Varies")
# Y% U/ _1 H* o/ P0 i - (set_tile "eb_thickness" (rtos ethickness))# j9 b& P. n! V7 r+ S
- )
4 ^7 x; X# H7 g: ]5 H+ P9 r8 g - ;; Define action for tiles: J' x: H3 ^: o3 M9 x f
- (action_tile "b_color" "(setq ecolor (getcolor))")+ ]: p# o' y) Q- \! X
- (action_tile "show_image" "(setq ecolor (getcolor))")
9 ` e) k% _ b2 @ - (action_tile "b_name" "(setq elayer (getlayer))")0 ?+ O; O- ?! ] i6 {* g' m
- (action_tile "b_line" "(setq eltype (getltype))")
! Y+ W$ g3 f8 D8 s! I' M - (action_tile "eb_thickness" "(getthickness $value)")! B3 {+ V. K" f; g( }; X
- (action_tile "help" "(acad_helpdlg \"acad.hlp\" \"ddchprop\")")7 @$ A# j: v5 P* q! B3 W/ n
- (action_tile "accept" "(test-ok)")
/ U. ^6 i- C% i - (if (= (start_dialog) 1)
- [. g3 U" u+ F! ~4 D - (progn6 n( C j8 M2 m! L* ?' f
- (command "_.chprop" ss "")
( h* w8 X; q* E8 D; C, }0 v - (if ecolor
, `. n, l3 t/ V2 S/ v: {4 L - (progn& Z" z7 h7 g p$ y: Q1 I
- (if (= 0 ecolor ) (setq ecolor "BYBLOCK"))
# E( I. ^) b i- K - (if (= 256 ecolor ) (setq ecolor "BYLAYER"))
' S* Z# X# w2 q8 t8 ~ - (command "_c" ecolor)9 A: H$ R0 \. M* B# T- @; o" ]
- )- m p: E3 ]0 W4 H6 ^4 } _
- ): v/ O* H$ k. l+ Z# l
- (if (and (/= eltype "Varies") lt-idx)9 t4 F% {3 U% r0 |6 z
- (command "_lt" eltype)
0 p/ e2 [: ?% z/ Y3 N F6 l - )
1 q0 N# Z+ {0 }) x - (if (and (/= elayer "Varies") lay-idx): D. L4 o" p3 k, l! A+ Y( M
- (command "_la" elayer)
J8 X$ j' \, g' d; [" k0 o9 k - )
, ^, Y% G: k8 @) V3 O! F - (if (and (/= ethickness "Varies") ethickness)' p. I+ J4 i( d
- (command "_t" ethickness)
/ W" b- w& A6 F6 y - )
* j. o8 n0 I2 P% c/ d6 r - (command "")
2 L4 Z1 S0 G6 b - )' Y' a) ^3 s1 o
- (princ "\nProperties unchanged") y' Q/ x/ h1 {" h) h0 x, x! X
- )0 R9 x% I9 I& x) `) V* O' p
- (princ)
- Y6 b0 r9 h" Z( Y8 ~8 S - )
+ b) R ^) ]; y, Z t$ x. ^3 k6 J - ;; \6 u" l7 x( ?6 O- b
- ;; Function to set the Color text tile and swab to the current color value.
& z- o% s. d; U - ;;
+ U+ v$ s% c# V$ [( q4 @ - (defun set_col_tile()) f* M$ o/ ]5 D4 t
- (cond 2 R! S, f: {0 L: L
- ((= ecolor nil)
( ?/ e: J8 E. d7 i8 L( V - (set_tile "t_color" "Varies")
; O" v& @1 E; D( S; ?8 w+ q7 ^ - (col_tile "show_image" 0 nil)
$ f% F1 l* q$ y: I3 B: ^% q - )
% M( v* q4 x" F* P$ @0 e - ((= ecolor 0), g1 v$ r8 p+ E9 ^
- (set_tile "t_color" "BYBLOCK")! N' L, u( B$ g( n- Y+ n1 X( X9 \& U
- (col_tile "show_image" 0 nil)( ?. w4 F6 C7 W" G. `$ k9 H
- )$ j: ^+ T5 `0 A8 e/ m3 V
- ((= ecolor 1)
7 ]' k Q4 E8 |; C0 t! y: r& F - (set_tile "t_color" "1 red")* P j- W4 E. t# V! t% _( A
- (col_tile "show_image" 1 nil)6 u' \$ H0 b# M* O6 v7 ^
- ): p4 S# s/ j; R4 b) Y& H
- ((= ecolor 2)
! h9 \$ q/ a; }) s) c$ k! o - (set_tile "t_color" "2 yellow")5 J( t$ ^! |3 L5 n
- (col_tile "show_image" 2 nil)9 T: M7 K9 ^8 w
- ). w' U- R% F) ^* c& T) a% \
- ((= ecolor 3)/ f4 H/ ]2 q4 b$ ~( [
- (set_tile "t_color" "3 green")" u: u F3 X( g! a4 o5 C
- (col_tile "show_image" 3 nil)
0 s U; U8 x1 [0 ]+ I& `5 Q - )
0 i; W2 [! i* D8 A1 b ] - ((= ecolor 4)
$ ~1 g, K8 g- v. Z) C% C - (set_tile "t_color" "4 cyan")
b ~$ s! M9 F/ n - (col_tile "show_image" 4 nil) A0 @& G, g* N& ^6 Y- w
- )6 z, n/ C6 I- l& g. N/ e
- ((= ecolor 5)+ V2 Z" I6 s9 P X8 ~. ]
- (set_tile "t_color" "5 blue")
( Q4 g' x% e. I4 o! V4 s; ~ - (col_tile "show_image" 5 nil)
6 g: m! l3 Z0 o! J - )
, G P5 J# P, e. j) @0 _8 z. E - ((= ecolor 6)
! o& W4 H& f+ o7 T - (set_tile "t_color" "6 magenta")/ n( \% M9 W7 P. B3 Q0 Q0 @
- (col_tile "show_image" 6 nil)0 G: w! \: l" y O, g# O. e7 z
- )
' Z6 a$ F1 b% T& P: g, ^ - ((= ecolor 7)
/ O7 X y: w0 {3 Y/ d0 y - (set_tile "t_color" "7 white")9 H, M2 \9 p1 i# s: \+ c
- (col_tile "show_image" 7 nil)
! X0 O' e8 r7 u5 P9 k5 a0 c9 G - )
6 T6 ^5 S' F1 b2 z7 j4 k - ;; If the color is "BYLAYER", then set the tile to8 [+ D, n f+ a: y5 s& d
- ;; show it's set By layer, but also indicate the6 c! J, W$ u. f# _: n% G
- ;; color of the layer - i.e. By layer (red)
F/ h s9 h: K% ~7 B) ?/ \4 D - ((= ecolor 256)
) f( c8 k8 u* c+ e- v - (set_tile "t_color" (bylayer_col))' k2 U! ]$ j' z. ^. F
- (col_tile "show_image" cn nil)4 p7 f# U1 g1 |" C; I" [+ B$ Y2 C
- )/ g! w7 f. b+ x' \2 Q$ Y% Q
- (T
J- _" L8 L! Y; A% V - (set_tile "t_color" (itoa ecolor))7 J$ k" r" B4 S" S
- (col_tile "show_image" ecolor nil)
# O0 w; [9 M& F" Q0 ?- I - )& W n3 a* }: W1 h9 U
- )+ O Q6 w1 G/ ^7 \0 n
- )
0 Y& T- |, w* e; S8 C. I4 G, N - ;;
% }8 c5 }7 @( i B% N: V: b - ;; Function to put up the standard color dialogue.4 c# k+ h; W9 H# L) J
- ;;
" k3 ]9 D+ t7 j j" h! L - (defun getcolor(/ col_def lay_clr temp_color)
; J7 l2 [' W, o( ^3 p! X - ;; col_def is the default color used when rq_color is called. If ecolor
4 z8 c8 P; R, m' p# B, | - ;; is nil (varies) then set it to 1, else use the value of ecolor.
( Q1 C& C1 p; ~ U' n8 n - (if ecolor
" @: O0 d9 i% Q8 `7 \$ T3 [# ? - (setq col_def ecolor)2 `, J* S! h0 j5 f* I$ e2 _
- (setq col_def 1)
# a* F4 `! a, _ - )& F& x& i) J* z# I7 z5 y
- # o1 D U r* A, H8 y6 E! P
- ;; If we're working with a single layer, get its color" t1 O4 T) w3 C) q+ {
- ;; for use in the color swatch if the user selects color BYLAYER.2 D8 W$ v1 F4 @) b0 k$ o( n
- (if (/= elayer "Varies")( c0 _4 d& d# V9 W
- (setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))
; ]2 @* [7 A# M2 f& } - (setq lay_clr 0)
* l3 |. P, v; m* P - )
9 c; S6 f: k; e3 V4 C5 J# b& I* {% \ - (if (numberp (setq temp_color (acad_colordlg col_def T lay_clr))) h% @ ~- X( H! C3 q6 D
- (progn8 y X+ ]) F! ]4 Z. H2 P* f
- (setq ecolor temp_color)6 D! q9 ]4 O% l9 u* }
- (set_col_tile)
% C( D7 A8 i0 d, U" \1 S3 b. | - ecolor0 v. r, N4 ?+ F# B
- )% |2 G7 v- Q) v7 m9 e5 {( S ?9 x
- ecolor8 N B6 ~" A+ z" ?- g
- ) % o4 i9 [; Y2 b4 |
- )
2 s' k9 B. o, A: r6 v6 y+ T - ;;
" |: e$ Y: T0 @3 U - ;; This function pops a dialogue box consisting of a list box, image tile, t. W' Q$ Y- Z9 g
- ;; and edit box to allow the user to select or type a linetype. It returns
. k! D9 K0 t! ]1 ^# o2 h - ;; the linetype selected.2 t. N7 j# G2 E; z! s
- ;;
; C" o* {' P6 U1 z1 Z- N - (defun getltype (/ old-idx ltname)
( i( ]5 ~4 X, \- K$ O0 o - ;; Initialize a dialogue from dialogue file, {+ V; n, G& K0 H: n3 w0 K- \, \
- (if (not (new_dialog "setltype" dcl_id)) (exit))
* {1 s7 _* O( A$ x/ w - (start_list "list_lt")) f8 k- U7 H" E4 O! u
- (mapcar 'add_list ltnmlst) ; initialize list box# E- Z0 C9 ]0 x( `
- (end_list)
( z3 T* |/ J) Z - (setq old-idx lt-idx)
+ U* o4 }+ |! Y7 G R- r4 r" } - ;; Show initial ltype in image tile, list box, and edit box
* l. X0 C% t Y% y9 n3 S( @ - (if (/= lt-idx nil)
2 J4 S* k8 ?9 y; @8 g+ K. f - (ltlist_act (itoa lt-idx))
1 N8 }/ [6 }5 Y$ h% Y0 j0 N' g - (progn
+ D5 j, N' J) h- A8 i3 M - (set_tile "edit_lt" "Varies")
9 G" M- r( e# j' P. ` - (col_tile "show_image" 0 nil): b- B7 a) Q% A4 s/ y* ~& R
- )' d, [9 {% P4 X
- )
3 A. F) n; K: O) l- j - (action_tile "list_lt" "(ltlist_act $value)")
7 a- @, P- b* {3 K3 O% Y Q$ D/ g - (action_tile "edit_lt" "(ltedit_act $value)") Y; w5 V u8 j) h/ R3 m' ^
- (action_tile "accept" "(test-ok)")' R6 S& o! R3 ^9 w
- (action_tile "cancel" "(reset-lt)")
6 `7 l1 R( [ U/ y: q- F6 L. a - (if (= (start_dialog) 1) ; User pressed OK
/ w% _5 p1 C: W) n1 }8 x I6 \, K - (cond
% M. t8 E" o5 \& W - ((= lt-idx nil)
8 b3 ?" F5 Z' _( X* R+ a - (set_tile "t_ltype" "Varies")
/ y8 ~/ S: \& m* y - "Varies"
: i' L1 ^4 S4 f+ t8 e - )
% @3 @- G2 r7 Y( Q$ w, K - ((= lt-idx 0) I4 C* n' C/ F* i
- (set_tile "t_ltype" (bylayer_lt))
c, W5 e$ `% X0 R - "BYLAYER"! L; x4 |, F3 ^" \
- )1 X& \7 [& y T1 O! J5 Q% E
- ((= lt-idx 1)
7 \9 }5 O. y; R# q: u* \) ` - (set_tile "t_ltype" "BYBLOCK")0 e- p/ d0 U* M) k# L
- "BYBLOCK"3 u4 i: N. T* X# L
- )
2 _9 E! C* ?9 ] - (T ) v3 a+ I7 ?; T
- (set_tile "t_ltype" ltname) ' G; e& E( q" s' G) u
- ltname* \: b2 t/ b& m
- )
$ x9 y$ N3 ^0 B6 z( E - )
# ]/ A0 R6 U' _1 ` - eltype9 u0 W: ^/ y! C8 P8 n6 v# ?0 s
- )
! c7 p7 L# S1 t7 V& C% w& H - )0 k& w! f1 y5 @5 j# D9 J: c4 o4 V; l
- ;;# o- ^* L7 K7 x5 B
- ;; Edit box entries end up here8 K# L: C+ n: k/ o
- ;;
, P1 _0 s: ~1 g; S d0 D8 N: g2 R - (defun ltedit_act (ltvalue)
) _0 |# u3 g* Y4 x; m7 N( M7 w8 G - ;; If linetype name,is valid, then clear error string,
& T: ^6 q% L# c - ;; call ltlist_act function, and change focus to list box.# R$ @5 n: |( a" j$ l h
- ;; Else print error message.
" q) H' @! `- \5 V) M/ E3 w9 ` - (setq ltvalue (strcase ltvalue))* C8 @5 [ u9 B4 W% o, B; D
- (if (or (= ltvalue "BYLAYER") (= ltvalue "BY LAYER"))
9 T$ O3 I7 ]. x+ \, N* F& t - (setq ltvalue "BYLAYER")- J! d, U% {& Q" p; \6 O
- )
9 m. a8 Z, ], s6 y* ]0 m9 s8 p/ ]) V - (if (or (= ltvalue "BYBLOCK") (= ltvalue "BY BLOCK"))
4 V0 u: P+ N; \9 a% |2 D7 X - (setq ltvalue "BYBLOCK")* C) y1 p7 r& ~
- )
?8 g9 S3 _% ?5 A' b( h0 m - (if (setq lt-idx (getindex ltvalue ltnmlst))% V P; L2 D. T+ o+ L2 b7 j
- (progn
0 n) ?8 i: d# A4 G F - (set_tile "error" "")
% B8 J% ]0 U5 t0 B - (ltlist_act (itoa lt-idx))$ k0 G* s7 X4 | n
- (mode_tile "list_lt" 2)
: n c5 Z) ^2 B9 v - ). P9 _7 u' `8 F8 i
- (progn
: O0 l1 s8 h& @+ Z - (if (/= ltvalue "VARIES")1 i) L+ W! F3 |
- (set_tile "error" "Invalid linetype.")
" z" s+ q8 O+ |8 {6 _* v - )
* o5 K5 T4 t+ t9 g4 I1 z0 u - (setq lt-idx old-idx)
; \4 o Z/ B" Z( W7 s. R - )
/ Z& ^+ z/ C3 Y# @0 u - )0 S. _0 f- l9 u- U
- )% V) ^& W D) H
- ;;
& H/ V, W% \& \, Z8 X( y( Y - ;; List selections end up here
6 ~: o" l+ g" s( d5 K - ;;0 i/ `9 p' N' n: ]
- (defun ltlist_act (index / dashdata)
5 }9 m/ l% H3 @! j5 E! u$ W6 V - ;; Update the list box, edit box, and color tile9 v& f" f9 z% g0 `. m4 P5 A+ a2 m
- (set_tile "error" "")0 b6 n6 ` I1 ?
- (setq lt-idx (atoi index))
% @. m* \2 s5 X* D j( B* J - (setq ltname (nth lt-idx ltnmlst))
( F; `7 } c/ F - (setq dashdata (nth lt-idx mdashlist))
" x) U$ S; G x: E' F - (col_tile "show_image" 0 dashdata)- [; v) Z* G( V; r
- (set_tile "list_lt" (itoa lt-idx))' I* ?! j9 x/ ~5 }7 D: f
- (set_tile "edit_lt" ltname)
/ v+ E' n- D1 E& A* M - )
( d- R- x$ W( `4 w8 Q - ;;
. `2 a' m+ x- c: A3 K, g+ v - ;; Reset to original linetype when cancel it selected
7 d3 k# u) }0 l+ l# B1 f/ L - ;;4 Z7 z/ @# A) u+ }
- (defun reset-lt ()' z; x1 w B1 U4 X( J8 I+ v
- (setq lt-idx old-idx), p8 g* i1 O5 ?! q
- (done_dialog 0)
% |) c( c* ?! r# ~' e- W - )
8 b' z8 ?7 J7 A& Y; z - ;;
+ r' {) y5 g5 Z! R8 E) F, l) p - ;; This function pops a dialogue box consisting of a list box and edit box to
& v: u; _# `" x& @5 ? - ;; allow the user to select or type a layer name. It returns the layer name 9 z: x( G x4 a) H, U7 k
- ;; selected. It also the status (On, Off, Frozen, etc.) of all layer in the
+ W2 X2 x/ l- h' o4 d, l - ;; drawing.
9 K4 x* e9 d- g5 z - ;;
6 a E9 K/ V4 ?: I& \& u5 R - (defun getlayer (/ old-idx layname on off frozth linetype colname)! d* w# U! E5 k$ F; F
- ;; Load a dialogue from dialogue file4 @: j* V6 ?1 B+ E- \! \1 s U
- (if (not (new_dialog "setlayer" dcl_id)) (exit))# f' q: V6 a) ^+ C3 a: U2 L
- (start_list "list_lay")
) X% @6 P; F. d4 n" ^. ` - (mapcar 'add_list longlist) ; initialize list box; h( h$ C4 L% d0 h- d
- (end_list)
! W- U: o' c: ?4 ]# T - ;; Display current layer, show initial layer name in edit
- I' y- r% m6 `' V4 @ - ;; box, and highlight list box.
) ]1 F2 T# H' O" l5 F' A - (setq old-idx lay-idx)
% L1 k% v/ B- V: W - (if (/= lay-idx nil) (laylist_act (itoa lay-idx)))
# M6 h! n, U4 f7 m! ~4 F - (set_tile "cur_layer" (getvar "clayer")). K2 }, o$ p3 m$ M2 M: w* b
- (action_tile "list_lay" "(laylist_act $value)") }" Z% z# B5 }. j" M1 V C
- (action_tile "edit_lay" "(layedit_act $value)")7 p1 T" u) ]8 n& @7 `: [, l" j+ d
- (action_tile "accept" "(test-ok)")
5 s) C9 z9 W: }9 } - (action_tile "cancel" "(reset-lay)")
* x; X A4 u' o7 z8 F9 l# _ - (if (= (start_dialog) 1) ; User pressed OK1 b8 E! B9 N2 S' a
- (progn' v9 V, [4 Q' S& k+ w
- (if (= lay-idx nil) (setq layname "Varies"))7 a8 _, t$ X( X% c, z
- (set_tile "t_layer" layname)' M0 N& j* k: J/ w5 T
- ; If layer or ltype equals bylayer reset their tiles
# d# z3 s0 q6 M - (if (= lt-idx 0), Y7 P' s: \) x4 I9 e% Z
- (set_tile "t_ltype" (bylayer_lt))6 `: l5 f$ S: J; Z1 L8 ]1 q
- )6 ^6 b! b# {: q/ p
- (if (= ecolor 256)
4 a# R/ ], t/ O - (progn& y3 \$ @9 R4 F- b# c
- (set_tile "t_color" (bylayer_col))
: V2 }% Q0 w' X: B) Z: u$ R( U, ? - (col_tile "show_image" cn nil)
7 }8 X" y+ Y! l9 y& C+ V - )
6 F) N, {! M! ~) K - )6 o$ v( M$ C) g' B# `# {
- layname
6 ?1 Z0 Y* p/ q* o3 I# Y - )
4 f* N! B( J" p& t! Q2 O3 A - elayer
: ~% R5 D7 H. s1 ^5 u6 l6 [, s - )& n: @9 w. x Z4 p" H( A4 q
- )# f% p8 [' {0 b# b2 Y
- ;;1 h, V0 ?$ W$ ]0 t% I" O: M& f
- ;; Edit box selections end up here
7 ?* o* B' F1 x. `3 K - ;;& s: O6 Y& w$ Z
- (defun layedit_act (layvalue)
+ C9 l/ J5 U* M, _ Y& l - ;; Convert layer entry to upper case. If layer name is g2 `4 T' R$ j f3 q. z
- ;; valid, clear error string, call (laylist_act) function,6 f) I8 W4 H# J
- ;; and change focus to list box. Else print error message.
. V9 p# u, v" ^3 J. c' Y' M$ X7 i# e - (setq layvalue (strcase layvalue))- @& A! O# k& _ R# L: R% C
- (if (setq lay-idx (getindex layvalue laynmlst)) G% V, J' V r4 [& C Z
- (progn( u m7 ]4 L2 d2 u; M* ?' ]9 q+ t6 F
- (set_tile "error" "")
' _9 Z8 V% m5 Q0 |2 x% L - (laylist_act (itoa lay-idx))
% ]" w+ v' A' Z( ^! j, R0 |1 _ - )
; A# l, l4 k3 N- } - (progn( z& [: H# J% `( B9 B" p
- (set_tile "error" "Invalid layer name.")) a7 d( x0 O3 f+ g. W
- (setq lay-idx old-idx)
: s( n. w0 G7 Q$ t - )
6 _7 p* g0 ]! p& d! B3 `7 W) D" \ - )% e, F) i) A+ p0 F
- )
8 v& T) A2 L0 y* C2 V9 l( x. H - ;;2 [: R' W4 B* F1 g) N
- ;; List entry selections end up here* u6 a# I5 S+ m C! M/ v9 h) P
- ;;
7 v5 W. h) R m% |+ r1 r - (defun laylist_act (index / layinfo color dashdata)
, Y T6 X; w; a% k+ x2 \0 O - ;; Update the list box, edit box, and color tile
0 u9 `1 J) \6 x1 J4 H - (set_tile "error" "")
5 m0 N. g, A+ k - (setq lay-idx (atoi index))! U0 p1 q) V8 d1 B3 v; @
- (setq layname (nth lay-idx laynmlst)), t, r( r# V4 }, ]1 S2 R2 V; d
- (setq layinfo (tblsearch "layer" layname))
$ h9 G8 `3 ], i8 r% W2 q! ~ - (if (= (logand (cdr (assoc 70 layinfo)) 4) 4)
5 Q: ~* G" m Q# C- G - (set_tile "error" "Cannot change entity to locked layer.")
! ]+ k0 t! I8 n& v! z: f - (progn
3 s9 J& K5 ^! |* S6 s - (setq color (cdr (assoc 62 layinfo))): |9 N# p* ?1 |
- (setq color (abs color))
& e: d* n+ }9 e - (setq colname (colorname color))3 P3 z/ \1 `$ C; z- D
- (set_tile "list_lay" (itoa lay-idx))
+ T6 v, b9 K8 C - (set_tile "edit_lay" layname)
- {4 N' u( `! t - (mode_tile "list_lay" 2)
0 q2 o! f3 P) J - )- i9 e! C5 J0 |: i2 _2 m, M, V: |* T( f
- )
+ m8 p$ M9 ]! `+ z - )
8 L! K- b+ _7 N7 v3 G$ G - ;;
- S. F2 s& @7 {) W b - ;; Reset to original layer when cancel is selected$ Z7 k* _ K2 |% z3 k( f- {$ M
- ;;
: i7 d: G2 s& q- `8 S- J - (defun reset-lay ()
4 i+ n9 C ]7 s! H; C4 ~' F6 \ - (setq lay-idx old-idx)' M6 ]- v3 \* h' r4 F/ J
- (done_dialog 0)+ Y& J6 q# i& \7 V$ k- M" |
- )
- e& y2 G% E/ s* G& t - ;;7 C7 H- U6 p+ l8 N2 g0 H+ a, \
- ;; Checks validity of thickness from edit box. Since (atof) returns 0 when a 1 Z6 w& p' t& E0 ^; F" v; N; v
- ;; string can't be converted to a real, this routine checks if the first & {$ i; i% C& C" G U
- ;; character is "0". It also checks to see if the value equals "Varies".
4 L0 Y; L) O2 @( Z0 v) F. G - ;; l" d$ ?: J' v. p2 P
- (defun getthickness (value)5 q9 m2 v: ~ [7 P
- (setq value (strcase value))1 L8 w1 O, r5 r5 g" n) v: V
- (if (or (= value "VARIES")& g" `/ l3 m3 J( t, y- ~& \$ Q
- (distof value)$ [& P+ m$ ?8 s* b8 C
- )
: I. b0 `$ g/ C - (progn) M+ q% b0 {* C! e; y4 |. B
- (set_tile "error" "")
7 ~* [6 B0 g! d$ k - (if (= value "VARIES")( T; P, R; p: }! X5 I+ d
- (progn
/ r* F* p! J X ] - (set_tile "eb_thickness" "Varies")
( `! I' D z( @9 V C - (setq ethickness nil)
3 e0 d" N5 L, |% G: ?: \' Q' p1 B - )
; L; z5 I, a6 K; `! L - (progn
! |0 j1 n6 S2 D3 L2 g& T - (setq ethickness (distof value))
/ k- F3 q' D& m% E9 D - (set_tile "eb_thickness" (rtos ethickness))
% l, k$ K, Z. i6 G& Z, b) {: N - ethickness
5 o$ h! ~2 {- r6 k4 Q% M - )
4 X5 u7 ^% d2 D1 c. T v4 I5 I - )! t) Z2 w, O; r$ J
- )
0 _/ m% g8 d0 v - (progn9 A0 \, P! m6 j# @8 `/ b4 X7 N! B$ D
- (set_tile "error" "Invalid thickness.")/ `4 }0 k8 i' o
- nil
6 F4 x2 _4 r" N8 U$ q) g - )
& `6 z3 h, w4 {7 B0 G L - )
( i- o) Q+ _8 x5 ^3 Q* } - )
6 @+ T: p( z0 B) M& i5 k6 Z! |5 O7 h5 Q - ;;! Z' ]/ B' a* K$ l5 t# U" L
- ;; This function make a list called laynmlst which consists of all the layer
. J2 y a0 W2 L5 ?9 e8 e: {' ^! t8 n - ;; names in the drawing. It also creates a list called longlist which . ]$ E# B- _$ g$ `+ _
- ;; consists of strings which contain the layer name, color, linetype, etc.
, d/ _. [ Z# i# Q8 L% k& K. G - ;; Longlist is later mapped into the layer listbox. Both are ordered the 4 }8 d6 |8 l R# W
- ;; same.
9 _3 {# _+ N/ Y4 u - ;;8 c6 Q" H+ Q7 Q
- (defun makelaylists (/ layname onoff frozth color linetype vpf vpn ss cvpname
4 H. q; B% C9 L/ u - xdlist vpldata sortlist name templist bit-70
, N1 U Q: N) h) v - ): L$ z: B- l, d
- (if (= (setq tilemode (getvar "tilemode")) 0)8 n; k0 _5 I; ]) B
- (progn
) k: C5 H+ Y9 n* n - (setq ss (ssget "x" (list (cons 0 "VIEWPORT")
1 y7 J$ n- Q% h - (cons 69 (getvar "CVPORT"))" ^7 G2 \1 M, d2 @: k8 @1 m
- )- g$ J# r" Y& X3 H3 K& n6 ]2 i
- )
. n+ K0 S: ?2 c c6 |- ~5 }: e% | - )
& X$ b) G, H: A# k0 R6 e7 g7 y X - (setq cvpname (ssname ss 0))% @4 j) Y" F5 A' J' H e! b
- (setq xdlist (assoc -3 (entget cvpname '("acad"))))* y- k8 f" I( L8 Y3 q$ S) B
- (setq vpldata (cdadr xdlist)); B# ^8 L- j1 M& e" {8 e7 e# r
- )
9 O! w% t$ \! e% V - )
g' f7 B, R" C2 a' I7 w# ^; j - (setq sortlist nil)) u0 v" P+ F9 o' r# ^# t8 J( a
- (setq templist (tblnext "LAYER" T))1 _- R# n1 O2 R3 E3 U
- (while templist _3 |) V6 z0 k" b/ l
- (setq name (cdr (assoc 2 templist)))( q' S/ m; g% ^( A' t
- (setq sortlist (cons name sortlist))3 r- E9 l6 R- e5 @1 |/ }
- (setq templist (tblnext "LAYER"))9 ^/ z; y( y, R8 u% U" L. X! N
- )
: k0 }" P k e - (if (>= (getvar "maxsort") (length sortlist)): x. q* T z3 J& v
- (setq sortlist (acad_strlsort sortlist))
7 A' L& D6 b' j, Y0 s3 x% ^ - (setq sortlist (reverse sortlist))
6 I4 o' ?8 R/ \4 C+ p% ] - )% a- h" b2 d' M H
- (setq laynmlst sortlist)
$ M" Z6 R( Q; z! D! ] - (setq longlist nil)
- W5 d6 \3 i5 R( E! f1 ~ - (setq layname (car sortlist))
- R8 p4 f, H& A0 p v- ?9 r - (while layname
' K: d1 C- a5 @$ e' c2 T ` - (setq laylist (tblsearch "LAYER" layname))0 ^; v" _7 b5 w, i# Z
- (setq color (cdr (assoc 62 laylist)))
$ o) B0 U. K+ p - (if (minusp color)
2 G+ ?- O; s. j) _" E - (setq onoff ".")! F7 Z" b5 i, e5 m4 p7 V
- (setq onoff "On")
5 V, Q2 p" V* d @3 Q' F, D - )2 K3 r0 I9 ~' c' s: c' y: K3 a( l. j" @
- (setq color (abs color)); r( k" ~8 x: r/ m4 `% b9 E) |
- (setq colname (colorname color))1 ^, I5 S1 y& r1 M
- (setq bit-70 (cdr (assoc 70 laylist)))
7 b' T2 H. y+ P: V# a/ y( ~4 l7 V - (if (= (logand bit-70 1) 1)
) h" N$ \& e8 C, g/ y1 ` - (setq frozth "F" fchk laylist)) \1 P5 Q0 a7 i# P8 n7 c( y% V( s
- (setq frozth ".")
0 C" W/ A/ E Y# C - )7 M0 ?+ Q$ X9 Q A
- (if (= (logand bit-70 2) 2)
" }, f3 F/ D4 T' u5 R$ B! I - (setq vpn "N")- Z. m! s: O0 W; r6 Z. e
- (setq vpn "."). K( U& h" p8 K8 ^* O& T9 Q; U
- ): U9 }, G6 ^2 Y# {8 ^
- (if (= (logand bit-70 4) 4)7 M" H2 R3 G% `$ j! T
- (setq lock "L")
$ x. x' y3 z* f- E - (setq lock ".")
- W# n- H2 f n9 @: z - )
- n/ T4 y3 ^) V8 _# Z( ?/ f2 C - (setq linetype (cdr (assoc 6 laylist)))$ B4 b) a8 j2 p& \' @# ~% y
- (setq layname (substr layname 1 31))
" l5 {9 b( T5 C - (if (= tilemode 0)
1 Z( s- S* p& q! P$ Q# I - (progn
4 w; L' R* P. D) I3 L - (if (member (cons 1003 layname) vpldata) }! k% y6 X4 p a+ W4 a/ K( m5 b
- (setq vpf "C")
& A2 X) r s7 r+ D8 Y# G1 h H - (setq vpf ".")
* E( G6 P" w. M3 q/ W8 ] v - )* T! ~2 G }5 F
- )
" r% {7 q8 h L: D+ u+ X! E - (setq vpf ".")
7 X+ q1 X7 A `! x - )* C: ~" N& K4 P0 l. b
- (setq ltabstr (strcat layname "\t". ^% K- d( X0 X8 s
- onoff "\t"
$ b' H! `' j; i* |" O - frozth "\t"
! W& A/ L4 {* f8 ~( P' } - lock "\t") A8 y3 g- s) \: r, n, ^
- vpf "\t"
, R* z! q% I6 {9 M& j - vpn "\t"
0 g# s- `3 a. ?7 S$ f' e4 G% | - colname "\t"
1 A! I3 V, T. y n$ w. o7 I7 e7 l - linetype
0 M$ I6 M8 {3 ]; `6 d( c6 t5 c - )
4 M$ k/ W- n0 O3 z" H% M9 {1 A2 I - )3 P* [) b8 {& u `, n& M0 p! f
- (setq longlist (append longlist (list ltabstr)))
/ r8 u2 X! C# K& @ [ - (setq sortlist (cdr sortlist))
$ j m6 Z. e, M2 b0 V* F - (setq layname (car sortlist)). ^ Q5 Z+ g* Z; V; i# n
- )- u8 C8 z3 p* A* X: @
- )! T) W( W& n0 D8 o8 F1 _ l
- ;;( A- X4 b6 y) t c2 h2 D# K
- ;; This function makes 2 lists - ltnmlst & mdashlist. Ltnmlst is a list of
Z) F! ~$ J6 J - ;; linetype names read from the symbol table. Mdashlist is list consisting * U9 b; c6 ]: _
- ;; of lists which define the linetype pattern - numbers that indicate dots, 7 s( ]" {& Z/ }( W. b1 E) O
- ;; dashes, and spaces taken from group code 49. The list corresponds to the , B, I0 e2 x) [ H( T
- ;; order of names in ltnmlst.
2 a! \7 \4 e+ J - ;;
2 s3 L8 I5 ~. n - (defun makeltlists (/ ltlist ltname)
2 \8 C+ t( |7 `4 K* r$ s" \ - (setq mdashlist nil), f3 Y% |( Y: y7 q6 Z
- (setq ltlist (tblnext "LTYPE" T))7 Z8 K3 J3 d, p" u0 v$ m
- (setq ltname (cdr (assoc 2 ltlist)))* w8 g8 L" n& K
- (setq ltnmlst (list ltname))
* V8 ?& M( t7 T+ Y
5 ?: u, e$ w9 i6 V7 A2 [( V- (if (= ltname "CONTINUOUS")
2 l& Y1 V% ?& A5 T1 t& h1 v - (setq mdashlist (list "CONT"))
% a0 U9 F) }% F: g! _$ p7 { - (setq mdashlist
$ s. Y# F6 j: S# R* n9 R - (append mdashlist (list (add-mdash ltlist)))- Q: R4 ~5 p8 v! X9 r8 O0 k; Z
- )
: B9 E; O4 H9 w+ S$ K0 Q" l6 s# d2 j# I - )
- l7 ^. t7 l% C5 o" P, m! M - (while (setq ltlist (tblnext "LTYPE"))" E' z8 R' ?- `+ w& d- l
- (setq ltname (cdr (assoc 2 ltlist)))8 @+ Z+ v8 u# s6 R p" j' s
- (setq ltnmlst (append ltnmlst (list ltname)))
/ w8 A6 o" i! _: g1 A& F8 V! a - (setq mdashlist 1 A7 t- S: S0 _$ K1 o
- (append mdashlist (list (add-mdash ltlist)))
# D* `; a0 C. Z2 K/ a$ H5 U, B5 y& u9 X - )! f2 F. @0 D' M
- )
* x* y0 }% t5 Y1 h' U/ C - (setq ltnmlst (cons "BYBLOCK" ltnmlst))8 F: C( C+ |, l9 p
- (setq mdashlist (cons nil mdashlist))3 W3 u) w# s/ j6 K+ ?5 j
- (setq ltnmlst (cons "BYLAYER" ltnmlst))
; ]4 u p4 F, f& |# T - (setq mdashlist (cons nil mdashlist))
9 s* K1 S! [, s3 a7 r$ u - )$ A% c" S: M" \5 j, D
- ;;& g0 \. b5 O- O0 ]) H* b
- ;; Get all the group code 49 values for a linetype and put them in a list : B' ]$ g5 P% w1 Z2 Q& l' q
- ;; (pen-up, pen-down info)
, q; ~- q3 Y; G# E. U - ;;
: t1 x( }6 w" Z: S, q: S- Y - (defun add-mdash (ltlist1 / dashlist assoclist dashsize)! R: j! t+ }$ ^" W f2 U+ p d
- (setq dashlist nil)
: B+ @0 Z {1 E1 y: N - (while (setq assoclist (car ltlist1))
4 A3 `$ I2 H; ` p: k/ \ - (if (= (car assoclist) 49)
' }* G; B; p y2 F - (progn0 B+ Z: h) ~0 h2 D3 P* f% ~2 A* i
- (setq dashsize (cdr assoclist))% l: b: o* Z: u& y
- (setq dashlist (cons dashsize dashlist))* l2 G! @- i; m+ q6 c- W
- )3 f* V. x, g' Q7 i3 g e' b X
- )
* P5 A# F4 R- d/ I0 P1 F3 e' _& V - (setq ltlist1 (cdr ltlist1))1 O$ E. l3 D9 {1 r: f" b7 n- X/ W
- )
8 Q4 ? _" Q& @+ J - (setq dashlist (reverse dashlist))
1 ^8 W5 w5 b/ ]" i# p9 z, H - ), u3 B/ n7 H4 a' y' E1 U
- ;;2 I* f5 K3 N- u R+ F3 D: T
- ;; Color a tile, draw linetype, and draw a border around it+ ]% h9 E- z: v3 d$ N" \! b
- ;;
/ A! }6 n+ ^" j+ C. T+ z - (defun col_tile (tile color patlist / x y), j$ S4 i, j5 g9 ~& h
- (setq x (dimx_tile tile))
$ F2 {. |9 y3 z3 a" L. N - (setq y (dimy_tile tile))
+ Q/ C( {3 M% \2 E2 E% e: s - (start_image tile)" q; Q% d4 y3 {4 p
- (fill_image 0 0 x y color)
' v) q: n& x+ h' [9 \4 V/ [' v - (if (= color 7)
: A4 x" f4 E( ` - (progn$ d; J& }2 |' F
- (if patlist (drawpattern x (/ y 2) patlist 0))
+ t. l7 j, M8 d& z - (tile_rect 0 0 x y 0)
2 h4 r* u$ W( R: R% F - )
/ Z5 Q e% f& `# f O. I - (progn
, B* V$ f3 @' a3 J; f% p @ - (if patlist (drawpattern x (/ y 2) patlist 7))/ N6 R4 \3 M& S! N5 |7 {* c
- (tile_rect 0 0 x y 7)+ \. `( x( I+ E {: U( f& c, t
- )
/ k( O4 ^+ K/ _. b7 {% _* W - )
' K3 Z- r. b9 U- d- h0 H4 @ - (end_image)
9 Z5 p8 q. `9 j+ F" S# _ - )- D3 `9 ]" A- p8 M
- ;;( J/ X+ Y9 j9 a2 t! P$ ~6 m
- ;; Draw a border around a tile
# X i( Y) z' W* ?* ?$ r* `: |7 e - ;;
4 a ?$ {& ~ A - (defun tile_rect (x1 y1 x2 y2 color)
+ p, c7 l" B& U' o% j8 f - (setq x2 (- x2 1))) Z/ l4 }! h$ t8 f% E8 r/ I
- (setq y2 (- y2 1))
5 \+ ~% J+ ]/ r7 M - (vector_image x1 y1 x2 y1 color)& i. L7 h. w9 |0 I& z
- (vector_image x2 y1 x2 y2 color)
% }0 N& ~4 U3 s; X+ _ - (vector_image x2 y2 x1 y2 color)7 k; p' z/ S" c+ Q+ ^2 R
- (vector_image x1 y2 x1 y1 color)$ p [+ y1 r; S; k
- )
& t: p' Z0 Z% l8 A# l - ;;
/ v- Q+ z8 |: _+ q7 L) s& T - ;; Draw the linetype pattern in a tile. Boxlength is the length of the image
$ Z1 [+ N. t( b8 B - ;; tile, y2 is the midpoint of the height of the image tile, pattern is a
; ~2 a; H7 _6 j) E - ;; list of numbers that define the linetype, and color is the color of the
5 b4 X2 t) e1 b0 O: ~' |6 h2 U - ;; tile.- q- Z5 A5 L+ f7 D1 z9 X
- ;;
& ]. H$ S; }3 i: L* m - (defun drawpattern (boxlength y2 pattern color / x1 x2
2 v! ~/ M8 I, `# M! k1 H- g - patlist dash)
$ ]4 Y0 s' \4 O! @9 T - (setq x1 0 x2 0)* |$ \$ o+ g- O; j. X, \; g
- (setq patlist pattern)
7 X8 c. |/ _1 F& f6 S - (if (= patlist "CONT")$ ^- K Y7 ]3 ~0 |+ I
- (progn * X' w, K# Q& ~. k% S0 j! z" u( r8 b3 }
- (setq dash boxlength)
3 Q3 N. V6 v9 r- ?. I# Q1 A - (vi)5 \& A% j: F: ~4 g
- (setq x1 boxlength)/ O8 Z, Q8 x" j; ]( e# ]( B5 @0 Y& u) Q
- )
5 K, O! K6 l) a- Z - )
* ? M/ B5 g0 I6 R; w - (while (< x1 boxlength)
4 l: K3 _. C, ?% C* q# e - (if (setq dash (car patlist)): [# z4 W- a/ `- J( J+ i
- (progn
3 _& J- U1 V7 Y' U - (setq dash (fix (* 30 dash)))
$ i* i) D0 H1 e, u6 A - (cond
, X; s3 I3 A" W' p. W* e - ((= dash 0)
Y, m0 a7 u0 _3 D - (setq dash 1) % d: H! S+ N1 A! S D A
- (vi)
/ P- {+ M) G2 x! x+ n - )
" u m+ ^9 q+ _4 Y - ((> dash 0)
" Z9 n1 F# k/ u: a* f1 D - (vi)
o" f% H7 A; C1 {( } C - )% f0 U+ k1 `+ e4 t3 _
- (T # ]. |7 ~% o. c
- (if (< (abs dash) 2) (setq dash 2))# W* w v$ [$ F) }# C
- (setq x2 (+ x2 (abs dash)))! S: ?# z: B( j6 {
- )
4 r9 c" U" `& P; y( \+ F9 K0 e' o - )
2 Y6 m6 _+ f! |& m } - (setq patlist (cdr patlist))5 B3 Y. y4 }2 u5 O$ c
- (setq x1 x2)4 t3 X: v9 {, S1 c
- )
5 ]& h" E- l7 `6 z2 h! z- v8 ^* X - (setq patlist pattern)
: }( H+ S# w7 v& b$ B; A, [ - )' \+ B0 N8 a: y7 N$ P/ [' K
- )* |5 Z( d( ^' _' _6 I3 V
- )/ X; H$ ?: O% P) x* \8 C; R. f
- ;;" L: F; N' z" t4 d( ~, b9 E
- ;; Draw a dash or dot in image tile
7 J5 y* M6 a; [- A+ Y - ;;
7 i% `/ l8 g3 @ - (defun vi ()
' p, r: i: {& ^3 o2 T% ] - (setq x2 (+ x2 dash)): u* J! ]+ g# d) p Y
- (vector_image x1 y2 x2 y2 color)
' b) R1 B- B. i7 ~4 I - )$ n& k7 d, a0 f0 Z
- ;;
. V- o2 p. a% Z - ;; This function takes a selection and returns a list of the color, linetype, 0 K8 ` g! Z; I& }( ]; f7 o9 @
- ;; layer, and thickness properties that are common to every entities in the4 z; E( N" N4 Q# X: ]% ]! V
- ;; selection set - (color linetype layer thickness). If all entities do not 0 v9 N8 M1 Q6 R* j% ~. _+ K
- ;; share the same property value it returns "Varies" in place of the
! x m/ K; i7 F/ U- H6 g9 D7 p: z - ;; property value. i.e. ("BYLAYER" "DASHED" "Varies" 0)
8 z7 Z" O% Z- ]7 ^ - ;;
$ @6 [6 C$ S4 m! ~5 O - (defun getprops (selset / sslen elist color ltype layer
1 z! U. E8 T1 q7 i, W' ^ - thickness go chk-col chk-lt chk-lay chk-th ctr)2 T1 {, M/ X4 @: G; v- {) r0 \+ p; X
- (setq sslen (sslength selset))
6 J8 o+ N/ ?; t- A. f" I - (setq elist (entget (ssname selset 0)))! E7 i u! l- a# m# k
- (setq color (cdr (assoc 62 elist)))
% i8 C- `2 N9 ?' f! ]" P - (if (not color) (setq color 256))
Y2 ~, v7 _8 ]6 C w& I - (setq ltype (cdr (assoc 6 elist)))
+ B* i$ Q; s! o - (if (not ltype) (setq ltype "BYLAYER"))
( E3 T' `5 g& O# C& U% f - (setq layer (cdr (assoc 8 elist)))
& O$ t! [$ {/ c - (setq thickness (cdr (assoc 39 elist)))
2 Q, F6 I- m! [! m - (if (not thickness) (setq thickness 0))
' @4 e5 \0 F" T3 A5 C - (setq go T chk-col T chk-lt T chk-lay T chk-th T ctr 1)3 X5 j4 _& D' \6 O/ b3 h: z3 z
2 e; n: t/ v$ _1 B# a4 Q6 |0 u- ;; Page through the selection set. When a property
, h; E# A% J9 e+ ~! s - ;; does not match, stop checking for that property.
@) P/ p8 L/ }+ B/ m6 O8 M - ;; If all properties vary, stop paging.- @/ M. n6 [: h5 i
: }7 r8 E$ j3 u6 z- (while (and (> sslen ctr) go)
2 p4 C# x' m% S - (setq elist (entget (setq en (ssname selset ctr))))5 l; c$ r/ Y* Z/ ]& {% s
- (if chk-col (match-col))
2 h4 G8 Z+ X- F3 ~7 { - (if chk-lt (match-lt))
- h. {% ~7 i0 o* t# d - (if chk-lay (match-lay))
+ Q! i+ n$ X4 D1 k: V _ - (if chk-th (match-th))8 {7 q9 c" Q0 f7 |6 U& p
- (setq ctr (1+ ctr))
# J @# L8 G8 t7 j0 x/ K1 i - (if (and (not chk-col) (not chk-lt) (not chk-lay) (not chk-th))) r) O3 G8 V4 [8 @0 {
- (setq go nil)$ Z8 C+ @7 J8 z. J o2 x9 v6 z
- )
: _9 N& X5 I+ w - )
: K1 z [ K h2 I# D: | - (list color ltype layer thickness)/ `, H% Z$ w+ N" b5 q3 K% _
- )
- e O2 z& \% B. A! u# G7 A/ n E7 L - A' S" h3 X u/ e6 K
- (defun match-col (/ ncolor)
) C0 G2 E7 a3 M) f - (setq ncolor (cdr (assoc 62 elist)))
9 x/ R/ C9 ]$ E0 q! [ - (if (not ncolor) (setq ncolor 256))
# H3 f- z* f) D" T7 F6 B, M8 R7 U. O* l - (if (/= color ncolor)* M1 M5 f5 N3 m& }4 P" M
- (progn* ~( Z! g4 _6 z# }4 v/ I3 A
- (setq chk-col nil): Y* A$ o0 z3 R) I1 F4 z$ Q- p* P& U
- (setq color nil)9 a# ~: M: X' x5 ^! J1 S' @+ T
- )% z: G- {: c: G! p# C6 W' G
- )) u' e$ F2 O7 J$ F+ z
- )) m! t2 g4 M6 o3 |# ^1 `; g
P- I5 ~2 F+ F! H9 X8 A& d1 d- (defun match-lt (/ nltype)
4 `) h3 s: H1 W/ f& y- g! ] - (setq nltype (cdr (assoc 6 elist)))& u3 h. a5 q {: t5 K4 [3 P3 L% T
- (if (not nltype) (setq nltype "BYLAYER"))+ ]$ S' m5 s! ~: S. N7 q7 x- z
- (if (/= ltype nltype)1 A! J/ G8 L" e: C! f$ F
- (progn4 ^. \! S% _" M! | L
- (setq chk-lt nil)
( Z T# G$ y7 ?4 D1 o) T - (setq ltype "Varies")
( w9 \1 n: s( C' j - )4 ~' s3 \: Z; L- U2 k
- ): p( m; q% d/ j. T V
- )7 {7 u, L' b2 b
" ^$ x. o3 a2 `" h' y& s; O- (defun match-lay (/ nlayer)
5 q+ B8 {4 W( f, s @5 F) x' B' L - (setq nlayer (cdr (assoc 8 elist)))
! T6 U. j/ j6 u9 A - (if (/= layer nlayer)
/ F* ~0 C+ v6 n x+ J$ `2 X7 y - (progn7 s* E/ P2 b4 X- X x, r
- (setq chk-lay nil)
& o1 k# M6 T% g, m. e - (setq layer "Varies")
3 k6 g9 `8 C, S+ w+ A8 v - )
% A% y3 K% U2 D. O8 o& @) G' h - )
# _7 K+ W) U8 R" s" F* X5 Y4 @ - )! I# T) P$ P% J6 _( w4 K9 I
- 7 C1 e1 |, L5 S# H2 k6 u. X2 `
- (defun match-th (/ nthickness)
3 o& h9 Q( u- r% g - (setq nthickness (cdr (assoc 39 elist)))
5 R' e) X* ~& J& y$ G& K - (if (not nthickness) (setq nthickness 0))
& M1 s( M0 T K& K7 D, m - (if (/= thickness nthickness)
/ _! N! X0 d1 ~- h$ p( S) G - (progn
% {( I3 B) k5 p9 S/ n/ J! a0 U - (setq chk-th nil)
4 {4 m# a, f! ^' Q- \2 |! p - (setq thickness "Varies"), E; L. W' w! M1 E
- ) G# C( j2 T0 f6 d5 o% l
- ), ~1 `: H& b* w/ l k
- )
% F: S7 e$ a7 i4 N9 c: n - 8 q# _: `, ^. t# L- q3 F
- ;;
, k" A6 E% R# j* A' z' f - ;; If an item is a member of the list, then return its index number, else + z9 ~6 R) E. x
- ;; return nil.3 P. @" n( Z# B& O& b' z- a3 N3 k$ q
- ;; V$ T7 F& j& u$ e/ s0 ~0 y
- (defun getindex (item itemlist / m n)
2 k% N) o# d3 u3 I y - (setq n (length itemlist))
& R, R1 a/ `5 o6 G; p8 Y - (if (> (setq m (length (member item itemlist))) 0), w% `1 y- p7 C/ T3 a
- (- n m)
2 R" u" n# Y: X* ? - nil
2 y- d" Y* J: a) }) n6 u; h - )
" t) Z& G8 k3 I- d. S$ I% B - )
0 D6 I( ]% O6 G/ j* ? - ;;
6 t3 x+ v& t: A- o - ;; This function is called if the linetype is set "BYLAYER". It finds the " L/ x: J0 N2 g' A9 c. G0 W* X! l
- ;; ltype of the layer so it can be displayed beside the linetype button.: z* y! k; l7 ]! U0 l
- ;;+ C' Q7 G# P2 H
- (defun bylayer_lt (/ layname layinfo ltype)9 F% Y1 `+ ~ q3 I
- (if lay-idx
4 k+ c7 I$ |* I- R+ p. ^; ^8 g - (progn- |# b6 j8 H) M" E4 z; v2 N
- (setq layname (nth lay-idx laynmlst))
" y* S( E# A. Y- w) G' e& H8 {% x6 n - (setq layinfo (tblsearch "layer" layname))- d4 \7 P: W: C) ]
- (setq ltype (cdr (assoc 6 layinfo)))
& i% D, ~ y' Z; U' v$ P3 k& N - (strcat "BYLAYER (" ltype ")")
# [6 J5 l/ \" A) b - )$ ^% F5 B6 I9 Z& g' q! G1 n
- "BYLAYER"
; _# c# [# R# u. @; { i: C2 C - )
3 P5 a2 K3 w$ ~: M8 B7 U* G - )2 P. f+ i. i/ R% R" b. `' F
- ;;+ ~( p7 g( |0 _0 m* ^
- ;; This function is called if the color is set "BYLAYER". It finds the
/ l5 E0 v: U, w! l - ;; color of the layer so it can be displayed beside the color button.
+ X- {9 f- ]8 g - ;;
, B+ N( ?0 M5 p; m$ ` - (defun bylayer_col (/ layname layinfo color)
3 U9 M5 Y% ^2 U% Q) m/ D- \! D* U - (if lay-idx
. {# I6 R1 b, x* }6 x, p - (progn6 D6 {9 `1 o. J0 c
- (setq layname (nth lay-idx laynmlst))
6 d# ~$ v- G" {5 D' G, I7 a) X `! G - (setq layinfo (tblsearch "layer" layname))
$ E! u0 u- @$ A% Q* c, `- g5 [. E - (setq color (abs (cdr (assoc 62 layinfo))))
4 ]. s! f9 H/ Z( L* e7 y - (setq cn color)
8 Y3 i3 t$ k3 w* x' G" G$ M- Q# V - (strcat "BYLAYER (" (colorname color) ")")) Z. v. `# y% }( q+ D: Q
- ), I, Z! U2 C! p
- (progn& J' y: Q% v; s/ S. e1 n0 b
- (setq cn 0)# g- b2 R/ j8 t: p% S5 A: T
- "BYLAYER"9 e# t ~3 [7 F; _
- )
( S; z0 s3 q9 [8 @/ K+ X0 g& q - )
: ~; F6 [# E* D1 B f! D# h - )" N" s0 T6 c/ ]: [0 |3 W
- ;;
3 w6 w1 B- O- O/ K& n0 a. s - ;; If there is no error message, then close the dialogue$ v9 L7 m' O, \* N Z5 r
- ;;
. R8 F, E( y K" b- u8 a - ;; If there is an error message, then set focus to the tile7 d" B! s C0 b1 M- m; z$ [
- ;; that's associated with the error message.) c- K. W ~5 z) I7 f
- ;;
2 Y8 y# c2 E% X! x3 {, u - (defun test-ok ( / errtile)# j3 N* }$ t3 r8 y9 G; j4 x. h
- (setq errtile (get_tile "error")) ^4 G, ~2 O* r! {
- (cond
3 W+ [6 e0 J; u d- J6 o6 \ - ( (= errtile "")3 L/ L _5 l4 l6 _; V0 E
- (done_dialog 1))" n) e1 U0 s1 S) s. G( b
- ( (= errtile "Invalid thickness.")
$ \, F$ i. w J8 b r% e - (mode_tile "eb_thickness" 2))
( O3 K1 x0 m& Q* T9 n - )
4 ~1 g2 }5 m8 ~5 X4 J - )$ g# y6 j- ~" I9 i
- ;;
4 L8 u1 F) g+ c* e - ;; A color function used by getlayer.6 N& h, L p; }6 p, X% v7 x5 B6 N L
- ;;
[* X2 t; \2 m3 {& J - (defun colorname (colnum)* p6 Z0 U/ ~5 I
- (setq cn (abs colnum))7 A7 r3 j: G& s/ ]3 G5 ]
- (cond ((= cn 1) "red")
3 a. A# R/ v$ u: s( J& Z* q0 q5 @5 X - ((= cn 2) "yellow")
( |/ Z( q7 O) [7 Y' _ - ((= cn 3) "green")
+ m( \% i+ M: J: b, F6 c' A - ((= cn 4) "cyan")& [$ X1 |9 q$ N
- ((= cn 5) "blue")
* W/ j, d2 Q0 ]8 W# Z - ((= cn 6) "magenta")- h0 x7 l& [ W4 }$ o2 F
- ((= cn 7) "white")
( |" K9 b5 |( L' i& U& H4 ` - (T (itoa cn))
: G9 E9 }3 ]# W) ~0 k- L - ); @- `) L% U& T9 U) R
- )
' h7 Y7 E# N2 c
, e9 N, ^% }3 m: Y0 F" ?- ;;; Construct layer and ltype lists and initialize all
( A! U1 g* F/ _3 I4 R - ;;; program variables:
6 C- r* k* p9 Q - % U- y6 v" x k5 ^
- (makelaylists) ; layer list - laynmlst
% R L* ]6 i( g. S7 V - (makeltlists) ; linetype lists - ltnmlst, mdashlist
+ f0 n7 G1 B& h' n& A3 ? - ;; Find the property values of the selection set.
3 o! J& T7 E5 h) u( f - ;; (getprops ss) returns a list of properties from
+ z# L6 v' [8 d4 r( I! ? - ;; a selection set - (color ltype layer thickness).8 E' W! O* o/ {8 n; P8 U; g# B0 v
- (setq proplist (getprops ss))/ n& ~4 O9 _7 T/ v+ I
- (setq ecolor (car proplist))
) ^) `, ]$ A1 s" t1 R' [1 c1 U+ Y - (setq eltype (cadr proplist)). E b/ f- U9 x* a2 l
- (setq elayer (caddr proplist))
3 p. _- H7 G: w7 D6 ^# J3 p - (setq ethickness (cadddr proplist))6 S8 N0 O% T ~8 n# k
- ;; Find index of linetype, and layer lists
: Z. A. ?7 c* F& ^8 U; M8 H - (cond) m7 t- D8 D5 G! F2 o
- ((= eltype "Varies") (setq lt-idx nil))
; Z! E- Q9 h$ m# n7 S8 J - ; ((= eltype "BYLAYER") (setq lt-idx (getindex "BYLAYER" ltnmlst)))
( d7 j- V# Y8 ] - ; ((= eltype "BYBLOCK") (setq lt-idx (getindex "BYBLOCK" ltnmlst)))
4 J2 ^& K2 S( d - (T (setq lt-idx (getindex eltype ltnmlst)))
O9 Z0 w. v: J, P - )
# l& W2 [3 |. D2 s1 b - (if (= elayer "Varies"), `# f6 e3 _) k' D
- (setq lay-idx nil)% |' z; W1 l% q: I! c
- (setq lay-idx (getindex elayer laynmlst))
) n8 B+ \& e' I, G - )
% v, \" X s8 n( f3 F - (if (= ethickness "Varies")4 m/ d% Q; R. M: P
- (setq ethickness nil)
6 x& R3 N, M- C( m) G. F" A" L% q9 b - )5 s" ?. M3 ?2 h
5 S! i( L* R E7 ]8 p- ) ; end (ddchprop_init)
( ?) d B) n k1 [+ X; g
$ a* F- L% K! p, [- ;;; (ddchprop_select)
5 V# m+ }$ Q, M5 m. n6 m) ]7 Y - ;;;
9 p4 h P& |4 D5 s0 T* U' O/ K - ;;; Aquires selection set for DDCHPROP, in one of three ways:* b, c% p" h% U; H% J
- ;;;$ T7 r! C1 k% [) o4 I( [$ [
- ;;; 1 - Autoselected.* V% q$ `8 r* z% X
- ;;; 2 - Prompted for.4 u. k3 y' t: F9 t) u5 z! e
- ;;; 3 - Passed as an argument in a call to (ddchprop <ss> )
1 c/ n6 D$ i b% q8 f; V/ _* L - ;;;
/ w! G6 D: t' E: d6 U - ;;; The (ddchprop_select) function also sets the value of the% I1 Q4 O' `6 t5 K
- ;;; global symbol AI_SELTYPE to one of the above three values to
8 c) D3 n6 R7 Q) _5 [3 S! L: [ - ;;; indicate the method thru which the entity was aquired.
& J. _% W! I' O - 4 \$ Y- L0 o, m; y8 o- E' R+ l
- , o( F; ]% A: Y7 A( N7 r ^' c
- (defun ddchprop_select ()" E- K& ~% M! s' [- a- Z
- (cond
% V( ~ T0 t' ~1 K' [+ f - ( (and ss (eq (type ss) 'pickset)) ; selection set passed to
s* O0 p: j O4 s8 m } - (cond ; (ddchprop) as argument
) H2 C' H! T+ g/ ~' J - ( (not (zerop (sslength ss))) ; If not empty, then) ~7 P" t6 L. g# {) ^- @- N
- (setq ai_seltype 3) ; then return pickset.* @. L9 R" b: s7 V
- (ai_return ss))))
1 L2 O$ G/ }- W% ?& \ - W0 U- }9 o8 C4 S! \( r
- ( (ai_aselect)) ; Use current selection
+ R g8 l0 Z) l0 Q! b* | - ; set or prompt for objects) f. l& N; d1 ]0 l
8 ^* M2 P& i0 y- }! L' F1 k- (t (princ "\nNothing selected.")% a9 m$ q/ i* I! k E
- (ai_return nil))8 R2 m: f: @; g9 y8 P! M) h1 f0 |, }
- ) f, N2 ]' X1 I+ {: s
- )
+ I' I$ F; ]9 L' g) P8 K6 r+ o - q6 \2 R8 u& z6 r4 u& u
- ;;; Define command function.
8 U7 b3 U) u# B) l
4 k# C; ]8 z8 }! w7 _% [4 z- (defun C:CH ()
: c, }- K' S( `% l: ]) H - (ddchprop nil)1 m8 j) B+ I7 X* f' r
- (princ)
z! [1 @8 J+ ]2 t! a. D9 M - )
1 [2 G: m& J5 l% o* u" j
4 P3 @% N6 h$ \
$ |8 b6 `6 P# y- ;;; Main program function - callable as a subroutine.
2 I; T6 A' G5 h g( e6 _ - ;;;
7 w, u' G' x* p L) T8 k - ;;; (ddchprop <pickset> )
, s3 W2 d+ u& V# c! x8 i - ;;;
# T; ~0 X# z2 R: t) ] - ;;; <pickset> is the selection set of objects to be changed.
# T9 A$ z* S/ [ D+ F& j$ D - ;;;
8 R3 |& Z) ~5 ^7 }. i5 Y3 [ - ;;; If <pickset> is nil, then the current selection set is
$ [6 l6 G0 }' K Q; C- B/ G - ;;; aquired, if one exists. Otherwise, the user is prompted2 u" r- V# e- K, G
- ;;; to select the objects to be changed.
: R# ]- U+ w) s/ H - ;;;% Y7 [& P! N4 G& I1 E9 U, q7 q
- ;;; Before (ddchprop) can be called as a subroutine, it must/ u& j% ~8 t2 Y% n
- ;;; be loaded first. It is up to the calling application to
/ d7 c+ @$ f1 @* \# Z& p - ;;; first determine this, and load it if necessary.0 B! ]2 m/ L% o2 \" ?% T- h7 M1 b/ i
" }; d, o! f0 I! A- (defun ddchprop (ss /, y" E4 r7 h# C: ]& h' z9 Y
- 9 V9 Y+ u$ d/ M
- add-mdash ecolor ltedit_act s" c H+ u- n, W& w
- assoclist elayer ltidx selset
7 Q. ~& r" ~( p4 o6 P3 V - bit-70 elist ltlist set_col_tile: [1 B! l! O& t0 _. \" t: z
- boxlength eltype ltlist1
; \2 S- r7 T, C r - bylayer-lt en ltlist_act sortlist, N k$ s9 b) O8 i% F
- bylayer_col ethickness ltname
2 j- ^" ]0 o$ K3 }( [ - bylayer_lt fchk ltnmlst sslen3 v u0 r C! u8 z; V' _, V5 f
- call_chp frozth ltvalue templist5 a& c8 I, _; a ]2 I% l
- chk-col getcolor ltype temp_color
# y9 T6 A, N' p& D) L3 L - chk-lay getindex m test-ok
2 c) M+ P! p* V8 q8 s8 g; F - chk-lt getlayer makelaylists testidx
' h: i- a6 E5 f. s& n4 X$ n - chk-th getltype makeltlists testlay
+ r, L3 v$ `! e6 [$ g - cmd getprops match-col th-value& w4 F- U# t! h+ M) v
- cmdecho getthickness match-in thickness4 J: w) i! g+ M% R
- cn globals match-lay tile
& t$ T3 q9 l, _' [ P - cnum go match-lt tilemode. O& T$ q2 P$ K7 P& }" m( J* h6 D
- col-idx index match-th tile_rect
; L! K& e! K1 H* N - colname item match_col vi
9 J' ^9 W. ?7 M7 _0 `5 U/ ~( f' F - colnum item1 mdashlist vpf! g% g, z6 g0 Y
- color item2 n vpldata/ b, t9 x. g9 \0 Q2 i/ Z7 u
- colorname itemlist name vpn& t- Z" {. G0 Z- ^( {: x
- col_def lay-idx ncolor x
& A( J# t8 b1 } - col_tile layedit_act nlayer x1) W! o! S# w3 K
- ctr layer nltype x2
) }$ G& R2 D- a; k0 Q3 | - cvpname layinfo nthickness xdlist
; a7 F4 @* s8 C: g; y3 x1 W4 a4 C - dash laylist off y
4 J, X5 s7 j s* a - dashdata laylist_act old-idx y12 Z8 ^* w! f8 [6 w9 c5 g
- dashlist layname olderr y2+ l- z: ], X5 m3 O
- dashsize laynmlst on undo_init
3 e C R# x& j4 h F5 c - dcl_id layvalue onoff& @+ k, z2 Z D3 {6 {
- linetype patlist
- f j s9 l3 W- G2 W1 Z' r - ddchprop-err list1 pattern* k! X5 E1 A' h: x6 M5 k
- longlist proplist1 X; a# K6 v. X+ ~3 I
- lt-idx reset-lay; {, V5 O+ \" V7 ^/ [. K0 J( z
- drawpattern ltabstr reset-lt
7 b. r6 _6 m( M8 E0 o5 } - )
/ L1 b6 u; j2 u: e0 l" P! B - ) [ {! C" y3 s6 J- q/ A
- (setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho$ [% b) Z3 i& w# o+ Q. F
- old_error *error* ; save current error function7 R- |7 r& i# m! @; Z
- *error* ai_error ; new error function; K+ Z- g& g* L- G0 x( Q! Y
- )
7 _% ]# L v5 l7 e) p7 n
$ Q$ @0 s3 O. _; `+ ?- (setvar "cmdecho" 0)) o* E6 S& q/ P$ D7 c
# B [8 x* X9 G3 g- (cond
1 N, M" q, K+ m/ @. H! y+ w( r; q& F* Z - ( (not (ai_notrans))) ; Not transparent?. F* c# F9 l3 @ t6 W! y0 `
- ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?! G! O7 \- @6 y. X V# a
- ( (not (setq dcl_id (ai_dcl "ddchprop")))) ; is .DCL file loaded?
) j8 V9 R4 ]: T0 P0 o; e0 k, q2 u - ( (not (setq ss (ddchprop_select)))) ; objects to modify?
* E( A$ f! Y% m3 W7 f
" m" n, ?0 P/ a- (t (ai_undo_push)
; D" A( V5 \8 w& j7 u8 L - (ddchprop_init) ; Everything's cool,
- t, ^. h% w/ K/ {! K) \ - (call_chp) ; so proceed!# a# \: z8 g4 r) }+ ?( j8 {
- (ai_undo_pop) N/ x4 N( q0 K! e5 t" {; w8 x
- )
, l3 U' B- D; W% `1 X' M' [ - )
7 `& \$ p4 ~" ~ -
( Z. Y9 x, X u' O - (setq *error* old_error)
# S$ O4 V% c, C! Z& u - (setvar "cmdecho" old_cmd)8 E' G" K" c8 z) j
- (princ): j8 | a& _ E2 I+ z; \7 O0 t
- )
" m }) ]9 W' }9 D2 ^9 R - 3 T9 B% u5 s5 b' l- M2 G
- ;;;----------------------------------------------------------------------------! F/ `8 S% Q) g Y) v+ W3 i
- ' ~8 N+ w8 e" d" T Z7 ]% |
- (princ " DDCHPROP loaded."); }) J4 }9 x( S N! J0 f4 D
- (princ)
% d8 } V3 {6 V$ ?3 ]
- W- o! m9 q) j* w3 X- ;;;----------------------------------------------------------------------------
' k3 f! ^* i T1 j" H - + ^+ I/ y' `% ?# V- B0 K& w
- ;--------------------------------ddmodify.lsp----------------------------------
8 g- s7 e+ S5 u) ~: j - ; Next available MSG number is 111
- J/ G, N" \ j$ J$ S( {7 U8 p0 s - ; MODULE_ID DDMODIFY_LSP_) W5 V, j: I5 Q4 ^ `- K
- ;;;----------------------------------------------------------------------------) S9 N1 l6 p7 X
- ;;; DDMODIFY.LSP0 ~9 Y# D* h' ?
- ;;;
, ~/ X0 u( N7 i g4 N/ S# n - ;;; Copyright 1997 by Autodesk, Inc.' N9 s; d; G$ T7 z/ ~" E
- ;;;8 t7 W- M% G" i3 H! w: `' q
- ;;; Permission to use, copy, modify, and distribute this software
, L7 {0 H$ m1 ?) Q$ } - ;;; for any purpose and without fee is hereby granted, provided
: ^# T) ]9 z& y) w# U3 }" t8 |& V - ;;; that the above copyright notice appears in all copies and
$ J' _8 d2 y: g' p- D0 r - ;;; that both that copyright notice and the limited warranty and' |1 _5 j) O9 f; B2 B4 W; i# f
- ;;; restricted rights notice below appear in all supporting+ g& d Y% v- q# \' ~
- ;;; documentation.
. @. {* {' F' z% i5 \% c5 T - ;;;
+ d0 p: x5 o3 @$ k+ _$ m* |, A - ;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
S$ n4 {' o* ^# b! x - ;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
" Q6 T3 j1 Q& V - ;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
+ ?; |6 s# b" V$ ~) v& d - ;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE3 N4 Z# y% q( Z6 A
- ;;; UNINTERRUPTED OR ERROR FREE.! C9 G2 n; V) i( @+ ^+ Z* W
- ;;;
" R2 s" W! i z - ;;; Use, duplication, or disclosure by the U.S. Government is subject to; B z7 {2 `1 G/ ^* W
- ;;; restrictions set forth in FAR 52.227-19 (Commercial Computer& B# m: @% a3 d0 @
- ;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
8 L. h1 M' }/ J4 ~5 v' C - ;;; (Rights in Technical Data and Computer Software), as applicable.% B0 t% @- ^5 a
- ;;;
( x1 ?% M7 O7 m. x5 ]: @9 ]+ r% Y5 B% d - ;;;.
; _0 I7 s$ }, P5 y/ A - ;;;
+ e' V6 y3 d, v: ?, P - ;;;----------------------------------------------------------------------------
5 I6 t3 L. }- B c: F& o# d, k- M - ;;; DESCRIPTION1 q$ v i7 o9 T5 A+ y [
- ;;;/ O" j' U, r2 Y6 r( J
- ;;; This function allows the user to get a listing comparable to the LIST
2 r! s" ^' S! C* I - ;;; command for most objects. In addition, most object fields in the
. x0 |) y5 I% R6 { - ;;; dialogue box are editable. Points can be specified dynamically by b. x0 x* a- f, W1 u/ W; {6 F. B
- ;;; temporarily dismissing the dialogue box. Each object has a unique) q0 R h9 N% q
- ;;; dialogue.6 y) C& f/ @5 l' I h! ^% F
- ;;;( ]% m% K$ I& D% X0 w
- ;;; Naming conventions
- L3 w& D# p; ~* `+ V K0 h - ;;; Long function and widget names may use an underscore "_"' N- z% l4 ?0 F; Y; K8 v+ y1 g7 s
- ;;; in their names to make them easier to read, long variable" ?8 Y- ^/ _5 l! ]* M
- ;;; names use a dash "-".
$ j- B5 Z- i0 V' M0 T3 J - ;;;----------------------------------------------------------------------------! L7 p3 T0 C- U" _
- ;;;----------------------------------------------------------------------------
1 M" }* c9 o y4 i8 D3 \) f - ;;; Prefixes in command and keyword strings:
$ S# ~$ v4 R8 u - ;;; "." specifies the built-in AutoCAD command in case it has been" K; f$ ?: m4 i: f
- ;;; redefined./ y+ Q+ f/ i$ v6 z! f
- ;;; "_" denotes an AutoCAD command or keyword in the native language/ P$ p, d# K+ y4 _% N
- ;;; version, English.1 `$ k9 f7 x0 D' A1 @
- ;;;----------------------------------------------------------------------------
% d! s( Q& H6 Y" c) p - ;;;
, G* n- z8 ]0 c, K9 ?8 a; a' n - ;;; Avoid (gc)s on load to improve load time.7 V; K2 X! ]" x5 H( p. A8 t, z: v
- ;;;
4 n# \; V+ }( F. o/ ~8 r - (defun do_alloc (/ old_allod new_alloc)7 W7 U7 U1 ]3 ~8 g$ W
- (setq old_alloc (alloc 2000) new_alloc (alloc 2000))
; y0 T4 \1 k0 T- J& U - (expand (1+ (/ 17000 new_alloc)))0 o* i! `# |1 }. v: ~; }
- (alloc old_alloc)& W9 R7 J; d& z. \. R
- )7 G* e3 O- s- p
- (do_alloc)2 v) C% [, ]1 W% N( K/ q( X& o2 I1 {
- (setq do_alloc nil)
1 \' C6 {1 `# @2 {* b - 7 l1 Q3 ]/ h2 ?9 ^ @. S3 B' v
- ;;;
. E/ p ]8 G" H( T+ }( G; Q - ;;;
/ y' w5 E8 U' b9 a - ;;; ===========================================================================# _" m/ c8 T$ j H2 s2 Q% ~4 a. z
- ;;; ===================== load-time error checking ============================
7 ?/ _* U; r$ S - 0 a; t* C2 H; F" U
- (defun ai_abort (app msg)6 p8 Q# Z D- I
- (defun *error* (s)
( x$ w- s; V$ t - (if old_error (setq *error* old_error))
* w3 Q. d' t0 u* N - (princ)
! v# }7 {: E/ ^" n - )7 `$ ]( i! B" S' G
- (if msg
2 _/ m& t# n9 E1 L- u% h, W- ?/ X& W - (alert (strcat " Application error: "0 o4 _. e& E3 n x1 X
- app
, k. E& a4 N3 U5 a, w - " \n\n "! z+ n" L f# K+ e {( ]
- msg
# ~: f% q7 _, d5 e1 L2 T - " \n"
7 {1 o5 a+ V: R/ v6 s - )
& C, u2 e! i; [ - )
$ t6 p* K, X9 E1 o* b' U9 R - )
/ w1 }) _7 y. _( B3 J - (exit)
/ J" M& e& v5 P3 s - )( `8 E0 z" \: q& i
- g. k; i" `: {
- ;;; Check to see if AI_UTILS is loaded, If not, try to find it,$ p9 _! ]8 ?) Z' j; k# ^0 f
- ;;; and then try to load it. If it can't be found or can't be8 o* ~" c( H' K; s: s
- ;;; loaded, then abort the loading of this file immediately.; Q+ O$ h9 q- k N) M7 D
+ P3 [: ?0 r# W y$ ~; l4 B- {- (cond( ~$ C" ]+ i+ q8 d3 }2 X: R4 j; L
- ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.( f; }) A2 l. M: H) K6 w
- , m6 z2 \3 b' s/ [0 q9 L3 D
- ( (not (findfile "ai_utils.lsp")) ; find it1 p3 X! q# x0 T3 j' E7 m; z( Q% Z
- (ai_abort "DDMODIFY"
" ]4 h! J* G" j) d7 Z - (strcat "Can't locate file AI_UTILS.LSP."2 g4 o; t: G& |8 t! ~$ l
- "\n Check support directory."))), b8 S! R# l9 z1 p- a% |
- 2 G% w, [4 i( `
- ( (eq "failed" (load "ai_utils" "failed")) ; load it
5 b# l* k7 a5 q- G' V9 f - (ai_abort "DDMODIFY" "Can't load file AI_UTILS.LSP"))1 `: A( ~& R% D, H, p" h) K9 I8 Q
- )2 r+ F2 F* r( p- A
' {% ]' g- |& { p* D W" N- ;;; If we get this far, then AI_UTILS.LSP is loaded and it can& {( P: Q& |6 G/ \/ x2 K3 n& z
- ;;; be assumed that all functions defined therein are available.& l- {5 w% P8 M7 I8 I- M5 d
$ p& N9 V `8 q& t; P# @2 b7 Y! a; J) I" P- ;;; Next, check to see if ACADAPP.EXP has been xloaded, and abort
+ m2 d1 [5 I: q" b& j - ;;; if the file can't be found or xloaded. Note that AI_ACADAPP
6 T! o. D" B% K4 ?5 A; o - ;;; does not abort the running application itself (so that it can
( { b- F" P3 G! K* ^ - ;;; also be called from within the command without also stopping ?7 |: B- f( b% o& v: s3 g
- ;;; an AutoCAD command currently in progress).; D0 Y" V! x8 H
- 6 a, w+ j! W& O# M W
- (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP. o" w9 d; g: x3 Z8 E- t
- (ai_abort "DDMODIFY" nil) ; a Nil <msg> supresses
# J3 u. i7 [2 t' s - ) ; ai_abort's alert box dialog.1 Z& K. q0 n, s1 @5 X2 l2 @
9 e6 X- s% z- h) ~- ;;; ==================== end load-time operations ===========================, k4 L) x* r+ T7 j. @
4 s# B l4 N# N; T+ @/ ~- ;;; global variables
, I* A( X* `: F. b) L, `% j- p- v# J - 3 z; Z* f( g! O& q8 q; ^
- (setq hatch-elist nil) L! k' ^4 K2 ^0 T
$ i4 T7 R2 n. ~- ;;; If we get this far, both ai_utils.lsp and acadapp.exp are
\* _1 [& q6 {6 c g - ;;; assumed to be available.
% ~2 c0 X) A! O( h
0 z4 G% @* [; u3 z+ r- ;;; Define and encapsulate all subroutines that are declared
, Y& \+ D Q8 x' T$ D7 q - ;;; locals of the (ddmodify) function.
9 f1 E! E* O1 V; D
: A' g+ R" r& W; [, u g6 U+ n- (defun ddmodify_init (). G9 `6 D) r9 x& U! r
- ;;2 H4 q3 e6 q% O
- ;; These three functions modify the enitity list for common properties. Since0 Q g% O4 M$ W4 \
- ;; color, ltype, and thickness are absent from the object list when they are6 V/ E& L- r) A* X) B
- ;; set to their defaults (i.e. color = bylayer), a simple substitution using7 r2 k( S+ Q7 V, i' `- k0 N
- ;; SUBST is not possible.
: \9 t: M3 {5 [2 _( ?9 | - ;;
: e& v U. w$ a - (defun modify_properties ()
: ]3 _3 I2 c6 U) d% G2 G - (emod ecolor 62)
" _; `8 T9 D% j5 H5 q* o: B# v' B7 v - (emod eltype 6)
0 v1 E6 U+ g7 H. G9 O - (emod ethickness 39)' Q }: F% N' |! P7 ^
- (emod eltscale 48)
( f! Q4 J2 l0 j. k. [7 a! O - (tempmod elayer 8 nil)
. T7 C; A: P( b2 l Y, d- k5 ?) P - )
7 k9 Q% Q+ @2 G% _- ^2 r - ;;# j( H L" d& _$ {: ? [
- ;; This function is used for modifying common properties of the ACIS6 b) w4 t# F7 ~5 D) b$ T; N
- ;; based geometry objects. Thickness is not valid for these objects
0 K, ^$ a% s) L/ C) A3 J3 }' U - ;; so it is left out.8 Y8 n! O: c6 \( M
- ;;& J9 x# ]- Z v- @6 Y q4 g! O/ d
- (defun modify_prop_geom ()7 e( d& ~( i$ F1 \0 v i; B) g v
- (emod ecolor 62)
( C1 Z1 ~% Q* _; | - (emod eltype 6)1 n- x! q! j% U/ P+ @% A5 k
- (emod eltscale 48). S" t, `9 w/ ]
- (tempmod elayer 8 nil)
& [; S8 V. j/ t; E - )! c$ T" H4 F5 t: F" s
- 5 f' c0 F% |$ c6 L
- (defun emod (value bit)
3 x4 M! q) q, P8 _: ~ - (if (= bit 62)/ T0 ~. D( o7 d5 ~* x
- (progn
! b U, l2 ]! u) S) N$ c - (if (or (= value "BYLAYER")- B' s- w* [, A0 }# S/ t( w; n' u0 W
- (= value "BYLAYER")) (setq value 256))
9 b3 X* l) S9 K( G) V4 n - (if (or (= value "BYBLOCK"). _3 J N E# |+ ^7 J/ }/ d
- (= value "BYBLOCK")) (setq value 0))
* L" @7 S* I0 Z& Q; i( [ - )1 E- j0 t6 u& S. O
- )+ V8 @, c0 g* k/ M4 a
- (if (setq oldlist (cdr (assoc bit elist)))
% t x, j: Y* w, X7 `! w9 q - (tempmod value bit nil)
% P. V( Z7 L, j' h/ Y; E: `4 r - (setq elist (append elist (list (cons bit value))))
1 j1 T* p3 v" Q/ B: K - )8 M$ J9 V8 B" v3 y
- )
2 [8 G& u: A! P# F - ;;
" t% B4 Z( h3 F! m/ ] m - ;; Resets object list to original values. Called when the dialogue or
, y: M# k7 W' q9 {% {, M% E( B- H - ;; function is cancelled.; Y# r1 _( V: V; {9 f
- ;;, ]' j. @* ^8 U" O
- (defun reset ()
- V& M: J4 Y, b" c2 c+ {' }, ] - (setq elist old-elist
; n7 V* D, B3 c3 g' e) J- ~. k - ecolor (cdr (assoc 62 old-elist))
y0 X' E& b0 F) ] - ethickness (cdr (assoc 39 old-elist))
- |1 T( m7 K' ]1 }, Z$ y - eltype (cdr (assoc 6 old-elist))" M0 \. t) z. `5 g# e7 ^2 U
- elayer (cdr (assoc 8 old-elist)); ]6 [7 c9 V* E) N) N; x. r
- eltscale (cdr (assoc 48 old-elist))
3 l$ i' Q" X0 y, R! {# w# i - )9 _& B) z0 M- R. r
- (if (not ecolor) (setq ecolor "BYLAYER"))
4 L1 y$ M* N: V5 s0 _' H - (if (not eltype) (setq eltype "BYLAYER")). U' @: W4 Q0 Y* N. P2 M( \7 [
- (if (not ethickness) (setq ethickness 0))
: z" T+ K1 ^ s3 S! F3 ~ - (if (not eltscale) (setq eltscale 1))
5 M) Z& g ` x$ Y - (modify_properties)' t6 J ~1 `& s$ n' r* {. ?/ W `
- (setq reset_flag t)3 a3 b6 [/ B k5 A6 K8 R
- (entmod elist)
. f( S" s9 y4 X1 X - )" r, _4 _% [) G: q6 M( Z
- ;;
' H$ R% H) d/ h6 ` - ;; Modify object when dialogue is temporarily dismissed to reflect latest$ R) O; t7 u7 @7 O* S, T
- ;; settings of dialogue. It converts the point from current UCS coordinates to
# ~& K9 a j: ~; s Z2 {! u - ;; the proper object coordinates (world or object).
) U7 V, J+ H- U( }% ` s- A3 o; P - ;;0 c* I4 G5 o7 K& I+ e: h |, t
- ;; Arguments: value - in current UCS coordinates4 `, p8 E5 \' j: w* s& F
- ;; bit - object code (i.e. 10 for start point)% Y' D5 X7 D, l% M2 e
- ;; ptype - point type 0=world 1=planar h3 j/ }( {, t' c V0 E3 f7 S W
- ;;, e; U3 V# l" ]
- (defun tempmod (value bit ptype / newpoint)6 S# R. x3 l* T! [% d
- (cond& C* o3 k5 g+ E& S+ f; `3 g
- ((= ptype 1) (setq value (trans value 1 ename)))
4 j8 H, i& P& d9 a - ((= ptype 0) (setq value (trans value 1 0)))# {( @7 ^ q% X+ s
- )$ x9 e* y1 L; B1 `8 d; c
- (setq elist (subst (cons bit value)+ I- X: s( z+ T% V0 A" z" L
- (assoc bit elist)
1 C, J2 k- A) p) ], Q+ i+ `3 ~ - elist
5 u" y# l6 Q9 @% W5 ~0 L' C - )
* }. Q$ c1 q/ r0 ^' p0 r - )# m* d' h1 S5 r1 s1 q/ ]. ^+ [* P
- ), k S2 Q& W( R8 O/ p
- ;;
( H9 f# _) L0 x/ {& {4 b5 J& G - ;; The following functions are called after a dialogue has been temporarily
. ~0 A4 {, x1 R' i. K3 h8 y) Z - ;; dismissed and the user is selecting a point. If a point is selected the: v* X3 O: o9 h) p0 [ I+ X# _( \
- ;; object list is modified and new X,Y,Z values set. If no point is selected, W3 ^ M6 @7 u) u
- ;; (null response), then the point is reset back to its previous values.! l x8 k" f5 `
- ;;
% K* |3 M& F2 j/ } - (defun ver_pt1 (ptype)
- X% x3 f+ L- }9 q6 M7 h' O" ~ - (if pt1
. q6 d) l+ q% y. s+ M& V - (progn5 E4 J! V# L% x# o! e$ }% D$ {
- (tempmod pt1 10 ptype)$ y4 V( j" F5 f" j" Z
- (entmod elist)
& m2 \/ q% E. o - )
7 v/ j _/ r" U! X* _: | - (setq pt1 (list x1 y1 z1))0 H2 u) X9 H7 `& p) W6 ~" X- A
- ), r+ ~, Z. g, M# o. l* M* v
- )7 H! G1 l5 {3 L# `" U' m. k A
4 u* \$ g$ {6 `( {6 A- ; (move_pt1 <ptype> )1 H6 H! K, h2 N) M
- ;# _# N9 ]& h: s" e" `, n
- ; Called in liew of (ver_pt1) to translate block insertions which% u2 ]/ Q1 {# o. s$ Q
- ; might have variable attributes attached to them. If the distance
3 a2 B) F$ v$ i - ; the block is to be moved is < 1e-6, the move is deferred.
: u4 I0 ^# d. D. K+ g) L5 n - $ r3 T( C$ a% T# d$ r* f6 z
- (defun move_pt1 (ptype / basept hi)) Q5 ~4 ~! C/ @& D& t1 @. Q
- (setq basept (trans (cdr (assoc 10 (entget ename))) ename 1))& e: N" u7 B; [5 D" I/ R" c' X) A
- (cond5 Z1 c% j, c% I3 X% w1 [6 R
- ( (not pt1)
* l1 t' k9 W, s# V% F. b, W - (setq pt1 (list x1 y1 z1)))
4 r5 T+ k, H7 g9 s: m) M% n A/ k
' V# G1 O! w1 s2 u- ( (> 1e-6 (distance pt1 basept)))5 V4 ?2 X$ t# [' M+ J6 V6 z9 z: n: S
) Y3 ~& J) C$ O- _+ [- (t (tempmod pt1 10 ptype)
( Y1 |7 w. N+ H, C( g/ D - (setq hi (getvar "highlight"))9 n& t8 Y% }, m: i
- (setvar "highlight" 0)' N" a( |9 O- `& ?% j; p8 P/ @
- (command "._move" ename "" basept pt1)1 M) g( @7 O6 l8 U" t \
- (setvar "highlight" hi))8 ~; U: p- W* Q$ d8 V0 M
- )
6 N# _( q; T- l. V2 c4 H& z5 H' D, Z - )) [: [8 O7 K& _2 _
- 1 Z. {, t9 Y% t8 x9 c3 G$ i
- (defun ver_pt2 (ptype)* m- |3 a* z+ ]# g
- (if pt25 B) K1 y& q3 [( h2 V
- (progn* \6 G' Q9 @ ]. Y* R
- (tempmod pt2 11 ptype)/ @/ {$ L* Y$ p& z( `
- (entmod elist)
; @! A9 _) u1 F* x9 L; [. g - )
! W* ^4 B! \' R% K1 l6 T# `- X6 p! ^ - (setq pt2 (list x2 y2 z2))
* I( I! |: c; {+ Y% h' [6 n3 B% ~ - )
' f5 a" P; r9 P& J4 R+ O9 t4 N6 i - )5 _, C) d6 A W: y/ [
- - P, p0 c3 V3 T% H
- (defun ver_pt3 (ptype)
% r* Z* n3 e$ c( ^6 i( S" ?1 I' G - (if pt36 C1 M5 J" V' E
- (progn1 A* y+ H/ A/ D r- K2 o) M; C5 h K
- (tempmod pt3 12 ptype)
1 G2 V A( B' k - (entmod elist)2 l1 j5 X9 b7 E( M$ D; p. j1 u+ r+ g
- )
. ~( `! {& ~3 p8 t, I) N$ | - (setq pt3 (list x3 y3 z3))& l+ h" x3 [ V2 L* r
- )2 w/ C9 `* j/ U+ V) q% O
- )% N' ]1 R1 R' S" ^( p7 Z
0 \' k2 ^5 R0 j& [$ @- J4 w- (defun ver_pt4 (ptype)3 ^) X$ t W9 i8 k8 w7 d
- (if pt4
) N- f& I, `8 ~ f1 E/ } - (progn% F) N$ F7 P" F# g5 C
- (tempmod pt4 13 ptype)
* |% E1 J+ V+ Z9 T5 Q8 d4 ^ - (entmod elist); n8 r2 d) G0 m4 x" g" b% v
- )& y- E3 F- p1 R1 E. M: i' M
- (setq pt4 (list x4 y4 z4))
7 x9 d; U+ A/ ^! i/ a. |+ R: x - )
7 T& B. T$ e, R6 n" v5 @) f - )9 v2 p" X+ S' B5 p3 ?' N5 A
- ;; Xline/Ray
& F7 G: Y, x$ {% W; b: t - (defun ver_xline_pt1()& r P3 B6 [% t; v5 W9 F$ P& @
- (if xline_pt1
# W. [9 I3 Z1 n$ v- w8 z) F$ N - (progn% n! q0 a6 [7 s. G
- ;; convert to WCS.
* u$ z+ p9 e: V# U# c7 N3 D* p - (setq value (trans xline_pt1 1 0))1 t- h. h- M2 f0 a7 G" B+ j) f
- (setq elist (subst (cons 10 value): h+ W/ g- k$ g: u) N
- (assoc 10 elist)/ Y' _& o/ ^4 B: R; C( `' j* k
- elist6 V& t5 j' Y2 n" [! P9 I" N
- )
8 e* Y0 x9 c. i/ }4 c% K$ R3 G - )/ o* m5 g6 t1 |) N0 u! I7 [
- )
/ l: F0 V/ h' `; D( V/ F) [! m - (setq xline_pt1 (list xline_x1 xline_y1 xline_z1))
& h7 [6 p6 d( c+ e, _2 ?5 C - )8 }, j% H$ W) a
- )1 D' k2 m: u( U# p4 \
- 9 ^" d5 A" Q, s- N Q
- (defun ver_xline_pt2()& ^8 Y4 G3 M5 B+ r! I2 M
- (if xline_pt29 `; ~) p O# C! }
- (progn
9 B6 B- f8 Z& r( z0 e - ;;
1 e m( h( | y# d" M - ;; Calculate new Direction Vector WCS
4 u- W! @" h) j# V. _( ^ a2 c - ;; x / (sqrt ( (x**2) + (y**2) + (z**2) ))" U. |/ X9 f% ^4 ?/ D/ e4 e
- (setq temp_dir (trans xline_pt2 1 0))
% a4 S/ r: J+ n' p - (setq temp_dir_x (car temp_dir))
/ i8 U2 {/ v' Q$ Y5 y - (setq temp_dir_y (cadr temp_dir)) m* f+ _6 N2 }) p/ ~
- (setq temp_dir_z (caddr temp_dir))( i. `* M4 P+ D! y
- 1 g# T, _/ K# e
- (setq temp_xline_pt1 (trans xline_pt1 1 0))
1 j( A! ^6 _2 f4 F' x6 f& I - (setq temp_xline_x1 (car temp_xline_pt1))
9 J( G+ w7 G9 k: S# T9 b& n - (setq temp_xline_y1 (cadr temp_xline_pt1)); B. B" |, V) v7 I1 j2 s* x6 r
- (setq temp_xline_z1 (caddr temp_xline_pt1))
) q, L* M2 _9 }& S. X4 [ - * ^) z# w3 c% ]4 ^! M
- (setq denom (sqrt (+ (expt (- temp_dir_x temp_xline_x1) 2)
: p8 j( N# s& {4 g0 `" z - (expt (- temp_dir_y temp_xline_y1) 2); U" \6 L. q2 m
- (expt (- temp_dir_z temp_xline_z1) 2)2 E3 x. W( c2 o$ g: \
- )))- y/ k5 g0 ^& F% R; q8 C
- (setq temp_dir_x (/ (- temp_dir_x temp_xline_x1) denom))
- ?3 t0 `+ E" [! i, r - (setq temp_dir_y (/ (- temp_dir_y temp_xline_y1) denom))
7 o* X. t R$ m: b+ l - (setq temp_dir_z (/ (- temp_dir_z temp_xline_z1) denom))
2 D$ k5 \1 d, F! u$ p; a - (setq elist (subst (cons 11 (list temp_dir_x temp_dir_y temp_dir_z))6 E3 y: `" j6 f
- (assoc 11 elist)% t; i0 l( J& h+ Y" e
- elist$ Y5 g5 P4 o* a! _2 [( X* U% H
- )* D# j+ n: N; [# c: _( }- t
- )
3 \9 z3 D8 v- i- ]3 x0 G% }1 x3 i0 z - (entmod elist)2 y# u: E$ K- m T5 V' W
- (setq xline_x2 (car xline_pt2))
1 T4 w/ e/ s. N3 L - (setq xline_y2 (cadr xline_pt2))1 G" l$ p# e% J
- (setq xline_z2 (caddr xline_pt2))
! u! ?- w' b9 Z6 X - 0 k8 K5 O, h" k; q1 s8 y
- 8 R4 H7 V8 E+ [
- )2 v5 |- l2 D; D9 }! Z
- (setq xline_pt2 (list xline_x2 xline_y2 xline_z2))3 k7 z7 s; S4 v: ]8 [5 V
- )- O% P8 m' p- ^* D
- )
F2 {! v" j$ C, }. i - % N& y5 p; A% F* W. @( X
- ;;: s- L8 R# m. \0 [2 t
- ;; Common properties for all objects- G: b1 I0 ~9 O( @$ b/ Y% |. O5 Y
- ;;
* C* U# T: E" V: g! @' J+ V+ o: x - (defun set_tile_props ()9 [+ D/ F1 r) n( k+ Q
- (set_tile "error" "")
q+ ]0 y& q5 S5 n3 v - (setcolor)
* n8 [; |9 {- }+ \ - (cond
0 K: y M- n3 r6 E- \1 v - ((= eltype "BYLAYER")
7 u; V% x; U, h# T( { - (set_tile "t_ltype" (bylayer_lt))) L* J u; l$ O1 E3 Q b) j
- ((= eltype "BYBLOCK")# ?6 w( F- Y( ?& A& w
- (set_tile "t_ltype" "BYBLOCK"))* b- Q3 ?; _: q( E! T$ w
- (T (set_tile "t_ltype" eltype))
, D) p" k. ]; z4 L' R0 o1 N9 T - )7 q. ?0 a/ {5 x# f4 B
- (set_tile "t_layer" elayer)0 j4 }2 w/ j: ?+ f
- (set_tile "eb_thickness" (ai_rtos ethickness))
3 F4 M3 }$ Y& x6 K! P% z - (set_tile "eb_ltscale" (ai_rtos eltscale))9 y( [: w3 @4 d$ Z6 O2 H) U
- (setq which_tiles (ai_common_state etype))
n. A* B7 W$ @ - ;; Disable tiles if need be...# V6 p8 E" _: ^' h5 K
0 ]& g$ V6 p/ ?# S7 w3 Q. w( e- ;; Layer Button and Text Field
! ]7 |5 b/ K- i: l4 V! Z, [+ v - (if (/= 1 (logand 1 which_tiles))
; A* Z2 w8 ]! f$ {, L' f - (progn$ C& ]3 y7 U0 ?2 Z
- (mode_tile "t_layer" 1)9 C( s3 D* ^2 W# d9 D$ ~
- (mode_tile "b_name" 1)+ m: |3 {7 [: j8 p3 I
- )
& `$ |% V1 O* V% y* a# j, O - )
9 M$ t, S* w; F& w: y% r+ H% z - ;; Color Button and Text Field
- u& R8 T `- _, Z - (if (/= 2 (logand 2 which_tiles))* G/ u5 Z$ a0 I$ r
- (progn1 ~0 d4 x: r6 g3 R+ N* L% r
- (mode_tile "t_color" 1)( g% Q+ {0 L+ c" ~
- (mode_tile "b_color" 1)
' B6 M0 ?# O( ]; t - (mode_tile "show_image" 1)
: ]0 ^; I- c5 l- ^9 c - )
* G9 L2 O0 P q; D& w+ k3 U( p6 R - )
) X# p1 c9 Y! P, s1 H9 ? u+ ] - ;; Linetype Button and Text Field3 `7 P& V, l+ x- j5 x" e
- (if (/= 4 (logand 4 which_tiles))( q! R1 ]( u5 d' @ s1 h$ d
- (progn
: A8 K. \' e( X2 T/ `0 M5 L - (mode_tile "t_ltype" 1)
7 g( [) }. F: \7 a) Y - (mode_tile "b_line" 1)
- F4 x& {( e( a1 D2 z+ I1 c1 g. B - )
' F$ I3 {$ z) q- F - )8 A7 g0 A% @, |% `! w. h
- ;; Linetype Scale Edit Field
' \9 D# J6 g# q9 H - (if (/= 8 (logand 8 which_tiles))
/ Y1 n8 P' t+ F' b - (progn
# x* L. x+ n% f - (mode_tile "eb_ltscale" 1)
t& d. t( k4 Q8 r2 \0 j$ h - )9 ?9 I- h* g: z8 e) M
- )& B; n/ f" `2 Q2 A, v! Q
- ;; Thickness Edit Field." z7 [, Y u5 E% k
- (if (/= 16 (logand 16 which_tiles))
7 H/ o* T& ?8 i' c! ~ - (progn. Z6 G9 D# D& l5 R% z# q
- (mode_tile "eb_thickness" 1)
3 _0 O% p2 V! k/ k) Y& [ - )5 ?8 H/ Z1 @: S& R9 e
- )$ x5 l$ _9 n- l: _7 ~5 Y
- )
$ L- t. `( B/ Z, { - ;;! D3 y' \' g# S( o( v: E
- ;; XYZ Point values for all enitites
1 D' _5 l2 M' l+ W* A2 C) d1 G - ;;
' s2 n7 y0 I& Q6 q$ |9 q: B - (defun set_tile_pt1 (ptype)
, {9 e: L& a4 ?5 k1 k# `8 n) U - (if (= ptype 0)
6 h, X% P$ a$ A; \ - (setq pt1 (trans (cdr (assoc 10 elist)) 0 1))% z' Y% f3 ]4 G% J
- (setq pt1 (trans (cdr (assoc 10 elist)) ename 1))% p6 a3 m* G& @9 F: v' F1 B: Y& E
- )' D) S6 C& @" o2 h: g. ~6 a
- (set_tile "x1_pt" (ai_rtos (setq x1 (car pt1))))8 R X. l7 d$ r" w1 t
- (set_tile "y1_pt" (ai_rtos (setq y1 (cadr pt1))))' G* j. {6 P' `4 G
- (set_tile "z1_pt" (ai_rtos (setq z1 (caddr pt1))))
0 Y0 g% b% Z0 A( v$ C5 V8 ] - )
2 W1 t8 d$ e r- ~* y0 g& \0 A9 x - (defun set_tile_pt2 (ptype)- p; B [: v( J3 d- U. u
- (if (= ptype 0): `0 c) E- x1 E
- (setq pt2 (trans (cdr (assoc 11 elist)) 0 1))! C2 P% K& b& S& d& q% V" a+ `
- (setq pt2 (trans (cdr (assoc 11 elist)) ename 1))/ ^1 [! T% n/ h/ r% h& y
- )
) K, @4 P7 i: j2 F - (set_tile "x2_pt" (ai_rtos (setq x2 (car pt2))))0 G- ^& m) L9 ]% B5 s0 \2 U
- (set_tile "y2_pt" (ai_rtos (setq y2 (cadr pt2))))
6 q6 C. b! P2 f# x8 r# W - (set_tile "z2_pt" (ai_rtos (setq z2 (caddr pt2))))
* t) B# s8 q* d" S5 o% k, q6 F - )- A6 F1 h3 j4 v0 s7 i p _0 J n
- (defun set_tile_pt3 (ptype)
- R5 j$ o* y; {! U' q# q3 c& Q - (if (= ptype 0)/ \8 y" f4 u) c9 v1 x6 d7 h
- (setq pt3 (trans (cdr (assoc 12 elist)) 0 1))3 j" r' ^9 Q* Y6 f/ G; w8 i8 W
- (setq pt3 (trans (cdr (assoc 12 elist)) ename 1))2 j1 _% s) c( h) Q: R2 n
- )% A F! Q- X8 i, B$ y
- (set_tile "x3_pt" (ai_rtos (setq x3 (car pt3))))
* E% o3 A) [; @% a+ X5 o - (set_tile "y3_pt" (ai_rtos (setq y3 (cadr pt3))))
4 r# R8 {1 } j, F - (set_tile "z3_pt" (ai_rtos (setq z3 (caddr pt3))))0 A! i: K0 A7 y6 T6 {. p( c
- )( M+ v( t% ^+ M
- (defun set_tile_pt4 (ptype)
1 u% M3 O0 H0 g J - (if (= ptype 0)
9 t$ G% i1 [- `% b/ o& t - (setq pt4 (trans (cdr (assoc 13 elist)) 0 1))2 f$ n$ n) N- P- B
- (setq pt4 (trans (cdr (assoc 13 elist)) ename 1))
3 O/ W9 \. U" M1 C* j2 Z - )
8 @9 \1 l6 c% E+ {3 Y/ @4 h, x - (set_tile "x4_pt" (ai_rtos (setq x4 (car pt4))))- f5 [" Q! p. P8 _3 g# _
- (set_tile "y4_pt" (ai_rtos (setq y4 (cadr pt4))))+ G/ K$ \9 ~! p7 C2 i% H
- (set_tile "z4_pt" (ai_rtos (setq z4 (caddr pt4))))
3 w! }4 A( j% A( V - )9 i$ ^' r) M) P7 e/ h+ l
- ;;
( @) C4 `7 h, T - ;; Xline/Ray# a B) h! R5 l2 {
- ;;- r u( [ B6 \" b: B: P( d
- (defun set_tile_xline_pt1 ()& ^" O: P v& z! x. I" `8 ^
6 i# }! q0 X) q' h$ I) B9 Q9 w5 f- (setq xline_pt1 (trans (cdr (assoc 10 elist)) 0 1))
$ N) N% I% u/ Q2 ?) j0 h! E - ( T6 |2 W% }$ Q, |% Q
- (set_tile "xline_x1" (ai_rtos (setq xline_x1 (car xline_pt1))))
+ V5 t t6 C1 a: b+ F. D& H. n - (set_tile "xline_y1" (ai_rtos (setq xline_y1 (cadr xline_pt1))))0 Q2 J1 F) K3 U( q- r
- (set_tile "xline_z1" (ai_rtos (setq xline_z1 (caddr xline_pt1))))7 K9 ~! U; P2 {" r: _0 y; |$ [& R5 G; J
- )
( U5 K6 F- B2 k; U1 n/ P( h - (defun set_tile_dirv ()5 j. C. m5 F4 F. |. I) d
- ;; Convert 11 group to local UCS (displacement)
. B9 U8 ~: J+ g1 ?- _ - (setq dir_pt (trans (cdr (assoc 11 elist)) 0 1 1))
6 ^9 V" p) V& L9 L - 4 V2 s( k4 l( |9 V
- (set_tile "dir_x" (rtos (setq dir_ptx (car dir_pt))))
9 r8 N5 g5 I8 ?# v f - (set_tile "dir_y" (rtos (setq dir_pty (cadr dir_pt))))
" z& G% B! y1 d: Z8 l1 ` - (set_tile "dir_z" (rtos (setq dir_ptz (caddr dir_pt))))! W; x, s' [# s7 f( V
- )# F( F c* L. n4 s1 p( z; Z" J
- (defun set_tile_xline_pt2 ()
L/ \- |/ X1 g' i" V - (if (not xline_pt2)
& m: Y0 E6 B: ] - ;; Initial second point is Root Point + Direction Vector
. }+ f; S7 t @1 h; Z - (setq xline_pt2 (mapcar '+ xline_pt1 dir_pt))2 {- m& I' V! C% o( |+ f" C8 B
- )7 Y' ?% G8 D- }% z7 o2 r0 N- \5 {
- (set_tile "xline_x2" (ai_rtos (setq xline_x2 (car xline_pt2))))+ G; ?+ X9 [/ D+ }* h
- (set_tile "xline_y2" (ai_rtos (setq xline_y2 (cadr xline_pt2))))2 J. {3 e0 m9 c; i! X' t$ o
- (set_tile "xline_z2" (ai_rtos (setq xline_z2 (caddr xline_pt2))))8 ` G0 e! B1 Y
- )
8 W9 A3 t _& G+ a3 V
8 k0 c# c2 `1 N- E6 K1 c I; k- ;;- T7 C3 b. M" J2 \2 i( R
- ;; Handle for all objects
# T) ^; j- R$ s4 m0 Y, o) o. E - ;;
4 b0 J8 t8 ~; {$ ~+ h9 ? - (defun set_tile_handle ()! ~5 b0 p( V4 h- S
- (if (setq hand (cdr (assoc 5 elist)))! V! X9 F- P4 |
- (set_tile "Handle" hand)
- _ U, K: _- M' s - (set_tile "Handle" "None")8 q2 O$ d9 f7 w, h1 q) B& C
- )) C. a- Q: l4 i
- )
/ k; y. _/ [! g+ W' v3 a& l t - ;;
# F, l; \ X5 ^6 o) \+ d - ;; Radius for ARC and CIRCLE; J6 z+ k# }5 `) q" H7 u5 S
- ;;
/ _ S# u1 z) \. |* j - (defun set_tile_rad ()
- E' L' K4 s. A& U% W# s - (setq radius (cdr (assoc 40 elist)))* T: D" X0 o. D" H
- (set_tile "radius" (ai_rtos radius))9 `; }( K/ ]" g8 u, V/ t1 d- M/ m
- )5 J: I0 H( ], N9 y0 l
- ;;
8 i& j+ E8 @6 h5 ?' }% O. x - ;; Start angle for ARC
3 k4 I* H2 m5 c! k" p& u) s+ k - ;;
. \9 m7 }- r1 M# T% n7 ] - (defun set_tile_stang ()
+ I3 N/ H6 I _$ K; k# J8 T m - (setq st_ang (cdr (assoc 50 elist)))
( e- U, V) V/ o9 t; l5 q( V" n( m - (set_tile "st_ang" (ai_angtos st_ang))
/ _! `+ k. U! k& L0 i: f - ), b9 g. {( I3 Q+ U$ l Y6 l/ |
- ;;" V2 ~, X" C% J% }8 w
- ;; End angle for ARC% O6 {8 C8 C0 S* }! N2 Y1 P2 P
- ;;3 M2 M4 @( |3 O5 O. |, A
- (defun set_tile_endang ()" F6 _' K9 C& x5 B+ ` Q2 l
- (setq end_ang (cdr (assoc 51 elist)))+ l9 Q# E; v1 ^2 V% J% j! F
- (set_tile "end_ang" (ai_angtos end_ang))" ?3 _: n. y. e' O3 m' D) w7 l
- )! [% l: b0 _$ K
- ;;
. `# U& \$ X* |# ~- \$ b/ G! t. V - ;; Rotation Angle - Text, Attributes, Block insertions and Shapes
, n2 H9 B1 N" s, p4 d - ;;
' v/ b" `- G+ q2 g {' \( ? - (defun set_tile_rot ()
+ H# A3 f! b `- Q3 ~0 k n) G - (setq rot (cdr (assoc 50 elist)))2 f! C: p/ q; n3 V) `! k
- (set_tile "rot" (ai_angtos rot))
& x8 l1 N/ k0 N- z5 I, l, T - )$ q4 }$ b# H* F% O7 J$ j
- ;;( w1 C6 _* S v% ]( n
- ;; Height - Text, Attributes and Shapes ]7 X, v# }) c* V
- ;;
9 x$ [! s4 m3 @/ f7 z; @, m1 d - (defun set_tile_hght (). g7 ]3 e# z% m" f9 |
- (setq hght (cdr (assoc 40 elist)))! O; M' V% [2 \
- (set_tile "hght" (ai_rtos hght))
+ R( q Q" |' y2 J* g3 H - ): I, U U+ {! L# f- J& O3 y5 w
- ;;
0 `, y* d9 J4 _0 W2 z/ z" T/ a - ;; Width Factor - Text, Attributes and Shapes
: Z( z7 j5 X0 d* P6 P L - ;;- O0 h" W/ ^8 w4 ?' S* h' U
- (defun set_tile_wid ()
1 X$ i) T+ g7 x6 E - (setq wid (cdr (assoc 41 elist)))
* O: p% K; m8 T9 N8 ]; F - (set_tile "wid" (ai_rtos wid))( J9 R/ a. g ?' x# ?
- )) [$ e! [% y: H. D
- ;;
# N1 d& t& v' o - ;; Obliquing Angle - Text, Attributes and Shapes
) n0 U: R0 {7 {! T - ;;" u) C6 ~1 O3 w, |% @3 a
- (defun set_tile_obl ()
7 C3 ^9 y: u! ?" G, L) j - (setq obl (cdr (assoc 51 elist)))
P" H& @8 V5 Q - (set_tile "obl" (ai_angtos obl))
0 _$ V6 q4 ?4 Q+ q+ Y) } - )" ?4 ~' }1 y6 z
- ;;# C% @, s6 a# W2 w' x
- ;; Text string% Y# \9 u2 I, j6 a3 ^& [5 q, o
- ;;9 f" @- A( Y, u5 U( j
- (defun set_tile_text ()* j2 S+ Z4 R& P$ s% I% {; U! o
- (setq text (cdr (assoc 1 elist)))
/ i6 |9 c. e% k3 y, w% L! r - (set_tile "t_string" text), n$ ^4 [9 O! y, _4 H& L% U8 `
- )* ` z1 n# L" L9 r
- ;;9 L$ Z4 @# d* [/ m( |9 F6 p
- ;; Attribute Tag" c4 j d+ m! m3 q! L
- ;;
9 r, \# A# q3 I6 ^0 w - (defun set_tile_tag ()
. x3 r% e; d2 P P5 ^$ F - (if (= etype "ATTDEF")
7 r) q k1 Z, t( A, d - (progn
: o, ?$ x- }) n2 P/ @$ { - (setq attag (cdr (assoc 2 elist)))1 }. M" J' w o% U
- (set_tile "tag" attag)$ @6 M- {% [3 e0 [1 |3 T) Q
- ), |8 K2 T) q) j: r/ m/ w
- )) Z8 t" y. v {4 `1 I) c
- )
9 @" P% ? N4 E2 W; O - ;;
X" i \- J+ ?: }" @ - ;; Attribute Definition, L6 {, p# }4 B" r# a: A) D
- ;;
) ]+ m. ~) V9 I& P! k - (defun set_tile_prompt ()2 U2 K: v, Z" G4 D5 o% q4 v
- (if (= etype "ATTDEF") b# a7 l- K- f
- (progn
$ ]$ ]5 e* E$ k: { - (setq atprompt (cdr (assoc 3 elist)))2 o& k: R9 c& x" x$ g
- (set_tile "prompt" atprompt)$ @. J0 m0 O) }6 }( k, _
- )- J8 }' i) J1 i0 G7 \2 m4 D' V Q
- )
; r; _, f m! \/ C5 t) v* D - )" a4 u2 O1 r0 @. b
- ;;
: j' q. Q: t3 a0 [ - ;; Justification setting for Attributes and Text. Initializes8 H8 k% N4 c; k" ~* y
- ;; popup list box0 y/ t( J, A. v
- ;;
3 H, x* j5 L3 O7 [; t - (defun set_tile_just ()
( r3 D# p- f9 R5 r0 u - (setq ha (cdr (assoc 72 elist))) ; horizontal alignment; s! `- v) r: Q- t
- (setq va (cdr (assoc 73 elist))) ; vertical alignment
, M, ~& c% t) L G - (setq ha-prev ha), m- @/ q9 D( e5 f( g( h) p, b9 F
- (if (= etype "ATTDEF")( _" J& ]+ m# j& r* b, s! a' c; f5 d
- (setq va (cdr (assoc 74 elist))) ; vertical alignment
0 g* c) V+ e/ {, i+ b0 ]0 f - )/ N m; q. ]% J
- (setq jlist
6 a6 G5 A( i R3 M' P - (list "Left" "Center" "Right"1 M* e7 t% U9 S( J1 `; M
- "Aligned" "Middle" "Fit"
; ~" O# W: b5 Q2 k! j' a - "Top left" "Top center" "Top right"
. V9 W9 w& F8 B2 G& g* i* G - "Middle left" "Middle center" "Middle right"( {* J$ t4 J ]; f+ O
- "Bottom left" "Bottom center" "Bottom right"
' D% \; _' c, B - )
. N: k8 e8 m( Q9 { - )
8 A3 z6 o% q. {0 H1 W - (start_list "popup_just")
1 `6 I1 T4 ^6 m3 y M8 j r8 w - (mapcar 'add_list jlist)
' R% \' {& X$ c - (end_list)
$ [; m4 t: w6 v1 J - (set_just_idx)# Y$ Y2 J# }- a7 e
- (set_tile "popup_just" (jlist_act just-idx))' U1 T5 Z0 N# y, C" I
- )
! `, Y" p( L% _* B8 {$ d - ;; \6 ?: U( R' { b) c
- ;; Style setting for Attributes and Text. Reads symbol table for popup list( n U3 G( s- g! L
- ;; box.
" ^! f: G: l: [9 t m - ;;
( ?5 y* ?8 y! f- V. p+ i - (defun set_tile_style (/ sname style-idx tlist)1 s# E4 n: [" c
- (setq tlist (tblnext "STYLE" T)
2 I" w' H5 S& s: f- \: q+ ^ - slist nil)% {! l3 T0 I1 l5 n1 C
- (while tlist! m, U2 y% k% b; ~' a
- (setq sname (cdr (assoc 2 tlist)))5 u! ~5 |+ Y! ~5 U9 d7 A* u# M
- (if (and (/= sname "") M3 [' K" ^+ ?2 O* @( g
- (/= (logand 16 (cdr (assoc 70 tlist))) 16))
: z1 ~+ c9 ^8 S7 }; b F( { - (setq slist (cons sname slist)))" @: x0 c- a0 X/ M0 l1 [& x" ?$ g! T
- (setq tlist (tblnext "STYLE")))
& L' z# |: |+ S* z9 Q - (if (>= (getvar "maxsort") (length slist)). w6 |6 |9 K% w* C7 f
- (setq slist (acad_strlsort slist)) ; alphabetize style list0 Q) F ~) M4 q+ i
- (setq slist (reverse slist))) ; or reverse it to put it in DB order/ f, y9 y. t6 i' y
6 ]0 U9 m) |' D7 D% R, g" J6 k- (start_list "style")
8 a, y6 b) S, l" ? - (mapcar 'add_list slist) r2 j' ^7 Z* m5 @7 C/ @
- (end_list)
$ j4 s1 D) V2 D- C) C6 h - (setq tstyle (cdr (assoc 7 elist)))4 d9 w1 ~! P$ ?% Q
- (setq style-idx (getindex tstyle slist))
' c+ p' p$ o$ n2 V$ `/ G9 z& S - (set_tile "style" (itoa style-idx))8 Y- L) i: S, @2 T; S. E
- )! G+ U# |+ M# w
- ;;4 Q8 M$ F; O# F
- ;; Text and Attribute setting - upside-down, backwards
+ Y: r+ }5 U2 v# o3 U" w - ;;% d( h* o: {4 m
- (defun set_tile_bk-up ()
3 k0 T, k6 ^4 R; \: }! t - (setq bk-up (cdr (assoc 71 elist)))
( ]- U0 q$ r {. T9 S, n* L - (if (= (logand bk-up 2) 2)& O5 j. V( g4 k7 y6 e- N, p
- (set_tile "bkwd" (itoa (setq bkwd 1)))8 B. f S9 `% i; q
- (set_tile "bkwd" (itoa (setq bkwd 0)))
9 y8 ~- N5 C7 m9 b% c8 H - )
2 k7 f6 s }1 A, ]+ p - (if (= (logand bk-up 4) 4)
2 J; M0 h% U" v' w |) s7 r5 b1 ? - (set_tile "upsd" (itoa (setq upsd 1)))" P' u5 O! n$ l' i/ v
- (set_tile "upsd" (itoa (setq upsd 0)))
# \: e4 f) Q; E0 X6 Y' \7 G8 U1 s - )* h8 U# l1 ~) g
- )
) t6 t) E/ ]4 L1 G( j* T - ;;2 @0 e9 F' b6 C) T0 T: Q, r
- ;; Attribute setting - invisible, constant, verify, preset
$ x/ j5 q, d, h0 N2 J - ;;5 H1 ~/ x6 M- Z8 M& i1 b* A1 H
- (defun set_tile_icvp ()" o h$ M" I# d8 A0 n. ^/ _7 I2 y/ P
- (if (not (setq icvp (cdr (assoc 70 elist))))0 ^, V/ z' d0 R7 |( Y$ H' [! ~1 v/ C
- (setq icvp 0)) I0 {' u4 C0 M3 o
- ). x4 F, A8 |6 q" m" A. y. X3 `
- (if (= (logand icvp 1) 1)% Z; X5 s2 u& b7 ^
- (set_tile "inv" (itoa (setq inv 1)))) }0 m) N v t6 a# c/ J$ \
- (set_tile "inv" (itoa (setq inv 0)))
7 c9 ?* _1 h. c2 ~/ r& K1 ~ - )" }, ^1 Y: g7 Q0 J7 S" c) B
- (if (= (logand icvp 2) 2)
: V- {3 {/ l* b& E2 `! G: `2 r, |! f - (set_tile "con" (itoa (setq con 1))). s: ~9 Q$ l* L( J
- (set_tile "con" (itoa (setq con 0)))
h) z$ A0 G7 l; c$ g - )2 U* b9 P& l/ q4 q
- (if (= (logand icvp 4) 4)5 |# _: b+ @- c# ^0 g; n
- (set_tile "ver" (itoa (setq vfy 1))); }8 }1 ~( b8 `) y6 n8 w( A5 |
- (set_tile "ver" (itoa (setq vfy 0)))* k, X" v( h! n9 g" [/ G
- )+ Q0 a8 D/ ?" V9 @% ?) m- y
- (if (= (logand icvp 8) 8)" ^3 v' a; Q9 y. M- Z" d
- (set_tile "pre" (itoa (setq pre 1)))
@8 e6 C6 U( O% ?9 I# `0 [* L, F) H3 Z - (set_tile "pre" (itoa (setq pre 0)))& {( d0 V9 ]4 F w0 ~ p% w3 O T
- ), q/ V. Y+ P/ k9 L# C- P$ I
- )
; H3 f+ t# x( M8 f- q7 k8 o - ;;. O5 D. o5 ?0 z1 y+ S0 J- V; U/ k
- ;; Scale factors for block insertions
9 V) y& O5 u! k% `+ h - ;;0 o( d& L1 @' `
- (defun set_tile_scale (/ temp)9 M7 `# k+ Y( m" W6 _; l
- (setq temp (getvar "LUNITS"))
5 |. G5 ~2 f D, X - (setvar "LUNITS" 2); Y% X" ^! K2 C- A" k
- (setq xscale (cdr (assoc 41 elist)))
! l7 }8 H* r6 k8 a$ A- \ - (set_tile "xscale" (ai_rtos xscale))0 R" D3 Q- o! m8 e- `) M: c9 z
- (setq yscale (cdr (assoc 42 elist)))7 i+ O, z2 S! p ^: {3 D
- (set_tile "yscale" (ai_rtos yscale)): ?, G% D- J O8 i4 n
- (setq zscale (cdr (assoc 43 elist)))
% q; w3 H' _& Y: B ^2 M - (set_tile "zscale" (ai_rtos zscale))/ b2 f F) B7 ?! B$ q' `- ~
- (setvar "LUNITS" temp)
: U$ `4 p' v+ v - )
|$ [( m6 L1 _0 V8 w, @- p - ;;
6 j3 N: y! J! q- n! B% _' u V - ;; Rows and columns for block insertions' p% l+ K' O+ l
- ;;
9 r9 t8 @8 M/ K - (defun set_tile_rc ()
1 Y- N1 G: Z( Y7 O5 T6 O: g - (setq columns (cdr (assoc 70 elist)))
! h7 Z6 P4 q- Q1 R6 X - (set_tile "columns" (itoa columns ))) _0 l% C* d! s; Q. h( W/ M M
- (setq rows (cdr (assoc 71 elist)))( u9 Z+ {" R! Y6 V
- (set_tile "rows" (itoa rows))) g$ B s* C* p
- (setq col-sp (cdr (assoc 44 elist)))
9 r5 X3 ^& c+ U1 K6 Z - (set_tile "col_sp" (ai_rtos col-sp))
7 W+ l6 |5 G5 n6 B5 K: U0 c - (setq row-sp (cdr (assoc 45 elist)))1 M8 `7 y1 P) }6 ^' v! U* @" v
- (set_tile "row_sp" (ai_rtos row-sp))" i: e7 ?7 M. d3 w$ B+ L4 L" i/ `1 X
- (if (/= hasclip T)9 t! P( r; k1 Y6 o: _
- (mode_tile "xcliponoff" 1)
! N* q" e W% A$ C5 {$ t* L- t: f3 @ - (set_tile "xcliponoff" (itoa xcliponoff))
/ a2 ? d' ~" N2 B1 c - )
$ z/ H/ q9 q! P2 G# q% f1 o - )
5 ^8 ~. V; Z8 O6 u% p - ;;; d7 z2 l& |( J
- ;; Invisible edges for 3DFACE
0 W/ X& B1 R# y9 _ - ;;9 m2 j/ u6 H0 K
- (defun set_tile_edges ()
( k) O1 _0 [0 w( E, O - (setq f-vis (cdr (assoc 70 elist)))
1 z: D' B# c, H7 D6 W - (if (= (logand f-vis 1) 1)4 X' l7 h' q' q/ ]: Y' t
- (set_tile "edge_1" (setq edge1 "0"))
6 e- ?; R9 s2 g$ H - (set_tile "edge_1" (setq edge1 "1"))7 J% {0 q0 Y1 ]+ Q* v" {
- )) f4 a! L& |9 E$ v- h
- (if (= (logand f-vis 2) 2)* ]8 m- J' n2 z/ v- S6 H
- (set_tile "edge_2" (setq edge2 "0"))9 W2 t; U; N" M: m8 `
- (set_tile "edge_2" (setq edge2 "1"))
% Z1 P' a+ `4 C' P' V4 x! | - )3 [: `. B+ v1 ~, H( x0 G- l$ T
- (if (= (logand f-vis 4) 4)3 f3 y& h; k4 I7 U
- (set_tile "edge_3" (setq edge3 "0"))
; }! N- V0 e+ v( q$ Y4 S' z - (set_tile "edge_3" (setq edge3 "1"))
6 U1 j2 X' s2 E( i1 O# ` - )
- e7 B/ W# Y3 v9 `/ A; K - (if (= (logand f-vis 8) 8)
) q5 x- [: `; S - (set_tile "edge_4" (setq edge4 "0")) R2 X% d' c: s$ H6 f
- (set_tile "edge_4" (setq edge4 "1"))2 y$ |% a* N% G+ U$ x% i
- )
" A7 p, I- I# w8 X" X - )
. f( I; @# r8 d% [* Y5 Z- b2 k - ;;
9 X n% J, _( l$ }7 [8 A - ;; XYZ Point values for polyline vertex; g/ g" {# _ q, Q n# ^
- ;;# f8 J9 S( Q! x# u. H
- (defun set_tile_vpt (ptype)
6 p+ y+ f2 i0 i- }1 x5 O$ ^ t - (if (= (cdr (assoc 0 vlist)) "LWPOLYLINE")# x* Z, c, v( U8 H/ R6 w. x$ j
- (progn" {+ ~$ H( O( Y' `6 |6 b
- ;; ctr is 1 based, vertices are zero based.
`/ h6 s9 ]8 G3 @, g6 X9 \ - (setq vpt (cdr (getLwVert (- ctr 1))))
$ q& p7 C/ q+ R' p. t - (set_tile "xtext" (rtos (setq x1 (car vpt))))
6 M% y% T/ D' b1 G( c# Y% Q - (set_tile "ytext" (rtos (setq y1 (cadr vpt))))4 j6 X# b8 k% [% ^
- (set_tile "ztext" (rtos (setq z1 (caddr vpt))))
1 n0 e( }0 @+ } t3 u - )
5 B! X0 t- `6 i, W! X6 i0 n. ^, [+ [; p) o - (progn
3 v$ ^* I+ Y: x% m - (if (= ptype 0)9 I* O X5 \1 W6 J. D8 ^; \ ]
- (setq vpt (trans (cdr (assoc 10 vlist)) 0 1))8 h, j+ h" ?" C( f
- (setq vpt (trans (cdr (assoc 10 vlist)) ename 1))
" ^4 H3 j! g" i1 U2 a' `4 O. g$ Y* h, H - )
* Q$ M5 P( ^2 B% a. E - 6 v/ j: [( j+ c `! W6 n- C3 t( q
- (set_tile "xtext" (rtos (setq x1 (car vpt))))
" _& i' l% k+ q/ p: N - (set_tile "ytext" (rtos (setq y1 (cadr vpt))))3 R5 G5 {9 O, K6 _5 \
- (set_tile "ztext" (rtos (setq z1 (caddr vpt))))
2 S% X3 y% j4 g% W: l# } - )/ ?8 X2 V& ]& R% U
- )4 v9 ^# A. Z- N: i
( R* S- h0 b: y* p) G$ r$ y- )
" ?3 |) J0 J( c7 T1 m - ;; This is the equivalent to doing an entnext on the heavy weight
3 q0 @6 g6 I% F7 |/ s7 F) v! u Q - ;; polylines. The hard coded '4' below allow stepping over the6 Z8 c+ n8 z( y+ p y5 h
- ;; 40 41 and 42 group code information. The while loop finds the
2 o8 F: i4 R6 h o - ;; first vertex which will be used as the starting assoc in the2 J7 l8 G3 I( f7 T& R
- ;; call to nth.# m1 k9 {9 P- v6 w/ `
- ;;
- n! L: q, | X1 L Y! r - (defun getLwVert (tmpctr / count tmp) t+ x7 x# H" W( Y0 v
- (setq count 0)) ~2 j. h( U4 ` p5 }% }
- (while (/= (car (nth count vlist)) 10); C6 E& c5 t" ~9 l/ _
- (setq count (+ count 1))3 U; R6 G" u; j
- )( P" V6 c1 y6 E2 A5 C3 K
- ;; If the counter reaches the number of vertices,
8 ~9 V7 P. X1 k - ;; reset ctr and tmpctr to zero again.( h3 C! p9 N a0 L) w' k
- (if (= tmpctr (cdr (assoc 90 vlist)))1 v1 k* h& H$ h) H& n( R, }
- (progn* e+ e4 H1 s3 S
- (setq ctr 0)
z* G' L* u9 | - (setq tmpctr 0)
# |% e) B7 B1 w! ]6 D9 C - ) C8 ~$ ]: s) k
- )6 m( g' S( j4 x" ?6 j
- (setq tmp (nth (+ count (* tmpctr 4)) vlist))
1 ^" s9 Q4 J, ]0 s - (setq tmp (append tmp (list(cdr (assoc 38 vlist)))))3 ? x0 c! M: R9 F, ]. @ c
- (setq pt1 (trans (cdr tmp) (cdr (assoc -1 vlist)) 1))
% [( |+ [1 @9 ^8 ~$ U - (setq tmp (cons 10 pt1))
9 u# d& _% l1 {' v# Q& B& A - (setq tmp tmp)
5 X ^+ ~" a& X$ Q" p; R' v0 G; X - )
0 M V0 y% i K K' U - ;;
1 Y' ~$ p& [- n2 K! h6 X - ;; Set tiles for Spline properties. If the spline is rational then we
7 r$ Z: k; f8 O6 |) X/ q4 s0 I7 x - ;; need to display the weight values of the control points, so set8 p4 e s* e) D6 P
- ;; flag to 1.3 d& D6 n: S" N/ g: u( X
- ;; 1 = rational spline
1 o) \# I2 N9 k' y s Z1 M - ;; 0 = non-rational spline6 _0 r6 y/ e8 n! d* r& H3 K
- ;;
2 d( _/ o% M, ^- g - (defun set_tile_spline_props ()- a" H( X* R2 c
- (setq rational_spl_flag 0) ;; initialize rational spline flag
& d! |1 v& k& y9 I) P( Y - (set_tile "Degree" (itoa (cdr (assoc 71 elist))))
7 Q3 [4 m" p4 M, q% l" d6 h - (setq bit70 (cdr (assoc 70 elist)))
/ e. l( D- [! E1 c# @ - (if (= (logand bit70 1) 1)$ o& o/ G6 M. R, B
- (set_tile "SpProp4" "Closed")
" E- W/ r( H$ L& B7 a - (set_tile "SpProp4" " ")4 `, o% J& O4 t' U5 G: [
- )
! X. H) C4 y4 @0 H2 A - (if (= (logand bit70 2) 2)
: W. x! }, s3 O* e) S4 c - (set_tile "SpProp3" "Periodic")2 s2 p# X" k0 @- o, V
- (set_tile "SpProp3" "Non-Periodic")/ C& g: m. ?) s9 I3 q
- )
7 o7 s) i3 d) l6 a3 z - (if (= (logand bit70 4) 4)
/ k& G! |. A9 `* l/ r8 Y, g3 ?$ Q - (progn
6 c$ C. I! [# G& W! @ - (set_tile "SpProp2" "Rational")% _5 U& R) ~. J+ I1 |: B
- (setq rational_spl_flag 1) ;; this is a rational spline
* O5 c, \( C5 ?- A- y - ) d: c6 W! u3 D: g; S3 A
- (set_tile "SpProp2" "Non-Rational")
9 B y1 n4 j( Z* h. E/ W9 Z1 I - )
t+ }4 d: ~2 l d5 y D/ P - (if (= (logand bit70 8) 8)
; G. F- k& T( r [- s& ~ - (set_tile "SpProp1" "Planar")
, d4 E% g5 }; q+ Y4 } v - (set_tile "SpProp1" "Non-Planar")) E% B4 a% r, o
- )
" c% u. g6 x3 G3 B - (if (= (logand bit70 16) 16)' y& ?4 P! k- W( p- f+ n
- (set_tile "SpProp5" "Linear")
& U s0 h b( J& `" s" P ~6 ` - (set_tile "SpProp5" " ")
& H( M1 G2 | M+ B - )
" m/ ?) Q8 D1 p8 F, Y" r - )7 [4 L) {6 H- s! _# d2 ^3 k8 g
- ;;4 l: ?& a# L; k& ~0 V+ o$ `
- ;; XYZ Point values for spline points
' p: r$ y `5 T. {: W9 Y3 s; @; P- E+ }) I - ;; Need to account for WCS/UCS _$ d9 j0 t5 k4 d
- ;;
~; _( Z$ Z$ T6 m6 a9 H. n - (defun set_tile_cntl_pt ()
8 r* C! F, L1 v% ]' i8 [- L* q3 r1 D - (setq cntl-pt (cdr (assoc 10 elist))). m0 a' h7 p0 d8 J. j
- (set_tile "xtext" (rtos (setq x1 (car cntl-pt))))- |% `" Q3 i( B* t& p9 B
- (set_tile "ytext" (rtos (setq y1 (cadr cntl-pt)))) X9 T2 Y& f' M3 j ?) W
- (set_tile "ztext" (rtos (setq z1 (caddr cntl-pt))))
& a% @; T! @' e' |0 A% X# Q$ K - (if (= rational_spl_flag 1) ;; if rational spline U) }7 |3 Z. N2 ?3 c7 S
- (progn ;; show weight# y: v, b, T/ y% P
- (setq weight (cdr (assoc 41 elist)))7 h% t+ e" Z7 O: m$ J P0 k2 ?6 |3 W
- (set_tile "weight" (rtos weight))
/ C5 p( o+ T- m v+ A6 _ - ) ;; else: S7 ?. [. S1 p# i
- (mode_tile "weight_text" 1) ;; disable weight field
# j+ T1 u) P/ G# N1 ]4 [( c - )
/ V& r# B- n, y1 S/ y; } - )
4 x8 H5 S* R1 ?6 g+ t1 w% P% ? - ;;4 x) h, Z7 V% Q4 e# j
- ;; XYZ Point values for spline points
! ]( {& D3 A) m - ;; Need to account for WCS/UCS1 D3 ]2 B* P* P8 o; L* j9 ?9 G
- ;;, U' |* x. G8 Z$ `. z" u6 M
- (defun set_tile_data_pt ()3 \+ A6 Q# N( n: k: {
- (if (not (assoc 11 elist))! _. y- I. v! K l7 o" Q: q1 `; R
- (mode_tile "data_pts" 1): P- f0 {* C. Y4 T4 j3 N' b# s
- (progn
. E" `$ m# L# f+ P7 \ - (setq data-pt (cdr (assoc 11 elist)))
, [- e. c( w7 J! w8 D - ;; display points with current precision.
5 e" N K3 A, H. Y5 t - (set_tile "dxtext" (rtos (setq x1 (car data-pt))))
) |0 M) H$ z1 W. n6 i - (set_tile "dytext" (rtos (setq y1 (cadr data-pt)))); g& {6 |: m' n
- (set_tile "dztext" (rtos (setq z1 (caddr data-pt))))
! h* a: w1 N( \% ^4 K( h2 [ - )( f+ \6 e! x: `0 \- y( t0 n
- )
! J% q% K, K# y. n; i) m - )
8 c, W' P5 i7 `: Y5 B - ;;' v* H% J9 m7 {* A5 U) } t7 P
- ;; Fit curve, fit spline, or smooth spline surface setting
( [( L# V* U% V* Q9 `3 d - ;;: W% ^3 }2 P+ \8 u4 v8 \
- (defun set_tile_fitsmooth ()
: S0 p* w- N% x5 f' U! p6 c/ o# ? - (cond4 M' \0 n7 X, s! a& e: W
- ((= (cdr (assoc 0 elist)) "LWPOLYLINE"). F$ ?9 ?8 D" o( e, ~/ }
- (set_tile "none" "1")' n) P8 e5 V/ A' }
- )
9 ?. n' `& j0 V8 P# g: W - ((= (logand bit70 4) 4)
! z: i# V( h3 e5 f! S* Q - (cond
' a2 {; \- P+ O1 }3 N8 K9 ` - ((= bit75 0)2 J( r8 n2 c; `: `* a
- (set_tile "none" "1")2 `/ I$ }* e% f( P6 @! H% W% C
- (setq spltype 0)
" t) E- b' G0 J! r7 ?( l4 R - )
! r+ |- d- r, \# h+ V: D4 k, r; ` - ((= bit75 5)& d" Y$ K( \4 G- b7 w4 h- u
- (set_tile "quad" "1")" C1 n# y4 G3 C+ }) x. `- D4 O
- (setq spltype 5)# X/ ?9 t- d1 [
- )/ r, v: m7 x9 p" w% d
- ((= bit75 6)2 x) `+ G* E0 a% M, S
- (set_tile "cubic" "1")8 A, {5 H% J8 O1 o: N
- (setq spltype 6)
) j4 B( h: @$ ~& N r - )5 h* i8 T- n6 X3 V( t I
- ((= bit75 8)) W$ Y' S$ k& i( `7 f' A3 ~
- (set_tile "bezier" "1")# `# Y( {5 O2 R# X
- (setq spltype 8)7 j/ z# t k2 u9 Y
- )" Q, Y5 ^# Z. U+ z+ Q5 o/ A- c
- )
' M7 a& o3 J' Q3 J+ A - )
) l* ~2 U3 q! J/ d. N3 K ^ - ((= (logand bit70 2) 2)8 n0 o9 W. ?! H
- (set_tile "fit" "1")# I w5 i/ I0 N( u- \
- (setq spltype 1)
- F5 E: ^* l h$ j0 c: @: E - )
; r* i: x* R' D - (T (set_tile "none" "1"))
, X0 |5 \2 g7 }0 B4 f - )0 {2 u2 z7 @% F% M% y
- )4 `* v% B. W, m( W4 O4 s+ |
- ;;8 z9 h% N" [# t; G) \! H
- ;; Closed or Open mesh and polyline setting* w2 e. M& O) X
- ;;4 {( a9 c8 z( V6 S
- (defun set_tile_closed ()/ c( E- X, L: Q2 I) e+ l3 ^$ g7 l' m* J
- (if (= pltype "3D mesh")
) @2 R/ C n. N: f U% { H, c - (progn% F9 r" M, ~ x% S$ J
- (if (= (logand bit70 32) 32)& m& o0 ~1 c$ L( q2 |
- (set_tile "closedn" (setq closedn "1"))* `/ T; }5 y) v+ y/ N4 ~
- (set_tile "closedn" (setq closedn "0"))
; g* z9 R2 g3 M. K - )
0 D0 p [/ w& r8 Y' p" M - (if (= (logand bit70 1) 1)
- Y7 }# \! K9 j& R; A - (set_tile "closedm" (setq closed "1"))1 {( V0 u( {2 O6 j
- (set_tile "closedm" (setq closed "0")): a1 M; ^7 A+ @5 g/ |: u$ [
- )) }9 v) G% m: e+ d( X
- (setq old-closedm closedm old-closedn closedn)6 q# _" }7 [7 J. ?
- )% B5 Y: G$ O, ^- e4 i4 B E
- )
. u2 k/ M0 C- _# m9 ] - (if (or (= pltype "2D polyline")# r! a3 `+ ~6 J8 n; G" y) @& B j
- (= pltype "3D polyline")
# a+ k+ |4 M4 w - )4 H3 A( b! {0 _5 {4 A
- (progn' Q7 F: y+ S' z5 Z7 ^$ o
- (if (= (logand bit70 1) 1)
9 L' o( A. k! k/ {% B - (set_tile "closed" (setq closed "1"))6 F( v/ y5 V( L$ T5 t( R
- (set_tile "closed" (setq closed "0"))' h3 }4 Y+ k+ {1 n7 }
- )
& i% d8 d5 ~/ M: ], z3 c9 \ - (setq old-closed closed)
0 u3 W: P1 m2 ]2 | - )8 L! k0 N! @; k% u! i+ e: L" y
- )2 h/ t$ Z) c5 x3 @
- )( X6 w; p4 u2 d
- ;; Set common action tiles
% O. J" F8 u$ A6 a3 ]) | - ;;
/ l( _9 b# r) B# {( w# r/ q) V5 @ - ;; Defines action to be taken when pressing various widgets. It is called. }) `- r' D5 T% b7 T
- ;; for every object dialogue. Not all widgets exist for each object dialogue,8 u8 a: s- l4 l1 F
- ;; but defining an action for a non-existent widget does no harm.+ U/ W$ ?' ^# a; B8 b7 }
- (defun set_action_tiles ()5 b# @1 a( x% ]) C
- (action_tile "cancel" "(dismiss_dialog 0)"): x# u6 b ~7 ?/ F
- (action_tile "accept" "(dismiss_dialog 1)")$ K; C% e0 M |9 V) m
- (action_tile "help" "(help \"\" help_entry)")
! X! R; N+ S7 N7 W# {- [1 A) a3 b* I - (action_tile "b_color" "(getcolor)")
9 A. d% Y( d) \& s; z8 b2 K- F - (action_tile "show_image" "(getcolor)")2 q# C# Q' U: Z: v7 X }, R- z' m I
- (action_tile "b_name" "(setq elayer (getlayer))")1 _1 X& Z8 D" o6 R1 G, w- q' o
- (action_tile "b_line" "(setq eltype (getltype))")
0 ^+ o R, C7 C7 m1 m4 B( u9 `' h2 v4 i - (action_tile "eb_thickness" "(getthickness $value)")
/ j' \7 E8 w, Z' v* e' Z I, H0 ?( ~ - (action_tile "eb_ltscale" "(getltscale $value)")$ D6 p) G* p: I
( a+ e+ S* A6 Y. t- (action_tile "pick_1" "(dismiss_dialog 3)")
# q' \$ F' C4 `+ F - (action_tile "pick_2" "(dismiss_dialog 4)")6 w* b2 Y* |' _: i# J
- (action_tile "pick_3" "(dismiss_dialog 5)")9 q* k1 X& U5 I4 R+ T
- (action_tile "pick_4" "(dismiss_dialog 6)")
/ L7 F' r+ t4 _ - (action_tile "x1_pt" "(ver_x1 $value)")3 X3 s: _& x- J! S. F e l
- (action_tile "y1_pt" "(ver_y1 $value)"). x$ @5 W4 l4 ?4 c5 t
- (action_tile "z1_pt" "(ver_z1 $value)")
2 j: _, L# j6 \/ A ^# a) n: a - (action_tile "x2_pt" "(ver_x2 $value)")
( o* ~. s9 ^) b; I5 y - (action_tile "y2_pt" "(ver_y2 $value)")
u: P' n1 a( S - (action_tile "z2_pt" "(ver_z2 $value)")
. }; J# ?8 D6 d4 C" o - (action_tile "x3_pt" "(ver_x3 $value)")5 e- v6 {% _# H2 o, b- O$ U
- (action_tile "y3_pt" "(ver_y3 $value)")
. P {' i7 |0 a - (action_tile "z3_pt" "(ver_z3 $value)")( `# v: F- x7 ~2 s
- (action_tile "x4_pt" "(ver_x4 $value)")
' D$ s, f$ h' J& _) m - (action_tile "y4_pt" "(ver_y4 $value)")6 h& X) G) x' W8 C& m+ h! F# b
- (action_tile "z4_pt" "(ver_4 $value)")
1 ]( v" Y' p. X P% O
) e' V' j! ]0 b2 ]3 Y4 t; n. @- ;; Action tiles for Xline & Ray' |( k' \+ g" `* }
- (action_tile "xline_x1" "(ver_xline_x1 $value)")
0 p/ C$ f! h: s4 @ - (action_tile "xline_y1" "(ver_xline_y1 $value)")1 \0 c) J; _! v" y+ \% b
- (action_tile "xline_z1" "(ver_xline_z1 $value)")
) W& k5 s Q( |& u% O4 D- ] - (action_tile "xline_x2" "(ver_xline_x2 $value)")
1 O, n8 I1 `( R, g$ K9 ~$ d - (action_tile "xline_y2" "(ver_xline_y2 $value)"): W2 Z! `4 e' D2 s% k% c+ D
- (action_tile "xline_z2" "(ver_xline_z2 $value)")! f6 j2 c; S; k, N; J/ @
4 f% A$ J" w7 ~/ x* O" p- (action_tile "edge_1" "(setq edge1 $value)")
" `3 |" r: Z2 l& Y0 v - (action_tile "edge_2" "(setq edge2 $value)")3 h! w ]0 v' p: ] O: `6 \
- (action_tile "edge_3" "(setq edge3 $value)")
% c' {4 V1 h4 X D' ^ - (action_tile "edge_4" "(setq edge4 $value)"): D- S7 T- B" F' C/ q
- y& q( F; i' Y* G4 L3 w: O
- (action_tile "radius" "(ver_rad $value)")
$ d7 \( y9 a! T6 b - (action_tile "st_ang" "(ver_ang1 $value)")) b. ?$ |# a5 ]0 X
- (action_tile "end_ang" "(ver_ang2 $value)")
( O. p& }8 [5 [; J2 N4 V8 v - (action_tile "end_eang" "(ver_eang $value)")
) N! D0 |/ `# Y) n' ?# t% B - (action_tile "minrad" "(ver_minrad $value)")# ~9 p( q# C" _8 e9 L* A) ^
- (action_tile "majrad" "(ver_majrad $value)"). H5 b& r( a$ J% M
- 8 b3 H$ Y# J5 r9 p* I
- (action_tile "xscale" "(ver_xscl $value)")
& \* S/ K- o/ F, d* S - (action_tile "yscale" "(ver_yscl $value)")9 q7 h5 m5 U% m- A) e: L
- (action_tile "zscale" "(ver_zscl $value)")
1 N2 j& J) W @' h( K - (action_tile "rot" "(ver_rot $value)")/ D3 V7 H4 o1 t1 J9 @. z
- (action_tile "columns" "(ver_col $value)")
9 k( V8 q! d0 c- E* M) l - (action_tile "rows" "(ver_row $value)")4 [# Z$ V# U) r+ V w
- (action_tile "col_sp" "(ver_colsp $value)")
) l: T9 D5 t, w: x( B8 l7 y7 P - (action_tile "row_sp" "(ver_rowsp $value)")
7 e; i! J+ |1 k
* p" A/ u; O! g. [: F5 a* l- (action_tile "hght" "(ver_hght $value)")5 Z+ D: q& H4 p# m" b n+ k. [# d2 I
- (action_tile "wid" "(ver_wid $value)")
4 f: Y2 e |' T# v! i - (action_tile "obl" "(ver_obl $value)")- Q1 ^) K' }5 e$ t
- (action_tile "style" "(style_act $value)"), f5 w t! u3 J( ~
- 0 s8 M. X3 `% Q% E/ e8 E
- (action_tile "t_string" "(ddgettext)")
% R D" Q- p# _5 V$ T3 d. t - (action_tile "tag" "(ver_tag)")
- ^& b4 H6 s9 ^( w5 f: [2 f' e - (action_tile "prompt" "(ddgetprompt)")# |& d2 |- Y3 d6 ^2 X l* X, v0 S
- (action_tile "bkwd" "(setq bkwd (atoi $value))")9 N q$ a6 P! R
- (action_tile "upsd" "(setq upsd (atoi $value))")2 Z" Y! ?/ A- D4 C! v
- (action_tile "inv" "(setq inv (atoi $value))")
- \0 i9 K% W, r9 O' _+ X \- e - (action_tile "con" "(setq con (atoi $value))")3 A! n R/ T& t4 ^; \
- (action_tile "ver" "(setq vfy (atoi $value))")" W T- H0 W% b( D, P" f
- (action_tile "pre" "(setq pre (atoi $value))")4 E- z* f ~( }0 e& b$ q
- (action_tile "popup_just" "(jlist_act $value)")7 c9 o8 u& N* e, Q; m0 J# s
$ C/ ` `! P: g) D' P- (action_tile "closed" "(setq closed $value)")
- {2 L3 q6 @- [ - (action_tile "ltgen" "(setq ltgen $value)")( a+ r% f3 }' q# I: c2 \
- (action_tile "closedm" "(setq closedm $value)")6 G8 ^ T5 [2 u4 e+ I* k
- (action_tile "closedn" "(setq closedn $value)")3 N$ X3 E2 b7 ~/ _! L( K& S
- (action_tile "next_v" "(next_vertex)")+ Z; ]# J& d- F9 `
- (action_tile "xcliponoff" "(setq xcliponoff $value)")
) E; H+ @+ C% R# T- L - & q' j g$ P$ I% k2 {5 N
- (action_tile "next_cntlpt" "(next_cntl_pt)")4 _3 f2 G) k$ {$ a. `. t6 |
- (action_tile "next_datapt" "(next_data_pt)")
: J7 W5 V& _7 i6 A# U0 _ - . X# |2 m# s# \1 M& M3 z( H
- (action_tile "none" "(if (radio_gaga \"none\")(set_uv 0))")8 H4 A; i& M1 ^3 P" M6 ]$ t7 T9 H
- (action_tile "fit" "(if (radio_gaga \"fit\")(set_uv 1))")2 ?4 ?8 y' D8 x; n0 Z
- (action_tile "quad" "(if (radio_gaga \"quad\")(set_uv 5))")
( B; z: k: s$ E; f - (action_tile "cubic" "(if (radio_gaga \"cubic\")(set_uv 6))")6 u6 ?5 s% ]7 h3 ^0 n0 k( q+ J
- (action_tile "bezier" "(if (radio_gaga \"bezier\")(set_uv 8))")
: M8 H3 y* I9 T( C; ^ - 1 h) U; Z4 R2 i% Y3 K, v/ l
- (action_tile "u" "(ver_u $value)")
4 x( z+ t% R m' p2 X" o& ~ - (action_tile "v" "(ver_v $value)") e) V7 ^2 w( Y7 @$ J- S t
- )
; H+ Y. b5 w9 |* d( Z0 B7 n9 \ - , y, j7 x9 g1 q4 L
- (defun ddgettext()- x! i4 }- g4 V0 _6 r! E% r
- (setq text (get_tile "t_string"))
3 M1 `9 i% X( k- g$ a( w2 | - )% Z9 x" h3 r' I0 k2 x: I
- & E' {1 t% ~- {1 k8 u3 {8 ]
- (defun ddgetprompt()7 Q3 H0 K/ G0 b; Q f" C& @0 c
- (setq atprompt (get_tile "prompt"))
$ m. C( }6 |: o7 n: n, G - ), S) U% p1 `$ x0 d+ B% B- q
* s8 n1 T6 |( O) Y6 e9 {8 g- X f- ;; As OW doesn't support disabling of individual radio buttons within
1 o' m. t: `5 z2 y$ n6 H8 F7 ~6 S - ;; clusters, a check must be performed as to the legitimacy of the$ T) t' h8 Q9 z- Y) H7 ]& ?$ V J8 H
- ;; button pushed and reset if necessary.1 v3 r N$ J ^7 @
- (defun radio_gaga (pushed)
u0 m' x/ I( V - (cond
: M. H6 P' d2 t: L! D4 }9 `+ R - ((and (= pltype "3D polyline")
3 I( w4 Y1 g2 U/ z2 w7 e4 _ - (or (= pushed "fit")
3 B4 E& {4 t* r; t1 v - (= pushed "bezier")
$ B9 [+ ^: S' b0 ?2 ~! g - )
, ?) f4 Q! E& @2 y+ d W - )
2 Y% A0 q3 Y& s - (set_tile "none" "1"); B$ J( w6 g- B7 t _
- nil; i1 b& r9 @" c
- )) W" S- K0 J# I' p, y0 \
- ((and (= pltype "3D mesh")9 C* k0 g3 u/ Z8 Z8 E N
- (= "fit" pushed)
, @8 j' V8 n9 U2 ~6 v2 E3 N& _ - )2 L5 h3 b1 |8 X/ o& L1 Z: x" M
- (set_tile "none" "1")
: v3 f7 n+ ^, E, n - nil
' B; Q8 I, b/ j4 J2 }9 j4 k+ M - )
( @$ `0 J7 e5 y) Y - ((= pltype "Polyface mesh")
+ h x8 E3 {/ b3 P - (set_tile "none" "1")
8 {- @, t: W) D5 z( G) f, s - nil
4 h4 U1 w; ]) c m2 i. W# o - )
1 x) G) f4 O% [8 y `4 K+ H: S, ^ - ((and (= pltype "2D polyline")
, ^0 L6 }# ]1 D. F( y6 @, R - (= "bezier" pushed)# _/ ~, }2 m5 h8 U. N* ~
- )
/ p2 y# t. E/ V l v - (set_tile "none" "1")
* E+ M1 G9 Q+ v% f# J/ r - nil
! o2 ?8 A% V0 I# T7 o - )
; r) y5 z* l( V7 n2 o" u - (T)
1 f/ ~% H7 m. P" D - )
: q7 J4 V9 R/ w2 u: d - )3 T; C2 ]8 a5 v; h' M
- ;;
0 ]% `% A9 _! j: c$ t* v; H - (defun set_uv (type_n)7 L) [! \" W1 I5 d# K
- (setq spltype type_n)$ V- V7 s/ M9 W
- (if (= pltype "3D mesh")
) f" m1 L: E: \5 r2 i - (if (= spltype 0)
9 q% F4 h p) t/ Z# K. m" f - (progn
- |* E; W2 a7 T! f3 ]; V - (set_tile "u" (itoa (setq u 0)))4 Q* j) ?# b" Z$ r2 n
- (set_tile "v" (itoa (setq v 0))): S' a& F/ K6 A8 T
- )( `, @7 h5 @- U2 Q# W1 D* T
- (progn
5 s; W) P' C+ b* C3 e+ q% }4 I - (if (= u 0)2 c; p- O3 _) m4 P
- (set_tile "u" (itoa (setq u (getvar "surfu"))))
* n/ W2 i8 P+ E9 x o - )
+ ]/ Z9 A- W- \& c, `2 w5 J - (if (= v 0)
2 x, `# _" L* f8 ^( ^ - (set_tile "v" (itoa (setq v (getvar "surfv"))))& @5 a6 G6 o9 P- @0 ?
- )
/ x* t$ P! p: K) r, N ? - )6 L, s) X8 w7 { w" R
- )
2 A! ], ^0 ^( s1 o& g( m/ X/ _. ` - )
" m+ P' d$ ?% ^( Y - )7 u: S, H4 Z$ G9 u
. {0 u. ~9 G/ b
: e8 F6 V2 N1 y4 J; U! |- ;;
' C4 t+ M; y' J$ [3 b' Y - ;; Verification functions+ E, z% u$ d) e" p h# O" w
- ;;
|6 s% R( A I0 y - ;; Verify distance function. This takes a new X, Y, or Z coordinate or
& H* a4 v; p- o6 H; z. Y( L; V - ;; distance value, the tile name, and the previous value as arguments.: @4 h0 w* P" O; L* s; W
- ;; If the distance is valid, it returns the distance and resets the tile.
5 H4 f# x7 h# l8 ^+ z6 W" ? - ;; Otherwise, it returns the previous value, sets the error tile and keeps: |" P( G* n! e; k8 Q- o% e5 X
- ;; focus on the tile. Shifting focus to the tile with invalid value can
+ l/ U$ \2 w4 X1 l" _4 A2 F- @ - ;; trigger a callback from another tile whose value is valid. In order5 a0 T6 w8 F; r) i2 P& X3 q4 V
- ;; to keep the error message from being cleared by this secondary callback,3 t# w3 E0 j3 c
- ;; the variable errchk is set and checked. The last-tile variable is set6 w+ `2 G2 _& k1 z8 U6 b5 ]* `, ]
- ;; and checked to ensure the error message is properly cleared when the# q4 N5 G/ f6 ]2 f, G" S( y, M8 S
- ;; user corrects the value and hits return.) G |/ Z6 o* y, A& `9 B3 o
- ;;
w+ N& P- m$ Z( {. _ - (defun verify_d (tile value old-value / coord valid errmsg)
0 A: ?% v+ f' T c4 F0 K2 H - (setq valid nil errmsg "Invalid input value.")
9 V* r6 }* V* ^+ { - (if (setq coord (distof value))$ o$ w5 G6 ?4 y. l* |% W: f
- (progn6 ~7 e3 L: n# w( h
- (cond( X' a( H$ m) N2 a
- ((or (= tile "radius") P5 X. I3 u$ G( R9 @+ H4 t
- (= tile "hght")
: U2 t. O# K! f6 k' p& J! Z - (= tile "wid")2 D( F7 s! l& \7 @- o
- (= tile "majrad")- ^4 C6 Z5 L& i
- (= tile "minrad")
$ k& K6 ^9 s5 R; D - (= tile "eb_ltscale")
( y1 t! N& j. g8 J1 e1 L: ]; O( Z) a - )
2 Q6 V$ h0 J, c. m# K, l7 h - (if (> coord 0)
4 @6 y9 L! x2 T Z4 S# l+ V! M - (setq valid T): J# ]" E5 B5 l O4 C; d1 a- O
- (setq errmsg "Value must be positive and nonzero.")
3 o. [4 R& Z3 P7 D! a8 `% f - )
8 k0 O' s( x1 o- z& D - )
( Z6 G, }# G- T4 t) A - ((or (= tile "xscale")+ F; n! [5 U! ]9 |( B+ f, Z7 W
- (= tile "yscale")6 y3 Z- W4 T+ r; R h
- (= tile "zscale")& J5 d) D, [- ?" h- \; @
- )5 W8 k3 G8 v2 G: a0 j
- (if (/= coord 0)
! {1 K' U/ [& i5 S0 j2 q - (setq valid T)
4 T Q: J7 t( @; w - (setq errmsg "Value must be nonzero."); L% z. W8 H1 t% _' `% t
- )8 |/ R# g9 u6 k5 r) }! w2 k8 I/ r
- )
9 t; p x; i( S* H2 \+ D, y8 }1 \2 s - (T (setq valid T))5 _5 K0 Z, G6 {5 O( q
- ), U7 X9 \. W. T
- )' s# T: `5 b& D, G2 A# ]7 W4 E& u
- (setq valid nil)
w/ z5 _5 Z6 O8 L! b6 A - )6 l! f5 |' j! H* r6 D
- (if valid7 k9 D( v& b$ N
- (progn2 n8 `2 p }8 a R& Q
- (if (or (= errchk 0) (= tile last-tile))& d1 K$ S( ~9 r! A' T, @ `
- (set_tile "error" "")
9 Q$ G7 l; n+ {; R. |2 P- s$ [ - )6 u) y) N. j5 Y1 L! L" ]) O! F
- (set_tile tile (ai_rtos coord))' f; s) j* d& T1 R) J) d
- (setq errchk 0)
+ x' g. j# E- q% @) [ - (setq last-tile tile)
, x# b- \8 q6 k8 Q - coord
0 q4 F0 M* k. Y3 ]7 F - )2 H: j( p+ I( V8 U1 b/ [
- (progn. `$ c' O$ L' G
- (mode_tile tile 2) ; Move focus to offending field8 h; f" b5 D, t
- (mode_tile tile 3) ; Select offending text
$ L4 L) ^1 |- g7 Z h2 ^ - (set_tile "error" errmsg)
X; }7 j8 u* \2 x* E* ?$ d - (setq errchk 1)
, C+ _' g4 Z* ^( l3 C! v) L - (setq last-tile tile)8 V, Z% l+ n6 c" Q8 I5 b7 J8 S
- old-value
. D G6 N! s# X8 [3 M: M d: K - )
: O% n; S) k) w+ o- M% u) C - )! t- a5 R, }7 l
- )
I0 Z( X4 a) h- s5 ` - ;; Function for Xline coord edit box checking.
! M K: j+ Z; x# Y) e - (defun verify_xline (tile value old-value / coord valid errmsg)( ]+ f$ z% b( ~
- (setq valid nil errmsg "Invalid input value.")+ B, C. y& p) L4 b2 q0 q7 w1 E; N
- (if (setq coord (distof value))8 z. I& E: M9 D. t5 `
- (setq valid T)% G- R; s: L) o& }
- (setq valid nil)9 z" B8 V0 z7 j) z
- )
: D9 p; V3 O7 _. u - (if (and coord+ @- f4 V4 Z% P" Z: l
- (and (= (atof (get_tile "xline_x1")) (atof (get_tile "xline_x2")) )
9 m+ j4 t' ?2 @1 ~" n0 @4 s* H - (= (atof (get_tile "xline_y1")) (atof (get_tile "xline_y2")) )$ h" c. E: P: U* W. S
- (= (atof (get_tile "xline_z1")) (atof (get_tile "xline_z2")) )$ h' @8 N# Q0 _6 l& S8 W
- )7 u) I2 ~0 ~! o0 S! O4 g/ K
- ) j9 P& U2 [" }0 a7 P
- (progn
& w1 H# ^) V& ~8 G6 s. [$ u0 R- D - (setq errmsg
$ Q. d6 d& R2 a0 @7 ]2 V% R - "The Root point and the Second point cannot be equal."): ~1 R7 @. b4 {& P
- (setq valid nil)
$ T+ J2 \+ u9 S5 d - )
7 |' q) v# n' D3 g0 n1 n3 m& e, Z R - )7 f6 R- @7 Q% j" l1 ^, i
- (if valid. c. _* `6 x& u+ p1 ?
- (progn* t3 n: \9 x# `# j" b* N
- (if (or (= errchk 0) (= tile last-tile))
) e+ A0 z! e4 U3 B5 S' e - (set_tile "error" "")' g$ g3 i: z9 H
- ), v( z6 Z" |, u+ ~7 O0 R N
- (set_tile tile (ai_rtos coord))
7 S8 h% s& h- D0 M# v# ~ - (setq errchk 0)) s8 K' v, e# U& D# H0 m6 r7 E3 j& k
- (setq last-tile tile)
6 O5 u/ F6 c. V$ V6 K - coord4 Q: u- e" O* M2 W* d. d% x3 b* O
- )# n/ J& ~ m% S a* m- x: @! {
- (progn& ?; S y1 b# f- m' B
- (mode_tile tile 2) ; Move focus to offending field& g+ e$ W5 b% A! d5 V& i( l0 O$ S/ v
- (mode_tile tile 3) ; Select offending text% o" Y6 M; u& }' ]
- (set_tile "error" errmsg)
q7 D f( S5 Y9 f+ M - (setq errchk 1)- ~! K* \5 j9 Z4 t& n
- (setq last-tile tile)- Q: p5 e! u$ ~1 t1 ]
- old-value4 p- O% v6 A" w. {
- )
/ m% z+ f9 U) |7 D9 u. o2 N - )$ ]/ n# c# e# m) B, H
- )9 q* I9 c0 L/ H7 I/ e% Q
- E; O; B% R9 Q
- ;;
( J$ h5 B2 R9 L! g% V% X - ;; Verify angle function. This takes an angle and a tile name as arguments.3 z# ~$ s) L4 F7 V% } r C
- ;; If the angle is valid, it returns the angle and resets the tile.$ a) N8 |2 \# L, Y4 _6 C7 J0 U
- ;; Otherwise, it sets the error tile and keeps focus on the tile.' Z& ?% q; ^* s+ u# ]! q/ L( }% v
- ;;
) l- u, V- e6 _$ R4 c! h5 F3 P - (defun verify_a (tile value old-value / ang valid errmsg oblqmax)/ `4 N' v6 p" P6 d/ f2 v
- (setq valid nil
) `. K! t) |9 ?, g - errmsg "Illegal input value."
, r* ^* u$ l* A; O1 Z! A - )
4 E% @4 x' v% t, V' n% B, M9 ?8 n - (if (setq ang (angtof value))0 S8 R4 ?' b( A) B7 V" q# V
- (cond
+ c9 P' T. {1 T7 [9 p) z - ((= tile "obl") ; Restrict obliquing angle' m7 @3 t$ G- [& v, Y6 |4 u
- (setq oblqmax (+ (* (/ PI 2.0) (/ 85.0 90.0)) 0.000001)): w/ u( R# A9 _% b3 ]. C
- (if (or (<= ang oblqmax)
! K8 Z4 R% {( E' Q! _ - (>= ang (- (* 2.0 PI) oblqmax))- y1 @3 W& L% z0 B: O( G/ q8 q/ Z
- )5 `: y" R# v- L P- L. ?, J6 S0 a
- (setq valid T), a5 s1 ^# Z9 t
- (setq errmsg
5 q4 l5 x& t- G7 `% S6 U - "Value must be between -85 and +85 degrees.")
. O: \9 S p# Z: [$ N/ [& B: G! f - )7 k3 u a" t9 ^% w' X& W! T
- )6 ?: E% Y: [- P/ t. p' I4 V. r0 N
- (T (setq valid T)) ; Other angles not restricted6 r$ {; A) m3 k' U- P8 x
- )
, b d! h/ E1 g5 i3 Y1 Y8 c - (setq valid nil) ; Invalid angle input. _* s7 d5 }7 d
- )
?+ i( E5 R$ D9 U0 ] - (if valid; z+ X: m* F' n
- (progn
: `! l. c3 L# q+ F - (if (or (= errchk 0) (= tile last-tile))! H1 g) E3 P# c
- (set_tile "error" "")) `3 _1 a1 V9 F- {1 x- E- _4 r. ^
- )5 T6 B$ o4 x9 Q7 h
- (set_tile tile (ai_angtos ang))# I6 i: O; h& t d+ K$ [
- (setq errchk 0) l$ w$ _6 |' T# V9 \
- (setq last-tile tile)
- q, m7 K- @4 I: v7 D5 |0 Y - ang4 V& K/ G( a( V* K
- )
0 U8 s2 }+ q( t! M/ ~0 j k8 n - (progn0 ~% G/ g2 o, B6 r2 Y; b. f+ u
- (mode_tile tile 2) ; Move focus to offending field
( J0 J" J" w0 D) y/ v; Q4 W - (mode_tile tile 3) ; Select offending text
% Y/ a' k! j3 z( f. Y. n& Z2 [ - (setq last-tile tile)
# e( A; A' g% @) [8 Y - (setq errchk 1)) b0 h$ }4 t' X% s2 q2 w& I
- (set_tile "error" errmsg)
2 W6 U& m! H! @, x" t# ]5 d- O, T - old-value5 q9 D, f1 T+ w5 S
- )! v6 G/ \3 Z2 S4 w8 {
- )
# I2 v1 d$ z6 ?0 x+ | M - )4 ^7 j3 d1 d$ j7 r% w
- ;;
3 @9 s1 h1 z/ D, H1 l2 } - ;; Verify angle function. This takes an angle and a tile name as arguments.% C) D. `. ^& T) J: H. B8 V
- ;; If the angle is valid, it returns the angle and resets the tile.
% k, ?- h2 z# C; c2 u2 w - ;; Otherwise, it sets the error tile and keeps focus on the tile.- `+ z$ w" ]1 I L1 G N1 ]2 o
- ;; This function is specifically for the end angle of the ellipse object. If
# a3 S( ]* l. E% n( U& `' ?0 _, a' C - ;; the end angle resolves to zero then we want to display it as 360.
! a" T6 M7 h! d+ K( B - ;;
! q! ]2 f+ ^. j/ `/ E+ y - (defun verify_ae (tile value old-value / ang tempend)
% K& _& U% N# o$ Z8 s4 l* n K h6 N* J% e4 ] - (if (setq ang (angtof value))
) i/ I& z! K) d1 k* X$ A* v - (progn4 ^- _+ d" {4 d
- (if (or (= errchk 0) (= tile last-tile))9 v% O4 U+ t0 q. f! g
- (set_tile "error" "")0 ?. g; [0 @7 a! R7 t7 X x/ \
- )
; ~& }" b' E; ^% N! Y! X - (setq tempend (ai_angtos ang))
( V0 D P. S! S4 t. h$ i! e - (if (= tempend "0") \) ]' U0 a$ w# a+ V' @8 @2 t/ h
- (set_tile tile "360")
. [. ~" t9 E) z1 K/ o$ o - (set_tile tile tempend)* k& H: ]4 e7 O) g
- )# Z" S$ N( @' ~7 c- q
- (setq errchk 0)
* g3 M" w3 E8 D$ Q Q9 o M/ r - (setq last-tile tile)
$ f* K2 F* u$ S! w2 H - ang
) _3 @3 h) b& L' G - )) J+ l$ G- S0 i$ k- ?/ l4 Z
- (progn3 Z. h- {# S) c1 i( R- c3 Q3 W
- (mode_tile tile 2) ; Move focus to offending field6 r o4 d2 D- L* p
- (mode_tile tile 3) ; Select offending text
" w5 V8 ]4 V: D" p3 v1 h - (setq last-tile tile)" w. x7 b5 j9 K* c3 W. h1 L" W: L/ v
- (setq errchk 1)
9 e( S. N2 {: S; F+ [& J/ G. j - (set_tile "error" "Illegal input value.")
. B3 {$ W2 b4 P# Z7 p* @- K; r5 }) O - old-value
. O# |' a |- Y' Y, [# c - ), x- T" k1 J" j' L/ v" G
- )( T/ j, p1 i% G' C
- )" m; X( p: J# e: I; Z, i
- ;;
( T3 Z9 Z4 c9 }, q$ X @: }0 f' @ - ;; Verify integer function. This takes an integer and a tile name as
9 j( M3 T( y J - ;; arguments. If the integer is valid, it returns the integer and resets the' C: c3 u; b4 T: }- r& Y0 ]
- ;; tile. Otherwise, it sets the error tile and keeps focus on the tile.: Q p8 I4 r" I! V* B; m# v
- ;;+ {# A M7 H3 E
- (defun verify_i (tile value old-value / int valid errmsg)
+ ]9 L4 D5 X! p: q% C) W - (setq valid nil)
: O) W J- t0 e3 g+ [5 K" Q9 _- o - (setq errmsg "Value must be an integer.")
# m. R2 g- F6 L- f: h1 d - (setq int (atoi value))7 g1 ^/ b6 I; K* C
- (if (setq intchk (distof value))
2 A1 {% n8 e& E - (cond8 M3 X( \: H" S; k, ]6 y! o H* |
- ((or (= tile "columns") (= tile "rows"))
% o, p2 L4 l* t, X: D' X5 ^ - (if (and (= int intchk)
F0 F% O, E' f* l" b: a - (>= int 0)
7 F9 ] I7 z1 \, }4 S - (<= int 32767)9 w. V5 _2 g/ f$ X
- )
" J2 c* j) c( h# R9 x - (setq valid T)/ L8 @/ O! z/ f4 S+ r" {
- (setq errmsg "Value must be an integer between 0 and 32767.")6 a3 F- W% Q6 C
- )( v, N7 X5 y6 W# }' t# C
- )5 @" B' ]$ P6 P9 r+ x
- ((and (or (= tile "u") (= tile "v")))
# ~, v, `9 m t; z* ~ - (if (and (= int intchk)
8 h! F. t W0 S" \+ w( _2 s, q - (>= int 0)
1 ^, t5 T1 s3 M6 ~1 y - (< int 201)
" f5 |, A! m, y1 b - )
( O3 f% _8 u: @7 R, i - (setq valid T)
# j$ {( Q# D- s3 w4 q/ p - (setq errmsg "Value must be an integer between 0 and 200.")4 d6 H1 a! B- }4 X
- )& [* @) s/ h& Q3 ~& A& \
- )$ i3 ^7 a6 ^+ V) j
- )
5 Y9 F! v2 W! Z% ^ - )
- Y+ y7 a& C! v" Q( v" W2 [ - (if valid% i/ z. q& |! O- L& J
- (progn
6 k+ |3 m# l, O/ j - (if (or (= errchk 0) (= tile last-tile))
0 |) m* O9 Z. D8 W: K5 H* f" Y - (set_tile "error" "")3 h v4 w* _/ @ j
- )8 w; x* H2 a' u) G$ {
- (set_tile tile (itoa int))$ ~7 W" w/ z4 q$ h
- (setq errchk 0)+ | y3 x2 M R M. M
- (setq last-tile tile)) o- q* V, g1 ^; p
- int+ r3 Q0 K4 g# @: k
- )8 s/ P' b; G: b0 T
- (progn
) d! p. w4 }' i" M! t - (mode_tile tile 2) ; Move focus to offending field
6 O" U# o+ }% N - (mode_tile tile 3) ; Select offending text
; x# f0 ?/ n3 s9 q! r9 L1 m - (set_tile "error" errmsg)
6 s. u0 g9 l7 D! y3 R, r - (setq errchk 1)
, ]5 b: W1 k( s: u A - (setq last-tile tile)3 q- P# s* ?1 V$ }4 u
- old-value
6 a5 [' F5 K9 a& }7 p9 X' Y - )
& {1 D% L2 V& ~2 ] - )3 E# y+ S: H, c" S
- )
+ z- `! F! z9 J B0 u1 |5 s - ;;% d: W- m0 m2 O ^4 |9 ~
- ;; Functions that verify tile values for integers4 l# y) }) B0 A9 k3 S2 W7 W0 [* F/ e
- ;;+ I; h! j+ Q5 G$ s9 z
- (defun ver_col (value), q0 F; |; ]/ F! n! h4 }; z7 T# Z+ p
- (setq columns (verify_i "columns" value columns))5 g! g0 [. a( g. ?/ u" z
- ), y0 O) ?1 G4 m2 M' _
- (defun ver_row (value)
6 a+ W/ b( f3 b) H8 E6 Z3 M - (setq rows (verify_i "rows" value rows))6 i4 M* J* z- l2 J1 N7 s2 q# E4 v
- )
V( ^! k+ }& U. D3 p! Q - (defun ver_u (value)" p, N8 u# l4 U6 C; f2 i
- (setq u (verify_i "u" value u))3 s# c- ^5 k& n3 |' N
- ), R! d8 t6 H: I- ?( e( p
- (defun ver_v (value)
/ i: w! Y& Y: Q z! i - (setq v (verify_i "v" value v))
! z/ g* k6 c& V$ h - )
3 b( v( n* v+ p - ;;9 d8 r; T! k" ?" Y, ~& L% @
- ;; Functions that verify tile values for reals
9 ~* Z0 T& G( v: t: Z- i/ j - ;;
# U: Q1 s3 x2 J( P) k - (defun ver_x1 (value)8 x9 y7 J; c# u- H D% c* O5 F) o" a
- (if (setq x1 (verify_d "x1_pt" value x1)) (calc))
8 J' B- D; J7 ~ - )
9 t' I2 `3 Q" A5 e. o0 c! F - (defun ver_y1 (value)
0 B: a Q- _: p/ a1 s# x; p; u - (if (setq y1 (verify_d "y1_pt" value y1)) (calc))
' P+ r$ t& @5 T - )
P" K) Q, U: Q - (defun ver_z1 (value)& G, n% [; W6 ]7 q$ s. w
- (if (setq z1 (verify_d "z1_pt" value z1)) (calc))8 p3 o' P" z0 A" F4 _
- )% L7 M9 ?5 L* q& r
- (defun ver_x2 (value)# f, H1 u8 g6 ^' v
- (if (setq x2 (verify_d "x2_pt" value x2)) (calc))
6 I# U/ M" q) j) | - )
1 i' }: L* ?7 f7 {( Z$ P - (defun ver_y2 (value)1 i! V- `5 F- `* @% t1 e
- (if (setq y2 (verify_d "y2_pt" value y2)) (calc))3 ]( X$ Z+ n: m9 @' x
- )0 F1 ?6 U/ @ Z" y
- (defun ver_z2 (value)
; {: W: {+ C0 H) { - (if (setq z2 (verify_d "z2_pt" value z2)) (calc))
) z1 U% i' O5 w0 |/ ]$ D" Y - )( H$ s; f7 ?; e& K
- (defun ver_x3 (value)+ e c9 N* Z! b. R- F. F( \4 e% r7 Q
- (setq x3 (verify_d "x3_pt" value x3))9 e z. R6 Z# q, l C& ]
- )
5 z$ h$ m* X- M - (defun ver_y3 (value)
6 d* \6 p ^. g6 n% n - (setq y3 (verify_d "y3_pt" value y3))0 l3 A2 [) v0 I! g% C3 M& v
- )+ X# ~1 ]! W: W- i; y; A
- (defun ver_z3 (value)4 G+ d: G! R) r- m9 K- E, n% R2 ~
- (setq z3 (verify_d "z3_pt" value z3))
' M! a) E$ h) v X - )
5 A+ c7 V4 ~8 v - (defun ver_x4 (value)- r8 V' N* v. f# A" J
- (setq x4 (verify_d "x4_pt" value x4))
- ^5 v$ d8 s; p4 N - )
( N; |3 w4 G" [: Z' n- W/ b - (defun ver_y4 (value)
: O V2 y W- p) q% k5 { - (setq y4 (verify_d "y4_pt" value y4))
6 A8 P1 v$ j: e3 E- s - )% x! X; Y7 ?- m+ | z
- (defun ver_4 (value); s- n, c: x5 y
- (setq z4 (verify_d "z4_pt" value z4))
% n7 M1 Q8 _& n0 b+ x$ ^* w - )+ N7 e) s' {4 K
- (defun ver_xscl (value)
% \: N4 L( d# s4 d" c* ] - (setq xscale (verify_d "xscale" value xscale))
: e: e7 P1 ^; R/ O, L4 L - )
' O' v: n6 ~; u5 g9 h& |$ T( A$ M) y - (defun ver_yscl (value)
1 `+ ~( D3 y* H6 A - (setq yscale (verify_d "yscale" value yscale))
* j$ d8 `: [2 V# \7 S& y; G+ }) G - )" F( A- `* m# H
- (defun ver_zscl (value)
& Z& e$ h$ w: D, d, @* V* X - (setq zscale (verify_d "zscale" value zscale))
! q- d2 a1 _6 K0 A) M) [6 j9 e6 D+ c - )
+ p* y+ K- H" ^! o L( }6 {/ c - (defun ver_colsp (value) G7 M1 C0 V4 G% Y
- (setq col-sp (verify_d "col_sp" value col-sp))
3 ?- r3 w9 w: t8 U5 { - )1 o4 g: Y* R f) R a7 A; g8 Q
- (defun ver_rowsp (value)8 D' y# L" i' f% m; a
- (setq row-sp (verify_d "row_sp" value row-sp))0 E( x f. V, c2 r+ B
- )0 E' L$ M% p9 O H; f* s$ Z
- (defun xclip ()% a& N: \0 B% ?: o
- (setq xclipmode t)0 F$ J0 T9 u1 ~0 k& w
- (if (= xcliponoff "1")7 _ f2 a7 O) p( M' R: o6 Q" y' q/ r; M
- (command "_.xclip" (cdr(assoc -1 elist)) "" "_on")
- s* A9 N; A# S' } - (command "_.xclip" (cdr(assoc -1 elist)) "" "_off"); j/ O s9 X6 p( [1 `
- )
; ^7 n4 ~! `9 m* h/ J; a2 t h - )6 B- F: V/ W& R% i4 d* d% h
- (defun ver_rad (value): \1 Z9 X" j K) W& I+ A
- (if (setq radius (verify_d "radius" value radius))7 h. @. v1 u6 A' J
- (calc)
5 }: N( Z: b" ]; Q9 X9 q" S8 n - )
. ^9 t+ f6 Q! r+ z O1 J( A6 A - )
& P' m/ ?. P; `2 Z! h - (defun ver_majrad (value)
5 Y& [- B" s9 w4 v8 H) _2 S) v$ ~+ ` - (if (setq majrad (verify_d "majrad" value majrad))
Z4 a/ Y1 S" M5 P- C - (ell_calc_newval "majrad")) k5 I3 }( N6 z% a0 e" q
- )
; F f2 H9 B/ P. x - )
; G9 ?$ M2 t5 M. }% Z7 w - (defun ver_minrad (value)
7 {: `; }; ~8 ? p - (if (setq minrad (verify_d "minrad" value minrad))
/ z/ [: T9 s' D& \) o- C/ H' o - (ell_calc_newval "minrad")( `. f. l" h7 ]' }+ J, M5 p# A
- )
6 _3 q/ {1 l/ |9 Q. ^6 d - )- F8 u N# C' _# w
- (defun ver_hght (value)& V$ q- j- e( x; H/ @5 Z' x
- (setq hght (verify_d "hght" value hght))- X9 e9 N; u! o* d: P5 A; _
- )
! v+ J" ~$ c% ^% o; Q" Y - (defun ver_wid (value); E2 M+ A- p9 Q9 F6 k/ p! j. G
- (setq wid (verify_d "wid" value wid))
) E2 P$ }# I1 n S8 ]$ v - )) u4 I' H8 i$ ^
- (defun ver_xline_x1 (value / temp)
$ |! l- l* ]* _, L: ? - (setq temp xline_x1)
' H4 n2 d: [+ @# z( d* p% b5 l - (setq xline_x1 (verify_xline "xline_x1" value xline_x1))
5 k' Q- p4 O* T - (if (/= temp xline_x1)
' w! J$ s0 W( ]! w3 a - (progn (modify_xline 0) (set_tile_dirv) )
$ q9 U0 S/ e' I* i T- ? - )/ o( S& b6 @2 H+ U
- )
0 ~& R" r1 S! l0 d6 h - (defun ver_xline_y1 (value / temp)) Q; \4 }" s3 k; p+ V
- (setq temp xline_y1)9 z+ Y/ A/ t0 |5 q6 S
- (setq xline_y1 (verify_xline "xline_y1" value xline_y1))
0 l6 r6 G3 K7 A2 f% i - (if (/= temp xline_y1)9 t. v' B3 `; }) W0 ?# F
- (progn (modify_xline 0) (set_tile_dirv) )" S4 e% U4 L0 k8 p! H/ u9 Q4 e
- )4 M4 T) ]7 Q4 s* s) \
- )+ ~$ @8 ~; e. s! g, O3 e. V
- (defun ver_xline_z1 (value / temp)$ G' B: \+ X6 }/ b- x2 F" T2 I
- (setq temp xline_z1)
6 r3 }6 ~& T6 n, Q) K) c, ` - (setq xline_z1 (verify_xline "xline_z1" value xline_z1))3 i: G( G# p$ l# ^( d) g
- (if (/= temp xline_z1)( K0 r: U, _8 F: k1 ^
- (progn (modify_xline 0) (set_tile_dirv) )
* _8 e) n4 s# e' a# w1 c/ v5 ~; G - )
; {8 G8 m6 C( i% B( _, _ - )% v- O) T# g6 d% j$ E7 ^8 E+ X
- (defun ver_xline_x2 (value / temp)
5 A* x7 s% \$ U9 C# J" L7 a, | - (setq temp xline_x2)8 A9 H9 s6 B1 J2 {8 I
- (setq xline_x2 (verify_xline "xline_x2" value xline_x2))7 ?" N3 R; x: e1 @- o, e! c
- (if (/= temp xline_x2)7 H( c G4 i2 J9 I
- (progn (modify_xline 0) (set_tile_dirv))% f r4 |1 y2 A/ H# z% l
- )
+ b8 H0 S3 @0 J8 C/ r# _0 ~ - )# U& H, [# b! n
- (defun ver_xline_y2 (value / temp)+ `; o) W/ y8 m, v" w0 T* a
- (setq temp xline_y2)9 B' b: t8 i% F0 R3 ~
- (setq xline_y2 (verify_xline "xline_y2" value xline_y2)); O6 T2 v& {1 T2 h
- (if (/= temp xline_y2)
6 Y$ d9 b6 q' K" l4 v2 H - (progn (modify_xline 0) (set_tile_dirv) )
% _* K8 j+ D+ n: i/ h2 _ - )/ L8 z+ j- P$ H! U: Z! A, X4 w
- )
) p" `4 t& m, h2 z+ T3 P7 Q; O9 u" ] - (defun ver_xline_z2 (value / temp)
: ?; e- Z+ p6 X( J( z - (setq temp xline_z2). o# j1 M3 ?0 P
- (setq xline_z2 (verify_xline "xline_z2" value xline_z2))
; n Z9 O; o2 Y" d& m - (if (/= temp xline_z2)
3 X3 G# S" Q+ }- P1 N+ p# ~* I - (progn (modify_xline 0) (set_tile_dirv) )
* e/ h8 n* `# C - )
( \! [3 p @& j* j - )
2 ^8 ]" U! b$ z& F# ]! l - ;;
6 J8 C! k1 E7 a! z6 e - ;; Functions that verify tile values for angles
+ `+ z$ g7 ~) A7 b0 n2 _ - ;;
" L) E8 O+ ?0 g0 S - (defun ver_ang1 (value)
9 B& K9 S+ D6 {: q - (if (setq st_ang (verify_a "st_ang" value st_ang))& b- C8 z9 T/ ~+ R3 V& {
- (calc): |0 I, `: f# F6 |
- )
& @! m4 T) m7 u% } - ). R) a2 G( Q: h# ?7 s6 \" i
- (defun ver_ang2 (value): w% e9 u8 U. z) g
- (if (setq end_ang (verify_a "end_ang" value end_ang)), a! U5 r# `* v% t" a2 W1 L
- (calc)
T2 Z: u5 z4 I% K - )
" `+ p9 Y; `% I - )
- \8 V, S( [6 c$ n& S4 }+ o* I) E - ;;
9 H( {: M- |. D9 Z9 J - ;; Verify tile value for ellipse end angle. Handled slightly, B* @+ m: R; N: U* x8 v
- ;; differently than the other angles.3 k, }& D' r \0 J( E
- ;;
2 d% I! W/ k, ^1 [( [ - (defun ver_eang (value)
4 Z5 x4 Y- W. O! I/ ?" G9 h - (setq end_eang (verify_ae "end_eang" value end_eang))9 R- Q% K& I1 j
- )9 y: ?8 D+ k7 c# b# v
- (defun ver_rot (value)4 H1 X8 f$ a1 m P) W; d H
- (setq rot (verify_a "rot" value rot))% z6 y U% ~ ^# {$ p
- )
4 ]$ I4 x% p, V+ W2 D. ?6 w5 X - (defun ver_obl (value)$ w7 i$ z6 R9 t/ F0 ~3 S7 j# A
- (setq obl (verify_a "obl" value obl)): M, \5 }' q4 {' S# e
- )1 o$ ?; s7 l$ G
- ;;
, x4 l( O5 B" s - ;; Function that verifies attribute tag field for null string,' r, K/ A& s4 o B) n+ v g: ^
- ;; or a string that contains one or more spaces. Tile value
1 _* I, V& J2 C8 B - ;; is also converted to upper-case as well.
( ]! d0 q# r' c! n, P1 C - ;;8 h7 J) k7 ^, G$ c( a! C
- ;;
0 Q* F0 ]5 s O& n - (defun ver_tag ( / tval)
" V+ X! O6 m& p$ A r" s; f8 v - (setq tagval (get_tile "tag"))$ Z$ J; n, x+ v9 a
- (set_tile "error" ""), S& b, @% r' R1 [
- (cond0 M/ t& Y+ \- c7 ]$ M
- ( (or (eq "" (setq tval (strcase (ai_strtrim tagval))))
) f& j& V/ T$ k, J - (wcmatch tval "* *"))% z5 f% s7 G8 b9 W: {0 W& v
- (set_tile "error" "Invalid attribute tag.")
$ S" |( K& z9 g& H3 C. \; a" z+ w - (mode_tile "tag" 2)
9 p+ R1 u0 m) n& j; t - (mode_tile "tag" 3))3 i2 W% i; U) U0 e! |
- (t (set_tile "error" "")
% o: ~9 ~: c; a4 a' l) I; V - (set_tile "tag" tval): [) G( Q3 m- S4 @+ ~3 S2 ^
- (setq attag tval)))
2 _! Z. b' g* K7 z - )
! F4 c6 |$ f' j1 G- @& y - ;;
: B! [' X& }# N0 A - ;; Calculation functions, N1 q0 e8 w) M5 { V# c) B
- ;;; p# X; e/ j0 }% A" @, Y
- (defun calc (); j6 A; h/ I/ Q
- (if (= etype "LINE") (line_calc))
u$ v! S8 g) S8 Y - (if (= etype "ARC") (arc_calc))6 M) o9 t1 |- W3 m/ x ]
- (if (= etype "CIRCLE") (cir_calc))
# G( v; P# Z: }5 @& j& u( t - )
; T: B. ?# l6 M { - ;;
( X. N2 _0 A( m' p( `! } - ;; Calculation functions for lines, arcs, and circles' I2 w6 d, Z' x; L! V3 |
- ;;
# I8 w. E/ e2 Q) c! h! h - (defun line_calc ()
( I; \( Z3 {/ x - (setq stpt (list x1 y1 z1))# H/ f8 X ~& p* X3 h4 M3 K
- (setq endpt (list x2 y2 z2))
$ U6 I3 g/ \0 I! S - (set_tile "delta_x" (rtos (- x2 x1)))7 R% N8 e( Q9 G
- (set_tile "delta_y" (rtos (- y2 y1))), B. w' L0 }7 X r P- Z% X! Z
- (set_tile "delta_z" (rtos (- z2 z1)))
6 N% Y+ o! l, T7 n - (set_tile "l_length" (rtos (distance stpt endpt))); z8 l: p) o2 j7 i8 t
- (set_tile "l_angle" (angtos (angle stpt endpt))) S) B# g9 i* K
- )
$ q6 r: F9 B" i4 |6 M
- o% h, T) l& m& G# x- (defun cir_calc ( / area units)+ ?' V z1 t( Z7 ]0 D
- (setq radtest radius)+ p7 N0 Q/ Q2 l3 e
- (set_tile "Dia" (rtos (* 2 radius)))
: e% v/ ], o0 E; R: J7 a - (set_tile "Circum" (rtos (* 2 pi radius)))% r4 ~. K! T( R; q
- (setq area (* pi (* radius radius)))
/ g, Q2 |: \& _ - (setq units (getvar "LUNITS")); l2 y* l- {. x% w
- (if (or (= units 3) (= units 4))9 e7 m/ G( e. C7 w' g: W
- (progn% k$ h2 ^ g, d4 c
- (setq area (/ area 144.0))
& M' p, U1 }: Z, I+ b$ a - (set_tile "Area" (strcat (rtos area 2) " square ft"))3 v1 h- b# K) [# Z1 ]* F: r) ^
- )
) T* `% J8 j* C, u/ T8 X7 Y& { - (set_tile "Area" (rtos area))
9 D- w. ~1 A5 a, r s |, s - )
( T6 P! P& c* l/ Z0 v - )
' H5 t O z6 g - / [( G8 {. X5 g ]& c4 R
- (defun arc_calc ()
" n4 D u: w8 |0 d, j - (setq totang (- end_ang st_ang))
! e1 n' {* U4 d/ H b- b* T t - (while (< totang 0)5 \/ Q2 @7 G6 z7 r2 k& {& m
- (setq totang (+ totang (* 2 pi)))
5 q- D% D" q4 l1 u - )
5 ~& `$ p4 w* r! J' ^, H3 I0 b - (while (> totang (* 2 pi))5 a j; e' ?0 E3 e
- (setq totang (- totang (* 2 pi)))+ ]9 K8 F6 t6 L
- )
7 k* e8 Y' k. r' R# J I - (set_tile "tot_angle" (angtos totang))3 I6 N/ K. f4 ?# N s9 O
- (setq arclen (* (* 2 pi radius) (/ totang (* 2 pi))))5 a+ ^' j, H! V5 c% ^. e8 p
- (set_tile "arclen" (rtos arclen))
. n3 @2 q ~/ a$ } - )
0 V3 _; R! L0 W - ;;
3 G: } K4 E: V5 {) t - ;; Calculate the major radius, minor radius, major axis direction.
) t7 b2 G: Y# e - ;; Get radius ratio. Convert Start, end parameters to start and end2 ]) `0 P3 t2 ~
- ;; angles. Save Major Radius value in "old_majrad" in case the user
4 D- y) G5 b1 X; ]$ ]' z' \ - ;; chooses to input a new Major Radius value later. It's needed to9 v; M Y! `( u$ C1 u: f
- ;; calculate a new Major Axis Vector value.
( O: C3 J: \( R) @) y0 P) Y2 @ - ;;
+ ~- ^% @% [ V8 k% |( w' x - (defun ell_calc ()
, ]3 L3 n# A, P7 i. p# F - ;; Get major radius from the major axis vector.
) e; X7 K6 e, I- g& h! t - (setq majaxis (cdr (assoc 11 elist)))) Q: ?8 j+ V% g
- (setq xx (car majaxis)), F8 | ^0 y) D& ]' Y, \/ {+ ]) S
- (setq yy (cadr majaxis)): }* Y! a! v5 A6 \ [# @, f
- (setq zz (caddr majaxis))0 u @6 s3 E! P: v4 ]
- (setq majrad (sqrt (+ (* xx xx) (* yy yy) (* zz zz) )))
% k: c" B$ K3 W9 t - (set_tile "majrad" (ai_rtos majrad))
) r$ o" H/ c' k - (setq old_majrad majrad)
1 o8 ?7 V+ [" s; ~ L# A1 w/ P9 m - ;; Get radius ratio
: W2 O# C( S$ r% ? - (setq rrat (cdr (assoc 40 elist)))8 Z' P* h7 h1 O- B# Y- S& ?
- (set_tile "rratio" (rtos rrat))" p5 d1 x( H: m
- ;; Calculate minor radius
9 ~! x# X' m7 p# }9 B2 _* W - (setq minrad (* majrad rrat))! M2 _# v Q3 a, F& `8 Q' J# ^
- (set_tile "minrad" (ai_rtos minrad))
, Z$ d) }9 ]( a6 r - ;; display major axis vector9 z: T! C! k+ y( ?1 j
- (set_tile "Majraddirx" (rtos xx))# W: M% v6 B. b0 y" c- Q
- (set_tile "Majraddiry" (rtos yy))! Q5 S5 H5 i# |7 X
- (set_tile "Majraddirz" (rtos zz))
) Q w( b+ z& `6 ~* A - 0 Q7 k/ C. U8 u9 {
- ;; Convert start parm to start angle
$ @% D% y! g: x( V, N$ h - (setq stparm (cdr (assoc 41 elist)))7 n$ m, Q' o8 I
- (setq vecx (cos stparm)), n2 }( g' j6 n& i8 [
- (setq vecy (sin stparm))/ U: _! H) X, Z- t, T# D4 q: k
- (setq st_ang (atan (* rrat vecy) vecx))
6 I$ B# e+ B8 K0 W - (setq tempst_ang (ai_angtos st_ang))& I$ v5 p0 k; s5 |8 i
- (set_tile "st_ang" tempst_ang)
0 B0 [6 {( r- Y - ;; Convert end parm to end angle. If end angle evaluates to 0
, z. J7 A! d5 V; ?2 D - ;; degrees then display it as 360 degrees.$ l6 x( L) R) x- \& v% D6 s4 | z
- (setq endparm (cdr (assoc 42 elist)))' g, ]/ P" d l2 C) m3 D3 N
- (setq evecx (cos endparm))
+ Q- X3 ^6 D5 V4 v( Q) ` - (setq evecy (sin endparm))* q& T3 g& _/ P; U/ x
- (setq end_eang (atan (* rrat evecy) evecx))/ C' C9 I. j# P @) T$ |. Q1 D
- (setq tempend_eang (ai_angtos end_eang)), ^# Z | ]% B# K) v
- (if (= tempend_eang "0")$ `/ i+ j/ w9 N2 R
- (set_tile "end_eang" "360")4 S# |2 J6 S6 ~' ?3 ]. h
- (set_tile "end_eang" tempend_eang)
$ ]. I" t7 k3 x! H- x - )' E( q5 u. e) L/ t
- ;; Get area of the ellipse. Q4 o; N' f5 L1 r% K$ N& }5 H
- (ell_calc_area)
( h. c! t$ \& \: o& Z - )
: g- m; _: W& n' j5 X) {* \, O - ;; Calculate area of ellipse. If it is an arc then1 q' } o/ S) G: M' y# ]; E4 n' O
- ;; grey out area display.
/ w4 x* H- K Z; U' E/ A; g - ;;1 I1 Z" h( V' v* {- I( ]9 k5 E
- (defun ell_calc_area ( / area units)
/ o1 T' f# R9 z1 a# n: { - (if (and (= tempst_ang "0") (= tempend_eang "0"))4 {, V% ~2 \6 j
- (progn+ r/ G0 Z# h% Y/ W# }
- (setq area (* pi majrad minrad))
6 ^. f6 u0 ^. `8 G/ P9 f7 ?$ G - (setq units (getvar "LUNITS"))
, D8 X6 W. n0 t* `! H& e" c0 b+ i - (if (or (= units 3) (= units 4))
- n: y* ~* x K1 L - (progn
, Y6 ^& n, t! C0 w: R) _( Q% {) N - (setq area (/ area 144.0))- T6 B) Y( Q. E
- (set_tile "Area" (strcat (rtos area 2)" square ft"))3 L- P9 W1 }# K4 z
- )6 c# @" m3 ?+ c4 h( S
- (set_tile "Area" (rtos area))
9 K, s% Q, [3 B& y- D/ n2 w5 s9 z - )
8 t. T1 q( c. H$ l U9 Y0 v - )
" b2 ~9 W3 ]8 N' O0 W - (mode_tile "Area_text" 1)1 w+ w! b. K0 T% W5 V, h, w, |
- )
% n) Y( L! s. L/ A6 W8 R7 S - )
0 \4 {* u7 ^: O; ~9 ^ - ;;2 w% v8 K G# o* V0 }
- ;; Calculate new values for ELLIPSE
8 ?+ x0 }3 ]; T8 x, V+ q! o w4 ] - ;; Minor Radius, Area
5 u) @$ y8 |% s Z" e0 L - ;;
3 _; _5 v( Q B) q$ i" {8 Y7 A - (defun ell_calc_newval (ell_tile)
[ S) Z, {: t - (if (= ell_tile "majrad")3 ^0 X* x: L) E& x$ Z3 { K: k/ K) b
- (progn! o0 F; D4 l. F' R
- (setq rrat (/ minrad majrad))
4 U7 V# O, g, I: ]+ t - (set_tile "rratio" (rtos rrat))
1 W, J% D6 X2 G% ? - (ell_calc_area)
# o0 k0 N! j6 l- C7 n# { - )5 d& \$ F& c0 `
- )
1 {* a; O7 g6 r' C0 Z, S" _& f - (if (= ell_tile "minrad")
9 ^2 \& r! g9 j5 |% Z/ x# V- h - (progn F$ Y& H, R2 C9 @3 S
- (setq rrat (/ minrad majrad))
/ {# c3 Y' R* @, r X/ a - (set_tile "rratio" (rtos rrat))) D+ |0 \7 m |* t# |! B, m
- (ell_calc_area)
' g6 K& L! n* m+ p4 i5 ~' X - )6 ?6 ~. O4 e+ l
- )
2 o/ |# c+ C3 J* ?' E - ). |! R( u. z; x) n6 m# ?. p
- 9 Q- V4 a4 v. g9 K! S) Q
- (defun set_dimen_props (/ loop a stl txstyname); d2 b+ H. S. v+ \+ L- _
$ N1 x$ l% \- E. ^& _3 |! {5 V- (setq stname (cdr (assoc 3 elist)) ; get style name, j! c; U6 Y7 p5 E3 O' e: C; ^
- stl (tblnext "DIMSTYLE" T)8 Q& N; ?9 P3 s: p
- stlist nil)
. a/ E( a6 F, g& T - ;; Get all style names and list them in alphabetical order/ p1 Y# `6 d( \7 Y$ u! v6 q
- (while stl$ ~+ B- q8 ?3 T1 a/ @" x8 N w( {
- (setq sname (cdr (assoc 2 stl)))3 u5 i: Z# u. U
- (if (/= (logand 16 (cdr (assoc 70 stl))) 16)
: D- I t7 L. f: H- U- R - (setq stlist (cons sname stlist)))1 b1 \/ L1 @! `
- (setq stl (tblnext "DIMSTYLE")))! \. a2 @; r: l. y+ K2 G
- % _" v$ p' k( ?" Q' b) e( i- R' s
- (setq len (length stlist)9 F: J* d$ X. P+ B+ T2 `" y6 z) i5 I
- loop 02 T: b# ?! W/ ^
- dimsty stname. Q& H6 ]8 x F
- )6 o7 {% B5 {. m& q% T
/ m) u( t! @/ ?4 M- j/ Z% J& ^- ;; alphabetize style list, depending on maxsort. u3 n# @$ ~) k& b, [
- (if (>= (getvar "maxsort") len)7 e6 t8 q5 R- S1 O$ ?
- (setq stlist (acad_strlsort stlist))( {4 U7 \- {2 f! h, S a5 E
- (setq stlist (reverse stlist)))
* h8 P) F% B. y1 L; P+ j: `+ g - " r2 ]& A/ I2 [ c- e
- ; *UNNAMED style (dimsty = nil at this point) is replaced with. y9 P9 X( t$ @2 ~3 @
- ; the current style. After R13, we require dimensiosn to have a8 q9 ]' ?8 w( h' l5 h! c
- ; dimstyle, so we plug any holes where we find them./ d8 O+ @$ M1 U0 j
- (if (null dimsty)2 N$ R: Y- _# h" J
- (setq dimsty (getvar "dimstyle"))+ s3 _* x% W. D# K9 u/ d
- )
& Z% w# F6 ^" Z y; M. n - ; Show the styles in combo box
4 {0 ^$ N' Q( A) ?/ Q3 i - (start_list "mod_style" 2)
0 \) Q* }- U% O - (while (< loop len)
: r# c" ]8 O) ?' L) a - (add_list (nth loop stlist))9 j1 |3 w1 u: @6 Z" K
- (setq loop (1+ loop))$ H3 |, u! `/ G$ f. o
- )( l& Z/ q. G' |7 l
) E0 n& z! W( P; l6 m# B: }9 @- (end_list)
! m: O& I% q1 { D/ _; R6 m
. E- o) _" I; O$ X! d- ; Hilight the style name of the selected entity
+ z5 o' h0 Z% i1 T' ]9 t& L0 z) D - (while (and (< 0 loop) (/= dimsty (nth loop stlist)))
- @6 R) }0 L3 E' O4 Q% g - (setq loop (1- loop))
+ _; C0 c7 |) f - )) Q4 c- H8 N/ W1 C
- (set_tile "mod_style" (itoa loop))
, l" H' G4 c: o0 V' _6 I
9 k& s/ H7 O: v; G' e- ; The following is the list dimvars. It must be sorted in the same
3 x, u" d& J6 z q; R/ f - ; order as the resfub returned from DDIM (ADS module).
9 h, |7 {8 s, m+ S5 @ - ( B2 @2 C; o. N0 t. t
- (setq dimtbl (list "DIMSTYLE" "Style name" "Standard flag values"
x; g2 H5 j6 l1 s/ O, l% {9 g/ `# D - "dimpost" "dimapost" "dimblk" "dimblk1" "dimblk2": r: Z+ A. ?' W, ]7 I2 d) ]
- "dimscale" "dimasz" "dimexo" "dimdli" "dimexe"
/ i( L$ g8 r p0 S - "dimrnd" "dimdle" "dimtp" "dimtm" "dimtxt"
$ e( J/ P- g) i% h& u* u& [4 H - "dimcen" "dimtsz" "dimaltf" "dimlfac" "dimtvp"
6 [0 G' m# |; c8 \0 [9 M! j# p - "dimtfac" "dimgap" "dimtol" "dimlim" "dimtih"
$ E" c @% R3 N - "dimtoh" "dimse1" "dimse2" "dimtad" "dimzin". e% h" O G5 y- C( C6 R$ h4 { q
- "dimalt" "dimaltd" "dimtofl" "dimsah" "dimtix"
: V& K {. c6 G+ s - "dimsoxd" "dimclrd" "dimclre" "dimclrt" "dimunit"" U1 U0 \; d/ B# K6 F
- "dimdec" "dimtdec" "dimaltu" "dimalttd"
' f( o# \" b) @2 u# a5 [' y4 U - "dimaunit" "dimjust" "dimsd1" "dimsd2" "dimtolj"$ i$ x: ]: _* B: X0 Z2 _6 ?
- "dimtzin" "dimaltz" "dimalttz" "dimfit" "dimupt"+ D5 T) C' N3 G" o' P
- "dimtxsty"6 E$ K4 p2 n4 O, A: \1 Q6 ?& p$ U
- ))
* l* v. [; y0 F: m2 v' f - (progn
0 H: m# }6 h$ U8 m - (setq sv_dvlist (ddimen_getostate dimsty)2 o3 o% h1 e, y6 q7 W$ r# d
- txstyname (assoc 340 sv_dvlist)
3 L7 q( a* o" t - sv_dvlist (subst (cons 340 (tblobjname "STYLE" (cdr txstyname)))
$ j' x0 W# K, e1 ? - txstyname sv_dvlist)
5 k0 k' V1 b) Q$ X$ a1 G2 T - dimlist sv_dvlist: l( ?* W8 w7 m+ l# I7 Z
- )
7 S% R7 i1 @1 z - )3 }: H# P7 {( V
- (if (= dimtype "DDLEADER")
+ N' L' G( u9 w) }" [' W0 {* I - (mode_tile "mod_format" 1)
" E2 P& ] B, Q2 j' s - )# e0 r! D5 b2 {) F( O
- (action_tile "mod_style" "(setq dimsty (ddimen_style))")
' }/ Y) P8 J4 Y5 F) h - (action_tile "mod_text" "(done_dialog 4)")
% u3 ]$ `1 M4 ]% a - (action_tile "mod_geom" "(setq dimlist (ddimen_dlg dimtype 11 dimsty dimlist))")3 L$ y' q" `( M# I1 N# Z3 N e
- (action_tile "mod_format" "(setq dimlist (ddimen_dlg dimtype 12 dimsty dimlist))")
9 O: i+ U$ y& M - (action_tile "mod_annot" "(setq dimlist (ddimen_dlg dimtype 13 dimsty dimlist))")
4 [: b5 i3 L3 O( P/ e# {/ h - (action_tile "accept" "(done_dialog 1)")
: v5 _ O M1 Q a - )
" I% [/ q: B* o: l( T) L7 E - ;;' R1 D1 d- W8 s6 q
- ;; Get dimvars that have been restored.
1 A8 y6 _3 W L1 H# I3 q$ H$ x+ R& E3 B" u - ;;4 t- A8 X+ L4 V
- (defun ddimen_getvars (/ elm dvlist dv i)
9 O4 \; f& L+ P1 L - (setq i 36 L" Y9 r7 W3 J
- dvlist (list (cons 0 "DIMSTYLE")
1 l1 E! I. A# F3 p/ A. s; A ] - (cons 2 (getvar "dimstyle")) (cons 70 0))
! a6 Y9 B& @* N7 R. X5 \( v - )+ s1 i1 T9 \1 w' ~
- (while (setq dv (nth i dimtbl))2 T, D4 U" u- d, t, {: O: n0 c
- (setq elm (getvar dv)$ b" P& C* P' P1 G$ G4 y W6 C
- dvlist (append dvlist (list (cons dv elm)))8 b. Y h# j: W9 L
- i (1+ i)
) ^$ u/ d$ L& S - )
# K, c: \, U/ J - )1 C5 z i4 N* |2 t( r" M# u# N
- dvlist
; |5 N+ O, `. H6 K9 p' p" } - )1 K; [4 P8 |6 u7 C) z
- 2 ^2 B A" ]9 l: |
- ;;
. h2 Y3 a2 R l5 d7 L - ;; Get the original states of dimvars. This is for DIMENSION entities.
! q1 ^0 Z- {3 p4 B - ;;8 I( F' Z, m+ c: y: r
- (defun ddimen_getostate (dimsty / dvlist elm i dvvars)7 g/ o; r4 z* M+ |: G, P% B
- (setq dvlist (tblnext "dimstyle" T) ; Get a skelton list, B/ g6 c0 }$ B5 T+ K
- dvvars (ddimen_getvars) ; Get dimvars for that entity7 K: b; g$ e, b& ?2 g8 T3 U/ r
- i 1 _, J4 R. Y! ^( i9 r
- )1 [1 x2 }( ~ X- a7 S2 y
- ' ^+ U5 U5 E* s# ~$ w0 a# D: F9 G0 i
- ; Create a list that contains values of the selected entity.
% J. C& l# u3 c4 P: `5 [$ m; y
) s3 o! S/ ?! J+ r8 H- I/ P! {. _, C- (while (setq elm (nth i dvlist))- o" [; F: `7 e$ }5 r) g5 q
- (setq dvlist (subst (cons (car elm) (cdr (nth i dvvars))) elm dvlist)5 |' g& R( J& [& q2 T
- i (1+ i)
) y# m7 X! n; s# r H - )
5 M- J' u: X% C1 k9 T* ?5 g7 g7 H6 u - )6 _5 c3 ?$ ~# G0 |8 M E& ]
- dvlist
+ |! P$ Y: A+ U+ O - )" c, p/ K' p; k# ?
* @6 p1 [# V8 n( l/ {- ;;6 p, C% M o/ s2 {+ v
- ;; Restores dimvars of the selected enity.
4 S9 j& e2 o) f: b. U - ;;6 I+ S0 \( Z; }- d5 T
- (defun ddimen_dimsty_restore(/ dimtbl dimsvcurset en)
" u {: A! ?$ `- A% ~ - (setq dimtbl (list "DIMSTYLE" "Style name" "Standard flag values"' b m8 @$ [" ~4 d
- "dimpost" "dimapost" "dimblk" "dimblk1" "dimblk2"2 P1 V; R( M+ F6 i# ~
- "dimscale" "dimasz" "dimexo" "dimdli" "dimexe"/ q4 s* a% o1 j% ]+ B7 |
- "dimrnd" "dimdle" "dimtp" "dimtm" "dimtxt"% M+ S% W" _; l: c
- "dimcen" "dimtsz" "dimaltf" "dimlfac" "dimtvp") j# v' E6 U4 ~0 P7 t6 v" t
- "dimtfac" "dimgap" "dimtol" "dimlim" "dimtih"
# z$ y, H% j3 u' [% o }5 o9 ? N - "dimtoh" "dimse1" "dimse2" "dimtad" "dimzin"+ H2 D0 v; d& c- j9 c9 K8 c
- "dimalt" "dimaltd" "dimtofl" "dimsah" "dimtix"! Q9 Q$ S7 F, Q) l; y7 o; w
- "dimsoxd" "dimclrd" "dimclre" "dimclrt" "dimunit"+ r* m: W/ N3 N0 _3 {" g
- "dimdec" "dimtdec" "dimaltu" "dimalttd"
0 N& a# x2 ]/ H3 Z - "dimaunit" "dimjust" "dimsd1" "dimsd2" "dimtolj"6 o, t, j- X; N8 r9 d Q
- "dimtzin" "dimaltz" "dimalttz" "dimfit" "dimupt"
2 h6 `5 n$ r% Z; ` - "dimtxsty"+ z; D' }/ o: t3 c# k& c
- ))# z/ O9 l0 p' l$ X% r% C" x1 i6 x
- (setq dimsvcurset (ddimen_getvars)) ; Save current variable settings
; y0 W! e4 q) A - (progn
9 b3 V# m1 k' A - (setq en (cdr (assoc -1 elist))). |& P' d8 a; b! [
- (command "_.dimstyle" "" "" en)
9 Q9 V) Y' ]9 ?5 j: S) k* s - )
4 l! T8 w9 d- j& E- V X! e( q8 i3 ? - dimsvcurset
) M0 G" b1 \" G* F; N0 | - )0 _" C9 `2 z+ i H
- ;;
* h% A( ?2 e4 O4 @ f: }: l. b - ;; Modify Leader
9 ^$ j1 M( }/ a& j - ;;
, W- k) a9 b$ n$ x3 G - (defun ddleader (/ dtypebit blkname bename sublist a stname n dimtbl
% G, W6 U% `8 ?3 d9 a( V I, z - dimsty dimlist dimtext svtext dimovr sv_dvlist stlist' v: @8 ^! _, Q* {
- dimtype dimsvcurset)5 b5 l& H/ z% b" g% y8 `
- (setq dimtype "DDLEADER"& q( D9 s# D6 M* {' X' v
- dimsvcurset (ddimen_dimsty_restore)" f$ s- M& y) q; X+ C3 `
- )( s/ ^7 B8 ?% w6 m( f+ q
- (if (not (new_dialog "ddleader" dcl_id)) (exit))
' s% M0 j; q: r1 |* L' ?& X6 _& g; ^5 r; b - ;; Set initial tile values7 E- I# w6 h$ c7 Y6 N+ D
- (set_tile_props) L/ t9 L; S8 v/ w# U
- (set_dimen_props)
8 `3 c4 C' v {0 t' @) x - (set_tile_handle)6 g+ X+ y/ D+ k! d- j# S. w4 Q
- ;; Define action for tiles
A) l) v4 N3 X0 M. _9 f - (set_action_tiles)! e! V* k, ~) c8 K
- (mode_tile "mod_text" 1)0 Q7 g# ~% o! c2 g$ E1 d% O1 F' q
- + |: A7 [- v& |) r. e6 I' H5 f
- (action_tile "mod_style" "(setq dimsty (ddimen_style))")
& s/ q0 @' w$ ~% u! E' r1 z - (action_tile "accept" "(setq leadtype (get_tile \"s-s\"))(setq arrow (get_tile \"arrow\"))(done_dialog 1)")
$ ?" o; }: V) i' V4 L+ U - ;; Get ARROW and TYPE./ ]" }+ o( U2 y) P3 x
- (if (= 1 (logand (cdr (assoc '71 elist)))) (set_tile "arrow" "1"))
3 h X; O. ?5 d3 i - (if (= 1 (logand (cdr (assoc '72 elist))))- Z' ]5 k# w8 c) B- A/ S
- (set_tile "s-s" "spline")
, n! B( H3 h! I6 E/ N( f - (set_tile "s-s" "straight")
$ c R8 C+ z' L: \7 S$ z% V - )* X! k2 g! {; { v- _' W
- ;; Start the dialogue.
* O7 |8 n( S7 F: i6 O - (setq dialog-state (start_dialog))
: V4 {+ @6 ?" E% R; i' v, s1 C - (if (= dialog-state 1)
h: p% e7 z$ h- N! Y3 A - (progn. N7 S( ?1 E l" H' M
- ;; update the style
6 c2 g" [( @2 R3 o' e0 e2 Y0 w - (if (/= dimsty stname)! A7 \/ {+ ]$ J3 T, G z
- (progn# S6 q2 \6 L4 Y2 }" R: f! X1 c4 f
- ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case- u: e& s9 g: [% s. X/ h
- ; doesn't have it.
# M0 q2 x3 l8 {) { - (if (null (assoc 3 elist))" M2 d* b; G3 Y3 j
- (setq elist (append elist (list (cons 3 dimsty))))
0 |; r+ N n) D; v. y( \( r5 V - ; else just replace it.+ |" G4 H1 p7 X' p( v4 S* X' B! }
- (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
/ u" ]6 X/ U3 N' O0 v/ L3 a - )# C' i; [5 k, M g$ [
- ; refresh sv_dvlist with new dimstyle.
" i- Z2 E2 i5 ~2 K! E6 a! w, m - (setq sv_dvlist (tblsearch "dimstyle" dimsty))
, w# F: z0 |& a - )
) `+ ?% x- ^- o; e; k - )) v/ I. v3 U$ y5 o p6 [" x
- (if (not (null dimlist)) ; attempted to change dimvars1 w( n$ q9 ?3 A
- (ddimen_complist sv_dvlist dimlist dimtbl). f2 B/ [& [- O# t/ ]3 Q+ a8 m) _& s( R
- )5 \/ c! i0 m+ J& Z3 s! t
- ;; update for ARROW.4 _. z& G3 ]. P- M
- (if (= "1" arrow)
p: f7 m, ^6 z- s9 S - (setq elist (subst (cons 71 (logior 1 (cdr (assoc 71 elist)))) (assoc 71 elist) elist))
9 z: c+ q- Y* V- d - (setq elist (subst (cons 71 (logand (~ 1) (cdr (assoc 71 elist)))) (assoc 71 elist) elist))( G# p: w, h. R# N4 v
- )- [7 Y8 D% A0 Y# R. T3 J1 K
- ;; update the TYPE.+ ?' _1 [% h+ h* ?6 p6 A* ~/ _4 v( s
- (if (= "spline" leadtype)5 B# q0 e" Q) E y1 a; ?9 \
- (setq elist (subst (cons 72 (logior 1 (cdr (assoc 72 elist)))) (assoc 72 elist) elist))6 F, m+ f! j) _' M1 q9 n3 ~
- (setq elist (subst (cons 72 (logand (~ 1) (cdr (assoc 72 elist)))) (assoc 72 elist) elist))5 s7 \/ X; f ?+ g( M. z
- )6 L+ A) s5 c: z( y F1 `
- (modify_prop_geom)
' o( F+ J* c v! a5 q, f1 g - ;; update the Color2 {1 ]5 s$ u# a! f1 z; i
- (setq elist (subst (cons 77 ecolor) (assoc 77 elist) elist))4 z5 l! B, Q! G) V
- (entmod elist)) a# y, {# Y0 |0 h
- )
. t- Q. N- \) R8 y9 T j - )9 ]+ L1 X7 c P
- (ddimen_setvars dimsvcurset) ; Prepare to exit! T5 ]/ G2 V! g( I. J
- )' ^' _; P1 `! ~+ r- _: B
e/ n7 a% a* w" V0 u+ V- ;;
1 r5 G* G& a' d8 L1 Q/ X5 _ - ;; Get dimvars of a dimstyle with overrides. e. P4 i) {4 c9 [- u. ]% O6 V4 E
- ;;
6 R5 X5 r! b/ z; S2 j& p
3 s: D, }% ?# Z3 d3 x$ K* z ^- (defun ddimen_getdimvars (dimsty / dimovr dvlist elm i)9 t+ h) U5 n* x6 [- I
: c6 P/ O8 M) u6 f& z- ;; Get override information for the specified entity.6 ?, r' Q# @. P1 S1 P) F
- ;; Leader/Tolerance cannot be restored by DIMSTYLE command, so we
7 v; B4 @9 ]' C; _5 w# I1 g" e4 g; S - ;; must obtain override information through this tedious operation.
* K' ^0 Q0 K" a; z - (setq dimovr (car (cdr (assoc -3 (entget (cdr (assoc -1 elist)) (list "*")))))
. b" P, K# D F( l - dvlist (tblsearch "dimstyle" dimsty)
* @" T' F, s& D% f* u - i 2
! b, d, P' C* m - )8 u8 y1 Y( ^1 B' }; B1 @ A
% ]8 }% ?% u: a$ K- ; Update the list with overrides if overrides exist.2 Y( t+ a& Z6 c X4 T# F4 n
9 \/ v9 \4 H6 H K: {! F- (if (and dimovr (= "DSTYLE" (cdr (nth 1 dimovr))))
; i/ c2 D/ H8 s, G2 H - (progn
: w" l5 m2 z* M8 n - (while (setq elm (cdr (nth i dimovr)))
0 i4 c( V3 t. X$ D& f6 A - (progn
, p5 ^& v: c7 l. u; u - (if (or (= elm "{") (= elm "}"))
5 s/ [& g, H( l$ D8 c: @# q - (setq i (1+ i))5 L) { e, }9 p4 F3 W
- (progn' S4 o( y! f. F! [8 A! @
- (if (or (and (< 180 elm). v {0 n I0 q3 u- L
- (< elm 190)( p* k' }6 @0 Q* Q0 s9 B
- )% L* w4 R6 \9 `. b. k
- (and (< 80 elm)% G9 }: q9 U. z+ I& G9 j" w' t
- (< elm 90)0 d$ U5 F9 ?) Y/ Q& @! t7 l( h# L
- )
$ \3 W# J+ `: A2 h0 o6 V0 k - )
, J _) e4 L* j4 | - (setq elm (- elm 10))
% b2 z% t3 @- M+ S0 u - )
" R* j: V5 s8 J! s! w" m2 e+ E( ] - (setq i (1+ i)" J1 A! }- k* ~: {- G
- elm (cons elm (cdr (nth i dimovr)))' X. Y/ D- e* M7 x7 z
- dvlist (subst elm (assoc (car elm) dvlist) dvlist)+ B. S, t; g6 Q) V2 ^ Z* J0 v
- i (1+ i)6 c: T" y/ Y. s6 s3 ^
- )
1 ?" X( g+ s* S/ S" F' X - ); a- O9 O! J' x3 s2 N" G
- )
2 V) \. R y, c' E& Z$ R1 d - )5 @9 k$ Y/ L( e
- )
H0 Z f: w. Z - )( F- j% K" z, |8 Q0 P- s
- )0 O" Q. u& o8 R9 X8 B }
- dvlist- \( x: B% U! J1 e. l* e/ i
- )
, _6 K. K5 R- M" U# B - 8 [2 n1 @7 m" R. ~
- ;;) Q7 A3 K" n- N& b! \$ [
- ;; Modify POINT
( s2 l- d& Q( N - ;;( L# D- X( e Z2 T# Z- m
- (defun modify_point ()7 F9 c8 P, i8 M
- (modify_properties)# t, Y# H, I6 L0 v
- (setq pt1 (list x1 y1 z1))
2 E7 w: q$ f0 m5 m8 q - (tempmod pt1 10 0)2 v3 r' @2 z7 Z6 G: o! d1 l& a
- (entmod elist)1 c _9 D4 }% y6 A
- )
. @: _" N m4 q3 t N+ r) z
- @! P9 z( t# P7 _' t7 o- (defun ddpoint ()
) x8 p" c: [+ ? B% P - (if (not (new_dialog "ddpoint" dcl_id)) (exit))
r5 b9 Q; `& r( I - ;; Set initial tile values7 V- P( C: `- X a+ t! p3 Q- I+ W% m! n
- (set_tile_props)
' f* V1 f# Y; \# c! o - (set_tile_handle)2 ~$ O; m' e, l8 e; N; }
- (set_tile_pt1 0)2 B0 |; k! I0 w# Z: |
- ;; Define action for tiles
. a" M# J) Q8 C) E: K9 E - (set_action_tiles)
/ X& W) M% R- p. a% S - (setq dialog-state (start_dialog))) T% V( {, U8 r9 |+ G3 `" M
- (if (= dialog-state 0)
5 W1 K, g4 E, K3 X+ H z2 V3 x+ r - (reset)* Q" u, z, x0 U3 Z8 a! b( p
- )
! s: s/ W6 \) l/ s5 n - (if (= dialog-state 3)
- M8 ]7 Q; L! w+ y# k - (progn/ d7 C6 |) l- J$ x
- (modify_point)5 c+ w( H- q. Z: ?5 v1 \
- (setq pt1 (getpoint (list x1 y1 z1) "\nPoint: "))
' _* O* _9 l# _) N) t0 {4 j" R - (ver_pt1 0)* s( P1 f" d% ?: r( }; i
- (ddpoint)
% S4 a( o: \" Y7 p9 Q- \ - )% e8 B8 T4 ^/ p
- )
# T4 s \* @9 C - (if (= dialog-state 1)
& J0 R/ {$ T3 H - (modify_point)- r6 e* y# d- t# \
- )
7 D1 q6 H1 q. O, P- Y1 D - ). _% R7 F; d8 M- j
- ;;; X; U+ f" j8 ^" W9 K) t
- ;; Modify LINE
% _% O( M; P k: G/ I, v0 Q% ~ - ;;# O; n% E! X- T' D( U% }
- (defun modify_line ()
( T0 z% k1 I f4 x, f - (modify_properties)$ X3 n/ }6 P& K% X7 u6 q% R
- (setq pt1 (list x1 y1 z1))
% L5 U' H) s7 Q1 D) q+ F0 H5 T/ B - (setq pt2 (list x2 y2 z2))
) O7 \ C$ n } - (tempmod pt1 10 0)6 x) n1 V- o6 a* Y7 F7 C2 f5 v
- (tempmod pt2 11 0)
) a, e) s6 d: F" B: \3 w& C - (entmod elist)" {+ y" V: Q- Z0 m
- )
1 J1 o; P) o/ \& f - (defun ddline ()
! C& q& X3 D# Q6 A( ^ - (if (not (new_dialog "ddline" dcl_id)) (exit))- G' B9 p p' @0 X! y; @* t
- ;; Set initial tile values, |: O( M. \" {! v
- (set_tile_props)
9 e# ~+ p6 O! L g; T2 n0 j5 F- B - (set_tile_handle)
" {, g) c) J% X& i+ w6 f* c) L* b - (set_tile_pt1 0)
; O6 A, U" Z: K; q; m# C# G C - (set_tile_pt2 0)# T* a g% ]( i T) k
- (line_calc) Q+ T/ N" K2 x1 d" F+ R
- ;; Define action for tiles
& ]+ F& E. h" a$ J7 b% w6 s. d - (set_action_tiles)9 X9 ]7 T$ o3 }/ |9 e/ s9 y2 m" C, j% r
- (setq dialog-state (start_dialog))
) [- O& ~6 Z- r+ z8 a4 w0 v - (if (= dialog-state 0)
% \- d& Z& }5 p; N) X6 ]/ S9 q - (reset)
* Z) e+ N9 j1 h* [ - )
3 ]3 Q) _ |/ e! y - (if (= dialog-state 3)
3 L3 U+ x. Y; n: V2 R - (progn
- \0 I( X3 T: n# C& O - (modify_line)5 ?8 V' c: C6 }9 D2 ?
- (setq pt1 (getpoint (list x2 y2 z2) "\nFrom point: "))
5 n$ W; C5 b0 P1 f: w - (ver_pt1 0)+ ]' Q5 X) v) R
- (ddline)
; w9 |0 H4 m6 f9 ? - )4 Y. B3 B2 r: ~* K! E, q# q1 E/ g
- )
+ S" q; J, I" i: _7 Y& t - (if (= dialog-state 4)
- E1 _* C6 x1 a" T) c. R& t% a - (progn
6 D9 N3 b& P) c5 P - (modify_line)# \% Z/ W9 u1 s' R: Z( X
- (setq pt2 (getpoint (list x1 y1 z1) "\nTo point: "))
5 X8 |. U+ E" K; B5 C: i - (ver_pt2 0)2 i( P3 j( g, S3 q! Y! b* X
- (ddline)% S/ U& b1 [3 `
- )
: B! ]/ d% U( j" X) Y3 U/ V - )" T# E" n X( k5 M
- (if (= dialog-state 1)
& J" K* p8 J) ^6 ` J% o - (modify_line)
& r I8 m! h' `( W7 a$ q k/ x r - ). Y1 D' {$ c# J3 N8 N1 s& e
- )
5 a) f1 W, w% T" T. t2 ]( U - ;;
. Z+ `& N( N. u1 z; c _+ J - ;; Modify MLine
4 z, }) z' s# q% X6 v - ;;- Q) I: G3 F* I8 K% u9 d: X
- (defun modify_mline ()1 q' A, `' J4 |$ H5 o
- (modify_properties)$ H5 x& H K0 @8 r/ k; L
- (entmod elist)
& V+ V0 ^3 U9 o9 t2 W3 ^7 S - ). B' j; F$ c2 B3 u3 n- ^! g
- (defun ddmline ()6 v6 G" s5 {6 s8 B1 q
- (if (not (new_dialog "ddmline" dcl_id)) (exit))7 ^& Y' e) s+ C
- ;; Set initial tile values) m, {; g' N! ~: v5 N
- (set_tile_props)
m! V- t' i, F5 A9 X7 y - (set_tile_handle)
8 ]# f* S% M. V3 `. N1 ?$ F - ;; Set mline style text field.5 C# r. R4 j1 W7 E) V
- (set_tile "ml_style" (cdr (assoc '2 elist)))
/ F1 A4 L8 Z9 x: }) _! @$ c4 U - ; w, f& w" M+ I2 r
- ;; Define action for tiles
# f1 w2 _6 p! K: X5 {9 p - (set_action_tiles)
( d; n# ] y# ^7 C" H& K - (action_tile "ml_edit" "(done_dialog 3)")
' v5 _+ `) r6 z1 r, t9 _- a/ T - (setq dialog-state (start_dialog))
- `5 x3 J; n. A/ P4 x- ~ - ;; Dialog cancelled, reset to original values.
% O% \! G! q' ? D - (if (= dialog-state 0); u8 Y- u$ |( K( p+ z/ ^9 }4 W# z
- (reset)1 N1 ~* I8 k8 I; f. z( p2 D
- )
( Z$ v& S% i5 R5 W! n - ;; Dialog OKed, update the mline.
( W2 L3 r2 @' v. z) a- b$ b - (if (= dialog-state 1)
! n: u. U M0 \9 ?' m/ P0 s - (modify_mline)& D6 }- U4 t* U& X9 B( x' B& A
- )
! w; p8 w( G( n - ;; Edit Mline, call MLEDIT.$ y( D& p! w6 w( H- R) F4 X/ W6 `
- (if (= dialog-state 3)
. N2 j$ \* S1 G0 a+ @. k - (progn
0 p+ T. y* \5 W E* y! K - (modify_mline)
1 }7 Z* D" r5 M& Z, v! F" ` U - (command "_mledit")
* b+ z) k6 M# \) z% W; I - (ddmline)
" N, ]) j1 x* @' o3 Q# o - )5 M/ L* b* D- p7 Y2 i
- )
& u' ~0 O; O( Y }' H - )0 H6 H/ ?, }6 ^5 |- s* B
- ;;
5 a+ _ _2 D1 _2 E7 r - ;; Modify Xline
, k5 d- _* w4 F' i- m! W) X - ;;
+ F+ c" h3 P4 [. a4 x9 E - (defun modify_xline (flag)
1 I5 X: q5 J& R! q% _! U: a - (modify_prop_geom)
$ x/ ?9 r9 s* Y ?' c; _0 a - (setq xline_pt1 (list xline_x1 xline_y1 xline_z1))/ E! Z& i+ j/ J2 a& g( ^" r6 [
- (setq xline_pt2 (list xline_x2 xline_y2 xline_z2))1 S& ]/ M" M5 A0 _ [; O$ }/ y" ~
- ;; Update the Root point.9 u7 K2 ?- A) X" n$ p
- (setq elist (subst (cons 10 (trans xline_pt1 1 0))9 l! @ z( q% b$ t7 V/ c
- (assoc 10 elist)+ h/ p k- w' D1 Y+ S, V
- elist/ @) }" K+ F0 Z4 m" F
- )) A( k% }2 m! ?- \; ?
- )3 l) W$ L5 u- B! d, _- n, E" H
- ;;( V) w) R! ]: z, U
- ;; Calculate new Direction Vector WCS
* L8 o' w$ D1 ^/ T- d - ;; x / (sqrt ( (x**2) + (y**2) + (z**2) ))
7 z; m5 ?7 _9 g4 h+ `2 Y [ - 0 O. R k4 Z W
- (setq temp_dir (trans xline_pt2 1 0))8 Z# j0 G6 |5 h) r% g6 `
- (setq temp_dir_x (car temp_dir)), O+ Q* K" _! l
- (setq temp_dir_y (cadr temp_dir))7 }+ E5 g' {1 C& @0 M1 X6 {
- (setq temp_dir_z (caddr temp_dir))
+ R! w: V) I3 {- n# F
* }) i* w* H* B: v4 r; |! {- (setq temp_xline_pt1 (trans xline_pt1 1 0))4 M7 Z; a0 X& w2 u4 y4 U
- (setq temp_xline_x1 (car temp_xline_pt1))
8 q; n, o7 @2 Z/ u9 q+ v - (setq temp_xline_y1 (cadr temp_xline_pt1))
! s, I9 V) f, i5 \/ ^+ Z8 o% {# W ? - (setq temp_xline_z1 (caddr temp_xline_pt1))! w( R4 _5 d8 j* t% }8 j, n
- % M( v% Y$ L4 C5 s
- (setq denom (sqrt (+ (expt (- temp_dir_x temp_xline_x1) 2)
4 J2 r) R$ L9 H7 \; _6 ^ - (expt (- temp_dir_y temp_xline_y1) 2)" ?3 L0 W3 {: D5 ~% H2 n3 W. ?6 y
- (expt (- temp_dir_z temp_xline_z1) 2)
& P% E. R) M. }5 x* M+ v - )))7 L7 i+ B# z( D, Q; Z( N+ V
- (setq temp_dir_x (/ (- temp_dir_x temp_xline_x1) denom))% ~2 H: t$ v7 H: M& ?* l
- (setq temp_dir_y (/ (- temp_dir_y temp_xline_y1) denom))$ M9 W; f/ i' G$ V7 [1 b) h
- (setq temp_dir_z (/ (- temp_dir_z temp_xline_z1) denom))! |) E% R0 Q& P
- (setq elist (subst (cons 11 (list temp_dir_x temp_dir_y temp_dir_z))
" m% E$ V$ e y! K" { - (assoc 11 elist)! y M& M7 P( L' {6 Z: o, i! n: I
- elist
t9 ]1 l7 X U3 P3 j' u - )
/ v( n% {; i/ {: v: A' ]9 M - )) G; C: K6 o) h1 `% W5 O$ a
- (if (= 1 flag)
0 V; N0 k& W8 W. x7 _+ S - (entmod elist)4 R& _% h. z( p+ a7 H
- )/ {5 V! ^& {0 ?% ^
- )
, d8 d; ?: T4 d$ f( {) o3 @
9 v. [1 ]- ?6 U$ p- (defun ddxline ()
4 x: x& N2 ^ z- i( J+ y6 g - (if (= etype "XLINE")
$ L$ J0 S3 m6 X* z$ @) `% Q - (if (not (new_dialog "ddxline" dcl_id)) (exit))+ a& W2 ]! |9 l$ a
- (if (not (new_dialog "ddray" dcl_id)) (exit))$ X; a0 j- l9 o+ e
- )( n6 ?9 Z# f2 T+ R& C
- ;; Set initial tile values& \4 \: u' S j ]% \
- (set_tile_props)
) B/ x+ Z9 x3 N) _$ W - (set_tile_handle)
5 X- O( L, L& S2 H) O5 c - (set_tile_xline_pt1)
: m/ q2 h6 v. l( r6 Y# d - ;; Convert to UCS and post Direction vector.
5 A! V. o U2 l8 j7 y) B - (set_tile_dirv)* x7 p1 V. w q2 M
- ;; Calculate second point by adding Root Point + Direction Vector.- R. T1 t) b3 W9 S3 O
- (set_tile_xline_pt2)
9 Q0 [/ |5 D+ X8 m4 J" | - ;; Define action for tiles, O; n1 ~5 g4 ~8 l
- (set_action_tiles)
0 i( y: X# v3 S: { - (setq dialog-state (start_dialog))
. S! e5 N# L" u' p8 u$ C8 h - (if (= dialog-state 0)' z7 u1 O: P5 K
- (reset)4 J( g! h8 E. F7 ~6 x' ?
- )
- q8 S3 }$ X8 g) w* b% L - (if (= dialog-state 3)5 X# K R2 x$ M' K! V
- (progn
- I3 A. m' ~! z - (modify_xline 1)
" \" P' V. b/ V2 C( I3 ^' f. X - (while (equal xline_pt25 E( _6 o: z. p0 B* z
- (setq xline_pt1 (getpoint xline_pt2 "\nRoot point: ")) 0.000001)
$ W7 j6 `' p# ~ `" s7 i - (princ "The Root point cannot equal the Second point.")% Z- x) s3 L0 s
- )
+ k; H' j# ]. N6 Q7 M2 v - (ver_xline_pt1)
# m# Q: j' ~6 M; w& B - (ver_xline_pt2). c% N- H. ^" o5 E/ F
- (princ)
- v1 ?3 u+ t9 l& w1 Z7 ], } - (ddxline)" G/ `. x) |- m, l1 E8 Y) D
- )
0 x( z& \+ A* ] F: Q/ N6 \: B+ X - )
. M) P' |1 ^, V( s4 [0 X# z - (if (= dialog-state 4)+ l) j8 u$ O& R# A
- (progn
X) g; X; @8 \8 ~, ~ - (modify_xline 1)9 ]% s/ d3 p8 w6 d' a+ ~
- (while (equal xline_pt1
: Z- S' x0 l& \1 h' f& R& ^5 T6 Q - (setq xline_pt2 (getpoint xline_pt1 "\nSecond point: ")) 0.000001)9 Y" h9 d9 P- x# B( O, y5 s" @
- (princ "The Second point cannot equal the Root point.")
( d; j; u8 m# @8 d+ J/ f4 \ - )
- y- ^4 G/ C& O+ J7 F - (ver_xline_pt2)
, R. Q: Z) d W - (princ)! Z6 K" ~/ ^3 _ i) g
- (ddxline)
u( ~: @9 f9 v" v. Q+ M - )
5 ~5 ]: L# v& M6 U' j - )4 s' R! b, E0 t* ?) |- a `1 z( g1 X
- (if (= dialog-state 1)
9 B1 }" \" I p8 @3 ]6 | - (modify_xline 1)
5 L1 d, C% q: q/ ?2 Y4 d - )+ p4 } y6 U# l# v+ O4 v
- )
7 X9 {! S8 e; p: ^% ~: B - ;;) d2 M9 z4 }, b, v5 s5 n
- ;; Modify ELLIPSE
! U1 e) S/ @3 M0 ? - ;;
6 ^# B* F) E9 g- X - (defun modify_ellipse ()
; v' F4 {2 Y) H' @: ]# e9 d - (modify_prop_geom)
. a2 g9 O [0 s- ?! @& x - ;; Update Ellipse Center Point value.
, }- O3 q" M) G* ~ - (setq pt1 (list x1 y1 z1))$ ]' Z5 @" P, u1 U/ A
- (tempmod pt1 10 1)8 o& a# b% f2 S0 }5 ?
- ;; Update Start Parameter value.
6 w+ C3 w9 _& @2 c; Q - (setq y_val (sin st_ang)), y9 A+ R6 a! L, x
- (setq x_val (* rrat (cos st_ang))): Y$ E, }9 X9 S2 y
- (setq stparm (atan y_val x_val))' ^4 C. R) R1 v [: @8 e
- (setq elist (subst (cons 41 stparm) (assoc 41 elist) elist ))1 z6 l. q3 A, @' p7 E% ]" y
- ;; Update End Parameter value. Normalize it, if it's less than8 j9 \9 i) O; q# U$ m' M
- ;; the start parameter.- W" t8 f2 R, V+ Y( O+ h5 `
- (setq y_eval (sin end_eang))0 C# v3 u( {, K1 C9 S" _' k; G
- (setq x_eval (* rrat (cos end_eang)))
7 k+ C4 q3 Z, g1 z% k% N3 h% } - (setq endparm (atan y_eval x_eval))& R" x1 k) L6 c) B
- (setq diffparm (- endparm stparm))
V0 F4 X6 O) _; }2 A - ;; Epsilon of 1.0e-6 radians for checking a zero length arc.
! `& S1 H: W+ T. G% c# T - ;; Since zero length arcs are not allowed - construct the full" {/ s) r4 W. Z% C. N
- ;; ellipse in this case.0 [9 ^# v( o2 f
- (if (<= (* diffparm diffparm) 1.0e-12): U- s& P( |0 ]& I5 B
- (setq endparm (+ stparm (* 2 pi)))) _% T' ~0 z# N9 N
- )* E+ A- `/ ~/ A' `& x
- (if (<= endparm stparm)9 L; k: J }' S- _: ]" M1 e: T
- (setq endparm (+ endparm (* 2 pi)))3 ^2 Y3 G5 B" _7 |' k% ~1 V O. g, S
- )
* k- a k3 O3 c; m1 U0 Z# v/ }8 J - (setq elist (subst (cons 42 endparm) (assoc 42 elist) elist ))
) A4 l& }: _; Q. `. E2 e. P0 D- G - ;; Calculate the Major Axis Vector by first calculating9 b$ y5 K- ~# @- t" O& E( [3 @
- ;; a unit vector using the old Major Radius value. Then& h8 P7 ?% i3 T7 S2 @1 f3 |
- ;; Multiplying that by the (possibly) new Major Radius5 P* k3 X0 @& f! h2 R+ t; [
- ;; value to get the new Major Axis Vector value.
0 d) m6 c4 {7 S* ]" \ - (setq unitxx (/ xx old_majrad))5 h' ~0 B8 J( S9 ?7 X. ^! a+ L
- (setq unityy (/ yy old_majrad))& W0 R5 d9 Z( F5 X% ~6 L6 M
- (setq unitzz (/ zz old_majrad))
; v6 s* g3 T6 @6 x D. l( B& [& ], a - (setq newvecxx (* unitxx majrad))! @" b" O4 N9 l+ U0 P
- (setq newvecyy (* unityy majrad))" w4 S; J" _: }, n
- (setq newveczz (* unitzz majrad))
/ D# g1 V! w" k( B- `& v$ y - (setq newmajaxis (list newvecxx newvecyy newveczz))
5 j2 v$ e/ k Q R& K- M5 N - ;; Update Major Axis Vector value" w# c: \3 |0 V: {3 e5 y
- (setq elist (subst (cons 11 newmajaxis) (assoc 11 elist) elist ))
8 L6 O% R7 W& q. g& y6 g - ;; Update Radius Ratio value
/ ]2 Y$ C3 {) A4 P - (setq elist (subst (cons 40 rrat) (assoc 40 elist) elist ))
* N2 |9 M" |/ f3 O" L8 U - (entmod elist)
3 _, F2 P! F$ r - )
9 T @3 w0 e2 I0 Z- ]7 {
. q) s5 V! U/ d8 A5 s" W- (defun ddellipse ()
' m% U4 Q' j/ j - (if (not (new_dialog "ddellipse" dcl_id)) (exit))5 i, Q, e+ {6 f3 g l' @( m+ j/ M; l5 U
- ;; Set initial tile values7 f4 V2 }' [+ A( w9 a
- (set_tile_props): ~! h( G& J/ q0 w' R
- (set_tile_handle)
. i" w- ?* r. r R8 @" M! @( O - (set_tile_pt1 1)9 Q# \0 W6 x/ g3 a6 d) ?
- (ell_calc)
6 X* [% i3 w9 C" P1 d- h* ^ - ;; Define action for tiles
- N& T: m! o( ]9 n9 _ - (set_action_tiles)
) J1 \) }" H$ ~ - (setq dialog-state (start_dialog))5 O" V' u; n) `9 h7 F% n$ j
- (if (= dialog-state 0)
; E5 J) j' \1 w7 @; _& L - (reset)0 ?9 n1 _1 b- _) n
- )% {) ], t- a( ~8 W" C
- (if (= dialog-state 1)" R; C/ M N& I
- (modify_ellipse)) i) q' s+ P) ?- F* {; z
- )
5 r2 `$ x' x5 k3 _: i9 [ - (if (= dialog-state 3)# v: N, i. F. t* J4 c* U
- (progn" F0 f# J( Q# ~! N
- (modify_ellipse)6 l1 {5 u0 k$ M8 r9 ]( R
- (setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))
; `! [5 R/ P* b - (ver_pt1 1)9 P) e# x3 m: Z# [- [0 G Z1 X
- (ddellipse)2 K5 D* b- ^) ^" v
- )8 v# g, n- S2 P3 \8 c
- )
% U# |2 m! I% V \& I - ); X7 `4 E7 q, U5 n. `5 j. H% L
- ;;
9 s9 j8 c+ ] a0 U- W; X( i5 e - ;; Modify REGION; _& i4 m# k2 B w
- ;;0 g2 M: o( T/ Q
- (defun modify_region ()
& V3 Z1 j( q8 f, N: I7 q l6 B - (modify_prop_geom)6 @5 w- U3 W5 f
- (entmod elist)
3 F5 A0 h( O; ~2 _" Q7 | - )) p: V5 ]2 K2 |% V& S
- 0 a& ~5 z% m7 E: n! S
- (defun ddregion ()
; u; U. n: [' w8 N - (if (not (new_dialog "ddregion" dcl_id)) (exit))
- H$ P/ s5 K2 X$ G - ;; Set initial tile values9 r* j$ E0 L4 [1 P
- (set_tile_props)
) a) I. c" y2 @# h, [ - (set_tile_handle)
0 W6 T2 v" y% a! X1 c - ;; Define action for tiles4 V5 Y1 f, m8 a& I
- (set_action_tiles)
! h8 K0 M2 T& Q& ^6 t - (setq dialog-state (start_dialog))
+ X7 I" w* t4 n - (if (= dialog-state 0)3 e) J/ W4 @3 Q8 ?0 u/ X
- (reset)7 Y6 E% Y6 c- \' ^" v! a! \# q' c
- )
5 W, \& z' W& h7 s0 ?' ]! f - (if (= dialog-state 1)' w+ ]! `, U. h5 X2 W
- (modify_region)
6 X$ T4 @: |* O% R7 f& l1 D2 }; h - )7 Z8 m% m! ^6 {; q" C2 b8 D
- )4 p* }- `: t# W, `; ^" {
- ;;
4 m4 j5 D& ~: l6 j- b3 r - ;; Modify 3DSOLID
7 `8 h& t; \ _: x1 x1 v7 N - ;;5 y5 r6 S; A) T
- (defun modify_3dsolid ()
/ g# M& W2 q9 U: m6 } - (modify_prop_geom), e# l( c* i, q0 ^7 r
- (entmod elist)
" x. W4 ~- D/ N - )# p0 V( k6 O' _6 A( T
- 5 }& y6 e- t3 ?: ?
- (defun dd3dsolid ()
0 A8 q9 \4 C% i; g* h - (if (not (new_dialog "dd3dsolid" dcl_id)) (exit))/ ?6 {+ ]8 x$ i' P7 ~9 s5 h0 [
- ;; Set initial tile values
! a! O) V3 {/ L: O - (set_tile_props)$ P' Q; P6 B, m0 M" ^, b
- (set_tile_handle)' f6 h; d; J0 Y' _; d
- ;; Define action for tiles
N$ B0 o- s" a - (set_action_tiles)- C" C. ~$ V5 z1 J, N3 f
- (setq dialog-state (start_dialog))- b3 O* P* R& n% Y" t
- (if (= dialog-state 0)
- @* ?' }3 l) z' r( F' C: p9 [& a6 ~( u - (reset)& |& y8 i+ \& B; O$ x$ q
- )$ S1 V2 f( z+ E, |% n
- (if (= dialog-state 1)
# `4 G4 p$ S3 K, S - (modify_3dsolid)
% {/ A# c# \& f. e- v; |5 g - )) q( F4 o5 b' ], P7 y: L
- )8 l3 t4 |# U: O2 z4 b/ [# Z
- ;;
# S/ o5 S3 r! k' Z! Y - ;; Modify AcDbHatch X9 D( T7 g# A& O! S: [" l' U) \* M
- ;;9 P; E# |1 z+ ], l8 P! s! b* ]3 k
- (defun modify_hatch ()$ }: q6 ]* Q0 x. q7 D: b
- (modify_prop_geom)# @: u$ w: d( d- p
- (entmod elist)
# U; `$ f- L; E( ?6 _ - )
+ X9 g' H( _( M# Q* X
# o+ V2 J& x8 L5 R- (defun ddnewhatch ()
% {, v" Z+ |+ D4 s! n5 V - (if (equal hatch-elist nil)
9 V" Z/ z# I& ] - (setq hatch-elist old-elist)
5 q5 q. G5 j1 J8 w" \. C8 x - )
2 e7 d. g: U8 A: |3 q) ^/ [( R
F# N* c# z4 w) ^- (if (not (new_dialog "ddnewhatch" dcl_id)) (exit))
Q' y0 ?; X# |" T. B( r& j
8 ? [/ A, f: J d p9 w) g- ;; disable the thickness tile0 r$ j: s) N7 L
- (mode_tile "eb_thickness" 1)* a# a% l# s: }. v0 C2 t! }8 |1 d
- (mode_tile "e_thickness" 1)7 l% B/ `9 m( b4 B0 Z) {8 f [% ]6 W
- , E, `3 x* e- S B g$ Y* ]; V
- (setq help_entry "modify_associative_hatch_dialog")" m( M3 e$ M5 g% `! t0 J; b5 Y
- (set_tile_props)
& q# B; B7 ]5 [, ]7 R* f7 X - (set_tile_handle), t; G7 c- k) i, u4 F
- ( g/ Z; w5 X2 o
- ;; Define action for tiles
; y* {1 D/ G/ A4 j' x0 k* ?3 g - (set_action_tiles)
' U/ T, a' e( V1 T3 i, K - (action_tile "b_hatch" "(done_dialog 2)")
# O3 T; `# a: d& y2 q+ t6 ] - (setq dialog-state (start_dialog))* P- X" g# S; I& p
- (cond. v- Y. J# Y$ a) j
- ( (eq dialog-state 0)* b Z5 w" J; T: i/ N
- (setq old-elist hatch-elist)
8 }3 ]# T6 z& a. Y- Q - (setq hatch-elist nil)
. G& s" w6 ]: C1 _/ T1 s - (if (= (checkforlockedlayer ename) nil)
) C, ^- I. o8 [' S. t% t; E - (reset)
) t& o( r, I: \4 Y - (progn ;;; special handling for locked layer reset
! ], `# G8 t2 J9 \( Y - ;; unlock the layer1 k, W" _# [7 W4 ^3 c/ ^
- (setq layername (cdr (assoc 8 (cdr (entget ename)))))2 p& r* {/ s- {# r# v
- (command "_.-LAYER" "_Unlock" layername "")
" O# E- {( Y0 q& T - ;; reset modifiction
. b5 P$ g+ ]" N: Q7 A - (reset)% w- W' |' Y$ j3 ?% e3 m# T
- ;; lock the layer again3 a' R" ?' ~0 L/ y G# X/ S
- (command "_.-LAYER" "_Lock" layername "")9 |+ i$ I" E3 S
- )& c. S$ K8 I1 V, e' E: W) U( L* f! d
- )
4 ?3 t9 |) E9 } - nil ;;; makes (ddnewhatch) return nil for Cancel2 `6 c: [: q% L1 R
- )% j' Z. [8 S, Q3 J& r, X
- ( (eq dialog-state 1)0 K4 [ U, `) Y v* l
- (setq hatch-elist nil)/ x# k+ v3 C. y8 U0 t* ]
- (modify_hatch)
, F& r- w) e: c" P6 s$ y - T ;;; makes (ddnewhatch) return T for Ok r3 M! T# p# f% _
- ); y0 U, [$ O3 n7 y5 j
- ( (eq dialog-state 2)4 [' ~) Y8 ~, m+ V; Y: J+ C
- : ~# _6 @. J9 p# L( v. h. f# p" I0 _
- (if (= (cdr (assoc 70 (tblsearch "LAYER" elayer)))0 A+ E& z" z& e* U9 S
- 4# ~- [- h4 c" X& R; @
- )
0 r* o k- F% } - ;;; new selected layer is on a locked layer+ ]" ^( k2 s' C4 @
- ;;; we can simply modify the hatch properties8 {+ B7 ^% a( F6 e8 Y
- (modify_hatch)5 q3 f; Z3 N1 i1 w
- (progn1 N# t# k4 S& C, j3 z
- (if (= (cdr (assoc 70 (tblsearch "LAYER" (cdr (assoc 8 (cdr elist)))))): A Z5 W* n# Q, o; C
- 4+ F7 H8 B- s$ G+ a. ~1 ~
- ) , \3 [5 f. K& J( [9 {. ]
- ;;; We changed the layer previously and now the hatch lies on a locked layer." H/ ]5 C. d1 Z. i) x) E8 @
- ;;; We have to unlock the layer forethat we can update the hatch properties.
8 Q: \: j* D1 C; Z - ;;; If we don't do that (entmod) fails to update to the new layer." ?# a; z% L. S3 j' N8 y2 j
- (progn
- Q) ~+ p" b1 B$ L2 H" V( L) C9 A9 ? - (setq layername (cdr (assoc 8 (cdr elist))))1 d% L, \& u: r$ o+ O# g& V
- (command "_.-LAYER" "_Unlock" layername "") ;;; unlock the layer: O/ ~5 h! H; A2 p, o
- (modify_hatch) ;;; update the properties$ Q8 y C! J! D0 e0 v! Q. h
- (command "_.-LAYER" "_Lock" layername "") ;;; lock the layer again" h3 I! d, Y- V9 b
- )
9 U) d; G% S5 u - ;;; All other cases we simply update the properties5 s# R5 y3 c7 K* l3 j6 S; Z
- (modify_hatch)0 [5 W4 T! g* F( }, Q" t
- ); ~' C4 U U# L4 w; R
- )
) s3 y. A% { i' V) x - )
' F- b. w* B/ d - (if (= (checkforlockedlayer ename) nil)) I5 b% D1 }! a3 [ p
- (command "_hatchedit" ename)' E9 ~0 S" L2 f- y. D3 m6 B. M' ~$ y$ s
- (alert ;|MSG111|;"The hatch object is on a locked layer.")( M: f' n! F2 b7 h
- ); s" o5 U' r+ F+ n8 [
- (ddmodify ename)
0 Q0 o D& n2 Z ] U - )
* {6 k# y: N7 t. t - ); P6 g3 {5 a1 Q: w( S8 \$ W
- )& z# f2 Z6 e8 Q5 g# z- N7 o5 T
- ;;& [" ]8 A5 r$ u9 m) d% \# ^
- ;; Modify BODY
+ K8 Y8 g+ T$ p* _8 b - ;;
" |4 T; U- T& u+ j, h" C/ E - (defun modify_body (), y- Y" M8 U) }5 E
- (modify_prop_geom)9 {' |% u% O( h
- (entmod elist)& M- Z% d; C* n
- )
! f/ V. N ^) Y, ?3 n2 f - ( R; `3 k3 Z- j1 q! @
- (defun ddbody ()
7 N# K6 D$ c" R1 u2 h u. Q - (if (not (new_dialog "ddbody" dcl_id)) (exit))
6 S6 R* }2 S0 `! Z6 j' b - ;; Set initial tile values( {- V- H0 x4 J, ?) ^8 o# a
- (set_tile_props)
. `% E8 J& f$ n$ D: T$ O - (set_tile_handle) U4 t! |; _# |2 y1 v7 G5 ~, R8 e- s
- ;; Define action for tiles. k) R7 S- e# r* B* I4 D
- (set_action_tiles)
- N' V3 I" A, {2 q6 U6 I - (setq dialog-state (start_dialog))
0 z2 W+ [. [5 l/ G- D - (if (= dialog-state 0) P' E, R1 i8 g9 k+ U l" S
- (reset)
- z5 a5 d& ~; b$ j+ O$ z# t( K- B - )
* k6 E+ f M) x+ C - (if (= dialog-state 1)
4 r# }8 {5 u2 ?. d5 C% [5 ?! ~0 v - (modify_body)! r# v1 {/ }% I! [
- )& `% j: H g4 e7 l
- )
$ f& y H2 ~: z/ s i7 D8 H5 e - ;;
( N# _% z5 i4 \# h& `8 O1 u - ;; Modify CIRCLE
) b. L, M2 f" G! }2 f$ I( n$ }: S5 ~ - ;;2 r- Q( V2 p+ L2 p/ o* y
- (defun modify_circle ()9 t! @- p8 K- t- g
- (modify_properties)
+ m: Q% r: ^# e. _ - (setq pt1 (list x1 y1 z1))/ \# U6 U- F5 L: R. H
- (tempmod pt1 10 1)* G" S8 F. M8 |- R
- (tempmod radius 40 nil)6 C8 h3 G1 j6 ?4 H, ? u7 [
- (entmod elist)
, H; i6 J+ R7 l4 J - ); } j' G1 Z, c+ l
- - h' H# f" n: {6 c6 r- F
- (defun ddcircle ()
# Y. e% e# d0 p3 e& S W - (if (not (new_dialog "ddcircle" dcl_id)) (exit))4 e% Y& |3 b& D" n2 m; G
- ;; Set initial tile values
1 {! P* H1 i6 x3 W( E - (set_tile_props)
. r8 y7 u2 _# d' r& r+ \) s - (set_tile_handle)/ U! T7 C% M& I2 l5 S
- (set_tile_pt1 1)& ?% ]9 Q# N7 L- ]( @. a- f" m% {
- (set_tile_rad)
3 p' k- u& p B; [+ ] - (cir_calc)
, i* Q& F' k* l3 A4 g; |5 G) n - ;; Define action for tiles# `& d" A! p% Y- F( s4 o: X8 R: ~
- (set_action_tiles)4 J7 l5 Y1 Y U6 x$ E
- (set_tile_pt1 1)
8 h5 y. n' D) ~7 |9 x1 \- o - (setq dialog-state (start_dialog))
; j+ v0 ^; A, m' O - (if (= dialog-state 0)
2 H$ e; O3 D `" V. p - (reset)
: E6 i5 a& N) D$ {" b& K - )6 C9 T; |, j' }$ l
- (if (= dialog-state 1)& q2 N& I0 q7 |: r% Z
- (modify_circle)4 o/ `; e" P, `7 g( K$ T
- )
- _6 Q- N B! p# `; |: [ - (if (= dialog-state 3)2 x9 a( p! f0 t& z/ }1 Y
- (progn* R1 t& V9 [& F$ u& `- u# w
- (modify_circle)6 u7 l" O% F% v. E* T
- (setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))9 Q; ~0 s0 ~! h# ?& D8 |
- (ver_pt1 1)1 Y; x+ d! U3 p2 ~% S
- (ddcircle)6 T- z$ J i$ u3 N; V$ P3 C# L
- )- Z! n' l7 Q% o$ a. N4 ?
- )5 y4 T' o6 V1 A6 |7 g `" [$ X* f
- )
( g/ T: r6 U) Z5 d - ;;4 [; n; s* b+ L
- ;; Modify ARC: w# M# M* K7 o$ V5 ~
- ;;% q1 j: B( I) {. Y6 ?
- (defun modify_arc ()# L5 G% F: d* U3 ?, p" ~. P+ }2 T
- (modify_properties)( m% _9 C/ O7 N8 C# o' c
- (setq pt1 (list x1 y1 z1))9 M$ ^5 w- X* h; Y+ Y7 a
- (tempmod pt1 10 1)
O T3 `- b: e - (tempmod radius 40 nil)7 U4 _0 z- Y+ u' ~( e" D Y
- (tempmod st_ang 50 nil)3 h5 e+ `% [3 _: e0 z4 O! }& u
- (tempmod end_ang 51 nil)9 y8 j9 {, }# n- v: k; w" V( M8 W
- (entmod elist)
+ d$ W% N- U8 S - )3 }7 I% i7 K! }* d
- (defun ddarc (); y X D" Z, g$ Y& K+ N% B
- (if (not (new_dialog "ddarc" dcl_id)) (exit))3 k: O! V6 r x& e- b7 b) U) w3 ^
- ;; Set initial tile values
/ y3 H0 H6 {" u - (set_tile_props)
& M# @6 t6 K9 Q - (set_tile_handle)* a6 u5 L* a2 K
- (set_tile_pt1 1)
- _4 C& X) b* q9 O) P7 \ - (set_tile_rad)" h- \! ^$ w, C4 H" E7 c' ?* t
- (set_tile_stang)0 v% A8 { A' x6 t5 P# I4 G/ l/ C. Z
- (set_tile_endang). ]3 p* A! i9 f. L- d
- (arc_calc)( O- L& R% m7 O. R: r* B
- ;; Define action for tiles
- ^$ s. ?4 j+ L3 N - (set_action_tiles)
8 S% a4 ^: e- K/ J5 f- M0 ?+ [ - (setq dialog-state (start_dialog))7 ~( m( Z# J1 ~$ b# P
- (if (= dialog-state 0)( l8 W- p1 i5 u, f
- (reset)
n4 ^& |9 n* d/ c - )% @% D. @ |3 ~# ~" {% D' V
- (if (= dialog-state 1)0 |7 S! v, \' a3 K. i
- (modify_arc)' ]) Q. N$ n/ n
- )
# ~5 A8 k- [3 @0 \" _: d7 g, | - (if (= dialog-state 3)7 ?5 V* P( @4 W* a
- (progn
" @7 F& G0 T+ @# M0 ~8 V/ z% ] - (modify_arc)1 W4 W1 o/ A9 y4 y4 T8 a
- (setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))& r, Z! r* a$ h0 I( W- |3 v0 J
- (ver_pt1 1)
% p4 y* r; F# i9 h0 c! r - (ddarc); o; p( _' s' B( j$ y
- )9 }3 d( Y8 c0 K! R2 M
- )3 C! {# ^# V, l; \
- )3 v7 W$ q0 O/ H2 n8 a' ]) n8 Q) W/ b' d
- ;;
, a/ L7 ~3 J, _9 g9 w9 a: Y( g - ;; Modify SOLID or TRACE3 @: _ l0 p S
- ;; Note the Z value of the object is determined by the Z value of the fourth
; B [. k" c5 e; g8 A0 n - ;; point - code 13. Changing the point values of a solid or trace from a UCS
5 T$ b r: c1 m* R. X - ;; that is nonplanar to the UCS the object was created may confuse the user.
4 Y* h$ T: `. R' q- G2 M - (defun modify_solid ()8 Y6 _( I4 D& P7 t0 ~
- (modify_properties)& D$ x$ h0 V6 Q* U$ o
- (setq pt1 (list x1 y1 z4))+ U* a3 i( [& r4 G5 [% Q$ p
- (setq pt2 (list x2 y2 z4))
4 A3 d) c6 E) e8 Y6 e - (setq pt3 (list x3 y3 z4))
/ D n" t% } |& K+ Q - (setq pt4 (list x4 y4 z4))
$ @4 j4 W* V) d$ P; E: ] - (tempmod pt1 10 1)* B! ?7 \4 d% u, c
- (tempmod pt2 11 1); O! D" q% ^$ o2 r$ {/ F
- (tempmod pt3 12 1)
, V3 K$ C1 d6 X! j# a' B - (tempmod pt4 13 1)
c4 a( _/ o9 \& j+ _ - (entmod elist)
- u7 g: K( i- V$ p - )
: b- Q4 I q/ }; n
; d* N. n; @3 }' v; u- (defun ddsolid ()
$ ? e# J' J" U$ H+ ~# D4 d* s - (if (= etype "SOLID")1 K/ ]* G0 X) X, v! f
- (if (not (new_dialog "ddsolid" dcl_id)) (exit))8 y) O3 u0 B! C6 V& g- z% [
- (if (not (new_dialog "ddtrace" dcl_id)) (exit))- N8 `6 u+ e/ M) x+ L2 q5 q
- )
) P2 ^. H% p1 W2 L6 |, S - ;; Set initial tile values
/ a j6 f* B/ F - (set_tile_props)) P- O/ Z& V0 g+ U+ Q8 l1 u7 \7 q0 x+ x
- (set_tile_handle); B: C1 `/ M) ^4 X) v; p0 t' @
- (set_tile_pt1 1)* \: v& W* ~# J" z% s
- (set_tile_pt2 1)% x* @% ]- L( ^2 t/ `& m0 l
- (set_tile_pt3 1)
* o. K& e% c3 j - (set_tile_pt4 1)6 V- j* f. U7 r+ M4 O, c0 w: |
- ;; Define action for tiles5 ] i5 [$ b5 N( [, {1 \
- (set_action_tiles)/ m8 c' B- I% x) C
- (setq dialog-state (start_dialog))
) ` j7 q, P- z! J5 O1 X" v - (if (= dialog-state 0)
! v; I; ~$ P* y- h! J - (reset)* D2 {6 B+ O) S% p
- )
2 L& @3 @5 |: D - (if (= dialog-state 1)( O2 f/ @4 |8 K# k( _
- (modify_solid)
* V3 c' u: {) e6 I# c9 x3 F - ); q4 T% u# V$ W) _( M" T9 M
- (if (= dialog-state 3)
2 e5 D5 _! \; o; m9 U4 u0 W( U - (progn- T3 K0 }. N4 `8 m+ ?+ n1 S
- (modify_solid): C2 _) H5 D _3 a. c, @
- (setq pt1 (getpoint (list x1 y1 z1) "\nFirst point: "))
) \# X2 H) _ o7 m+ y. w$ Q6 G - (ver_pt1 1)
% k# e* O1 g- F- g. H2 A - (ddsolid)8 M; q. O* x7 X
- )
7 |& @% E7 w$ N, I; h$ V5 Z - )
5 J3 n5 c% ^* |& | - (if (= dialog-state 4)
1 R2 n2 X3 W# H4 a0 V" f - (progn# G' U0 x' n$ t# F( o: @3 p) ~+ P
- (modify_solid); P9 l% k2 w* j( F( S% B( ^
- (entmod elist); S$ d: P! Z; k/ I- s
- (setq pt2 (getpoint (list x2 y2 z2) "\nSecond point: "))
3 l& }9 K# N: x/ q1 m - (ver_pt2 1)
7 n/ p0 O. z: I- `# \5 w' Q - (ddsolid)4 |! y8 A+ D3 Y
- )3 L0 n% Y4 |$ D# Y1 X
- )7 ~0 S' Q9 f8 B5 ~3 H" H8 {5 N
- (if (= dialog-state 5)
1 b: K0 } K' | - (progn
, q& q8 U# b5 k - (modify_solid)
) Q# S0 w2 D0 M0 }3 Z - (setq pt3 (getpoint (list x3 y3 z3) "\nThird point: "))
8 m# Z! I0 \6 a. d - (ver_pt3 1)6 N- a6 S- R! g3 x; Q. X" U
- (ddsolid)
: v% f( s1 c; H- v& i& h9 Q. D - )
% U7 q. I1 f. f+ e7 p* c+ Q! B - )
1 h9 Y* a/ Z( Q2 ^9 j- t: g6 |6 c - (if (= dialog-state 6); p6 J8 Z/ Y5 A9 `. ~, W! E
- (progn
6 v# a/ f, G4 K/ Y - (modify_solid)8 S4 b- g* Z" `9 B$ `/ p" o/ Z
- (setq pt4 (getpoint (list x4 y4 z4) "\nFourth point: "))0 P) C7 ~- B, y% ]% B
- (ver_pt4 1)4 s2 Y( {* b3 `4 x: ~6 D& ]
- (ddsolid)9 F: I/ g: V9 X2 k6 R
- )! G' e) M1 l) p6 k" u0 g- E! F
- )4 }$ n7 O2 I& z- [
- )
7 R" b: R5 O1 b. z! \3 X - ;;* p0 A) ]1 f5 U% }" x1 f
- ;; Modify 3DFACE# h1 O) s- m0 \8 q" }
- ;;# S& Q7 [5 ]7 m- Q' {. @8 s
- ;; Check visibility of edges8 L# c0 |- y$ Z( P0 r. Y. }+ Q
- ;;2 O3 O. ~% I' _2 D/ G! A" Q; _! g
- (defun edgetest (/ bit1 bit2 bit3 bit4)
|6 D. E/ V' t/ T; e - (if (= edge1 "1") (setq bit1 0) (setq bit1 1))
( \' {8 @9 Y3 |2 n - (if (= edge2 "1") (setq bit2 0) (setq bit2 2))
- o$ S; K7 f0 ]* x - (if (= edge3 "1") (setq bit3 0) (setq bit3 4))
% Y, a; [7 V7 P# N% q - (if (= edge4 "1") (setq bit4 0) (setq bit4 8))% G, ]! e: ~! H! n' a# h
- (+ bit1 bit2 bit3 bit4)" s% c$ x9 I1 Z" V
- )* \6 H! E( g- L
- ! L: J( V' i( }7 i
- (defun modify_3dface ()
' x& j& W1 r" I D7 f6 f - (modify_properties): N6 x8 Q/ Y5 {0 l+ Q5 p9 o+ G
- (setq pt1 (list x1 y1 z1))
+ S0 A7 }0 `' \6 ~ - (setq pt2 (list x2 y2 z2))# r7 b% ~4 ?; E f, R# {
- (setq pt3 (list x3 y3 z3))
1 z8 ]$ z. h0 n: V1 X" c/ j6 B - (setq pt4 (list x4 y4 z4))% U9 j' Y2 l$ [% i6 ~5 j; b
- (tempmod pt1 10 0)! D: N; y3 T7 y
- (tempmod pt2 11 0)
( @; W U; O5 c2 g5 z4 v - (tempmod pt3 12 0)
$ C$ m2 }3 s+ E/ C2 l, b - (tempmod pt4 13 0)0 v: S6 ^( ]4 j& ?5 l$ G- c
- (tempmod (edgetest) 70 nil)
' ?2 m: C* j, u2 i9 T6 { - (entmod elist)
$ a" y. n6 u. l4 T - )+ H& R' O' [# H5 G
, x6 Q7 S4 y# P/ r5 i- (defun dd3dface ()6 f/ z" [) R; |- z
- (if (not (new_dialog "dd3dface" dcl_id)) (exit))
- ?0 |3 Q) |9 P! o/ r - (set_tile_props)
- D- Q; Y0 Z) v+ Y `3 t1 V3 @. z0 O - (set_tile_handle)
9 R8 R# l+ ^9 K( h - (set_tile_pt1 0)
7 ?5 v. l$ F' s1 P2 }3 c - (set_tile_pt2 0)( D2 g3 k' o2 h" c( J5 O4 M! _
- (set_tile_pt3 0)4 k0 F+ z1 q! @
- (set_tile_pt4 0)
' e# e3 ~$ s+ u# \ - (set_tile_edges)+ W8 O1 _& h' b5 `% k
- ;; Define action for tiles
( e9 [% i7 f; g - (set_action_tiles); \/ S' s6 P O" v0 m; m
- (setq dialog-state (start_dialog))5 `% l6 v2 c( B6 y/ c
- (if (= dialog-state 0)1 q) }: {. z; `
- (reset)' R B# n9 V4 e
- )
) \: C6 Y5 m; t - (if (= dialog-state 1)6 J; t- H/ L5 C1 f+ p. I' f% T9 O! M
- (modify_3dface)
$ S' b* I% H& U - )# @# h- B7 |7 J$ u
- (if (= dialog-state 3)6 j- k: m8 u4 ~" B& |5 J
- (progn
6 V% ~7 b5 y4 ]6 b, ] - (modify_3dface)
5 L/ T0 C* N, v0 \( o/ } - (setq pt1 (getpoint (list x1 y1 z1) "\nFirst pt: "))5 H. c( |: {3 V+ Z: J' M) d
- (ver_pt1 0)$ v$ E, w, I2 @/ j% ^
- (dd3dface). w& x0 u/ |/ V
- )
6 H" A$ s1 Z( M( P, N/ S$ ^ - ) i4 g/ P* H; ~7 r; \$ b" P G
- (if (= dialog-state 4)
/ Q- I/ D" G* }: O9 h G% } - (progn; C' c) h. W# r. w6 W1 `5 X8 \
- (modify_3dface)
/ a2 c) i, ^) g: [% }, U - (setq pt2 (getpoint (list x2 y2 z2) "\nSecond point: "))1 ~9 V' j& L1 Y i) [
- (ver_pt2 0)# \* \, M$ l; `: D0 o% v
- (dd3dface)* {: y# r$ T1 ^
- )& I$ R; Q- L. n o8 f& s
- )' }3 o+ u! m; K, E4 N3 s/ P
- (if (= dialog-state 5)
6 C$ T g( O; `; d- A8 M - (progn# \) W& X' Q1 W$ E
- (modify_3dface)) p. o' z9 \- H, f4 `
- (setq pt3 (getpoint (list x3 y3 z3) "\nThird point: "))
% V( O4 ^* }2 P* O# L# O - (ver_pt3 0)" u- w( _9 `! u: [2 o8 A, U. j
- (dd3dface)
% A1 y: W$ S" N - )
9 q W! E# L @! B$ S - )
, X$ j& W5 i5 z2 l* [: u - (if (= dialog-state 6)
8 O0 H: W5 q7 F) _ - (progn
`+ l; G4 u8 e; @) X: [ - (modify_3dface)
3 l( g" a& j S - (setq pt4 (getpoint (list x4 y4 z4) "\nFourth point: "))
, W/ D9 [) q7 e: @- l! h5 N - (ver_pt4 0)0 I0 I2 `5 {& S% G
- (dd3dface)/ [& Y- E( P! o* P/ V0 [
- )
4 X, G @1 z+ w- ?$ j' X" p. L - )
" B9 p: E+ J1 ?+ Y7 p9 X9 Y% o! F - )
+ C. W8 E x; T |1 H - P( E) h: ?! V. W3 D7 T5 Y3 T
- ;;
S: P7 H) ^. M: N% p - ;; Image functions
' I1 d- u, n' ~* Q3 ^! T* j - ;;
& u9 G& p9 b. O! J* C6 E - (defun image_scale (/ upixel en n userscale temp)
9 \0 v2 S- K2 ]2 a# D - ;; Calculate the size of an image pixel in AutoCAD units3 J- ]9 }$ J$ l: g
- (setq upixel (distance '(0 0 0) (cdr (assoc 11 elist))))3 B S9 ~7 R, j: n$ {% l$ a0 ?3 i
$ I+ ?# t2 |' ~5 q- ;; Retrieve the user scale9 u5 E* U) {& V
- (setq en (dictsearch (namedobjdict) "ACAD_IMAGE_VARS"))
8 ^2 K/ [) O8 C, b. K: h% C! e. G
6 D4 u2 J p% i# h* I9 y- ;; Next, extract the image units and pixel resolution
8 Z* U+ L @# t, P" | - (if (or (= 0 (cdr (assoc 281 image:olist))) (= 0 (cdr (assoc 72 en))))
7 @8 x& f' n& B- C& T8 m5 q$ Y - (setq image:scale (* (cadr (assoc 13 elist)) upixel))7 ^$ e1 y r3 M5 {4 x$ b
- (progn
3 ~7 |( t. E' F T - ;; Convert the user scale to the proper word1 w* ^& l: S5 N' P1 e: z- z
- (setq n (cdr (assoc 72 en)))
. k9 j" Z! j7 i$ a. s - (setq temp (getvar "LUNITS"))
+ I e; Z+ T2 q5 x - (if (and (/= n 0) (or (= temp 3) (= temp 4))) (setq n 5))
# Q+ y0 A, s6 A% m7 |. V - (if (= n 1) (setq userscale "Millimeter"))0 `" G& A/ J9 E. c0 X9 Y
- (if (= n 2) (setq userscale "Centimeter"))# C6 \2 r# \0 F: q: H
- (if (= n 3) (setq userscale "Meter"))' U1 U" m- N& d+ \; G' a6 q
- (if (= n 4) (setq userscale "Kilometer"))
5 E2 V( ^- x6 M" j$ n" Q- G% F - (if (= n 5) (setq userscale "Inch"))1 I! _! ]- w5 d6 f* ?3 a7 x
- (if (= n 6) (setq userscale "Foot"))
& w4 F9 e: T% c7 K$ i - (if (= n 7) (setq userscale "Yard"))% V! g! @! J+ s6 m8 e, B
- (if (= n 8) (setq userscale "Mile"))
/ K- b+ S) t" V: g: D - (setq image:scale (/ upixel (cvunit 1 "Millimeter" userscale) (cadr (assoc 11 image:olist))))
0 o* q" o4 P; k" X7 ~7 P - )' B) C, \5 y; l" G
- ). t, O4 d3 ?, ~5 `" I# m
- )
# X4 y$ ~- v) H7 d* h8 U6 g
! ~" F* k7 w0 G7 ?$ k/ [- ;;
6 ]6 U, D, F1 X8 H- L, ^3 N5 m - ;; Scale factors for block insertions
+ b' g5 h3 ?* V$ T+ J" X - ;;
* @. A1 j- [- P0 R5 Z! y% l: h( p - (defun image_set_tile_scale (/ temp)7 \) ?) L0 |* h9 R
- (setq temp (getvar "LUNITS"))* G- I$ S) x7 }4 C
- (setvar "LUNITS" 2)
' E% S, O; c0 O! S* ~: x& T - (set_tile "xscale" (ai_rtos (* image:scale image:mult)))+ R+ X# W# Q" r! K
- (set_tile "wid" (ai_rtos (* image:width image:mult)))& D" d7 j0 ]& A2 B c& g
- (set_tile "hght" (ai_rtos (* image:height image:mult)))2 }) n# X, ?8 z
- (setvar "LUNITS" temp)0 C" @( j' z0 ~6 u, g* O8 W
- )
& S q4 L2 `0 L/ h3 x
- n. B5 Q/ w! p4 e. I+ e- ;;
. e# b1 G; A" p/ ^. R" ] - ;; Set the scale, width and height values appropriately.$ S/ u; K, [5 y, H% m5 K- K0 a
- ;;* ]0 d. B0 E( [: Q
- (defun image_update (field value / orig_value new_value mult)' J- I. y/ H6 L& `$ }, T
- (if (= field "xscale")( O4 W$ V/ k# P2 ?
- (setq orig_value image:scale)+ r, T1 c1 k3 A7 B
- )
% g$ u0 R! w: S) A& J - (if (= field "wid")
7 A5 e* N' ]/ Q. [/ v - (setq orig_value image:width)
# b* L3 s9 E7 _: @ - )3 J2 {5 g7 O4 l2 R
- (if (= field "hght")
" j( p6 f+ E+ c - (setq orig_value image:height)1 I, p0 t5 F6 i! O
- )
! e4 A( L) h: Q7 u' b; Q - (setq new_value (verify_d field value (* image:mult orig_value)))
9 ?. B8 d4 ~4 i' ]0 E! p - (if (/= new_value old_value)
" p( B' H4 Z$ V4 n" q - ;; Make sure the user has entered a sufficiently large value
( \$ o* e' v f- O5 h7 u9 ^ - (if new_value. { ~: L% J5 e1 f
- (progn- l0 c @, U- E& Z) O b6 r5 L
- (if (< new_value 1e-8)) d3 G1 }0 y4 _: x. h
- (setq mult image:mult)6 t; W2 }+ ? [/ O, t8 g/ B
- (setq mult (/ new_value orig_value))
/ Z6 v2 p- `7 X - )
7 X1 l/ R' @% N' k8 Q. o1 l0 i8 s - (setq image:mult mult)! ^( j5 ]5 v! L* F0 d! A
- (image_set_tile_scale)
?" c' Q. w. J - )6 J5 U1 @) a0 }# x( w
- )
+ G4 q( A, i( f: G: u* C7 R" N6 y: | - )5 c* H9 o9 ?- _1 f }8 p; [
- )
+ i5 g: B p+ c8 S( [% H- | - / W, L9 ~: _5 ^. k8 }
- (defun image_disp_opt (bit)
/ e& |2 z! P( U, ~ - (setq image:options (Boole 6 image:options bit))1 p9 Z7 D' X+ x" E1 R9 ^6 B
- )
1 K; o: F7 i8 `
4 O) H( Q/ n( I9 V3 H) f1 {' L- (defun image_modify ()
d4 y' ]7 }/ L8 o8 `9 _ - (modify_properties)9 c: u. g9 a& N- S
- (setq pt1 (list x1 y1 z1))
' ~2 O. `' ^" u% J6 Q - (tempmod pt1 10 0)
; o' f( H; D4 n, q% _) ^$ v - (entmod elist)9 k, M. m3 @) |0 e' L( u, ~
- )
1 T. ^* N2 I6 F% f" C. ^ i, t - % E7 M7 }% ?4 f2 W) b
- (defun image_clean_variables ()! l7 f; N" R* M! h- z
- ;; Clean up global variables used here
, |, m) Q/ S7 X0 }3 M - (setq image:scale nil)
: a& @2 I' X1 [; J - (setq image:angle nil)
5 T8 h/ n3 w5 B0 x, C( l# m/ ? - (setq image:width nil), z$ ]% e2 A. i3 p% ]
- (setq image:height nil)# C+ k; G! L7 [3 w- k, ~
- (setq image:options nil)3 h2 h2 e+ G8 V9 j1 D# u0 \
- (setq image:oname nil)
6 }" E, h/ O5 b, v" D" s0 v6 D - (setq image:olist nil)
' h" ?) z1 N1 r8 E% W/ D - (setq image:mult nil)
- n# l7 d3 y; n, | - (setq st_ang nil)
( m F' Y$ o8 L1 |# i4 A4 A - )/ s& I! d4 X8 |
- * t$ w8 v/ p+ v
- (defun image_scale_vector (v1 value)
# n9 I8 r$ V2 B - (list (* (car v1) value) (* (cadr v1) value) (* (last v1) value))
6 C1 z/ R0 q! R1 V& e6 T2 Q - )
0 s# M% E! M% d- M8 W8 w4 ?1 U# Q5 n - * _+ Y h0 Y# P# P
- (defun image_cross_product (v1 v2 / vx vy vz)7 Z" K, U9 e1 S: L
- (setq vx (- (* (cadr v1) (last v2)) (* (cadr v2) (last v1))))/ V$ H: r/ J3 U1 n# B
- (setq vy (- (* (car v2) (last v1)) (* (car v1) (last v2))))
" Q; f* n! I; U' u9 r/ P, D - (setq vz (- (* (car v1) (cadr v2)) (* (car v2) (cadr v1))))
8 L! `4 e1 n. s; V% L L: t* Q0 S - (list vx vy vz)
( Z! K2 M3 ]. ^9 y$ D4 C# C - )
c8 V0 [9 c8 I/ i; n* B4 E9 D - 1 ~$ m7 I; {0 ]
- (defun image_dot_product (v1 v2)9 z- r0 P; _( h
- (+ (* (car v1) (car v2)) (* (cadr v1) (cadr v2)) (* (last v1) (last v2)))
1 F$ a( J- e% [* P# {8 `/ s - )/ ~5 p U: o3 ~3 P8 x
( B$ o: Y+ Q" t8 S3 g- (defun image_add_vector (v1 v2)+ E3 M4 L: ]& Y
- (list (+ (car v1) (car v2)) (+ (cadr v1) (cadr v2)) (+ (last v1) (last v2)))3 b! ^3 O) I& ^+ k, _4 R
- )& X6 j) ?. M- x& r" Y }% J( e( o
4 l# g" ^( k0 A, ~# {) {; @2 J- (defun image_subtract_vector (v1 v2)" v0 l& @; w% x9 ^* i8 Q: D
- (list (- (car v1) (car v2)) (- (cadr v1) (cadr v2)) (- (last v1) (last v2)))
2 B5 m4 L a# `' L$ r' o' ^ - )( t2 N! B1 N9 B* d
- ' N: A5 i1 D, ~
- (defun image_normalize_vector (v1)
/ R; g$ a- d n2 Q6 o - (image_scale_vector v1 (/ 1. (sqrt (image_dot_product v1 v1))))
" u# {4 e* m2 H/ f2 F+ j( _ - )7 y/ L, q# U5 H/ I7 p& q
: _5 q0 Z3 ]3 R; A d- (defun image_rotate_vector (vector angle axis / along_axis axis_x_in_rot_plane axis_y_in_rot_plane in_rot_plane)
. \% L/ J( R) {5 }6 C; |5 V/ i - ;; Normalize the axis
P1 s3 C8 Z9 T# X% i - (setq axis (image_normalize_vector axis))
: E; v) O$ _* \7 Y" ~ - (setq along_axis (image_scale_vector axis (image_dot_product vector axis)))
( H5 a# z# Z7 x - (setq axis_x_in_rot_plane (image_subtract_vector vector along_axis))7 Y& {. ?$ S: G8 b3 S7 g, D) |- B
- (setq axis_y_in_rot_plane (image_cross_product axis axis_x_in_rot_plane))( y$ f x. a* ^9 m: ]3 w
- (setq in_rot_plane
9 u: e4 i) M! T" S4 a - (image_add_vector
9 z2 K0 O. t% ` {+ @3 N - (image_scale_vector axis_x_in_rot_plane (cos angle))
/ j7 U* v( U4 Z* s/ ~9 s - (image_scale_vector axis_y_in_rot_plane (sin angle))
: t3 D3 j" u: x9 N" _5 F* s- r - ), ~9 v. t8 v' s0 U' ~
- )
& W3 w6 Q6 I' h8 f - (image_add_vector along_axis in_rot_plane)% N- i$ b9 @/ X
- )
' w2 h6 y: B4 U* H
; K8 |6 X; y9 T9 W! P1 U- ;;# x1 z' ~1 q! V8 T. o. [# | V
- ;; Calculate current rotation angle if appropriate.
! H. Z- |9 i' W$ I3 g - ;; If not, grey out the rotation field. Q5 Q6 w1 g. V& G
- ;;2 d n# x% c7 d
- (defun image_rotation (/ normal rlength zlength sqrt_tolerance)
1 B" D4 l) q: Q% Y - ;; Determine if image normal is codirectional with# c$ A. C2 m/ L7 H; J
- ;; the current UCS Z-vector.; M% o3 J9 [5 z9 p! P! G
- ;;
) V8 s* [! N1 D+ I+ c - (setq normal (trans (image_normalize_vector (image_cross_product (cdr (assoc 11 elist)) (cdr (assoc 12 elist)))) 0 1 1))
# R; p: d' @0 B, Y% c* f6 ^" \ - (setq rlength (+ (* (car normal) (car normal)) (* (cadr normal) (cadr normal))))
: g+ |* s. z9 V8 d% l6 V/ W - (setq zlength (* (last normal) (last normal)))( E. s5 y$ C$ _
- ;; Note that the value .0001 in the radians is approximately 0.0057 degrees.
* M8 n6 i$ e0 T- k# Q# T/ x% R - ;;
' Z! ^6 o8 k5 P7 Q Q; G - ;; cos(.0001)^2% _2 z7 `" i6 ]' z
- ;; Tolerance = --------------
9 y3 M0 U A# `% Y0 ] - ;; sin(.0001)^2! V. V9 K; Y' o3 _% {, X
- ;;
4 F3 I& U: q2 {% q - (setq sqrt_tolerance (/ (cos 0.0001) (sin 0.0001)))
2 e/ H/ @7 ~) }4 k - (if (and (< (* rlength sqrt_tolerance sqrt_tolerance) zlength) (> (last normal) 0)) V# a; _/ i% G& x
- (setq image:angle (angle '(0 0 0) (trans (cdr (assoc 11 elist)) 0 1 1)))) I/ X3 }, q9 R. l( \
- (progn3 @; f: s$ k( g* U6 ^2 p( M, q! z
- (mode_tile "st_ang" 1)- s! q3 E, K7 w7 k- W c! G
- (setq image:angle 0)3 c; b" M* R% }
- ); B- r, F3 U( ?3 { r! ?
- )& _2 J# V5 k2 r6 n
- )! C, J1 [: \5 o
3 k1 d$ I1 | _3 G0 Y6 b8 }- ;;
: u3 ^* o, p/ z* ?3 V! ]/ z - ;; Modify Image
) t2 ^6 Q T" ]; L3 r$ T - ;;
, \ O" |( ]# l V - (defun modify_image (/ u_vector v_vector z_vector)7 H) d! z8 S. }/ { G$ B
- (modify_properties)
4 y- z. R4 n8 D8 X' D5 [2 ~7 e - (setq pt1 (list x1 y1 z1))
0 M% B' V/ @: X% g1 k - (tempmod pt1 10 0)- {0 c3 s0 R" o, R# Z
- ;; Make display option changes to image# r" K; e: a8 d* a% E
- (emod image:options 70)) D: m; {3 f+ b/ t# S y" L
- ;; Get the u and v vectors2 u) \" N9 c$ n
- (setq u_vector (cdr (assoc 11 elist)))
- ~2 K- `4 V/ m4 i' x - (setq v_vector (cdr (assoc 12 elist)))
! @ t$ S& _2 v' B3 ^9 C$ B$ D8 \
8 i$ [8 m- z. Z# T9 J. q- ;; Make scale changes to the vectors0 p" [ @& m0 Y9 b4 O
- (if (/= image:mult 1)9 C$ H7 C; o) j) H4 _1 v+ Y
- (progn# G% |: P. E: }! w0 E" T t
- (setq u_vector (image_scale_vector u_vector image:mult))
0 j+ ~$ E; c- m- w. X - (setq v_vector (image_scale_vector v_vector image:mult))# d' L3 t- v3 F& l+ b$ }- r
- )9 t. n. i& y3 }4 P5 H
- )2 g2 ~ U; U: h8 d
- ;; Rotate the vectors
7 t2 B( ]1 p% K& _! e - (setq st_ang (- st_ang image:angle))
1 p- d# p6 U5 Y: `5 [7 o - (if (/= st_ang 0)
( L0 h. J# u% | - (progn0 b0 S. F6 p' x+ L! Q0 ?# W$ W) z
- (setq z_vector5 m3 i- Z: \: l4 i
- (image_cross_product
: ~ E% y- I& r( s - (image_normalize_vector u_vector)
3 c4 \5 \5 I% S$ w" P# \7 m - (image_normalize_vector v_vector)
; V0 ]$ Z( T) }- s2 f - )
M! C# u: u. y, K7 @9 E; r - )( g- F# G( S8 m3 k# u* f6 [
- (setq u_vector (image_rotate_vector u_vector st_ang z_vector)) e% t0 t, T' e5 h
- (setq v_vector (image_rotate_vector v_vector st_ang z_vector))
1 @& a1 B* C8 L/ ?+ F - )
B$ X: z' e6 n, R' e" V1 u - ), S* u: H: C# i& j0 ^ h
- (emod u_vector 11); u3 }7 t% I0 g7 e: I% R8 X: M) {+ s( I: l
- (emod v_vector 12)
1 r/ w) [7 l' R# T% A - (entmod elist)5 ]$ C7 {' S0 \* y! U1 k
- )
c0 a* _$ d3 R; k% c# u R
- V$ w' ^3 K0 j8 h B- ;;- M; r2 q4 B9 O) P/ H* z
- ;; Run imageadjust on given entity, working around possible& X; e) W P+ i, a! [$ z
- ;; re-entrancy problems' |6 p4 x0 X: k2 d8 N. u) l
- ;;7 `1 F: U' L% {! }( B7 n
- (defun image_adjust (ename)
7 s( ]/ r/ ^! L( X) {$ }% } - (verify_arxapp_loaded "ism.arx") ;; make sure it's loaded...
6 X; r( q/ m$ O# f2 h. [7 p+ ~ - (imageadjust ename)
: }# F' {8 C! t+ c } - ), g! {6 Y- u2 M8 u$ s+ A9 @7 n
- 3 ~5 x3 R1 C; K+ F1 L, c4 Q/ R5 \* K
- (defun ddimage ()
! {, P1 p- [" t- x - (if (not (new_dialog "ddimage" dcl_id)) (exit))" P, B/ ]4 S% c7 C, E. R5 L( X n7 X
: F+ B$ e$ @' |- Q3 s. ]- ;; Grey out the thickness field.
( w6 ~1 M6 d( k) I - (mode_tile "b_thickness" 1)
$ y: P8 `, e1 H$ E - (mode_tile "eb_thickness" 1)9 v5 f: ^6 S6 X
- 8 L3 \, N* B, q3 r6 ]( J& c V6 y
- ;; Get the associated def object.$ s% K0 b+ _6 U$ W4 Z0 S; e
- (setq image:oname (cdr (assoc 340 elist)))2 t A! T6 t0 f, c$ e
- (setq image:olist (entget image:oname))
" j* i1 S, n: |' C- ^0 t9 ?2 z - $ Y, l5 D- f, T5 s( n1 p: e; q
- ;; Set initial tile values; C% W- c: w2 R( k1 I- h
- (set_tile_props)
3 q- D5 _2 K C0 T% z& G - (set_tile_handle)
( h: G# K8 F: K) V! G$ h9 L - (set_tile_pt1 0)
% z) p/ T& G5 p7 H - (setq image:scale (image_scale))5 j6 c) l/ r8 N+ L' x/ J
- (setq st_ang (image_rotation))
$ S( S1 S# o9 k$ y8 L( R - (setq image:width (* (distance '(0 0 0) (cdr (assoc 11 elist))) (cadr (assoc 13 elist))))
9 B0 X; y3 H5 O% ~ J2 g1 Y - (setq image:height (* (distance '(0 0 0) (cdr (assoc 12 elist))) (caddr (assoc 13 elist))))7 j# Y$ O! p' X0 W; d" r3 i
- (setq image:options (cdr (assoc 70 elist)))
6 K1 i( r, y1 P: V8 T& ?
1 t- z' C3 g6 M j- ^- ;; Record the last multiplier for use in image_update function
4 O; `+ M% H- } - (setq image:mult 1)! j& J/ i I6 _+ b9 E+ J" K; v
- $ @, q# ]# f, A9 ]
- ;; Retrieve the image name
, O# Z8 J4 o' w P! H - (setq fn (reverse (dictsearch (namedobjdict) "ACAD_IMAGE_DICT")))
G8 Y" u- Q! M$ _" d - (setq flag 0)
5 M2 x" E0 R; g% P - (foreach n fn% e D0 L$ l: [$ E3 Y
- (if (= flag 1)
- N5 O: P$ L8 \- q - (progn
6 r2 E' R0 o8 H3 ^' Z$ N7 [ - ;; Display the image name: S% @* Z( o7 Y0 P' @. P+ D
- (set_tile "image_name" (cdr n))/ z( @% s i: e3 p( r
- (setq flag 2)7 W- ^2 I* m4 }
- )
( y( h0 ]' {. _7 ] - )
; i7 X: ^$ b3 V5 U - (if (= flag 0)
; _! c8 h8 e# N# y& a2 c7 M5 r - (if (equal (cdr n) image:oname) (setq flag 1))
: w' `7 ~9 n+ v7 v1 ~. }3 O - ); P# s* G! V& N6 A U
- )
* L# u4 m! d/ U9 |/ r# v - & ]8 M. ^/ _) L5 Z* C: ~; R$ ]
- (set_tile "image_path" (cdr (assoc 1 image:olist)))/ w Q6 o6 B# z5 l6 d6 i+ {$ Z
- (set_tile "st_ang" (ai_angtos image:angle))
|$ q" g/ k! Y: s% H& ~9 R: M+ U - (image_set_tile_scale)
% {( ~- j/ b/ M* x8 w - ) y! F" B9 w3 ^$ n3 y
- ;; Check the appropriate boxes! u5 L- {, ?5 k9 B/ x3 R
- (if (/= (Boole 1 image:options 1) 0) (set_tile "image_show" "1"))
1 q1 h5 L& \: E - (if (/= (Boole 1 image:options 2) 0) (set_tile "image_non_ortho" "1"))/ }) L( V! C/ c
- (if (/= (Boole 1 image:options 4) 0) (set_tile "image_clipped" "1")): x5 m4 N6 E; Q) k5 `
- (if (/= (Boole 1 image:options 8) 0) (set_tile "image_transparency" "1"))! m& H8 B, u0 _. n% t4 r
- ( P9 _ h# e O3 C
- ;; Define action for tiles$ o7 ~2 f" J( R4 y6 T; H; b1 K
- (set_action_tiles)
# g- L" q K! e - (action_tile "xscale" "(image_update \"xscale\" $value)")
6 f* c$ r" M! L - (action_tile "st_ang" "(ver_ang1 $value)")
+ s3 s6 u: I6 W& d - (action_tile "wid" "(image_update \"wid\" $value)")
" i( U2 J, i1 J - (action_tile "hght" "(image_update \"hght\" $value)")
- B2 t+ Q% L0 z2 i7 G - (action_tile "image_show" "(image_disp_opt 1)")
@3 _, [' X. z0 C - (action_tile "image_non_ortho" "(image_disp_opt 2)") A& L6 Y$ x% ]( @, }! U) x
- (action_tile "image_clipped" "(image_disp_opt 4)")% B! H; j. z& g/ z7 Y
- (action_tile "image_transparency" "(image_disp_opt 8)")
( W& T5 l5 g' ?0 D - (action_tile "image_adjust" "(done_dialog 4)")
" n2 |5 j, o4 h
5 ~: Z/ f4 a$ [3 `1 D, M4 L- (setq dialog-state (start_dialog))
2 ?7 I# v6 j! b, ] - (if (= dialog-state 0)
. X6 { S4 ?7 S" T$ b* P& ? - (progn
" a+ s: I( k |; S4 X4 F - (reset)
) H2 q4 q0 X( r) R! |9 e - (image_clean_variables)
+ H+ }& I2 e! n1 Y8 ` - )
8 L5 d- ]7 n4 z9 _- ]" [" g - )
5 q) Z' P3 V. F7 n V& q) O$ f0 { - (if (= dialog-state 1)- {/ F) B$ F+ K5 J5 l
- (progn" R$ m, I3 f& V2 A
- (modify_image)- n! d/ s1 V4 p/ c3 Q
- (image_clean_variables)$ t4 \( W: p' `, [# W
- )* j5 w! U2 J/ H+ r4 ^4 r
- )
. K }% v7 z: Q6 h0 M - (if (= dialog-state 3)
) F% K* x- X2 d c4 f' ]) J - (progn
0 M% [1 L7 t* o - (modify_image)
. @7 ^6 |- P! y) G4 F0 G: [1 X - (image_clean_variables)* @- |+ h3 h. p
- (setq pt1 (getpoint (list x1 y1 z1) "\nNew Insertion Point: "))
0 e" K: K. h, @6 L - (ver_pt1 0)0 s5 p& ~' p; a/ @4 F
- (ddimage)% E; m/ d3 Z8 A& n* x m5 {8 F
- )4 {) V( p# B" J2 @4 w% Y% t! p
- )
7 D& T9 G+ Z% [6 f - (if (= dialog-state 4)
% }7 k4 j; @( }; {% q2 | - (progn
4 Z' o$ g) r% \9 \) X# Z; L$ W - (modify_image)
- r! U: I1 B4 K& ?$ S - (image_adjust ename)
1 b; ^+ U$ ]0 ^/ T/ g# R6 O - (setq elist (entget ename))
+ w1 O/ ?) T- k3 c6 { J( h - (ddimage). I' l1 E! W! g
- )
/ `* O. l, z- l) i/ u - )
9 Z5 @9 T, b% u* w - )
1 {, X' S2 M! M) R* g - 6 f. T/ B) ]9 {1 @/ p6 J2 c( q
- ;;3 F1 F7 u* b- }5 V
- ;; Modify BLOCK (and its Attributes, if any)
& {" e( z/ |4 O - ;;
' ^+ Z7 R) v$ d7 e/ c: v6 L9 M - (defun modify_block ( / el en2 p1 p2 oldp1 oldp2 new_hgt old_hgt attr
& w4 H, F, f/ f* F D0 A0 U - new_wid old_wid old_rot scaling old_scale' ]& Y& j8 T& Q+ V- M) i( K
- xdelta ydelta zdelta xbase ybase zbase ipos)
: E- N. R4 G; p2 ~: e5 W* I - (modify_properties)
4 J/ G$ i( v9 j# {( R
+ w3 F' A8 J! l- ;; First, translate and scale the Attributes, if there are any.
/ M6 |1 p2 k# P - (setq old_rot (cdr (assoc 50 elist))
* _+ |5 {; x0 i) B3 l' I$ V! N - old_scale (list (cdr (assoc 41 elist))
, K; ^$ w! u* n2 X# e - (cdr (assoc 42 elist))4 |/ D' M9 }! s0 @! e/ K" N
- (cdr (assoc 43 elist))
) x/ W, o; }) j! Z0 a* s - )
. f) y+ l/ K7 L1 o' f, R. j - scaling (or (/= xscale (car old_scale))6 n' O( `6 g& Z
- (/= yscale (cadr old_scale))+ s: A4 V8 }& M$ Z
- (/= zscale (caddr old_scale))2 l- ~$ e/ {4 D, W; Y
- )
3 T# l1 k8 A( G9 u' b' E; z4 ? - attr nil ; No Attributes modified yet" u2 R: W/ V- O
- )
$ T' S; e8 m" O4 i0 f - (if scaling
4 l# _ Y. `$ V - (progn. B* F2 y$ V2 S8 d
- (setq xdelta (/ xscale (car old_scale))
Z7 s- u# C2 c! T4 O+ G! K4 ] - ydelta (/ yscale (cadr old_scale))
3 u" e9 G, L0 H - zdelta (/ zscale (caddr old_scale))( p% I! K, f8 V. P" @5 M2 F+ b1 A
- ipos (cdr (assoc 10 elist))8 U4 {- M! E c& G
- xbase (car ipos)
! h! P6 S1 C X) C/ r - ybase (cadr ipos)6 k$ a3 J' ~2 K; X l% [, G, O
- zbase (caddr ipos)& G& [8 u4 E5 y0 V) d0 }
- en2 (entnext ename) ; First Attribute, f; g" W: g2 h
- )2 D, M% E4 n; z' N6 h" d
7 E% w7 k% P: C: x0 ?9 ^- ; If the Block is rotated, temporarily un-rotate it, along
! ?, M# A1 P4 C8 C. o - ; with all its Attributes, so the scaling/translation of the
* i% P( Q y; j - ; Attributes won't have to take the Block rotation into account.6 ^+ V$ A. ^; h7 c. Z* ~' l
- (if (/= old_rot 0.0)
( F4 ?2 j5 ^; A! L& z' I* v - (progn( O3 j/ q: B: j4 V, j$ `
- (command "_rotate" ename "" pt1 (ai_angtos (- old_rot)))
5 L* U/ s# E. z0 D( M - (setq old_rot 0.0$ A" _+ s0 Z, N8 z8 V w; g
- elist (subst (cons 50 0.0) (assoc 50 elist) elist)8 X! ]8 F# A# K& B1 Q* l
- )
9 t' F6 z/ q ?1 b4 g - )% J4 N/ {/ r1 [! R
- )
" t+ c8 g* ]" S6 x6 E" ] - $ c1 A, R6 d* G1 S
- (while en23 T9 }3 {! u% V; H8 [2 T
- (setq el (entget en2))
. w1 M1 m4 ^8 ?$ b - (if (= (cdr (assoc 0 el)) "ATTRIB")" p: k: n# T: E Z$ a6 o4 L1 ]
- (progn% R2 H3 ~. s0 _0 o4 J! n3 [" z- ?
- (setq old_hgt (cdr (assoc 40 el)) ; Height
2 H8 O4 g7 W' s7 g7 Y! g - old_wid (cdr (assoc 41 el)) ; Width-factor) z0 d7 O% u0 w$ z5 ]
- oldp1 (cdr (assoc 10 el)) ; Generation start point& E7 f _0 ~/ c" E, u
- oldp2 (cdr (assoc 11 el)) ; Optional alignment pt: b5 h2 |- P. i8 S0 S
- ha (cdr (assoc 72 el)) ; Horizontal alignment- Z8 f: z9 Q) `9 r2 ]3 [
- va (cdr (assoc 74 el)) ; Vertical alignment" \+ Q* T2 V8 E8 @, f* o/ p7 z! h
! [9 D$ t( e6 o" F, {2 X1 B5 p- ; Translate gen. start point
8 A1 Z4 ^# m! q3 @ - p1 (list (+ xbase (* xdelta (- (car oldp1) xbase)))
* D& a& b4 Z$ } - (+ ybase (* ydelta (- (cadr oldp1) ybase)))9 }4 c$ O* t' a5 a: l
- (+ zbase (* zdelta (- (caddr oldp1) zbase)))# @3 J4 I5 d+ c
- )( G' f% j) A7 z: {
- el (subst (cons 10 p1) (assoc 10 el) el)# D' P8 }. W; _" \% b
- )7 M7 i+ m4 Z; i! M o
, X. {8 `8 E1 w2 t- @2 {- ; Translate alignment pt similarly, if present and applicable
- e; q: |& i5 v0 b5 G - (if (and oldp2 (or (/= ha 0)! X7 `/ P3 _+ n6 Y" ]5 D
- (/= va 0)8 h7 Q7 J5 a9 T5 f
- )
) n* ]0 _" ]; E9 ` - )) v8 ], m% L# j" r$ H9 `
- (setq p2 (list (+ xbase (* xdelta (- (car oldp2) xbase))): H, T7 c% U5 [$ a! v% ]! r
- (+ ybase (* ydelta (- (cadr oldp2) ybase))): T5 K3 [$ x5 v8 v) \
- (+ zbase (* zdelta (- (caddr oldp2) zbase)))% M) e" q8 L1 I0 E
- ), |/ P& U& t7 P6 U, o M
- el (subst (cons 11 p2) (assoc 11 el) el)' g2 G( Z {0 U0 V3 }8 D
- )
5 A) J7 {; N0 \$ W; I+ F: | - )# J: M; @! C3 N# W- }) M6 _0 J
- / ?0 ?& I) b3 c# Q$ V* n
- ; Each Attribute's height and width-factor were computed" j0 u( h5 L( {& d% d" W
- ; based on the Block's scale factors. Adjust them now,
* c% b' d p+ G3 J% L4 Y' k - ; by first reducing to values for 1x1 scale...
& A% w; w7 U) X - (setq new_hgt (/ old_hgt (cadr old_scale))% d2 w; E [' T* ^2 K# P
- new_wid (/ old_wid (/ (car old_scale) (cadr old_scale)))" [0 H% [2 T2 Z/ p7 K# P2 q0 Z
- )
7 g X+ n- |# n# A - ; ...and then rescaling.
! [, i# @/ {- Z/ M+ E. S - (setq new_hgt (* new_hgt yscale)
. j9 u6 W1 K+ w' v: O - new_wid (* new_wid (/ xscale yscale))8 e* F* Y1 W7 H
- ), }3 B2 Q2 S3 i1 H# k6 S
- (if (/= new_hgt old_hgt)& Z8 w. K' W9 y: R9 Q$ Z
- (setq el (subst (cons 40 new_hgt) (assoc 40 el) el))
9 o7 R) v& G6 z1 K - )
$ h* d7 f5 N3 [ - (if (/= new_wid old_wid)- y; G0 J2 @8 _2 i
- (setq el (subst (cons 41 new_wid) (assoc 41 el) el))
6 }2 v# `: U% I3 B - )) G6 X3 ^4 N( h5 i( U
- (entmod el)! u/ F5 ~; K( Z% J% U2 e% ?1 H
- (setq attr T ; At least one Attribute modified
: p7 j4 O) {% g$ \3 U - en2 (entnext en2) ; Next Attribute, y7 q+ V a' I+ } |2 p
- )0 Z8 A* ], K/ ]
- )
7 @; r. r' G. u6 ~. b: [ - (setq en2 nil) ; No more attributes' v7 M% \6 F- x' V0 |2 O
- )
1 e9 z3 q) k# X4 ^& @+ ? - )6 q& U1 |- w5 M9 B D1 v$ P
- ), z k! X. O; z `# \, N' d; h% x1 \
- )
: F0 a4 m$ N9 r+ m [" W ~$ d - # X/ ]" ~, C) j& p# Q
- (setq pt1 (list x1 y1 z1))
- R# o; `% t$ r/ p( D' x3 { - (tempmod xscale 41 nil)
" e3 `: @, @' X `% S9 p5 R! G - (tempmod yscale 42 nil)- A, Z9 l. o3 u7 k
- (tempmod zscale 43 nil)
( d7 H( G5 T) Q - (tempmod col-sp 44 nil)
0 k; x9 \. g7 [- b* w - (tempmod row-sp 45 nil); n7 v% Z% q. N, J
- (tempmod columns 70 nil)
6 L* |* A6 R% t4 h4 w - (tempmod rows 71 nil)( e/ ?$ \9 Q$ W+ `
- (if (= xclipmode nil)6 ?& Y$ ~6 m, C& K8 c4 Y a
- (entmod elist) J! U5 [# r# E
- (setq xclipmode nil)* q* ?3 L* A4 P& n# V8 P# V
- ); U. S7 M; P% W9 d: P
- (move_pt1 1)
0 c; }& w7 r9 |" H& g - 3 u. \7 e4 R$ I% \. G
- ;; Now do the rotation with the ROTATE command.9 g H6 i* T) B7 X3 w7 S6 X
- (if (/= old_rot rot)
# M/ k) k( O) R) L - (command "_rotate" ename "" pt1 (ai_angtos (- rot old_rot)))% C P( a9 j. S1 W5 b( ]) C6 U1 K
- (if attr ; Else, if attributes were modified,& I" N. H" c6 O2 P; {2 A
- (entupd ename) ; just regen to force attrib display) ?! O5 o G1 {" C% N. I* E2 k
- )
, x: Q' s3 ?, t8 y1 m2 d - )( f: u. B9 R3 D1 T- E
- (setq elist (entget ename))3 s( w1 |) q, k8 x% p( Z8 C
- )
3 p5 O8 G8 R" }6 |/ y - (defun ddblock (/ temp temp_xclip newhatch blkname blklist blktype program xrefpath)
! {5 L% I' u6 P) [ - (setq newhatch 0)# H( d. t, K0 c- w7 W
- (setq blkname (cdr (assoc 2 elist)))% T* \9 ]1 c! p4 A8 y
- (setq blklist (tblsearch "block" blkname))
8 Z& x. C( |4 [& k# d1 h" L - (setq blktype (cdr (assoc 70 blklist))). A6 g! V0 u' j; F" P
- (setq xcliponoff 0)9 Q% E+ ?1 o0 r
- (if (or (= blktype 0)(= blktype 36))* y0 q- U* D: J8 H
- (progn/ k$ h1 d8 c+ |; O
- (setq xcliponoff (xclipon elist))
1 @% U9 G2 I1 c; s2 A - (setq temp_xclip xcliponoff); _- o& \8 T, g3 s# i4 }# Q
- )7 {6 c0 L5 @* o" F
- )
* I$ C( t4 g$ X4 h - (if (= (logand blktype 4) 4)/ Q" g! V. y- l8 Y
- (progn
$ G0 Y: y2 l) @& T' S' h0 Y - (setq xrefpath (cdr (assoc 1 blklist)))
5 l8 U: d6 _- u: x - (setq help_entry "modify_External_Reference_dialog")1 n5 M, a0 i+ f2 G
- (if (not (new_dialog "ddxref" dcl_id)) (exit)) L( l Y6 w" n
- (set_tile "Bl_name" blkname)( b- S8 a- K J: q% j* L
- (set_tile "path" xrefpath)9 m1 w; q' s% m. h* ]
- )
S" z+ P: A: r( a E1 W - (progn; T8 g* z9 A, h3 y. f T/ h+ K7 _
- ;; Get program name for use as Xdata app name3 G8 W' ?/ I$ g0 b0 k
- (if (not (setq program (getvar "program")))
/ G6 S+ ^, M- |' E/ r2 A4 f8 l. | - (setq program "acad")
4 d4 L6 ~4 x6 N O. ]- T- T - )
! r: I8 ]' b. w9 T$ U - (if (and (setq temp (assoc -3 (entget ename (list program))))
2 `* T. L2 S# B - (= (cdr (assoc 1000 (cdadr temp))) "HATCH")
8 `9 _& G; D3 }8 R) o- X4 L - (assoc 1005 (cdadr temp))
6 H! v& h* m, x q; o6 W - )
9 o) [' V: I& \) y9 q1 D' @ - (progn: Y5 E3 r: `; h# ^# Z/ |
- (setq newhatch 1)- O: C$ m' A/ {" P2 i4 Y
- (setq help_entry "modify_Hatch_dialog")
# ?! T& N& G& w0 t. y - ;;; convert the object into a new hatch E K g& k F% l5 I/ N' I
- (ai_undo_on) ;; enable undo" G, n$ e5 O3 r
- (COMMAND "_.UNDO" "_Mark")
. x' z8 o# Y! r - (COMMAND "_.CONVERT" "_Hatch" "_Select" (cdr (assoc -1 elist)) ""): m) R! \5 _; X7 U2 I; t2 {
- ;;; suppress nasty message from convert command$ K. m& M/ T+ Y% I5 u
- (princ "\r \r")
$ w$ c6 S8 L5 i$ e: f; y: A: t - (setq elist (entget (setq ename (cdr (assoc -1 elist)))))5 ~* q4 [/ h1 T
- (setq old-elist elist)4 ?) O) w; t$ R/ ?* l/ ]% {
- ;;; If we have cancelled ddmodify5 k0 S: v7 Y' U' Q( [! Q
- (if (not (ddnewhatch)) ;;; (ddnewhatch) returns nil for Cancel or T for Ok
9 f, `: p( I. S3 [1 }1 @7 w8 s - (command "_.UNDO" "_Back")
: c9 {( ]& D ^* Y) i+ B. M, O$ i - ): g+ s8 S8 R! ]
- (ai_undo_off) ;; restore undo state1 F8 K2 p+ Q' l8 w
- )$ a( i$ s- s, \# T" W' [3 ~
- (progn& b) ^# i& H3 F2 r8 s( X
- (if (not (new_dialog "ddblock" dcl_id)) (exit))
( @6 I3 P3 x' G3 ? - (if ( = "*" (substr blkname 1 1))
* n( o7 j5 Q I/ y& |( x ` - (set_tile "Bl_name" (strcat blkname " - Anonymous block"))
+ w) l. g: [6 d9 B/ F, j& B% ] - (set_tile "Bl_name" blkname)7 A+ {0 a. U2 m3 f/ P7 A
- )
) Z/ G% E. b6 _" N$ j7 L - (setq help_entry "modify_Block_Insertion_dialog")
5 M' I9 T/ P/ a+ h1 P - )# n9 K" J* `+ Q8 u
- )
& H1 o9 W, S" n" p$ ^! Q- I2 q( a - )
' x/ \9 j* ]0 _" ]% t! J( y - )" B L8 {' k& p
- (if (= newhatch 0)
& {7 k) X; v4 |# v - (progn$ X" n" W$ C" F- \$ Q- c
- (set_tile_props)) r# }- ]- }; U' Q
- (set_tile_handle)) E2 k, J( e* [2 ~3 g, Z$ h
- (set_tile_pt1 1)+ ?0 D" d5 K5 \/ J- V6 [
- (set_tile_rot)
- C8 ^7 C- b3 t3 T - (set_tile_scale)
- } b0 Z7 L, s8 L4 o - (set_tile_rc)7 [6 x' c F( i, R
- (if (= (logand blktype 1) 1)
9 x6 ]0 D8 V% x+ r: a7 K - (progn
: e) i4 Z# A/ | - (mode_tile "xscale" 1)
2 l9 [4 p3 e# H5 E6 k5 \/ Q - (mode_tile "yscale" 1), R. l4 L3 D( E9 r) \) r
- (mode_tile "zscale" 1)
. w5 e/ }' n0 V$ u5 i - (mode_tile "rot" 1)* y& D) ]$ _5 @2 p$ |6 ^
- (mode_tile "columns" 1); n% t1 v8 I S5 c1 V
- (mode_tile "rows" 1)
8 T1 u+ N& |$ B" B' R - (mode_tile "col_sp" 1)
, y4 Y9 q2 Z& A v) I" E Q8 D: h - (mode_tile "row_sp" 1) P: h/ O* [3 {( ]6 @/ D1 m% f9 z
- )
2 m# |5 B# P! G5 { r) T: E2 C - )9 B+ v9 b- A( ^' [% P5 G
- ;; Define action for tiles
2 g( W4 v( q3 g p - (set_action_tiles)8 z" G9 _% E' J& E8 [6 D8 P* C: X
- (setq dialog-state (start_dialog))% h- G k% ^8 A0 \; F; n; G2 |
- (cond
. \% t0 u: ?; Q$ R2 T g - ( (eq dialog-state 0)5 X9 Q! ]- a9 t" y$ n
- (setq pt1 (trans (cdr (assoc 10 old-elist)) ename 1))
9 B0 T; a. T/ A6 O4 w. k1 `& E! G, d - (move_pt1 1)7 \" {- Q8 G( i! W, z
- (reset))0 ^7 a$ ?0 o8 q) N1 c5 D
- ( (eq dialog-state 1)0 w/ O1 w9 H: r( h' p
- (if (and (/= temp_xclip xcliponoff) (or (= blktype 0)(= blktype 36)))9 J& X5 k9 O1 y( B$ N6 m% B9 b! k
- (xclip)
8 V4 r4 H/ m+ P1 \1 \ - )4 V: y$ |2 C# L) t4 V& O
- (modify_block))
" E* R) U; c) |3 M2 d1 X - ( (eq dialog-state 3)
^8 X: w2 b7 Z1 B* A - (modify_block)8 y9 ]& m7 O* X
- (setq pt1 (getpoint (list x1 y1 z1) "\nInsertion point: "))! S/ J$ ^/ l) G8 i3 h
- (move_pt1 1)
0 |, x5 T) U, j; Z1 B& S: f - (ddblock))! o* \5 V, Z3 n; E7 T( F
- ( (eq dialog-state 4)) O% k$ b8 a( g% r( ^1 E5 E) n. N
- (modify_block)
9 @2 W9 Y2 \+ M+ M% Z - ;; Get current handle.5 J: N" @2 [! U3 T
- (setq hand (cdr (assoc 5 elist)))
5 t# z1 E2 s- g: C- e - (command "_hatchedit" ename)
; |. V1 v( r: j - ;; If OK in hatchedit, a *new* entity is created and the old one/ e5 H5 `" f5 ~6 i) n& d, p
- ;; is deleted. So if the old one exists, it must have been a" `0 L9 Y+ C( M- k6 ^/ \" A1 D
- ;; so rest the entity.
! q+ r9 v$ h7 j" m; H - (if (entget (handent hand)) (reset))
( M6 z( l- b; Q/ D* t; q - )1 Q+ |6 m) d+ [5 f; F9 s* M7 m
- )
& ^! C6 `# c5 P" P- N+ c - )
2 x& \" L- E9 Q& X7 t2 z - )1 B4 I7 s# V; b4 _0 I7 z7 D
- )' ~, E3 y" q- C9 K6 V5 G7 |
- ;;9 }8 l( m- F$ K+ v; w' |* H
- ;; Modify SHAPE7 g- y- K* ~2 y' e" y) A6 T$ k! j
- ;;
: ?5 x. y$ I0 d, a. j5 O - (defun modify_shape ()
6 ]2 e. K5 J% M - (modify_properties)! P) F! h. g0 a" I' U7 l* q: ]8 v
- (setq pt1 (list x1 y1 z1)); X; A ^( W5 r4 R: o1 Y5 Z
- (tempmod pt1 10 1)4 H( Y/ N) P' W
- (tempmod hght 40 nil)
0 {4 }* y3 J8 U1 x: o) {% D1 C - (tempmod wid 41 nil)
! L& Y% [6 K. D U+ t - (tempmod rot 50 nil)5 N; s( d0 Z# ?+ S6 b8 C& _' Y
- (tempmod obl 51 nil)
+ s; U8 e+ i6 J4 R4 a - (entmod elist)
+ D! w4 f+ b- f9 p - )+ a( w0 B5 \ b7 h' Z! q
- ' a- ?, v! d4 V+ A w& B
- (defun ddshape (). f9 k6 r+ O6 @2 ~8 |
- (if (not (new_dialog "ddshape" dcl_id)) (exit))
- T5 @! T) s' p( k* G - (set_tile_props)% L1 m4 Z) d% v
- (set_tile_handle)
) k8 P2 b, E; {* V+ f9 K - (set_tile_pt1 1)* n8 l5 L; C* L
- (set_tile_rot)
& {1 ^ ~. M9 Z - (set_tile_hght)
+ D+ c( x+ h; k% _/ U% X8 \ - (set_tile_wid)1 a. h/ E) s5 e4 U
- (set_tile_obl)
) ~, h6 t% n: K* O - (set_tile "sh_name" (cdr (assoc 2 elist)))
* V+ } ~; @! M; H( } - ;; Define action for tiles) J( Y; D) `6 T8 _# Z
- (set_action_tiles)" g" _8 b4 a2 n: A2 f' D. P
- (setq dialog-state (start_dialog))- U1 P" f7 @9 A3 N/ f8 k# J
- (if (= dialog-state 0)
* Y5 @" @- E l ?5 w - (reset)+ A6 ^& @5 {3 P( j% l
- )
5 t% z/ E, y4 ?1 V - (if (= dialog-state 1) ^4 R. g" Y1 N0 I$ y% y, I
- (modify_shape)/ ~( g# A6 u- I$ G' S% X& Z! L
- ) l# p. r4 ^+ O" h
- (if (= dialog-state 3)
& H/ G4 i/ g$ J) z. u5 r - (progn
) ? ?1 `# Z9 U Y" y8 X* Y9 i - (modify_shape)
. D7 f3 b6 E5 g4 a - (setq pt1 (getpoint (list x1 y1 z1) "\nInsertion point: ")) p1 m1 f3 ^; [$ S( j) N F
- (ver_pt1 1)9 A' S! P4 A! w6 \' K
- (ddshape)( L7 F& i" G0 o! S0 r
- )8 D, @. l$ x, H
- ). t: ]" l# R V) p3 j1 A% f
- )
! m7 ~/ {: i+ E- _ - ;;9 u8 w3 R8 q. z
- ;; Modify TEXT or ATTDEF
4 M3 \2 T/ k' y - ;;
1 b/ d! H+ @' d" c, V - ;; Set bit code for upside-down and backwards setting
. o1 n4 f7 | ]1 P- t" ~4 z/ i3 G - ;;" t. M: x6 \9 ^- F* H! I+ t
- (defun code_71 ()
, o' v% V; }. X! l; R - (cond ((and (= bkwd "0") (= upsd "0")) 0)
9 @& j6 j) k( b/ k& ] - ((and (= bkwd "1") (= upsd "0")) 2); s6 E! y( [8 u' d/ D3 q" x
- ((and (= bkwd "0") (= upsd "1")) 4); _0 `" L! \+ @+ i, @* I
- ((and (= bkwd "1") (= upsd "1")) 6)7 }5 o2 \# `+ b3 Q1 Q+ ?7 {2 p: a
- )
$ L% n# y, H* v8 G8 {# M - )
( c: v# Q8 J4 P - ;;
$ S% |* b6 {. p% ~! l - ;; Style action. Reset widget values to style defaults
0 j8 X0 g6 Y+ o - ;;
: m, W- m" s, E; _; k/ o - (defun style_act (index / style-list)
& t* B" z% [ n: _ - (setq style-idx (atoi index))
# m2 W2 H4 d8 c+ v9 G - (setq tstyle (nth style-idx slist))1 B/ K( f' v# F& }: E
- (setq style-idx (itoa style-idx))4 m8 M$ A4 b8 \2 y7 f* N
- (set_tile "style" style-idx)7 W7 Q8 I {( e/ f5 S( S" g
- (setq style-list (tblsearch "style" tstyle))) M4 [6 |$ ]* r7 }. B
- (setq shght (cdr (assoc 40 style-list)))
' h1 f. z! U! t$ b - (if (/= shght 0)( i% S! o6 k, p) F
- (progn
/ K6 ^( R' r/ ?" R - (setq hght shght) A/ O& G; y: U( ?0 z* L0 _5 s) v5 p
- (set_tile "hght" (ai_rtos hght)) l, t7 a$ U5 f
- )
+ k: T3 u2 e8 \/ x, L% y7 V7 h' g - )
. c" D; P% w0 V+ ` - (setq wid (cdr (assoc 41 style-list)))! A* t, p% m1 z& x- g1 i$ w* `3 i/ P
- (set_tile "wid" (ai_rtos wid))# I( T6 S9 T* P; r2 R3 j; i8 H
- (setq obl (cdr (assoc 50 style-list)))
& u% R" F- q. Y! f% P! u$ x! V - (set_tile "obl" (ai_angtos obl))# G+ B- G; f0 R W# O8 I3 a$ f4 c
- (setq bk-up (cdr (assoc 71 style-list)))
0 Z l- p! i# ?3 \! _) F! a8 E - (if (= (logand bk-up 2) 2)
1 u! ^0 J5 N4 J7 D6 N9 V - (set_tile "bkwd" (itoa (setq bkwd 1)))
7 R. X/ h7 R! @ i- w; ] - (set_tile "bkwd" (itoa (setq bkwd 0)))7 k% Y, i8 K, y: G$ s
- )- z6 |6 q8 j# z' i w/ ?4 A) [
- (if (= (logand bk-up 4) 4)
I- u7 [) U! X' k/ t - (set_tile "upsd" (itoa (setq upsd 1)))
9 u2 J) N5 p0 F# ~% Z$ C8 C - (set_tile "upsd" (itoa (setq upsd 0)))
5 j) Y; P# ^. a! J' z/ F2 \ - )) a2 o3 ^! C, w$ u
- )6 T* a. L7 R- Z1 b
- ;;
! ^1 @7 J5 l [1 x& C - ;; Justification action. Set vertical and horizontal alignment variables, ~( y0 o1 E; y& ^' ~ m
- ;; grey out rotation and height if alignment = "aligned", grey out rotation1 s& s( V! u s9 h$ V" B
- ;; if alignment = "fit". z& w- E0 P. B
- ;;: {4 i% z# W4 I! p
- (defun jlist_act (index / templist)2 u! Q+ C6 Y$ z: X6 v' \4 c
- (setq just-idx (atoi index))6 o5 F: X8 \* }& B- S" o. r
- (cond9 f# |( e' [. ~1 C" j, y% s
- ((= just-idx 0) (setq va 0 ha 0))& {$ ]$ Q6 y7 c0 @
- ((= just-idx 1) (setq va 0 ha 1))" j( f4 U. W8 G6 j* [+ ?. k6 g
- ((= just-idx 2) (setq va 0 ha 2))
9 ]2 ]* z, V/ u# q# s' F - ((= just-idx 3) (setq va 0 ha 3))6 @8 g6 i9 @8 t) e8 F" i$ y9 c
- ((= just-idx 4) (setq va 0 ha 4))+ u& J2 }/ u& L0 \! }; |+ C
- ((= just-idx 5) (setq va 0 ha 5))
4 E) T6 T2 ]5 \; L) f - ((= just-idx 6) (setq va 3 ha 0))% k3 a) B+ P. j
- ((= just-idx 7) (setq va 3 ha 1))
o4 s* v" F0 @! d$ ~ - ((= just-idx 8) (setq va 3 ha 2))9 Z9 l- P2 Y6 f* F# I7 N4 W: J4 w, }
- ((= just-idx 9) (setq va 2 ha 0))
+ Y/ q& j- a9 I1 o% o - ((= just-idx 10) (setq va 2 ha 1))/ F+ G. H8 o8 A
- ((= just-idx 11) (setq va 2 ha 2))" B! P7 E1 I. {( x( ]5 F
- ((= just-idx 12) (setq va 1 ha 0))* M( t: {0 k5 {$ n( ~/ L
- ((= just-idx 13) (setq va 1 ha 1))
! \# v1 J4 I* j8 ~1 } - ((= just-idx 14) (setq va 1 ha 2))! P9 f2 u4 p1 b) @: S" }6 Y# j
- )
- t* n* n$ Z* w- ^/ Z4 g - (if (or (= ha 3) (= ha 5)) ; If Aligned or Fit text3 v6 H4 r5 F9 y, B# ]. d
- (mode_tile "rot" 1)7 b. |0 t! y, c9 }4 r8 s. u
- (mode_tile "rot" 0)7 D% b* p% @; ]0 r! e7 r
- )
3 V3 ?1 l$ h; j! O - (if (= ha 3) ; If Aligned text* S7 w" e' Z' @" _6 R
- (mode_tile "hght" 1): O7 f; l6 L( ^7 V& p- h* i
- (mode_tile "hght" 0)- t$ i5 y( Q0 `7 L- [3 ?
- )# j: w0 b6 M# Z& {0 |
- (if (= ha 5) ; If Fit text. F; m' K) D8 c8 W; S
- (mode_tile "wid" 1); G+ C1 g: f+ K6 S2 u3 o
- (mode_tile "wid" 0)7 f; i9 |8 e# j {6 `$ u6 Z
- )
, Q& m. J1 y# X* A6 h - ;; Reset rotation and height if changing from aligned.
+ R: p6 X* a, T5 K' n4 M! B+ O - (if (and (= ha-prev 3) (/= ha 3))
4 f& E2 d, L6 {. x0 o. U; } - (progn# J2 @( i6 l* Z! X x
- (set_tile "rot" (ai_angtos (setq rot 0.0)))
}! Q# K: V) s( o/ J4 d - (set_tile "hght" (ai_rtos (setq hght 1.0)))
9 `2 I: e( I) O' S1 ]" R' ] - )
) [& v9 E0 t& }0 F C - )
7 _4 H$ t4 Z0 M( B/ I m. J - $ ~8 H8 R0 R: G% m' P3 {
- ;; Reset rotation and width if changing from fit.! ?: {% b, r1 s# X
- (if (and (= ha-prev 5) (/= ha 5))3 L# \4 ?/ G7 v& B7 z. e
- (progn
$ n q9 {: `4 C3 q/ E+ I/ B - (set_tile "rot" (ai_angtos (setq rot 0.0)))5 O& @' U2 Z) s
- (set_tile "wid" (ai_rtos (setq wid 1.0)))
# I% A* j4 i+ C& u; U0 ` - )/ g- }* ?; u5 Q+ g" L Q
- )
% V4 [; a' V# _0 ~+ Y - , o& E: d% r! l2 b0 h- R, L) v
- (setq ha-prev ha) ; update ha-prev for next time* E5 X- |* }2 Y6 O% Q
- (setq just-idx (itoa just-idx))
) W: p$ i; W: |+ ~+ k - )
0 ^$ e; S6 a3 u7 g7 H - ;;. }8 A( U* l# o+ f
- ;; Set intitial alignment setting based on vertical and horizontal alignment7 q9 k% }6 o# O" G6 F l- t
- ;; bit codes.+ H3 B4 Z1 v5 r* S3 q9 d
- ;;
3 G0 o' f! _% m - (defun set_just_idx ()- C8 v7 H( Y( x/ \8 g1 A1 @2 t E' j3 y
- (cond0 t8 i- w. H, J! T! f! E
- ((= ha 0) ; Horiz alignment = Left2 b. A" q8 u5 \) A" }8 F' Z/ R
- (cond7 {1 e7 t, G1 d5 m% l
- ((= va 0) (setq just-idx "0"))
' I0 s! T- ?+ M9 W - ((= va 1) (setq just-idx "12"))- @) J* U3 V2 L4 x/ v! ^. [5 M
- ((= va 2) (setq just-idx "9"))
1 w: `8 w4 \+ v0 A/ L! M% h - ((= va 3) (setq just-idx "6"))
& Y* g- R" X4 b3 z9 X( R7 w, { - ) ^0 w0 I. E% Y9 a$ v
- )
: g( x& Q0 g8 l - ((= ha 1) ; Horiz alignment = Center% Z; T; ?( \* z6 F6 G
- (cond' P( D0 l/ d* w# W- R2 V" W
- ((= va 0) (setq just-idx "1"))% F1 i% ^& p% w% H: E
- ((= va 1) (setq just-idx "13"))
' u& s% U( l& C - ((= va 2) (setq just-idx "10"))7 R6 `/ X% C8 v! d
- ((= va 3) (setq just-idx "7"))6 w/ H" L1 t* n, y8 |! F# N1 v# N: E
- )7 O; Z+ A$ f" e; _6 ~# F C
- )
; Y% P! e; G5 f; d9 W) e - ((= ha 2) ; Horiz alignment = Right
: W6 d: Z6 e( |! x - (cond
3 H. G. y2 b v( F5 k2 I' g - ((= va 0) (setq just-idx "2"))
! @/ w; M/ {5 r! A2 M' M, B6 u - ((= va 1) (setq just-idx "14"))
. h# ^1 z2 @6 h8 c& P% }; i - ((= va 2) (setq just-idx "11"))5 Z$ p/ J S8 {& d' G W
- ((= va 3) (setq just-idx "8"))
! _0 m! y( V) t6 @: @8 u5 I8 C - )
! Z, d* R2 w9 N$ y/ z: _ - )
( \$ a' }( e: i) S4 e! Q) `4 E - ((= ha 3) (setq just-idx "3")) ; Aligned
C+ R, S5 h, U - ((= ha 4) (setq just-idx "4")) ; Middle
$ Z/ g! Y& \3 L p7 t C - ((= ha 5) (setq just-idx "5")) ; Fit) ?' r+ W$ ^ K9 q; g" [# {
- (T (setq just-idx "0"))# Z+ ?! ~. y! ^' C0 B, K
- )
( m8 S0 V- ~+ g0 |/ p - just-idx1 b1 l. [' Q3 G) _
- ): |( O2 m9 c! O2 b
- 1 V; @1 a6 ~# Y$ D
- (defun modify_text ()! i$ R+ l3 ^; a! X% k
- ;; insertion point' c! |! f6 l5 _6 @) l
- (setq showpt (list x1 y1 z1))1 B& w' e9 o7 P2 h& G5 w
- (setq bit-10 (trans showpt 1 ename))
0 a6 w# b J# @5 w# v4 a& ^ - ;; alignment point: l9 W, {6 B6 K$ p) D! H
- ;; for 'Aligned' or 'Fit', alignment point must be different4 }& G1 k# [; X* Q
- ;; for all others, use insertion point
" g/ A6 s Y- o/ X - ;; (ACAD will recompute insertion point)
- F1 ^3 }# R+ s: c - (if (or (= ha 3) (= ha 5))
5 W- |8 J3 l+ r% F3 j& t& q - (progn
! A# T7 `2 r5 J% I) Q; J, o) @0 i2 ] - ;; if no alignment point, fabricate one; C5 ?. f- U/ `. }6 k, f
- (if (not alipt)
: \ `% q7 @( I, o6 Y* y$ u; @ K" O& } - ;; add text width to insertion point
: T4 Q1 y) [! n, T ~ - (setq alipt3 \: ?5 u- [+ `
- (list (+ (car showpt) (car (cadr (textbox elist))))
$ _1 d; E: ]$ x1 c5 @ - (cadr showpt)
n$ @8 L1 |; W. {9 F( _9 z - (caddr showpt)
5 A; M% i* C( N8 @+ G3 z - )0 G% }: n# _2 g( x1 _! z
- )% D' v" s) d# U/ Z* i* A& G
- )
o" e2 F2 d) ?- Y1 U1 o - (setq bit-11 (trans alipt 1 ename)) _6 |: k& k/ J
- )
& M2 |: {9 A. |) o: k" s4 _9 k - (setq bit-11 bit-10)
! s/ _5 \$ ~' I9 H - )
$ w6 M4 y* c+ Y p$ H! l' s - (modify_properties)
& N/ v' [+ T' b: B - (tempmod tstyle 7 nil)' W5 x9 H. V' \/ e# p# {& C6 l: \' \2 ?
- (tempmod bit-10 10 nil)% z1 Z& L7 O2 Q+ o
- (tempmod bit-11 11 nil): Y; k0 Z6 O( V4 w3 o0 g
- (tempmod text 1 nil)
1 c; Q1 D" G6 j% C% A/ t - (tempmod hght 40 nil)
6 W. X7 f) P4 v- @1 b V, i0 P* L - (tempmod wid 41 nil)
5 O# {) W# @; G4 l9 m. d8 m - (tempmod rot 50 nil)& E' e: Z& y2 `' Z. d+ C7 E r
- (tempmod obl 51 nil)
$ m+ q _5 _1 c& {/ D: ]& ?/ U - (setq bk-up (+ (* bkwd 2) (* upsd 4))), g# U: b* ?; [" e9 m: E0 F
- (tempmod bk-up 71 nil)
) S+ c/ J; q" G& h# p4 _ - (tempmod ha 72 nil)! d& }: O1 H+ y2 k. [
- ;; Attdefs use 74, text 73+ M F( ]. p6 o
- (if (= etype "ATTDEF")
; A/ d |0 g( r# a7 K - (progn3 V" |+ |5 N6 ?+ Y5 m% P/ d0 @1 K
- (tempmod attag 2 nil)0 R, |: {; ?7 d; \1 f! q
- (tempmod atprompt 3 nil)0 Z9 @* S5 ` R% _8 o% m0 T
- (setq icvp (+ inv (* 2 con) (* 4 vfy) (* 8 pre))), y5 ^+ D& B& Q7 ^/ B4 d
- (tempmod icvp 70 nil)& n" o. _' j# y
- (tempmod va 74 nil)5 T ]0 X8 i2 B, W) x5 @
- ) O+ K+ g1 i. J/ C4 l! S
- (tempmod va 73 nil)9 G: y! X4 p! O% ?+ R0 a
- )! w/ C; m- A' a& l
- (entmod elist)+ Q: k6 v) V7 L j) s4 M
- ), |& x6 I A) E
- ; J& }" M! q6 f1 b9 |' E
- (defun ddtext (/ 2ndpt slist i)$ ^4 k5 f& A$ q: @' k4 `% h
- (if (= etype "TEXT")& ~3 w, Y/ H$ g4 }1 e
- (if (not (new_dialog "ddtext" dcl_id)) (exit)), a9 k+ N6 E. {: I' t9 k9 M
- (if (not (new_dialog "ddattdef" dcl_id)) (exit))
5 p/ _& y* m, T; H' ^0 R& W - )
+ p- {" Z2 \6 a8 i' A, P) F6 i - (set_tile_props)/ Z C* w/ D- s' C; {& w
- (set_tile_handle)
$ P: ~1 @1 i7 v& L, D8 k - (set_tile_text)4 m. @6 ~& T5 Z+ C1 Y0 Y
- (set_tile_tag)7 o) |; u( _! p8 b2 Q/ k
- (set_tile_prompt)5 u( E- X e* {, g% u% |* }# c
- (set_tile_hght)& T0 v! I1 d% d& K: A
- (set_tile_wid)
/ {! Y( X9 w9 t8 s - (set_tile_rot)
/ L! Y; @3 o* T) p+ o- r - (set_tile_obl)- q" ?0 j3 z7 t" R. X
- (set_tile_bk-up)
3 U; H i- @, f% \- Q/ E0 Y4 }3 t2 B - (set_tile_icvp)
9 g- y; d4 S+ H: O: k3 R - (set_tile_style)
0 |. h% l1 R2 _; \; [6 H - (set_tile_just): T4 |+ {9 H- f0 |
- (setq pt1 (trans (cdr (assoc 10 elist)) ename 1))
, U( j* X& n& S) P/ M4 R4 F* \ - (if (not (assoc 11 elist))
4 [6 E& [: q$ f - (progn (setq pt2 pt1)2 C3 V* q, O/ a3 U- l5 Y
- (setq elist (cons (cons '11 (cdr (assoc 10 elist))) elist ))0 @* y/ B; d- U7 `- x( r% N
- )
6 f j$ u! a! A* ` d - ;;(trans '(0.0 0.0 0.0) ename 1))
- T, e. C; K4 }4 ?2 _) ^ - (setq pt2 (trans (cdr (assoc 11 elist)) ename 1))2 }, |9 h+ x8 i! z* I' V- l
- )- N1 Z! U; g* v3 \( I
- (if (or (and (= ha 0) (= va 0))6 z8 u% j$ j/ }2 R: }2 J& e6 \
- (= ha 3)
1 X- l) ` w3 U/ i6 [# M* S+ `, j - (= ha 5)# }, M% ^3 U) F- _
- )
" b! w# i: _1 M# G7 A - (setq showpt pt1)
4 _; w3 j* C' r w% r# J$ ` - (setq showpt pt2)
: [7 F6 A7 Q6 F - )- s9 T5 I* i& i$ S* F$ y8 Y
- (if (or (= ha 3) (= ha 5))
% ^0 R/ A2 n9 I* c5 [1 ^6 M - (setq alipt pt2)
+ T6 y8 t9 M- q+ N, ~* S+ S - (setq alipt nil)
4 d. S1 k, X& U' {/ N - )2 z5 u9 W% z) v) k7 K' C4 D
- @: G* D" M3 v* n# ?- (set_tile "x1_pt" (ai_rtos (setq x1 (car showpt))))
; _$ Y" z4 |0 Q* { - (set_tile "y1_pt" (ai_rtos (setq y1 (cadr showpt))))
9 ]5 ^- {- I9 I* P - (set_tile "z1_pt" (ai_rtos (setq z1 (caddr showpt))))- f8 T5 m7 Y R( i0 j
3 |1 ?& B) K7 s9 `! I9 K/ e2 n- ;; Define action for tiles
. v3 d0 M' m' ^% M - (set_action_tiles)
" r" y d- i0 Y1 T9 v7 D* W - ;; Set focus initially to the text edit box.3 Z2 t! H/ j5 I$ h4 j
- (if (not i) (progn (mode_tile "t_string" 2)(setq i 1)))% V- q) T; v6 R
- (setq dialog-state (start_dialog))
$ _) P1 ?9 E. L* H - (if (= dialog-state 0), Q$ o H0 r6 f }$ d
- (reset)! D! J6 F8 G G3 k/ t5 t
- )
* J. h+ Z2 L# v9 s! j - (if (= dialog-state 1)$ U1 f0 \3 Z) q p; Z; {
- (modify_text): `' q3 I( c* Z) ?1 H6 ?# c
- )
: h1 G: Q1 F7 R" t' f/ ` - (if (= dialog-state 3)6 i7 H4 s) K+ L; _/ R/ N( u
- (progn
9 v6 T" p- {+ B) i2 @4 E! V - (modify_text)- D, y' r6 g* k+ o P* V/ B; z
- (if (or (= ha 3) (= ha 5))# l+ w& `5 ]6 K
- (progn
" S, y8 n) [: y) s" n8 J8 p - (setq showpt (getpoint (list x1 y1 z1) "\nFirst point: "))
) r U% E$ E/ T7 M - (if (not showpt)4 D7 Z }$ O% h; z' o/ s3 n
- (setq showpt (list x1 y1 z1))
$ c) R) c# [+ V& E( D3 r - )3 U3 x D6 \7 b
- (setq 2ndpt (getpoint showpt "\nSecond point: "))" h. B9 M# } P9 v$ A% G/ e' i
- (if 2ndpt
7 W8 |% d8 W+ U3 q" J$ N - (progn8 f2 \- E& A& [8 H6 o
- (setq alipt 2ndpt)
5 Q' x; x& h( x - (tempmod showpt 10 1)6 D, K! C8 \6 P9 w
- (tempmod alipt 11 1)+ K) M- I; H& B ]$ O1 p% J& x
- (entmod elist)
( j" X- H3 k. T1 \" P - )/ X- r; |! o7 P
- ); U% p3 _- h4 [8 ]2 |! U9 J. l0 Q
- (setq elist (entget ename))
1 w$ F" O# X+ d# j3 t0 o" p$ D - ) F( y! X8 K* {1 |
- (progn! A4 E- n" Y$ P/ F
- (setq showpt (getpoint (list x1 y1 z1) "\nInsertion point: "))
; K: F" F& f4 @0 E* } - (if showpt+ l$ r* G& q- @+ g: c/ P; V
- (progn
, H/ R& C9 ^& L+ a$ }+ l0 v7 N - (if (and (= ha 0) (= va 0))
7 J3 _; q3 K, d& w - (tempmod showpt 10 1)- o7 Y2 L9 \% ]" v0 f! a
- (tempmod showpt 11 1)
' D% V9 f8 d' F" t" _& e - ). c3 W( X/ n$ W7 l
- (entmod elist)
9 ]9 E' D$ J" e, E6 i: I. Y3 B - )# z* j+ q) u- M- Q
- (setq showpt (list x1 y1 z1))1 {* _/ T( x5 W/ [/ Z8 r
- )
0 p# l1 G" K" [, ?$ [. z - )/ n/ T5 L6 J# L* C
- )6 U0 J: r% K$ b5 O3 h# n
- (ddtext)
; Q! _3 j7 Y7 p. s5 j# ^ - )6 N: Q% t- H C# R$ x+ x) Q
- )
3 t' x* c% j6 z' X/ B; A' ^1 P - ): V( h( z! P) d2 j5 q1 w
& m+ B9 U* c7 `: v p5 J+ n' W- ;;
# A3 _1 K4 w* j+ y4 h6 I+ g - ;; Modify MTEXT
9 t3 W4 q( ^2 V3 L% B - ;;
9 j2 Z5 L5 o1 X! \8 ^ - (defun modify_mtext ()
" H, A* P; a+ a - (modify_properties)
9 Y A0 u& y$ }7 O - (setq pt1 (list x1 y1 z1)): F- I4 y+ T0 |# N4 n
- (tempmod pt1 10 0)
' N3 T3 \ K) F - (tempmod text 1 nil)
8 d& b) G9 [: G, E: M - (tempmod tstyle 7 nil)
5 @ k! `9 U3 O$ @ - (tempmod just-idx 71 nil)
& a0 t; n) j. T1 m3 u - (cond2 `' @; s$ H+ C8 l" ~# K |. G
- ((= dir-idx 0) (setq dir-idx 1))+ h9 h6 C! h" ?. g- l. l- \; |
- ((= dir-idx 1) (setq dir-idx 3))# h' K8 u) H2 x2 a3 [) Q
- ((= dir-idx 2) (setq dir-idx 5))
5 R7 M8 G9 q) q. I- w# d - (T (setq dir-idx 1))
" W" i3 A/ D& y7 e2 H- p* E - ); H% c# m6 L6 G; E7 @/ `& q
- (tempmod dir-idx 72 nil)! _! N9 U2 U0 x- `
- (tempmod hght 40 nil)
8 A7 q2 b9 z" {6 I8 e( F; { - (tempmod wid 41 nil)1 T8 ^2 R4 H! y; s0 ?
- (tempmod rot 50 nil)
) q8 o% p& W/ j$ v( j - (entmod elist)
# k9 Z; `! w1 S1 h0 J, {3 l - )
* @4 u, Q1 ]! q) u: {5 u
$ @) d- c' |8 n* f6 m- K- ;; Set MText text style: ]* K8 m' S7 F+ G2 O
- (defun MText_style (index / style-list)
, y( s# H$ L0 g* b8 C; ^6 Z: Y9 C# [ - (setq style-idx (atoi index))) G- @& A" e# A6 f+ F! `
- (setq tstyle (nth style-idx slist))
1 v/ m' e) S5 ^# D) o# [5 V - (setq style-idx (itoa style-idx))% `" t1 D: t$ R+ T- x& r, J
- (set_tile "style" style-idx)
, S9 P) x" o4 |; i) w$ E - (setq style-list (tblsearch "style" tstyle))
- ]2 e a) J0 n3 q - (setq shght (cdr (assoc 40 style-list))), ~& n' h, F: t( @
- (if (/= shght 0)( A& Q% R1 M, I4 w' S( v8 ~
- (progn5 ^8 `! X$ H/ m. D' A
- (setq hght shght)
( K9 f$ J( }3 @. ^7 } - (set_tile "hght" (ai_rtos hght))
9 s& U# m: U$ T% c+ { - )6 T- O8 M0 u/ g0 m, o7 X- Y
- )) s0 z6 V+ y2 q5 J6 ? K
- )
; m, v2 h) c% x/ \: V# V
0 u& b; W& p: f. t- ;; Run DDEDIT on given entity, working around possible re-entrancy
6 b) Y- ~0 i0 @& U - ;; problems with MTEXTED
" u) K7 a# |. f: m& U0 a* i& K' } - (defun safe_ddedit (ename / orgMTextEd work)
. r* J' U( x+ w1 G A6 D - (setq orgMTextEd (getvar "MTEXTED"))9 [$ x! s! }8 b, L9 [- c$ ~
- (setq work orgMTextEd)
# j7 O+ b. V2 ]$ V8 D/ }. b - (if (= ":" (substr work 1 1))
0 M% `6 e0 c. H1 n0 }, f1 F, b - (progn
9 W4 a; c$ j6 _' x; }+ X4 E9 T% @6 { - (while (and (< 0 (strlen work)) (/= "#" (substr work 1 1)))) i8 \8 x1 m5 I0 O; s9 g: P
- (setq work (substr work 2))
! q; q# s- c2 H8 T( s/ Y* S% v - )0 m$ k C$ m2 s
- (if (= "#" (substr work 1 1))- \& ~7 C R k- g4 L
- (setq work (substr work 2))
. `* z( a& S! F- q& Y) y% c - ), }# G1 _3 ]. x$ l0 I0 e9 R3 I
- (setvar "MTEXTED" work)
& x) U4 E% P% O+ q - )6 }5 q$ p4 F; W
- )" x5 G' L0 r9 k5 |
- (verify_arxapp_loaded "acmted.arx") ;; make sure it's loaded..." d! Y& G' W! V' F1 q {
- (command "_DDEDIT" ename "")
2 V$ q; g r+ X1 s# L$ @" ^, X - (setvar "MTEXTED" orgMTextEd)
( R, y, z, [+ I3 s# P - )
6 j# K' N3 X o2 W; V, s. j - # _! Z. v p+ |: R+ b
- ;; Verify MText object width
+ C: F% ^. Q B - (defun ver_MtextWidth (value)6 O9 N+ h+ m' D3 q, O
- (setq value (distof value))" H* L' r$ B9 \/ X* D! w; c
- (set_tile "MTextWidth" (ai_rtos value))
8 d5 x" l; O8 [ - (set_tile "error" "")
2 c: n# Z9 h5 z4 W7 e: Z/ W - (if (< value 0.0)
' u1 V) ]( [9 G) B0 D* }( f7 g - (set_tile "error" "Value must be zero or positive.")
; c( v$ R$ }$ _. i - (setq wid value)
" d. n+ Q. l) q. a: U: K7 Z - )$ P; a$ F \4 P- k# E4 u
- )3 `- t2 x+ R7 D$ Z
: i* @) A8 t x, V- (defun ddmtext ( / gc3)) {* P0 g+ e4 x
- ;; Get dialog" B2 s$ x$ d: @: a% b# t" m a& j
- (if (not (new_dialog "ddmtext" dcl_id)) (exit)), ?7 B8 ?7 n1 N! `9 H- L
- * @1 [3 W' g ^3 `# Y4 N
- ;; Load list boxes
% N: f y8 A6 A4 S. g- g - (start_list "MTextJustify")2 f. _0 x' O0 w& t. _: A
- (mapcar 'add_list '(
: {6 @3 _, s8 V0 l% n7 Q% a) E+ w' W6 Z - "Top Left"% Q1 H( I) N$ B# L. D, |" o8 Y0 Y
- "Top Center"
5 @" j# Q/ L6 g: i1 e! n- J - "Top Right"
- f' u, B& I9 I, T. A - "Middle Left"4 l8 I: V' j* _6 c, o
- "Middle Center"
3 R- n$ Z F! g$ j - "Middle Right"/ c# _& f, Z1 u" f$ c1 k8 Q
- "Bottom Left"% u' s+ M' |4 c3 M
- "Bottom Center"
% h0 S6 F3 b2 j5 F; } - "Bottom Right"
' p# E' o. P4 G. l - )( c; Y& v% x) s) Z( p* N. K! ^8 `
- )* o4 D" [9 s8 z
- (end_list)
+ d8 E/ M6 k+ j3 Y( d; m8 s - & C! k4 {! ^, E8 U- s9 j$ W
- (start_list "MTextDirection")
8 p {+ [5 o: c \3 ]3 m* \3 D - (mapcar 'add_list '(! l" O6 V6 d; K1 j4 W- U
- "Horizontal"
% v2 A0 t: z4 E( r9 n" | - "Vertical"
3 [+ ]3 k5 K# [; f( J - "By Style"
' V `. E5 X* y- `: B6 u8 A - )0 E3 o% H2 `3 l- S) t+ G" x
- )* L6 s* C# I( Q' M3 G6 H
- (end_list)8 z: H! T" Y/ E
- * @( P( T$ l- A( m
- ;; Set initial tile values
9 j3 ?5 O, ?6 w - (set_tile_props). h# V+ L+ t* K+ j* d4 @
- (set_tile_handle)1 P3 z Y/ l4 s& {- ^
- (set_tile_pt1 0)7 z" M9 v4 K; L- \1 A8 c
- (set_tile_style)
* J$ F" t5 L1 x Y8 ` - (setq just-idx (cdr (assoc 71 elist)))0 T! {' F6 {6 i
- (set_tile "MTextJustify" (itoa (1- just-idx)))7 j# v3 F" I/ n
- (setq dir-idx (cdr (assoc 72 elist)))7 e. R6 z! ~+ i" D' ]7 W* O7 i$ Y
- (cond
( Q6 t- @! z& |, B2 ]( r- o7 ` - ((= dir-idx 1) (setq dir-idx 0))5 w" c* Z1 L \# x
- ((= dir-idx 2) (setq dir-idx 0))0 }9 u# E% @" W0 U. N6 v
- ((= dir-idx 3) (setq dir-idx 1))
' B/ t7 |. s5 [ v, r+ D) F- U5 j - ((= dir-idx 4) (setq dir-idx 1))) s- L0 p5 s$ `) w4 g5 d; M1 J
- ((= dir-idx 5) (setq dir-idx 2))4 J$ b6 s; u! L4 W1 w% n% J
- (T (setq dir-idx 0))* P' v( o# ^" y. n
- )
: v; `6 p" `* M! ~% J$ u - (set_tile "MTextDirection" (itoa dir-idx))$ F7 `- _# [4 h f0 M/ c3 b
- (set_tile "MTextWidth" (ai_rtos (setq wid (cdr (assoc 41 elist)))))
: l) L8 Y/ X1 b! D - (set_tile_hght)
, |$ F. u/ G# p+ X! P$ R - (set_tile_rot)% Y! z0 l0 W) u5 w) {+ B& U
- 3 Z# B, g- S& h5 O- e
- ;; Set edit box, disable if too long
: B' `' _, a: w9 C9 _5 J - (setq gc3 (cdr (assoc 3 elist))
7 D% P D3 ]& m- j% N/ T) p - text (cdr (assoc 1 elist))). O! u" `" B0 k" M, d
- (if gc3
: x7 E& @& j- v1 Z - (progn ;; Text is over 250 chars, disable edit tile
/ p" F/ ]" Y1 D - (set_tile "t_string" (strcat (substr gc3 1 25) " ..."))
+ J; j3 G6 m, u* | - (mode_tile "t_string" 1). _5 t( w$ U+ @% ?
- )
( H) Y! v6 B3 U' i% p* N! J& k" u - (if (> (strlen text) 80)
; e1 {5 u7 y4 W - (progn ;; Still too big1 l# P+ I2 C% z- o% _1 J1 k' Z
- (set_tile "t_string" (strcat (substr text 1 25) " ..."))4 i# k& a: e/ L, o8 {8 K/ h0 M, y# }
- (mode_tile "t_string" 1)
) T {# S, N1 `# f/ {( z. S - ). T5 x4 S5 Z- p N! w3 i
- (set_tile "t_string" text)* K6 V+ u: T6 v- A
- )9 ?% t& S' b4 k0 i+ X- D
- )+ c: k( |' c* k7 f9 C' m
! ^" m- \% d" H% A3 i, g- ;; Define action for tiles
* ]; D/ E- x- y1 g3 h/ r! \ - (set_action_tiles)
1 ?" l4 D4 L! X0 Q) Y - (action_tile "style" "(MText_style $value)")' u9 _# A* D7 C8 H" E c
- (action_tile "MTextWidth" "(ver_MtextWidth $value)")4 w ~' L% b1 T
- (action_tile "MTextEdit" "(done_dialog 4)")
+ X0 c7 Q8 t; a/ d - (action_tile "MTextJustify" "(setq just-idx (1+ (atoi $value)))")
# W( o6 H) |' [6 v - (action_tile "MTextDirection" "(setq dir-idx (atoi $value))")
. r K6 @, m& g1 z+ H Z6 C6 @ - + {9 i# ^- {# W
- ;; Set initial focus to text edit box.
: }% q' \8 }% p5 l" ^" X6 B/ C - (mode_tile "t_string" 2)8 `, a4 c2 `7 ^. i
- 2 e. N$ ~- G( Y
- ;; Run the dialog
: s9 v n; d( s8 S1 P - (setq dialog-state (start_dialog))
" q4 [- m) q" s4 a+ {& y' } - (cond
& n8 d+ f5 N' i0 H - ;; Cancelled - restore saved data
1 H7 z% {# J- H# e" i( _& E; Q - ((= dialog-state 0) (reset))9 R6 N' H# ?+ ]
- ;; OK - save new data
5 ?# {% P% j- T- W: o' j - ((= dialog-state 1) (modify_mtext))
3 E2 @, q( ?. m) T: l+ o& w - ;; Pick new insertion point; l! h: D; Y; t" l+ w5 r4 F1 B0 Q
- ((= dialog-state 3)) {. z4 ]. R( N1 ?
- (modify_mtext). v! L3 C+ X: I, X% O
- (setq pt1 (getpoint (list x1 y1 z1) "\nNew Insertion Point: "))' c1 b2 y6 Q1 e+ t9 E6 N0 S
- (ver_pt1 0)
5 l9 v, O( K' n5 u; G - (ddmtext)
9 Q b' ^, [+ I+ p7 M% D2 c4 P - )) B: |6 A# V x9 ]' e# w' D" ~
- ;; Run full editor( Y8 j3 z9 j8 r1 h
- ((= dialog-state 4)
: R* S6 L& {7 ]1 [6 r& o( T - (modify_mtext)
; u1 ]* z' n3 R: S( n - (safe_ddedit ename). u8 h1 M+ E' @0 u+ Z! n: w! l
- (setq elist (entget ename))
* y7 z) q0 c M5 } - (ddmtext)2 B2 g& A0 z6 W) K' g! `
- )" k) }8 `" Z X9 H2 C1 G: |7 h
- (T nil)2 \5 p5 s' p1 x' |. y' z0 N& l
- )% X2 n* T' ?8 ]! Y: m5 n" p
- )
+ `( L9 \/ i1 ^6 ~ - 2 V9 z7 c1 X( X, W4 {$ _
- ;;& d P5 l( U! H
- ;; Modify VIEWPORT9 ]+ c, V6 {" @4 W
- ;; t, n, h3 K& c E
- ' }' t3 M p% X) G! _- e
- (defun ddvport ()
$ m3 a1 r \/ O - (if (not (new_dialog "ddvport" dcl_id)) (exit))& Y/ g! A) I3 d7 U0 [
- (set_tile_props)3 m( W3 U! x$ w) H; A! D/ P
- (set_tile_handle)
# s; P9 W8 S8 J+ K - (setq vpt (cdr (assoc 10 elist)))
$ f0 I! i# |. x1 I- Z - (set_tile "xtext" (rtos (setq x1 (car vpt))))( o: R1 I/ P( c, k) D! C* \! [
- (set_tile "ytext" (rtos (setq y1 (cadr vpt))))
- l# A3 J. G7 E/ i5 }7 k- | - (set_tile "ztext" (rtos (setq z1 (caddr vpt))))
. w% H7 c' @- x" M; ]- {5 b2 _6 l - (setq wid (cdr (assoc 40 elist)))9 s" \/ t. I; A
- (set_tile "wid" (rtos wid))3 o+ J1 j+ X, k& \% k& {4 K M
- (setq hght (cdr (assoc 41 elist)))
. d( }" ^) H# v. K. K5 x - (set_tile "hght" (rtos hght))
% }' K$ T1 H7 S - (setq vpid (cdr (assoc 69 elist)))
% p- ]0 ^4 q T7 a; L* F - (set_tile "vpid" (itoa vpid))
. Z& F+ a* x2 X- R, i - (setq on-off (cdr (assoc 68 elist)))! V n" ?9 v; ~7 V6 ^
- (cond7 c) Q$ U* n" x0 _
- ((= on-off 0) (set_tile "on-off" "OFF")), U" u& [% t- z: o$ m [# U2 n: E
- ((> on-off 0) (set_tile "on-off" "ON and Active"))# M+ v; B* g0 k+ x( u
- (T (set_tile "on-off" "ON and Inactive"))
; f/ T- T% R: K d - ) X# d/ S5 f3 V) j
- 9 ^; ^, X/ j+ ~# {
- ;; Define action for tiles1 ?. m" e) `1 T6 k8 [6 }7 T
- (set_action_tiles)$ \# H% U0 ]1 z1 f9 I: ?9 e3 ?9 {
4 n2 W/ f) O: n* V2 g0 ^% f- (setq dialog-state (start_dialog))
3 l( P! E- L8 {4 ^0 m: l - (if (= dialog-state 0)
% h7 ?: L) z$ n2 C" a7 O2 J, K - (reset)
3 e& g6 y8 v" c' e5 m- |4 J+ s - )1 j6 x1 i$ e* T" }
- (if (= dialog-state 1)# P0 }) }" t; S) K. D9 d: k3 L
- (progn
$ Q) X+ A- I4 p- }$ H9 p - (if (= ecolor 0) (setq ecolor "BYBLOCK"))' y7 K% F& ?% F! b
- (if (= ecolor 256) (setq ecolor "BYLAYER"))4 F" j7 u/ z1 o
- (command "_.chprop" ename ""/ D ^. x$ t, ?5 S7 z1 e
- "_la" elayer1 X3 g- A( a* c/ b, t: ]# R
- "_c" ecolor ""
& n3 ?0 [! o& @8 J5 y! V* \ - )1 Z" R: z+ F/ O5 B
- )
% @, @! _6 ?/ K' o3 { - )$ E1 L4 s8 ?' m
- ): L( y3 B; R" F
- ;;& e/ a. n% v5 l. M
- ;; Modify POLYLINE3 c, G7 C. Z2 _
- ;;$ Z+ \2 G1 C: n, H3 L, Y3 N
- (defun modify_polyline ()
V# G. G' U% l& V - (modify_properties)
( R$ ^! ?& l' V! U' m - (if (= ltgen "1")0 o1 b$ J N& C5 Y+ O5 i( g3 Q C
- (if (/= (logand bit70 128) 128)
; m3 T' X. }8 R% r - (setq bit70 (+ bit70 128))
2 `. L( o( c& X4 e: ]0 e1 C7 A - )- c& ?: X5 M g! t3 x0 S2 U. ?5 E
- )
+ N1 p' L. P' y& y& H# M9 f3 C - (if (= ltgen "0")4 v% l4 c. p; y4 P4 o
- (if (= (logand bit70 128) 128)" {& p: V) o X5 u1 l: ]/ R: _
- (setq bit70 (- bit70 128)). \, B2 \/ D1 |5 g) U% M
- )( b8 g2 Z) j, J* p! C: P
- )
: S! p: p8 j: Y h0 X& O2 D4 v - (setq elist (subst (cons 70 bit70) (assoc 70 elist) elist))5 ]% }' h) [3 f8 Y4 f x
- (entmod elist)- L6 Z. T7 o& ?! j+ `
- ;; Added to take care of updating Vertex information for color) q1 }; X& u: I" w9 z2 w+ e
- ;; and linetype.
, L1 c+ f" g. {1 _ - (setq save-ename ename save-elist elist)
3 Y$ w4 o% w9 Y3 P( \ - (if (= (cdr (assoc 0 elist)) "LWPOLYLINE")* l& x, r& ~9 f
- (progn: ^& q- v; ~+ W; e B; j( G' K$ x
- (emod ecolor 62)
7 Y& A! J4 p, W7 J' K) S3 c - (emod eltype 6)" ]" x. {, C8 U6 E1 b, @5 z
- (emod eltscale 48)
" x" ^: \; n" Z \( ?' g% T - (entmod elist)
& x3 g* w- f7 s! S; X2 Z - )- t8 ]' P, z& \, T1 m7 l2 }* L' s
- (progn6 Y% Q) B8 y& d8 z
- (setq ename (entnext save-ename))
3 n! D* ]+ {4 s3 J% ]; }/ r' E - (setq elist (entget ename))# k* M, }% L7 T- v! R
- 4 k# o K% m8 [" R
- (while (not (= (cdr (assoc 0 elist)) "SEQEND"))
2 Z ~5 }7 ]( {, ^+ Y) } - (emod ecolor 62)& z! l/ `- ~ a+ w9 A. f6 ]
- (emod eltype 6)
! C% @/ E6 o' b# ^ - (emod eltscale 48)
' P& y: G# R3 X( m# V - (entmod elist)
1 W% ~9 @/ k' f% s f3 D% [ - (setq ename (entnext ename))
1 u& d, h3 `( s( d! N9 M7 t& d% ?5 ` - (setq elist (entget ename))9 }" U: R& I4 O; \
- )
" U0 ~/ n, v5 @% j - )+ o9 t6 _& t o. z
- )
1 _1 C5 g+ g1 H n5 E: H - ;; Update the SEQEND7 [& ^7 x" Z3 L' y9 p
- (if (= (cdr (assoc 0 elist)) "SEQEND")! c d" ?4 ]7 p+ L4 ] A# [: g* r6 i
- (progn
0 D; `/ `2 q2 d% L - (emod ecolor 62)2 {- t) ~" F0 y
- (emod eltype 6)8 A) Q5 s% w1 Q( S& G6 P
- (emod eltscale 48)$ Y- S1 {5 N( \
- (entmod elist). \. Q; f& M9 m) E
- )+ ~. h9 K/ N* K" w8 |' m
- )4 w @, [" @# Z
- ;; Go back to header.
- a7 T! {& b! K% e - (setq ename save-ename elist save-elist)8 V: S% t1 }9 C6 B) B! p6 E6 p. G
% R" S8 r9 L" t7 m) ^( @- (entupd ename)9 @6 q0 f3 k* @9 \/ W
- )
5 W& q! U% |4 `5 [8 h - 5 Q J' V* W0 d) I7 ^; T
- ;; Increment vertex. Set tile values to next vertex
) T: Q% E' @/ N4 H - ;;, c/ i E# C- W3 L
- (defun next_vertex ()
6 F: H9 x+ H+ v8 X9 Z' ]/ d5 R7 w/ r - (if (= (cdr (assoc 0 vlist)) "LWPOLYLINE")6 O7 c2 r7 }% u) L7 h. ^
- (progn7 s# R+ D* O: V
- ;; If the counter reaches the number of vertices,
3 y* [9 o" m) |: t. H+ n$ s0 z - ;; roll it over to zero again.
) F8 ]/ p& N4 O; ]' i0 o* A - (if (= ctr (cdr (assoc 90 vlist)))1 Y/ c( M; [1 @7 g$ v1 h$ k
- (setq ctr 0). v$ }8 m: V- Q8 y* A: q0 x! u9 t
- )% G2 W8 ?8 T+ P7 G- L7 C' h: \2 h
- (set_tile "ctr" (itoa (setq ctr (+ 1 ctr))))
' I1 e' L( K" j ^ - (set_tile_vpt pointype)
: x S) C* m( V* n3 P - )6 b( |% E5 m' N# z
- (progn3 p% r/ n( ^. w% T( K
- (setq vname (entnext vname))$ V: _5 y, s" x, f; m
- (setq vlist (entget vname))
" N! D1 P9 a; J% z C& c7 ~ - (if (= (cdr (assoc 0 vlist)) "VERTEX")2 S( z2 F- Y! V) u8 B7 I; H- k
- (progn
2 {/ a, ], g6 {1 h* w( j - (set_tile "ctr" (itoa (setq ctr (+ 1 ctr))))
3 H+ F9 M# o2 c2 D - (set_tile_vpt pointype)4 a t+ \8 k3 |: a
- )* `4 Z& b3 ?& T7 r1 m0 a+ ?
- (progn0 l* F8 K/ c @0 D# Y7 t
- (setq vname (entnext ename))
% z9 b, g6 h7 s! b3 @: [0 E$ f - (setq vlist (entget vname))
6 `8 H) ]1 M1 |4 z7 O U - (set_tile_vpt pointype); s0 j9 V, T. x$ e3 i. f
- (set_tile "ctr" (itoa (setq ctr 1)))
/ K5 u4 X1 @. }0 N! B! W% r/ i; O+ r; R - )
" g4 x/ @ Q9 ^' C - )9 o; v. T3 T* P! ^+ O
- )
/ f; @8 k" n! ~4 g - )
1 t/ u- H! S6 A* _5 C, g; ~ - )' x9 k) t: M% A) [5 L$ [3 \+ P" r) p
8 \9 ?7 l% ~$ t) v. V6 }+ ~3 j! f- (defun ddpline (/ oldecho); |9 C; `' M4 L$ h# O9 {
- (if (not (new_dialog "ddpline" dcl_id)) (exit))
/ Y' h7 x, \2 N9 \ - (set_tile_props)
8 f4 D9 J) r8 q8 v - (set_tile_handle)% K( u) \8 _# W. K% G
- (setq bit70 (cdr (assoc 70 elist)))* |* I( l8 l! B$ m9 E5 E
- (setq bit75 (cdr (assoc 75 elist)))
# x. v4 o4 i& N4 S - (cond/ R: y% O1 d! s0 c& n+ J# a# H9 {* ?
- ((= (logand bit70 8) 8) ; 3DPOLY3 h, d2 y' c( \4 q8 q/ {
- (set_tile "ptype" (setq pltype "3D polyline"))
/ K# g5 m9 u8 g) u6 R; C) k$ r - (setq pointype 0) ; WCS or ECS point values/ ]& U: t8 ?; ^0 E6 d5 Y4 h& y
- (mode_tile "fit" 1)
" f1 Q/ [+ `3 U - (mode_tile "mesh" 1), s7 l9 g' |! t: p
- (mode_tile "bezier" 1)
\% ?: L6 x$ Q7 {) R- u) M - (mode_tile "ltgen" 1); J `4 c3 r3 ?
- (set_tile "none" "1")
5 j" W7 x2 H' Z. j" S - (set_tile_closed)
M- C6 i0 V: ^: E V0 f2 [( I - (set_tile_fitsmooth)5 s3 h$ }" z! H ?6 D
- )/ |6 _, n+ b/ ^; d
- ((= (logand bit70 16) 16) ; 3DMESH
; c2 _1 m" ]3 f+ X! p - (set_tile "ptype" (setq pltype "3D mesh")) X% R5 F6 F: h/ M/ B4 A. d
- (setq pointype 0)
% x4 j, G0 K& i5 n' K8 B - (mode_tile "pline" 1)
! H( w% X, N8 C" [- t* F4 J - (mode_tile "fit" 1)
9 w" a! u6 ]/ q8 \! i - (mode_tile "ltgen" 1)& {7 x& \ J8 O2 s
- (setq m (1- (cdr (assoc 71 elist))))
" b$ G5 m0 R: X - (setq n (1-(cdr (assoc 72 elist))))
{' }4 ?" u. `2 w3 p% v- m5 J! ?" | - (setq u (1- (cdr (assoc 73 elist))))& o; f1 `6 z; [6 z# {- G* o8 ?
- (if (< u 0) (setq u 0))
1 r2 S- N. `2 V, x# r# A - (setq v (1- (cdr (assoc 74 elist))))
; W& H7 M& Z( ]) C z1 a" @5 \ - (if (< v 0) (setq v 0))! z6 s) g; ~( j- d$ [9 B
- (set_tile "m" (itoa m))6 A; c5 ?( ^2 B2 B6 M7 r' `6 T7 U
- (set_tile "n" (itoa n))
- g, ^% C* G0 }8 H - (set_tile "u" (itoa u))
2 X: x+ U; c7 k' u - (set_tile "v" (itoa v))
' x, k$ |& [) S1 c" J$ D& x+ o - (set_tile_closed)
# S1 b& @' w- g/ d% k9 y$ d - (set_tile_fitsmooth)' m9 E2 ~0 R$ |- B8 a$ t8 u# o
- )
1 A' I' V, Y+ t/ A - ((= (logand bit70 64) 64) ; POLYFACE MESH5 l3 w* w& F0 k( l9 }' P
- (set_tile "ptype" (setq pltype "Polyface mesh"))
5 ?* c' s5 d9 ]2 |1 @ - (setq pointype 0)
; F! g# m5 }0 w' m - (mode_tile "f-s" 1); u! j+ I9 m5 P: b0 G5 U' _
- (mode_tile "mesh" 1)
1 b2 [* }4 @# T5 v. w$ U/ ` - (mode_tile "pline" 1) Z- B0 k+ m3 w1 q* p* I
- )- J" B$ Z) Q, K4 x R4 h( R
- (T ; 2D POLYLINE, g. o+ a2 e$ _
- (set_tile "ptype" (setq pltype "2D polyline"))
. I2 p$ I5 W6 S; ^ - (setq pointype 1)( Z' U' }/ Q( F/ S5 l* z- z/ R
- (mode_tile "bezier" 1)2 o3 n/ c3 I3 L" O0 V$ J
- (mode_tile "mesh" 1)
, f' f6 [+ n/ H- s - (if (= (logand bit70 128) 128)
* ^4 G. g7 [; h - (set_tile "ltgen" (setq ltgen "1"))
/ w% M2 L% ?4 S0 x" w! D$ q - )2 K$ [/ L! d% t- j+ l8 ^5 m! Y
- (set_tile_closed)8 ?- ?3 }- j# ]& j* j+ G! g7 o
- (set_tile_fitsmooth), N0 j# X/ \% h& o- }" s- R
- )% [- H% q! p5 V! B8 j1 `: H
- )
) o: e, u `% ?' s; T* W! e" ? - / `4 j0 Y6 h9 M0 I& @1 r
- (if (= (cdr (assoc 0 elist)) "LWPOLYLINE")
2 i9 {) P0 ^2 ^/ x0 J7 A9 ~# l - (progn
" C! I) G' `. T' a* c, C/ I - (if (not next) (setq vname ename))
% J/ Q/ p- m J [ - (setq next T)
; ]( Y7 s, K- }, q - (set_tile "ctr" (itoa (setq ctr 1)))6 ? M) o0 b/ l! N
- (setq vlist (entget ename))
; Q y/ D7 Z9 h3 F$ T6 o8 X" e - )
* ^' n; C. G& r X - (progn" K$ ^. T% C( l0 U7 x& a. R
- (if (not next) (setq vname (entnext ename)))
% ?* t/ F& q& n ~: o: E - (setq next T)
* O% [1 |! C# Q - (set_tile "ctr" (itoa (setq ctr 1)))
* I* c7 ~6 x7 B5 O5 S' O - (setq vlist (entget vname))
# c( B9 [: I8 j: p% e. c8 i! S - )* b& y! D0 s' }6 s @9 j
- )2 x* q0 e. b) v) i" l, c
- (set_tile_vpt pointype)& |7 a: s7 \* h) C' j
- ;; Define action for tiles, R% l/ ?9 H1 c
- (set_action_tiles)
/ |, N& n8 j& J6 ^$ k - (setq dialog-state (start_dialog))
' ?% Q7 [; q, v( f0 w
: b1 _4 o) ]# T: l* u- (if (= dialog-state 0)
9 I) i8 e) l$ Z* P! z6 Q! _ - (reset)
3 b; [. R/ o% J1 `+ i( I - ): X! Q. Y8 S* O' ^! @ r$ J
- (if (= dialog-state 1)
! Q7 B# d+ R- I4 q: L' {3 A - (progn
+ C8 r* y& ^1 y) r" K _/ x - (modify_polyline)
7 O6 ^' Y4 B7 r2 _# U$ K - (if (or (= pltype "2D polyline")
- ~: _/ T- m5 C# ?1 c - (= pltype "3D polyline")$ ~" T1 F# |) R8 [6 M
- )
S% }4 {$ B+ T2 H* N* h7 D - (progn
& O( f6 I+ W; a - (command "_.pedit" ename)" }* m& T. ~6 Q
- (if (= spltype 0) (command "_d"))* Y" p7 u" B+ H+ l
- (if (= spltype 1) (command "_f"))- {/ M4 E( h+ g$ M
- (if (or (= spltype 5). H3 S, \5 ~; V. ?% P* y
- (= spltype 6)0 o( q- I* B5 L4 G; O6 x' `
- ): Y) G7 i- n% l# E
- (progn
" P8 }, F# W4 j; w! o8 e% u - (setvar "splinetype" spltype)& i, l$ O3 p; @: k4 d2 r& P
- (command "_s")
1 ~; X% @: g6 G P - )+ @, M6 w4 X! G3 `% U
- )
2 t7 R( v v3 b- p# E5 Q9 I - (if (= closed "0")
) `2 c, N" t$ x4 f- J - (command "_o")8 m% |# }! h4 N1 h+ P2 P; ]
- (command "_c")5 Q/ b6 `) T0 k
- )) a4 i, c/ H2 |- A2 w
- (command "")" L- t3 ~: R- \- G" {2 K) R
$ C/ j3 \" o% q# N0 B; n9 x" y- (if (= spltype 0)4 [ ^# n" d, i+ D. M; {2 Q% \/ {
- (progn" R. [: {7 L! o! z# I
- (setq oldecho (getvar "cmdecho"))
8 \0 R! \4 K3 I) f - (command "_cmdecho" 0)& r( v1 e3 w" e% ^/ D0 g7 ~) C
- (command "_convertpoly" "_light" ename "")
3 [" V3 u$ H7 d% Q8 B; P- ^ - (command "_cmdecho" oldecho)8 }1 T9 W2 h0 \" I/ j. X& L: r
- )
" P. f+ S; u& g7 p! n+ h - )
; Q) m: ]% S+ r( D - )
- `* E3 N$ r; f( v1 [/ B$ A4 Y - )
- D# U, L/ s, p+ l; u, P% e" G - (if (= pltype "3D mesh")
- b/ a6 U+ @& q; ] - (progn
) f5 \) Q3 Z( r* Q7 e4 H% P - (command "_.pedit" ename)! ~% A" y1 c( ]3 O9 @( `7 s+ D+ U
- (if (= spltype 0) (command "_d"))
' G' G! U+ v% W - (if (or (= spltype 5)
6 |- j+ E7 Z, Y8 C - (= spltype 6)- I& W& g( T' W$ a0 q8 S1 B
- (= spltype 8). A; J) H% J8 Q( G& K. I4 D
- )
+ M. D3 {5 s) s9 d - (progn+ h4 ~9 n5 C& [& D( K7 y( \( t
- (setvar "surftype" spltype)* {, |/ u) B _. |6 }
- (setvar "surfu" u)
6 c, V* L1 A& e0 }- t, t3 k/ l - (setvar "surfv" v)
- B3 {; ^! }) _/ W k% C2 G$ C - (command "_s"): B+ F# _! I9 v! q( b J
- ), o5 I0 p% P! N# X% ~0 m! a
- )0 f5 D. h. _2 y# ]
- (if (/= closedm old-closedm). C r6 D: ^; A2 W% j# ]4 ~8 v6 n- F
- (command "_m")$ t9 ^; L9 h! A
- )6 L/ y) }! M% M1 [$ J, X
- (if (/= closedn old-closedn)
4 _5 r" j4 |7 E; ]6 I* y, a - (command "_n")0 }1 ~, b! C% R7 X
- )
0 F! J& K! ], k - (command "")6 O4 v& M; L$ {5 K
- )
( [3 s! b2 j$ M" q8 G8 Y - )9 c( P7 ~# B: m' T8 `
- )3 H# W0 W- x7 @$ u* ^8 R+ O
- )) Y. W9 I0 C- b: o; R
- )" E. ?( ^, Y" y+ `+ i& u' ]
- ;;5 C- `, F4 N; T! b
- ;; All the spline data is contained in a single elist. We must do some
. F. ]5 N) I# i4 d" a; F; W - ;; tricky list processing to loop through the elist in order to display
% x3 O2 N% e' C - ;; all of the control points.$ L8 U6 l. u$ n. P, [- S. |
- ;;6 a( V& [& y& I: { W( e) S/ e* N5 _
- ;; The structure of the elist is different for rational and non-rational5 v( D' S5 g0 p# ], F: k
- ;; splines. Therefore, we check the rational spline flag.8 u* v/ u& s; S. I4 D: A- ]8 Y
- ;;
+ \0 t; K% b+ {2 a - (defun next_cntl_pt ()
, k. a( Q- k$ y2 x - (setq elem-no 0) ;; elem-no = element counter" W, A- G* p4 u9 w9 [4 l
- (if (= first-10-time 1) ;; If first time, find location of first8 P- J C8 _& [% I) b# S0 K! \
- (foreach list_item elist ;; cntl point element in elist
& E" [% C" M! }6 X6 K - (progn0 @; z4 D8 E4 k
- (setq elem-no (+ 1 elem-no))
. S2 [5 z; o g& S) T0 [! K _ - (if (= (car list_item) 10)+ `" ?0 G% n- r' c: u
- (progn
\7 f4 M! J) o$ d: c, T. o i - (if (= first-10-time 1)
V( r1 S0 I' L6 J" c - (progn! [1 ^) h) |" I+ t) \0 c5 J! M
- (setq first-10-rec (- elem-no 1))2 _; w( j+ L& |- R$ G2 V+ v' M
- (setq first-10-time 0)
8 `( A$ C8 u& {# S/ d; y6 e - (if (= rational_spl_flag 1) ;; if rational
8 t# a) \0 N, x/ W( d0 n @ - (setq cur-10-rec (+ elem-no 1))- i# v& x5 u! [
- (setq cur-10-rec elem-no)3 i; C# u% n6 E! h
- )+ I6 ]$ W% d- k8 W* `" e% H
- )
- d Q) q; d# W5 j" P7 ~) D& {1 Z, S - )7 N# V ]9 x. x7 i# R' d7 @# {
- )
9 v+ E9 O& V! |# s6 x - )
: Y. q: u# V# ~ - )6 s* d7 C; @2 ^5 j4 l3 g4 K
- ): Q9 k- w5 [) \1 w
- )& q; _7 V' `* z/ z( i
- ;; Now we know the location of the first "10" record; it's stored
+ _& b% [; T0 V/ U. B+ [4 X& m - ;; in first-10-rec. The first 10 record was already displayed when3 |" c. u/ ]& t9 E3 u. j
- ;; the dialog first came up so let's display the second one when
& ^0 d3 B5 |1 ]: H C# _ - ;; the user presses the "next" button (the first time through).
4 j6 `/ {. ~0 g' l9 @$ Y0 w, U - ;;5 _% M8 X$ j$ t' f
- (setq temprec (nth cur-10-rec elist))) c& `; y3 W! H) ~
- ;;
4 Z, U" o: h9 k7 t. d7 z3 | - (if (= (car temprec) 10) ;; if 10 record
8 Z' ^0 T/ Q/ k! h5 C" W! F' `. w& ^ - (progn
' ~1 z6 r' \9 e M9 z8 f: Y - (if (= rational_spl_flag 1) ;; if rational spline
4 S" Z$ R/ c9 T. { - (progn
1 ~/ A7 J; h! v6 v: N - (setq tempweight (nth (+ cur-10-rec 1) elist))
! j4 ?2 Y* f2 D9 \6 V0 k1 P% h: D2 E - (setq cur-10-rec (+ 2 cur-10-rec))
+ L& l- ^, X8 A - ), A8 w; V' d2 p: D: d+ `
- (progn ;; else& i& L; L0 P. F ~
- (setq cur-10-rec (+ 1 cur-10-rec))
5 v5 f" j i; c) \- Q j - )7 z+ @) Z0 _' u V U N
- )
5 k0 h& |( u: L9 }/ Y: H: y - ) ;; end if rational spline
& W$ l$ ~; G D - (progn ;; else reset counters
/ m( v: p3 Z2 I: U& Z K1 ]/ W - (setq temprec (nth first-10-rec elist)) ;; get 1st 10 rec
* |) s! ?6 c1 H% x9 }1 a - (setq tempweight (nth (+ first-10-rec 1) elist))2 @' p0 S. K; P" C$ `# P/ t
- (setq cntl-pt-indicator 0)& E1 a/ m. ?/ L* K; L& X6 r( O' X
- (if (= rational_spl_flag 1) ;; if rational w2 m7 T' w; A/ b0 Q {
- (setq cur-10-rec (+ first-10-rec 2)) ;; point to 2nd 10 rec) e/ o0 e, ]- [% g( `4 ^6 R
- (setq cur-10-rec (+ first-10-rec 1)) ;; point to 2nd 10 rec& o8 W& @4 s* c9 _
- )# ]- a" S1 k. L- m* f6 y
- ), Z7 z' d" Q6 E6 a1 b; L2 V- A
- ) ;; end if 10 record" h. ~/ T% [/ X- e/ w5 |- g% o
- % x1 ?7 ?( O8 f; C6 N: q
- ;; Display cntl point, weight and ctr. Increment ctr.6 B" \; K8 o1 a0 d' a T" V/ S; g E) v! {
- (setq cntl-pt (cdr temprec))" J& e/ q. e# e& ?( a
- (set_tile "xtext" (rtos (setq x1 (car cntl-pt))))
( y5 {& c5 s2 [' Z/ N- B - (set_tile "ytext" (rtos (setq y1 (cadr cntl-pt)))). z, I3 x& n* v* o- Y
- (set_tile "ztext" (rtos (setq z1 (caddr cntl-pt))))
7 ^0 [+ {+ J* b& t9 u7 q( x: W% S - (setq cntl-pt-indicator (+ 1 cntl-pt-indicator))9 Q* P) d. R* ~* u, d+ {
- (set_tile "cntl_ctr" (itoa cntl-pt-indicator))
, m$ G* v+ K+ t! f, c) T( b - (if (= rational_spl_flag 1) ;; if rational
* g" M0 T! ?9 C8 A# z7 v1 ]+ S - (set_tile "weight" (rtos (cdr tempweight))) ;; disp wght0 \3 s1 d1 P- V/ G, ^* U
- (mode_tile "weight_text" 1) ;; disable wght$ `% g& b8 w# l
- )" j, [# G7 W$ @- D! u; n
- )( o5 B# d0 V4 b' |) D$ A0 d
- ;;
( ^7 U, ]9 L! L$ K( b - ;; All the spline info is contained in a single elist. We must do some. n7 @9 |3 L6 {. h7 X: q
- ;; tricky list processing to loop through the elist in order to display
* m, W8 n5 w6 w+ I/ K# |2 g - ;; all of the user data points.8 J& ^. X7 j5 n! L0 G: C- ^* h
- ;;; {# t, D: {+ G8 O% J! C
- (defun next_data_pt ()7 B; c0 X9 E: A9 ~" a
- (setq elem-no 0) ;; elem-no = element counter
. W" N3 I9 o; I) I$ [+ Z1 s. T - (if (= first-11-time 1) ;; If first time, find location of first) P) M- D0 |! U7 D0 {% f
- (foreach list_item elist ;; data point element in elist* T& f" S) V3 V( A7 G
- (progn' M+ N$ E1 }1 g* G. Y9 e* M
- (setq elem-no (+ 1 elem-no))
9 `; B4 ^, U5 V" O/ F4 t1 }' L - (if (= (car list_item) 11)" K' ~; _8 h$ h
- (progn
/ a1 O B2 n. t/ V/ t. s$ w8 h - (if (= first-11-time 1); Z+ S& c5 L% X$ I% \% u
- (progn
5 `5 O# G1 j0 X+ n i d - (setq first-11-rec (- elem-no 1))
1 P; s% I. d; b( F. }. D% L% b) C6 \ - (setq cur-11-rec elem-no)% y. e: v5 \' P/ G$ n
- (setq first-11-time 0)' r% M% N5 ]4 [' a' [, H) b( _$ S
- )
/ p2 P( A( `2 m- [# s - )
4 Q7 Z) W* M" T: _) _ - )
" b" A% w1 W8 I+ c8 }, t& ^ - )4 h& j# S: f- H. k8 m' H
- ): V6 Z B$ d9 N9 R# A" q
- )
! \: C$ i% G* t& p - )
5 `; N" S6 ~/ t3 C6 H# x; B- w - (setq temprec (nth cur-11-rec elist))1 k/ y- |8 p& f& P# F' {3 o5 h5 ]0 ]# f
- ;; If it's not a DXF "11" element then we've gone past the last f& e6 Z7 v. t! V7 K% g+ H
- ;; "11" element. Go back to first "11" element. Reset counters., q C! T6 P+ b, G& p7 ]3 ?+ e+ q. y
- (if (= (car temprec) 11)
; d) ^8 T: d; ^- t - (setq data-pt (cdr temprec))# R% X$ F' c( |) y3 A( N
- (progn ;; else* }5 ^# _) r: q
- (setq data-pt (cdr (nth first-11-rec elist)))
Q6 C" q' a7 \3 r4 K6 i2 ^ - (setq cur-11-rec first-11-rec)
' [& t2 ?: u4 [ - (setq data-pt-indicator 0)* J/ Q3 t5 o7 e& D# D$ i
- )
5 H3 D* P" C/ J1 s( f: A$ O! h - )3 a5 T& z& ?3 i; X
- ;; Display data point and ctr. Increment counters.
1 R$ n' ?! I0 }6 r - (set_tile "dxtext" (rtos (setq x1 (car data-pt))))' S# V1 N" G; s, z
- (set_tile "dytext" (rtos (setq y1 (cadr data-pt))))3 w( ^' d8 M* R u2 V: m0 [
- (set_tile "dztext" (rtos (setq z1 (caddr data-pt))))
+ s: k# ?7 l% y. ^ M. F* |* h - (setq data-pt-indicator (+ 1 data-pt-indicator))
) T/ w; f/ W1 F) E1 e' d M - (set_tile "data_ctr" (itoa data-pt-indicator))
2 O' ?/ V/ t5 x4 q l7 {% A' G3 F' j - (setq cur-11-rec (+ 1 cur-11-rec))2 R+ p" g# `4 Z& r
- )' Y2 }/ X- S/ l; V5 t
- ;;+ d( A& h: a! \& H5 R
- ;; Modify SPLINE
- g. V, j# ^' e% W - ;;
5 H- e% L1 g' f/ R - (defun modify_spline ()
% y& G' V, O# v# }" q - (modify_prop_geom)& w: R, |) N+ d2 f3 M
- (entmod elist)
* |! `% r x- W; z7 _; y: H( M - )
, S f4 B' A+ b6 N% i5 s1 O2 n5 ] - " V9 e! d5 _# n4 V4 S
- (defun ddspline ()
; a. z1 Z1 b5 c% _) n9 W$ k8 g6 y- ? - (if (not (new_dialog "ddspline" dcl_id)) (exit))
. g2 c3 P% z& M$ M - (set_tile_props)1 J) m3 m3 z- r: y9 X N) U x
- (set_tile_handle); h) c% j# b7 U! Q4 A# Z( N
- (set_tile_spline_props)
* ^5 ~2 G; ?0 p! k; p& [. ^ - ;; Display first control point
) G7 N# A3 M5 K) \# j0 k' ?& F - (set_tile_cntl_pt)
7 V3 N3 j+ f( L3 _3 {+ F1 ` - ;; Display first data point: O5 j" p5 N, }+ h! c
- (set_tile_data_pt)
5 D; a- C7 k' r" t# m
/ Y- m6 b, S# y" H! l( U* E6 z1 i' q- ;; Initialize flags to indicate first time through the dialog.( T9 i( c1 H, k: C" c7 l
- ;; For control points and user data points the "next" buttons7 }$ u/ n1 g% I( @3 G& r, S
- ;; in the dialog call the appropriate functions.
( o* W- T/ }4 Q9 J4 ^ - (setq first-10-time 1)
, `3 x, {7 j+ o# {4 m' E# [# C - (setq first-11-time 1)
5 H: M( @: v3 D9 f: @ - ;; initialize control point number counter3 \+ [4 k. H6 M
- (setq cntl-pt-indicator 1)& {9 s, k8 |) x2 a3 y, c
- (setq data-pt-indicator 1)1 j8 I% z! u9 K! s/ q- b) N0 a
- (set_tile "cntl_ctr" (itoa cntl-pt-indicator)); l' e1 i. C V9 V, l" p& A
- (set_tile "data_ctr" (itoa data-pt-indicator))
+ O3 ?; }% Y- f- g* v o - (set_action_tiles)6 o5 ]2 V" D! T; U3 Z( {, G/ b [
- (setq dialog-state (start_dialog))4 f- @8 A8 G! |1 _1 f
0 Z3 z+ f+ E8 e p$ e- (if (= dialog-state 0)/ ]! G- }# U/ p2 j
- (reset)- T- W+ t& {' w
- )
9 {9 o( ]+ G2 A/ j3 O3 c/ L$ M - (if (= dialog-state 1)
0 g) L' E7 L1 E1 C: _% X" w - (modify_spline)* g" O9 O' S% L
- )/ ]9 w/ C2 e* }& C2 B, P
- )
/ I- g- ?. P8 g. |6 k& q
3 j- `' M6 x) K9 _ [- ;;
: [/ [! m: b9 w9 V0 V - ;; Modify DIMENSION& g3 B' {, y. d- t% v
- ;;- L( _' r- c( m/ k7 @2 H# C6 W5 m
- (defun ddimen (/ dtypebit blkname bename sublist a stname n dimtbl( x a! _% k" H0 e w: g+ Q& H% E
- dimsty dimlist dimtext svtext dimovr sv_dvlist stlist
5 L; F- b4 C3 e3 g# P - dimtype dimsvcurset)
p8 v' H' V" n! a2 o - (setq dimtype "DDIMEN"
5 A+ O& X2 y4 ?4 I) G4 p$ \& ` - dimsvcurset (ddimen_dimsty_restore)
- ~/ p8 D. V& X0 o - )
3 v* |9 W9 s( w/ `0 w) j* ` - (if (not (new_dialog "ddimen" dcl_id)) (exit))
) w% E# G; \* _" k - (set_tile_props)! `: q. V; ~1 t Q, W" f
- (set_dimen_props)
/ @9 [: f* O& g0 h- W4 f - (setq dimtext (cdr (assoc 1 elist)))1 P' \% G% a. X) v
- (set_tile "t_string" (if (= "" dimtext) "<>" dimtext))
3 x; n% U5 }9 W! m - (set_tile_handle)
" h& T6 G( p' d' X - ;; Define action for tiles6 N3 K" V7 ]# r
- (set_action_tiles)! w$ v/ z& e- V, W
3 y& Z1 _. }, i6 F' N. p- ;; Set initial focus to text edit box.
5 V' i7 p& `) Z2 m3 ? - (mode_tile "t_string" 2)
6 `2 x7 h/ n) }* l, n* d4 m8 V' d
2 R4 y m! ?8 Z. A- Y' b- (setq dialog-state (start_dialog))
K# }! f- U5 d6 i" C9 v+ N3 g7 z5 s - (if (= dialog-state 0), J |9 Z2 d/ }8 }! q& |) v
- (if (= ddimmt 1)
( f% r$ `+ G- L# C Q t - (reset)
2 ?1 ~8 t( R2 p o+ S - )" A6 x* S* c c- K3 k
- )( v( A- w8 Y. P) U: _
- (if (= dialog-state 1)7 I7 Y2 n* t& O5 s1 |
- (progn
s) O! _0 ^1 }* R - (if (/= dimsty stname)
. e: m0 D; I0 u7 F/ Z9 u: V5 ~ - (progn2 {( V4 e: R- f$ a# Q$ I$ W' x
- ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case
3 @- c! X! Q3 C& y - ; doesn't have it.
, m& v+ R! f! _* Y1 v) b5 E - (if (null (assoc 3 elist))
1 `: \9 i8 [8 x6 s# D - (setq elist (append elist (list (cons 3 dimsty)))): H9 l( y1 L2 E5 @0 u2 e( Y
- ; else just replace it.
: z$ \% {/ v, U& H7 n - (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
* Y2 u& u' `2 } - ) {# ` z$ j1 s9 b/ V
- ; refresh sv_dvlist with new dimstyle.+ i7 a E. C1 M
- (setq sv_dvlist (tblsearch "dimstyle" dimsty))
' a" h: f% E/ y1 Y - )
2 Z e4 P/ U! I; C/ N2 ^ - )6 p+ w+ O4 j- U5 O' @& ^, T4 K
- (if (not (null dimlist)) ; attempted to change dimvars
! a" D9 Z# z9 t& _3 f - (ddimen_complist sv_dvlist dimlist dimtbl)0 V* y7 ]3 W% i' E) c4 |. @
- )- @1 j. }" P% x9 G1 z
- ; Modify dimension text
2 Q2 J' t7 @. F. _; q0 ]! n& G6 J% }8 v5 ^ - (if (/= dimtext text)4 L0 H8 {% X) r+ F7 E
- (progn; ] p! k/ L4 c4 g5 ^+ T, ]
- (setq dimtext (if (= text "<>") "" text))' z3 \2 I) c8 m `
- (setq elist (subst (cons 1 dimtext) (assoc 1 elist) elist))
6 r) J, l! \3 ?: S - )
5 C6 T6 d4 Q7 c# x - )% s; n) C+ D: U9 C$ l1 |* M
- (modify_properties). F8 a) Q9 B+ z; z e
- (entmod elist)
8 ~: \% |6 D+ f0 I0 m) z& I - )
0 c) [' q3 O! b/ v, U* i% S - )1 L( k) s5 C& ]# m4 c5 }+ ?2 i. i
- (if (= dialog-state 4)
* S9 N1 Y6 Y4 T3 T" |9 U - (progn: } H6 m# Y5 S/ W
- (setq ddimmt 1)5 \4 P4 |- K0 h; v3 K# d
- (if (/= dimsty stname)
# y, V8 E2 j9 k4 O# O - (progn- ^8 p: a' f' g3 V f: n
- ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case' Z) t% ]) f5 }& z% }
- ; doesn't have it.3 o2 z5 p2 {0 {; y
- (if (null (assoc 3 elist))
- _! }% q- s. _# F - (setq elist (append elist (list (cons 3 dimsty))))- j/ W, \4 ~ D
- ; else just replace it.6 j F5 v* T e' ?; K1 u
- (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))1 {; m; z0 b8 R' `8 t. E& O
- )
( t9 h6 G% P5 u9 p9 T: d - ; refresh sv_dvlist with new dimstyle.
; z" T5 D" f% L! v8 X - (setq sv_dvlist (tblsearch "dimstyle" dimsty))9 x/ t/ ~% E4 |
- )# e: ~5 c+ k6 {) x
- )
$ P" o! E* d- }2 g - (if (not (null dimlist)) ; attempted to change dimvars% Q1 Z$ Q% s6 g) \* v; m1 J
- (ddimen_complist sv_dvlist dimlist dimtbl)6 W4 T4 t# ~1 n
- )7 y; ^/ a6 F# l9 l
- ; Modify dimension text; m4 [" s8 q/ B1 ~3 Z
- (if (/= dimtext text)7 G$ \# K6 {! F# E
- (progn
1 t1 y0 U H1 L# g - (setq dimtext (if (= text "<>") "" text))
- a7 C j1 z1 i0 G - (setq elist (subst (cons 1 dimtext) (assoc 1 elist) elist)): t3 R; J+ U8 Y1 E+ _0 R/ N
- )
1 R* [# n; F; y4 w6 h4 @ - )
9 u0 `7 i4 E/ e: S - (modify_properties)
: w5 Y( N- Q4 d; K2 n3 _ - (entmod elist)/ z; b; M5 v+ y% a
- (safe_ddedit ename)
6 [( e0 T4 r+ a, w# I" Q - (setq elist (entget ename)). E; V7 U% \- x/ k( k
- (ddimen)+ B, L2 K5 @8 [: x
- )4 _$ \, Z4 z3 O
- )
* o w3 u9 T% A1 s - (ddimen_setvars dimsvcurset) ; Prepare to exit& i3 a+ {3 L' |+ ?/ P) }% v
- )5 ]5 B4 E) p/ i
- 9 s: B2 m9 a1 i2 v& q
- ;; J, ~1 Q, h. V& [; i7 j, b
- ;; Modify TOLERANCE+ w7 \4 b( \7 S0 ~ u3 F: O
- ;;
' I4 [0 n! h7 J* ^( s - (defun ddtolerance (/ a stname n dimtbl
0 t% _3 x) @& g( Y6 r- d; _ - dimsty dimlist dimovr sv_dvlist stlist dimtype7 W: s( z r# j3 {2 \
- dimsvcurset)
k; U4 M& ?+ H# V+ i - (setq dimtype "DDTOLERANCE"! n! K* W4 j3 T4 Y
- dimsvcurset (ddimen_dimsty_restore)% r5 Y: w0 p3 x$ d5 u* L
- )
5 J+ k. K) ~& Q7 j0 u% e; J# Y - (if (not (new_dialog "ddtolerance" dcl_id)) (exit))
7 U% y( q& r9 F" \1 o6 E - (set_tile_props)
; w, H& t; W% c5 h1 w o - (set_dimen_props)
; V- r k, T# [# D( A& A0 I7 M2 A' ` - (set_tile_handle)
, o. s* @; H; W. h( g1 T. g3 S& a - (set_action_tiles)
8 L; ^5 q# X& [7 a8 `) } - (setq dialog-state (start_dialog))+ Z" `( E( r* V# J
- (if (= dialog-state 0)
6 v1 M. F% C+ X4 ~$ z - (if (= ddimmt 1)
8 g7 V2 r9 M9 D' e - (reset)
- u" I1 a' _, p) H' w" r - )
% o4 F# |( R: c0 D- f - )
2 c+ E! ~! j* u* ?" U - (if (= dialog-state 1)/ ?( n( v( v- C( P
- (progn
. Q* r6 b) N0 ^& m/ h - (if (/= dimsty stname)
* @' p% E, I/ V% X8 w% E0 \ - (progn
! n0 U8 T2 u4 H1 C - ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case/ }2 b% l! \" T4 T
- ; doesn't have it." x4 k+ ~! n+ j, K. Z2 j
- (if (null (assoc 3 elist)); }( k0 Y5 ?1 Q
- (setq elist (append elist (list (cons 3 dimsty)))); h# p+ D7 b6 l0 T
- ; else just replace it.# A( Z6 R. _) ~' }) w2 r8 @1 Q
- (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
' L3 Y& I/ {1 T) R1 t! D - )
4 o0 l2 ?! ]0 D - ; refresh sv_dvlist with new dimstyle.! L0 P* ~4 Q5 S" v0 w8 L( I
- (setq sv_dvlist (tblsearch "dimstyle" dimsty))2 E- T% r6 O6 }& a1 f( x* e9 z8 P
- ) m2 A. h6 G: w' F4 x
- )9 H$ l0 D% L* ^" K, r. Q1 U! O
- (if (not (null dimlist)) ; attempted to change dimvars- b1 i; `+ K1 r5 r+ I% p
- (ddimen_complist sv_dvlist dimlist dimtbl)9 S( l% p8 R1 l
- )
4 x7 A( p6 p7 L1 ]: \4 q - (modify_prop_geom)
7 V' s f( G: _9 S - (entmod elist)9 b6 }" [2 |/ m
- )) Y. ?0 j& V0 g% y) [0 \3 C( r& `( x
- )
9 G. _' v. F. Z2 y1 G8 i - (if (= dialog-state 4)* |9 s: v! P# @7 h) d
- (progn$ g( T$ v. {- |) e7 g
- (setq ddimmt 1)1 ^3 h5 ]# Z9 y1 X' j% o
- (if (/= dimsty stname)3 {; p" J c9 u" F9 J' f) Z( x
- (progn
- a+ |) L. n6 i8 g8 x9 M5 _ - ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case. r7 ~9 _1 G9 j* Y2 Z/ l; W
- ; doesn't have it.
% d) p! J9 `; T7 n3 q2 |( p4 ` - (if (null (assoc 3 elist))1 m8 j1 u7 s% |# L* W& u
- (setq elist (append elist (list (cons 3 dimsty)))), N1 j& p& ~1 ~: K4 v: z
- ; else just replace it.( s# w" ?2 l9 O0 l
- (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))6 E8 e" w) N6 p/ Y; K+ R
- )
( y( H& l1 T- x* l& o/ h - ; refresh sv_dvlist with new dimstyle.2 Q4 T1 A% H# o5 ^) _/ e
- (setq sv_dvlist (tblsearch "dimstyle" dimsty))
/ D3 v( N: m; [2 P - )
N* |, c+ `- x" _ l" N- `5 [ - )
! i3 A4 C$ c7 U" r( B - (if (not (null dimlist)) ; attempted to change dimvars
0 d* p1 x+ R/ H - (ddimen_complist sv_dvlist dimlist dimtbl)1 n3 L& }0 B H$ J: E+ Y$ V3 A" L! w
- )
2 S4 Z1 M: F8 k7 p" P - (modify_properties)
' }" Q' t, e! I" G - (entmod elist)( B6 |. \5 E6 ^; A5 x- z
- (safe_ddedit ename)+ g% q1 P# F# M; p' y) o
- (setq elist (entget ename))
( q; n9 |, N9 |* h& A - (ddtolerance)2 s7 E: g* K, V4 S" G
- )5 u( ~! U& m% B0 p3 Q& N
- )
5 @$ D3 @1 r( ` - (ddimen_setvars dimsvcurset) ; Prepare to exit u9 ?6 B4 u% y
- )) r5 h# v, y% w- |
- 7 z; }5 ?, |9 b; W) b6 _
- ;;5 R# t2 h7 p* t& i: ^% t
- ;; ddimen_dlg - jump to ADS ddim module' f' k( L$ H- b h' [
- ;;7 n( z+ `8 j( R
- g# ?6 h3 z C3 D/ Q3 |+ r6 R( e
- (defun ddimen_dlg (dimtype tile dimsty dvlist / dimlist) v8 I; J+ z7 } }. i$ E0 e
- 5 Y! x$ Q/ a% @0 X
- ; Jump to DDIM with overrides if any.
& [7 |: U6 v8 B$ F - (cond ((= tile 11) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Geometry% }6 l9 N V: S4 {+ C# Q* t: Y0 r
- ((= tile 12) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Format; [/ T/ y$ `& C5 n
- ((= tile 13) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Annotation
; }/ [* G& _0 Z6 U/ W- L Z - )
' X" I% u% J/ s _0 t3 s" M5 h A - )
- O; n5 t: j5 q, {6 j6 L8 J7 ~
4 | ?. O, i7 ]) a9 T* e* l/ i- ;;
5 G1 y/ l* O( G - ;; Dimension variables updated are stored as overrides.
' d9 H) a& [* i) Z5 i3 v' M - ;;
3 W" ~; U5 q* |* z+ r: Z3 S! H% ^ - + D/ \' j" Y3 n1 f+ k7 k
- (defun ddimen_complist (dimolist dimnlist dimtbl / i odvar ndvar
- F* @; E$ a- J - dv dime commandIssued)' s; B5 `/ p- L2 t( C
, ^, `$ f6 q: Q8 o& e- ; Here we skip the following first three items:) S' w4 o6 @' A. J3 v J
- ; (0 . "DIMSTYLE") (2 . sylename) (70 . 0)4 k4 _: a, P! M, p# y4 _9 b1 Z
- ;
/ J' _* Z/ b4 _* V, n2 J - ; The list comparison immediately begins with dimvar.
3 g1 ^, Y5 W4 A3 E" K1 }4 R - ;
' D8 k5 M2 a* M* @* S% H2 E" q! Y - ; dimolist - original states of dimvars, `8 U4 `0 F, G% @* F
- ; dimnlist - new dimvar list which is of the resbuf's& V% U8 k) W' ]0 ]% Q6 y7 k! _
- ; dime - entity name for the dimension0 @2 {( U) L- o! ^2 P! g
- ; odvar - value of dimvar for the dimolist
( h( ^2 C. d: Q& _- j - ; ndvar - value of dimvar for the dimnlist
h* y( Z$ J8 F8 s2 m
, w/ L: I; D9 h$ a! f& b, Y- (setq i 3
+ A8 N5 T- Q' c# Z z x - dime (cdr (assoc -1 elist))5 d& N) z* {! A+ n$ V' P, A: z* b
- )& k* {9 ~8 ~3 R m% c6 S# e
- (while (setq odvar (cdr (nth i dimolist)))- x+ A/ z6 N% u- u) W1 T
- (progn
+ Q$ V, k' e$ R( |0 l& C - (setq ndvar (cdr (nth i dimnlist)))5 c- p# L8 J+ E* W* N" A8 @% L- ?" w
- (setq dv (nth i dimtbl))" B( ^! _; X; v: }& O0 \
- (if (eq dv "dimtxsty")( z) Z; j0 i3 z: B9 ]* g
- (setq odvar (cdr (assoc 2 (entget odvar)))
& R |$ Y7 n* @" R - ndvar (cdr (assoc 2 (entget ndvar)))
: H- J7 w+ c$ t. J - )3 q. J, `( }; [2 G" p4 J
- )" s8 g2 o7 T y$ q
- 6 H$ v% W0 c7 E0 E, A7 T5 ~
- ;( N+ G2 i/ Y$ ]* I" @2 {
- ; In order for DIMOVERRRIDE to operate correctly with string% R( e( n) z9 n
- ; based dimvars, we must pass "." versus NULL strings.
' L" Z1 d7 F4 Z$ h8 o - ; In this case ndvar is the new dimvar value the user wishes
. W5 A# J( {; I$ B6 j! k& n - ; to update on selected dimensions. B4 b$ s, C4 ? J
- ;! l ?6 i" ~8 |0 ?
- (if (/= ndvar odvar)
5 w( p7 N, |& a" H - (if (= 'STR (type ndvar))
# F( t, w5 L( T1 Z$ Q8 k& y - (if (= ndvar "")- y! e ^9 Z: E2 _: s: V6 P
- (setq ndvar "."))))
" H! Q6 K6 I8 m/ d
# g4 w7 u- f$ P8 ^$ f l( g- (if (/= ndvar odvar)6 U1 `6 n7 R) W; q. i$ ~, _; }( ~8 V
- (progn
2 R1 Y' I! |% B' H+ l1 j$ O - (setq dv (strcat "_" dv))
3 N& `( [7 n: T$ m4 K. {+ D - ;
6 R4 ~0 z& ?, r( b) J - ; Start the dimoverride command. W0 q% H; N3 Y9 q( X
- ;
8 W- M. J" u9 n$ @ r- e: l' b - (if (not commandIssued)
6 V8 m9 l8 \. V: B6 f+ b% X5 E - (progn4 t- Y9 C& v$ [- t8 ]/ L' F% M
- (command "_.dimoverride")- U( S& r7 c: ~# Z7 o# s/ w
- (setq commandIssued "T")
6 M P/ Q5 _* m R - )
) Q& [1 A- m9 ^. D2 @ - )) s1 f% h! [) w9 p1 X o7 [& B9 \
- ;1 {3 f X$ B+ t, \- a% |
- ; Issue dim overrides
, F/ Y$ i0 i; y; c. a5 W0 _. y - ;9 D$ l& b/ |' Z: @" R
- (if (and (or (= dv "_dimclrd") (= dv "_dimclrt") (= dv "_dimclre"))* ^: |$ E& v$ F( r6 j+ Y
- (or (= ndvar 0) (= ndvar 256))
& U- ]" V- M2 r8 X! c9 Q( G - )" k7 ?9 t+ v; d' q" P9 c* i
- (progn
9 l% D; I% `" s, }: U- v - (if (= 0 ndvar) (command dv "BYBLOCK"))
* W: ^. x( G' u/ L, x Y - (if (= 256 ndvar) (command dv "BYLAYER"))
8 Q6 n: H* u# i- y; H" w - ). R c& M4 T9 x* Y; k1 q3 s9 R6 M
- (command dv ndvar)& N1 g8 Y( V# k0 p4 l
- )
2 W% D6 `; B9 ]! @ e - )
; @# o% H! c) x7 u- L - )
( q# S* X* `6 x" R; t ]/ a - (setq i (1+ i))/ J* h. k6 f3 L% }4 z
- )8 w4 j- `8 Z; x% }$ ?$ o0 l
- ) X& r: U- w+ |' {: @. |
- ;* x P$ |3 K" {# ^; b
- ; Select Entity and terminate command( t: I+ W9 [: F" x, q9 ?* R& R
- ;
. M2 d/ H0 W! }' U1 g7 w, i& z - (if commandIssued
. f2 N* ?2 s2 R1 v - (command "" dime "")5 D/ Q+ R0 i' R' C8 b
- )
! [6 H: k ^/ f& }, S( W7 t - )- I0 \9 b* ^5 N) C
- 0 {( Z6 Z) d* |! U5 N7 Y/ H6 T0 r
- ;;
$ f( Q3 p/ \2 ? - ;; Get style name currently selected style name.
# m S' P* v) m' |! q, F - ;;
2 U! u( ^0 f; l/ m - 1 M* ^4 I$ ~- d7 k2 C- m" J
- (defun ddimen_style (/ dimsty)+ |. j- r! H% A9 g+ F- R
- (setq dimsty (nth (atoi (get_tile "mod_style")) stlist)
( ?# t" V' |- Q - dimlist (ddimen_getdimvars dimsty). O6 B' \) L" y' D
- )
$ A% u+ v ?- A$ F1 Z. X# _& \# x - dimsty
, B9 r2 b' t: T5 a* {5 n - )
# Z& K( H. b9 O) G5 Y
5 g! f; Q; `+ B5 L# y- ;;! A* Q+ n0 F: A6 B+ B
- ;; Set dimvars% X& O) q! i8 q0 R: u* q( q' s, v
- ;;5 h( t8 n7 f& m2 P
- (defun ddimen_setvars (dimsvcurset / dv i)
. k& d* p" [3 i4 N' }- v0 F( f4 y+ e - (setq dv (cdr (nth 1 dimsvcurset)))
- D) ?6 J& U8 q/ U: X - (command "_.dimstyle" "" dv)* P; N3 i) c2 {; O
- (setq i 3): A8 K1 _/ c* K2 o( n" z$ x
- (while (setq dv (nth i dimsvcurset))5 F3 f7 Y6 L6 S7 M/ u Y0 V/ B
- (progn
( r" Z# w& k/ R- e9 q, V - (setvar (car dv) (cdr dv))" ]9 \ D" O' }7 v1 R+ c
- (setq i (1+ i))
/ v; s Q6 Y/ B$ x4 T" F& [ - )+ O# `5 q, Y/ M1 B) {& T
- ), v! O" ?5 J U* d ~- d
- )
0 h" e8 _8 P' D0 w8 P0 j+ R# f - ;;
# S: k" }, l/ g3 ^6 r - ;; End-of-dimension& c4 d* C) l/ f1 l* w) D
- ;; ==================
3 y2 ~: G1 U X2 I( R9 I) Q
- z5 ?' o% }( _+ K- M0 P7 ^7 g/ E7 W- ;;
0 U5 F/ b- m0 V$ }& x) M3 G- U' Q - ;; Sub-dialogues for properties. Common to all object dialogues9 k% h V' I0 C- c( b5 s+ t
- ;;
1 K3 _1 {; A7 K& b! D9 A( [ - ;; This function pops a dialogue box consisting of a list box,image tile, and
# i5 ]1 Y8 L1 s - ;; edit box to allow the user to select or type a color number. It returns
" ]2 {8 t3 j3 i) d% \* S& s - ;; the color number selected.
" Y( G) H1 C5 E+ d - (defun getcolor (/ old-idx colorno cname lay_clr)6 N2 Y3 p9 F' R1 Q' P8 _, x' F
- (if (= (get_tile "error") "")
7 y) I9 z. v# P7 B1 C - (progn
/ |2 P+ @9 j0 d! A! G; f. A - ;; Get the color associated with this object's layer, for use: w! g" ]7 f& Z: ]; |9 Y
- ;; in the color swatch if the user selects color BYLAYER.
& `" R$ i: E0 f7 z - (setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))
* N, s+ z/ a% r W- I - (if (numberp (setq temp_color (acad_colordlg ecolor T lay_clr)))
2 k& ~7 t$ X2 ^ n - (progn4 k6 D( S x0 X8 a; q
- (setq ecolor temp_color)$ H6 Y% z1 {/ F
- (setcolor)7 n+ L2 {9 V* J
- )
& Q/ K- s. H( o3 i) f - (setq testcolor temp_color)( {# P$ b P! P3 d4 D: j
- )
/ z9 D; N6 O1 y5 L- n - ), j; a* C" {3 N/ Y4 S) X
- )
% E5 K" p8 k' J8 x6 s5 y - ecolor( H7 @3 ~ h: t" t
- )
0 E) |& {7 R6 z2 Q: ] - ;;4 N3 Y2 {. T! }" D; ?$ M* G9 Q0 e
- ;; Function to set the color tiles.
& G5 e! K- }* g) j - (defun setcolor()
- b7 m( W/ @: J+ m - (cond
; {# V2 ]! k7 C" @; }2 U ` - ((= 0 ecolor)
# l6 I$ F1 P9 g+ |2 T2 p! k) T - (set_tile "t_color" "BYBLOCK")% T7 W0 Q# {$ z# Y) t
- (col_tile "show_image" 7 nil) ; show BYBLOCK as white
) X( b5 N4 C0 d7 e: E( [ - )" d0 E" M4 L8 m. E
- ((= 1 ecolor)
. Q. E# v; j$ D - (set_tile "t_color" "1 red")* g7 x6 c; z3 l% z2 Q. c6 X% M+ I, X
- (col_tile "show_image" 1 nil)) w% z- ^. n, N/ @
- ), Y) y- }5 r6 O. z
- ((= 2 ecolor)
$ E9 ?# R1 q' Z/ V( e1 C - (set_tile "t_color" "2 yellow")
5 N/ {0 L; L" p( j$ w - (col_tile "show_image" 2 nil)! h: v, P# _) X
- )
% A; v4 x0 J) c& O8 h! w; e r - ((= 3 ecolor)
4 G1 ~3 ?) t1 ?/ M - (set_tile "t_color" "3 green"): e7 {; E" T/ s4 Y
- (col_tile "show_image" 3 nil)
' H9 Z* W* U2 @- K; ` - )0 G) k* z* C6 {6 Z! l' A* z
- ((= 4 ecolor)
7 R( n) X% r/ l0 m! U: G+ i - (set_tile "t_color" "4 cyan")) D* o, J9 ]( { X3 C
- (col_tile "show_image" 4 nil)# U& e3 H# \5 G7 M
- )) r+ e3 D$ ]% u; a% q7 e/ Y
- ((= 5 ecolor)9 F6 w [* \2 y
- (set_tile "t_color" "5 blue")
' k- z0 W5 \( O# H - (col_tile "show_image" 5 nil)3 y( l- w7 ^3 O2 o; I9 z( t
- )
. x/ H" _$ X# b, ~+ J - ((= 6 ecolor)
$ K6 y" D# S/ A) \, \$ n - (set_tile "t_color" "6 magenta")& v2 N, Q. `' C# y1 d' c
- (col_tile "show_image" 6 nil)5 ]. b" D2 F# o0 h
- )6 ~" {, j& [' k4 t: H* p; k8 x- D
- ((= 7 ecolor)
9 r1 ]* a. R9 P q* ?1 c! L - (set_tile "t_color" "7 white"). ~# W- I! F0 n* O' s8 H* T
- (col_tile "show_image" 7 nil)0 M, G- _6 y2 r8 v1 Q" S0 B
- )
( `; p2 Q5 H/ ~# L5 k% r - ((= 256 ecolor)
% u) J+ _0 ]* f( @ - (set_tile "t_color" "BYLAYER")
: Q" B% z" n! \ - (col_tile "show_image" (bylayer_col) nil)
" L2 d* x! D6 C6 X$ B; a - )/ |& n5 Q2 j/ z2 q3 V) c) o4 m
- (T
7 f7 ?- J2 ^: t) S% D8 h+ |6 p/ U# B - (set_tile "t_color" (itoa ecolor)): j9 a1 s: n. ^# `, @9 y5 n4 n
- (col_tile "show_image" ecolor nil)
. J: t# x N9 a: B. f% M - )
! _4 w- c& w% o9 o7 \( V9 T - ). [, R6 |8 W- \" M
- )6 R9 s: L" b' q# j+ Y
- ;;
& |% [3 B/ A- W \1 D - ;; This function pops a dialogue box consisting of a list box, image tile, and1 z8 i) e& C% U$ a1 b
- ;; edit box to allow the user to select or type a linetype. It returns the( O# d: I6 [. {1 t4 A9 X
- ;; linetype selected./ _, L/ {4 X# J W' J3 z. m& u
- ;;
9 g/ ~8 L5 m" ?) m - (defun getltype (/ old-idx ltname)1 e3 N3 E, _- w9 Y7 v
- (if (not lt-idx)1 D7 |. I" c0 c8 T2 r
- (progn
7 t( c. ^7 G! U/ E) j - (make_lt_lists) ; linetype lists - ltnmlst, mdashlist
; h2 H/ x. G: W - (cond1 `3 ~. b8 ?- B
- ((= eltype "BYLAYER")
" D5 [/ @$ s7 N/ A% E - (setq lt-idx (getindex "BYLAYER" ltnmlst))): ]& l& {; W% H# x
- ((= eltype "BYBLOCK")$ P1 ~5 f* a/ w2 [, [
- (setq lt-idx (getindex "BYBLOCK" ltnmlst)))
2 C. o" C4 ^5 F5 d' H# ?. x7 E, ]$ r" u - (T (setq lt-idx (getindex eltype ltnmlst)))6 @$ z1 B4 w2 S' V' c0 [1 r, n: k
- )4 M* t2 e, T. J
- )/ Z! R) l& I6 g7 _
- )' W8 x2 [ Q d6 k9 z$ a! a
- 2 |- a- b- U; R
- (if (= (get_tile "error") "")
7 b# w. @8 W5 l4 `% m - (progn
4 A0 Y( E2 V$ Z) C; t0 Y' o - (if (not (new_dialog "setltype" dcl_id)) (exit))
4 h( G$ k+ A* g6 v6 b& w - (start_list "list_lt")
0 \5 q& l+ @. v - (mapcar 'add_list ltnmlst) ; initialize list box8 E6 Q# B, \& d$ V% @' M+ k
- (end_list)4 B U& A% H8 F, o' Z0 q* Y- d
- (setq old-idx lt-idx)
3 D: t- y, z% f - (ltlist_act (itoa lt-idx)) z9 ~0 o. _6 @' o2 ]9 w( ]
& A1 G6 m4 d0 z7 b% }- (action_tile "list_lt" "(ltlist_act $value)")0 ~0 M: z' O" K) H" \# y, q
- (action_tile "edit_lt" "(ltedit_act $value)")/ {* |% K( P4 q
- (action_tile "accept" "(test_ok)")- j1 ~4 a( V( O+ e" K9 D' c
- (action_tile "cancel" "(reset_lt)")
4 Y# D# U. M6 A* b) s, G
- D; O# ~; k5 ~5 o- (if (= (start_dialog) 1) ; User pressed OK; A* c6 B% q0 A' q2 i4 @; A
- (cond+ [( O& J7 O$ S( Z" `( |' E
- ((= lt-idx 0)8 [- u; {2 E) H) x1 h) }' E" J1 a
- (set_tile "t_ltype" (bylayer_lt)); i5 O0 W% G! | b/ Q4 s* i0 S
- "BYLAYER"
/ l6 ~$ H4 ~" C; S1 k - )
" Y; c+ h$ Z- f- e - ((= lt-idx 1)7 V- g' W T* e& j3 I& r5 M
- (set_tile "t_ltype" "BYBLOCK")7 y/ |% s* J) ^. c+ s+ C
- "BYBLOCK"/ N2 B* n6 {! z! f3 q
- )
; y8 A2 F% A8 O3 v! q( c7 {" K - (T (set_tile "t_ltype" ltname) ltname)1 u, ~, @+ _) l3 L1 L1 \6 j7 b
- )
$ [1 D8 ]6 S, S3 w7 q - eltype* P# J1 V% U) A7 H! A
- )6 C" \0 \8 o. E4 h# Y: e x
- )
6 k6 n9 [+ R* ~& ^* c$ X - eltype
$ O O9 x. x" U2 P7 N9 e; S( x - )9 E% Y! a7 U' \) Q" ^9 v8 G6 z% r( E
- )
; ^& ?$ f3 Y- { ?. p$ A - ;;
) G8 E; _6 i. a - ;; Edit box entries end up here9 {3 K9 t+ Z7 r5 h( E# r3 v
- (defun ltedit_act (ltvalue)8 l" a' K# Q1 a$ r* U) M( h+ G
- (setq ltvalue (xstrcase ltvalue))
8 W) N" ^8 V0 ]! I - (if (or (= ltvalue "BYLAYER")2 m( L% `' ~* T7 T$ h7 W! Q
- (= ltvalue "BY LAYER")), d1 \* z( z2 l- V$ ~
- (setq ltvalue "BYLAYER")9 f4 z# z# g: x) u
- )
% d* u' [0 n4 g) Y& [$ j - (if (or (= ltvalue "BYBLOCK")
/ [3 i8 F$ `0 O, ]; C% A, q/ D% e - (= ltvalue "BY BLOCK"))
' {" T% N6 M3 x - (setq ltvalue "BYBLOCK")
% F$ H: u8 }& D4 q% ^& G - )
5 X" c1 a7 w+ y1 w1 e - (if (setq lt-idx (getindex ltvalue ltnmlst))
/ j+ ?& f2 z6 h) `1 i: ^ G - (progn* F7 U2 F: I# m9 M! d E) x5 {
- (set_tile "error" ""): ?) y+ z O1 C$ B5 d4 a/ _
- (ltlist_act (itoa lt-idx))6 t% r, [" u; o" E( k8 J) p
- )
4 N- }$ O& N4 N! D' q B - (progn1 G0 O3 Y7 o: o/ U8 g
- (set_tile "error" "Invalid linetype.")7 n2 L) o/ G) Z: ?! `
- (setq lt-idx old-idx)/ j& ]3 C( G( G3 Q* R1 O
- ;; (mode_tile "edit_lt" 2), c/ F- O% l" I2 i8 `5 ]% u
- ;; (mode_tile "edit_lt" 3)6 R- y* r# H- _1 `
- )
4 x7 h- e: G$ y& K* m$ G7 W- O - )+ r/ t* T( |' X0 t( L
- )
9 {8 _3 J% q; Y& L# H n4 _ - ;;3 c0 @+ |0 M+ R
- ;; List selections end up here. Update the list box, edit box, and color2 W- W2 h% U$ {2 E- Z7 U5 n- E
- ;; tile.2 T( s4 D3 W3 X, u' R
- ;;# v; O5 F+ R# @! T8 I8 V& I0 ~9 V
- (defun ltlist_act (index / dashdata)3 q3 V* q" N" v9 y6 v) H
- (set_tile "error" "")
5 F% j. r6 E4 j6 t- J8 @) C& Q - (setq lt-idx (atoi index))2 I ]; X; u3 T8 l" N; p
- (setq ltname (nth lt-idx ltnmlst))
* s, D# G6 D( G4 ~+ t+ m - (setq dashdata (nth lt-idx mdashlist))) C0 T- t3 ?% m5 `- r/ o2 q
- (col_tile "show_image" 0 dashdata)
2 R! @% o2 C+ |, H, w6 U - (set_tile "list_lt" (itoa lt-idx))2 X2 r( u4 N) T, {" V5 e6 G
- (set_tile "edit_lt" ltname)( E0 A% `! F# J) J0 f
- )
E3 x! [3 B3 u5 S' ?. P* v: V - ;;% I, C( v8 [; y7 h! i' c
- ;; Reset to original linetype when cancel it selected
; I5 X7 |; S" b; R6 {# T - ;;0 K I! `- O' b' H% U
- (defun reset_lt ()& g b2 D- }" G, l* k
- (setq lt-idx old-idx)
3 l6 ^0 O" O! E* R+ |! ?$ q - (done_dialog 0)+ |. n) B* r2 N$ W! o( s+ M; i3 ]
- )
2 ^7 p: d& Y \8 W% g$ T7 x - ;;4 h o- G" _% [6 e! S) h- c
- ;; This function pops a dialogue box consisting of a list box,image tile, and
' Q( s" G# \/ ? - ;; edit box to allow the user to select or type a layer name. It returns the5 L x5 ?/ P7 f1 L9 a" W0 o; i
- ;; layer name selected. It also has a button to find the status (On, Off,
: o9 ~, `! i" B7 F, P5 w - ;; Frozen, etc.) of any layer selected.. q' D' r! m. i4 X' b
- ;;
5 r) g9 O; w7 j/ S - (defun getlayer (/ old-idx layname on off frozth linetype)
) Y, }9 l5 C) Y( A! u - ;; Create layer list the first time the layer; ^2 X2 A# s& \8 G: Z3 ?
- ;; dialogue is called.
, @0 M' `) U9 Q' Z1 G" c( |8 w - (if (not lay-idx)
' U& K5 y/ ^5 r7 ^/ G2 J' a2 C - (progn
\( ^6 a: K3 P1 d; _2 F8 a - (make_lay_lists). s& C2 X0 v+ V- m
- (setq lay-idx (getindex elayer laynmlst))
+ z( L. t" e9 g5 H; E7 M- W - )
8 v# Q6 q2 a# s% E - ). K; o4 |$ q0 B+ ~- h9 \
- ( ~5 x* n& C- J( o$ ~5 \, }
- (if (= (get_tile "error") "")5 r) Q1 u, x1 J- C |
- (progn ~$ _2 J, h/ M3 ?
- (if (not (new_dialog "setlayer" dcl_id)) (exit)): h# W; m! h3 V* b
- (set_tile "cur_layer" (getvar "clayer"))+ S' \) @) m' ^5 S' a
- (start_list "list_lay")! k( g) v1 h' w+ Y5 k/ ?
- (mapcar 'add_list laynmlst) ; initialize list box
' y6 m" t) t# c6 k$ l9 N - (end_list)& z! V9 x% k7 P0 A) s7 T7 v& @
- (setq old-idx lay-idx)6 l# @: ^2 m! @& f: [' g" m
- (laylist_act (itoa lay-idx))" N s- b7 A9 [) ~8 ?
- (action_tile "list_lay" "(laylist_act $value)")4 i1 H" n) {9 V9 _2 @
- (action_tile "edit_lay" "(layedit_act $value)")9 ? z; M. x0 n9 k) A- U: _% {* ]
- (action_tile "accept" "(test_ok)")
0 m7 [8 W# f; e. s3 \+ E! y - (action_tile "cancel" "(reset_lay)")3 u j6 z _2 q" U4 q" a
- (if (= (start_dialog) 1) ; User pressed OK0 b r, D- \# \0 T
- (progn
# F( P3 r9 E) Z8 j2 z4 a& o - (set_tile "t_layer" layname)3 [' W/ m# c+ K) c, k
- (setq elayer layname)! u o; V6 b, o6 b9 d
- ;; If layer equals bylayer reset color tile! Y0 m1 E. _; z% N! O
- (if (= ecolor 256)
6 g! J# j; E3 a& e - (col_tile "show_image" (bylayer_col) nil)
' o4 n1 ~' v, r; O7 O* { - )4 H( [* H& ]8 L e8 i3 f
- layname
) Q) u0 U7 _" Z - )
& \3 D2 ^" j% M) f+ _$ Y4 _ - elayer' `2 m5 k9 R) |9 s7 }6 b3 N
- )
$ v/ f1 _) z; N( Y! N6 E' A0 v - )' Q$ z A/ c5 M+ u0 R
- elayer _1 w/ m) j4 a1 T" {$ j. L4 J2 p! x b
- ), U" c/ }6 [" k& t
- )" k3 ~0 H! O# C) K
- ;;
4 O. r% K7 i; ? s0 A8 r" A - ;; Edit box selections end up here. Convert layer entry to upper case. If" ~" E" m/ f; U; i1 v
- ;; layer name is valid, clear error string, call (laylist_act) function.
1 H, c7 M( T! G: k - ;; Else print error message.
' R% m$ A& U4 o4 _1 V; w - ;;
, @* Z6 D s$ ?! K5 a) J - (defun layedit_act (layvalue): ]4 X6 r5 Z' e2 |& ?
- (setq layvalue (xstrcase layvalue))
: R2 _2 y% p( p: g1 }5 h% U( C - (if (setq lay-idx (getindex layvalue laynmlst))6 ?% J* [9 j! O; Z% j) M
- (progn
. s% H6 c) X1 f - (set_tile "error" "")
1 a. T; p! j6 {1 k B% E - (laylist_act (itoa lay-idx))9 W0 q6 U4 G r
- )
% L% v% S# \7 ~4 W. S% B2 f - (progn: m0 Z7 K, `- c- |
- (set_tile "error" "Invalid layer name.")6 v ?% X, M5 |9 E7 `# q
- ;; (mode_tile "edit_lay" 2)4 {+ A& o8 S6 l1 y) Z$ _
- ;; (mode_tile "edit_lay" 3): S" \' F5 n* Q) g; E N
- (setq lay-idx old-idx)
& k( v0 E6 R" G, v3 S7 U8 h - )! w/ L6 T4 G; V( Q) D* b, K
- )
" _+ g( W& q. S - )
, o0 [ F# d& p5 W; ^; ` - ;;
- W. w5 N. f& z* G+ c- @9 O - ;; List entry selections end up here.0 d, f$ Z y; _6 I$ y
- ;;9 R k3 {; H2 u4 O* A
- (defun laylist_act (index / layinfo color dashdata)0 z. L" @* @+ S3 L! s7 q2 G: }
- ;; Update the list box, edit box, and color tile.# {! q; ?. B+ F: ^) F$ S
- (set_tile "error" "")7 p& r' X# X, B- i* P9 o! b0 e
- (setq lay-idx (atoi index))+ e2 U% u% v: M! n4 K7 }2 U2 `
- (setq layname (nth lay-idx laynmlst))
: [) @2 G* T% C# k( G/ x* s" } - (setq layinfo (tblsearch "layer" layname))
) H5 G$ I+ H8 `, c% l G* m/ y - (setq color (cdr (assoc 62 layinfo)))# L8 t- L6 \( X
- (setq color (abs color))
% Y& @) i4 M* y/ T - (setq colname (colorname color))
% Q: X: z& g( G, N' { - (set_tile "list_lay" (itoa lay-idx))6 f; Q p8 M3 s& f
- (set_tile "edit_lay" layname). U( r* {7 Q$ k8 y, a; S, i
- )
; X6 e( q! q2 o) r - ;;
9 |& o: S% } X- L( z: u; s - ;; Reset to original layer when cancel is selected.# D9 m% j8 S3 L* b- y+ o8 L6 g
- ;;
7 [0 m. A1 @5 ]+ W. g* B, I - (defun reset_lay ()* W3 P1 {' ]+ `
- (setq lay-idx old-idx)
* Q. C! k! k" p: V0 N% H - (done_dialog 0). H7 }& O* n/ e$ d
- )( D5 \" T `$ R5 k0 I( ~
- ;;7 ?2 _" ^' ^" s
- ;; Checks validity of thickness from edit box.
" e( N" j# Y) C8 w - (defun getthickness (value)
( |0 V$ D5 x+ T. e) H - (setq ethickness (verify_d "eb_thickness" value ethickness))
; [7 m' l7 E: \: e; n - )& I1 X3 q7 V# ]; P8 ^
- ;;
6 I" s) P6 r6 x0 ~6 c - ;; Copy of (getthickness) for ltscale. If more, make this function$ E+ C8 Z4 T3 p d5 S' d
- ;; generic.8 R) y. X0 z; d9 [
- (defun getltscale (value)
5 B7 E" r4 O9 N4 v1 d9 N+ M - (setq eltscale (verify_d "eb_ltscale" value eltscale))
8 I7 E. M$ h, s6 |" t - )3 c2 m3 q9 N [$ p {5 @
- ;;
1 ^1 g3 L+ V: a9 ?5 d9 H - ;; This function makes a list called laynmlst which consists of all the layer
5 m& |" ?8 z( D; A7 K" }/ q - ;; names in the drawing. It also creates a list called longlist which X6 A0 X4 o6 h: B
- ;; consists of strings which contain the layer name, color, linetype, etc.$ ?" a- `1 b8 U) e4 s3 q8 ~
- ;; Longlist is later mapped into the layer listbox. Both are ordered the. V& y* w9 }( T* r/ Q
- ;; same.
3 b. N9 r& m2 C4 U5 Q X/ s5 c - ;;& Z& s6 H. |4 i& ^! w. G6 I6 x
- (defun make_lay_lists (/ layname sortlist name templist layer_number)# `$ r, V' _/ y7 J; h
- (setq sortlist nil)
5 Y- I X% g( q6 W3 a+ f- Y - (setq templist (tblnext "LAYER" T)); r1 o; r& h# G6 @$ l" a
- (setq layer_number 1)
0 p/ |) a: _* G6 r2 v+ [, D) D - (while templist
# `* x$ V. C! V5 R" N) @3 X - ;; No xref dependent layers, please.
0 a% F5 S7 x; y4 K" W. V - (if (/= (logand 16 (cdr (assoc 70 templist))) 16)
+ P3 O& k3 @ I, \ - (progn
7 F2 P- j0 ^0 P. i9 X( p( k$ B - (setq name (cdr (assoc 2 templist)))
) R& \9 I% n* A7 r. L - (setq sortlist (cons name sortlist))
) p, _, |, M0 h. x - )
+ W7 B( X1 J3 n6 n - )
6 R/ r% F. h" L- k6 ~ - ; Get the next layer.
6 E1 ~# h* j/ v- ^5 P; l - (setq templist (tblnext "LAYER"))
! |: E- _: v) E9 s' W6 M& E - ;; Not dead message...' X1 ~- ]# Z, V3 K- x
- (if (= (/ layer_number 50.0) (fix (/ layer_number 50.0)))& d: }0 R; s/ W$ {! r7 Q
- (set_tile "error" (strcat "Collecting..." (itoa layer_number)))# b4 s3 ^( ^. m* F# W1 i6 P5 d# a
- )2 @+ o. i' q7 {0 f, I4 j) e
- (setq layer_number (1+ layer_number))
4 c+ t0 S) O! D - )" N& A/ |. d. c0 c& |
- (set_tile "error" "")
0 W$ P( n1 J6 c8 B& Z. H - (if (>= (getvar "maxsort") (length sortlist))
1 y: n- g6 P( b; w+ w4 ?0 p5 y - (progn
' W d9 T$ ?1 @3 H) }: s3 p; Q0 h - (if (> layer_number 50)
" L% c9 a2 S; v& r3 i, m7 t - (set_tile "error" "Sorting...")- j* l7 E( K+ K# M' z+ w3 W
- )- r8 M2 W6 }2 _5 @
- (setq sortlist (acad_strlsort sortlist))
7 R5 J3 q* e0 v9 @5 R$ z/ [ - )2 K2 \: K6 M3 K; Z, a% z" Z1 H& I
- (setq sortlist (reverse sortlist))
1 w' ]9 c/ T7 I - )
' w: c1 R h& Z2 b, S5 a* s, u) l - (set_tile "error" "")' z/ ]1 T" o: J3 l
- (setq laynmlst sortlist)
: @9 w1 M0 b& Q: u$ y - )7 j" K- D( b" p H4 H
- ;;8 r6 T. S& P4 x6 V5 N7 `" Q
- ;; This function makes 2 list - ltnmlst & mdashlist.. v" E2 ~/ Y( R. l
- ;; Ltnmlst is a list of linetype names read from the symbol table. Mdashlist
" j: M( P" I- K2 \2 w- r" j& [ - ;; is list consisting of lists which define the linetype pattern - numbers; @# ?! Y8 t# F3 o! e; y. v
- ;; that indicate dots, dashes, and spaces taken from group code 49. The list3 ~# i- U! ^0 x; V
- ;; corresponds to the order of names in ltnmlst.
# C+ Y- t1 @ A# \) f& R/ v - ;;! ?$ A8 Q7 a$ E) M. Z: [
- (defun make_lt_lists (/ ltlist ltname); \4 ]- n: n& O6 o
- (setq mdashlist nil)
0 q3 @6 U# S# v' ~) E - (setq sortlist nil)
S5 ? s2 Z, X - (setq ltype_number 1)5 `, c: F( ?) ?) e0 z
- (setq ltlist (tblnext "LTYPE" T))7 k' n# ~3 B% T
- ;;(setq ltname (cdr (assoc 2 ltlist)))- d9 r1 v/ w/ O5 F
- ;;(setq ltnmlst (list ltname))- b, `* ^6 {. E- j+ I) `
- (while ltlist: _+ { S3 m* Z$ d
- ;; No xref dependent linetypes, please.. [, N/ m; {; I0 x
- (if (/= (logand 16 (cdr (assoc 70 ltlist))) 16)+ u/ b' _( ~& a6 R+ M1 @* J
- (progn- N+ D/ _' ?' [, X% x- L
- (setq ltname (cdr (assoc 2 ltlist)))
, L! N# b3 }8 |5 m$ c6 g7 O& Z$ b2 @: B - (setq sortlist (cons ltname sortlist)); y( t% S% L7 S( z
- )0 ~ Z, p- W* _* a1 S* S
- )- l5 H+ j3 `9 c3 j0 f8 D/ `8 e1 w
- ;; Get the next linetype.# j) |3 c5 _. `8 c) R
- (setq ltlist (tblnext "LTYPE"))3 p; m* d S, f; H7 I# {
* |( f! X! v8 X9 [- ;; Not dead message...
! o. P! e9 \% [9 | - (if (= (/ ltype_number 50.0) (fix (/ ltype_number 50.0)))5 {6 k$ t' ?: H- A- I
- (set_tile "error" (strcat "Collecting..." (itoa ltype_number)))
% A% [: L: n$ w0 R7 G. @8 Q4 _6 j0 ~ - )
2 X" M: ^: ^ E; Q9 ~! i: [8 { - (setq ltype_number (1+ ltype_number)), @* N5 C, o+ o1 e; X3 F
- , F+ {# @' \ a+ _8 f
- )
- g, }7 P# N8 T X9 j) U+ v0 d
0 r1 f" E( N7 \( I; W- ;; Remove Collecting message.
4 L# O% f: ^7 |8 o- P - (set_tile "error" "")' Q5 C. T, A( c. m- ~' {
; q5 [' l( b4 f$ T" M- ;; Sort based on maxsort.+ p$ y& E# F0 F9 w
- (if (>= (getvar "maxsort") (length sortlist))
; Q5 t; s8 E" h. T# X; ?: X0 y - (progn
M0 F) O t o( ] K - (if (> ltype_number 50)- F3 s: n; j f, v3 b
- (set_tile "error" "Sorting...")4 }/ s/ g1 o1 C& Y5 `5 A# y& z; M3 v1 h
- )
5 ]1 U1 N" i+ e+ z# q - (setq sortlist (acad_strlsort sortlist))
: i0 h2 y- M8 P3 q) ^0 ` - ). B0 p, t$ {0 N, u
- (setq sortlist (reverse sortlist))
, p+ ]2 {+ @+ K6 e: c; E - )
+ H: }3 `2 k/ J; p3 {2 S - (set_tile "error" "")
3 c2 E9 h$ D! a - (setq ltnmlst sortlist)+ F. v3 R3 n, {4 x- B
1 w1 z5 Q0 B) I! f; x8 E# P- (foreach ltname ltnmlst
8 b, J3 ]2 r# p% @% n5 ^; d6 | - (setq ltlist (tblsearch "LTYPE" ltname))0 o! _5 E( Q- A
- (if (= ltname "CONTINUOUS"); D' ~, J. {6 A; l
- (setq mdashlist (append mdashlist (list "CONT")))
4 c" S7 ~8 J) G9 l" m - (setq mdashlist
$ [2 T9 r2 E# @3 Q$ e: Z; { - (append mdashlist (list (add_mdash ltlist)))$ A; g+ R; Z' d! g/ U: V/ [3 F
- )
* o5 n/ l" s! {3 L) R - )
( S f l& Z' r - )
+ ~) b1 Q7 A7 O7 r+ ~: w7 m. k0 @7 C3 r; y - (setq ltnmlst (cons "BYBLOCK" ltnmlst))
* |: y; e B) s P - (setq mdashlist (cons nil mdashlist))
$ ]& [8 z0 s' ]# b, p6 M6 A - (setq ltnmlst (cons "BYLAYER" ltnmlst))
6 u! G" R& g# _ - (setq mdashlist (cons nil mdashlist))
f' K3 l/ a/ S: [ - )
- J( g) E. [8 e1 l% h - ;;1 k, J! v0 m; |9 Z. ~
- ;; Get all the group code 49 values for a linetype and put them in a list( l" J ~; d! F" u% k$ ?3 M) E
- ;; (pen-up, pen-down info).. h3 ?. v$ i9 V3 y E
- ;;# Q1 s( B& [1 `' _& k! _( {3 G8 T
- (defun add_mdash (ltlist1 / dashlist assoclist dashsize)
( y! v+ K; h j# q! m P - (setq dashlist nil): b! v3 ?7 e5 d
- (while (setq assoclist (car ltlist1)), Z7 O8 o1 ?0 W @5 z
- (if (= (car assoclist) 49)- {: \! \2 {9 T# e) h" E7 G# t
- (progn
* P) Q2 w7 H% j3 ^ - (setq dashsize (cdr assoclist))4 `2 W& |3 m/ T; J8 W1 t
- (setq dashlist (cons dashsize dashlist))" _0 `. g* u. h( c* x) l2 q
- )+ d; N3 k9 u5 @* l% K7 n& Z
- )4 A4 X9 M- u; f( `; n
- (setq ltlist1 (cdr ltlist1))
! p& A m+ E* N - )5 X3 n+ j! A; b+ u+ C
- (setq dashlist (reverse dashlist))
! E6 ~$ \' a( {# ^8 C+ M$ @& D - )
" }6 U8 }2 s4 _; o. ?) f - ;;
% a+ t3 G E7 R$ u- i - ;; Color a tile, draw linetype, and draw a border around it6 J* a2 V% w! M6 y: W
- ;;
( q: o4 u c* S, p$ { - (defun col_tile (tile color patlist / x y), k( q5 `: e+ h6 Z
- (setq x (dimx_tile tile))
7 v# Y z2 ?$ ~" R# b, }$ ~3 V& \ - (setq y (dimy_tile tile)) @9 V* W6 p6 } b$ F# A. s1 m6 N- x
- (start_image tile)( J: A' d7 ^5 X+ E& p9 T: X- |9 r0 H
- (fill_image 0 0 x y color): U% Z& U3 ]0 L2 I
- (if (= color 7)
* p* T# Y7 e8 z# N8 V - (progn
& d7 n* m7 ~6 p4 ] - (if patlist (drawpattern x (/ y 2) patlist 0))
3 z$ W1 F0 o, |2 a9 @4 K' H- h% w - (tile_rect 0 0 x y 0)
& g' r: [0 Q4 Y- b: L& m - )8 Y& v" @) l9 F( z- C5 r( X
- (progn
1 k) \" O) l# J6 W - (if patlist (drawpattern x (/ y 2) patlist 7))
; Q0 |1 q+ \$ U7 y - (tile_rect 0 0 x y 7)
& y! V3 M5 H7 A4 P) X: ^" q( r% x - )
+ G( d# c4 `' u. p9 ^) w" z M9 k - )
: @$ E1 x2 Y3 U4 p - (end_image)
& c9 _/ l [% ? - )& W( a: m: a7 S" N7 { P
- ;; c5 E$ p# I% l$ o$ b/ ^4 z! V
- ;; Draw a border around a tile
( v' \. B; o+ {( V - ;;& |! x \0 J8 v7 Y6 d. [7 J4 f
- (defun tile_rect (x1 y1 x2 y2 color)
* K" K" i. ?: k. m4 h4 O9 |4 a3 _( d# x - (setq x2 (- x2 1))
. W( |5 L1 ]' @! E% O/ P - (setq y2 (- y2 1))- @( S6 L9 l' z2 y1 o9 b8 C0 Z
- (vector_image x1 y1 x2 y1 color)
$ S# l" u8 M; m! ]3 @0 H - (vector_image x2 y1 x2 y2 color)
% h' n( b- ~$ P - (vector_image x2 y2 x1 y2 color)
( I2 w4 x* Y; r8 A% S - (vector_image x1 y2 x1 y1 color)* ]: m4 K/ H! t* j7 P0 u1 J1 p
- )
3 b# J2 u b9 S. M& X - ;;
2 ^: [" B8 Y2 ?8 Q3 v [) E1 o - ;; Draw the linetype pattern in a tile. Boxlength is the length of the image& U2 U: h" C% M4 C7 A/ h+ g, N
- ;; tile, y2 is the midpoint of the height of the image tile, pattern is a. D: l5 _8 v4 T8 _8 w9 h/ R
- ;; list of numbers that define the linetype, and color is the color of the
! {( z W9 d( e9 ?; y* d - ;; tile.
& a3 S. g- _2 |6 X) P( I. q* u( w - ;;
$ {; x" N1 X2 t: g6 a - (defun drawpattern (boxlength y2 pattern color / x1 x2
/ n2 R- {8 m/ ~ - patlist dash)
# L4 ]" |/ O6 [ - (setq x1 0 x2 0)
0 E' A$ H6 ?. a1 y# s& p3 y - (setq patlist pattern): U1 T% Q- |7 E% C' `' X' B, r, {
- (setq fx 30)) q, [" w( V0 E* Q- J# K2 {
- (if (= patlist "CONT")* {& K3 N/ S$ ?7 f
- (progn (setq dash boxlength): u; S( n; X: `: H
- (vi). U* v H: k# r; p7 P) F x; P
- (setq x1 boxlength)
5 {+ v1 B+ j. |" R4 d( E* m - )
0 V$ h6 [+ ?1 b6 G. X - (foreach dash patlist$ y4 N1 l; p1 s {
- (if (> (abs dash) 2.5)
* w$ \# j9 [7 u( b7 c( i - (setq fx 2)1 J. t* C: B Z9 M# Y6 R
- )/ F6 J% n7 p2 k4 I0 M# h. |% ^! `, V$ J
- )
+ R; D( t3 p5 ]3 J$ ]* L3 M - ); [# z) v7 z P) Z) ^+ W' Y
- (while (< x1 boxlength)
" u9 V# U8 N0 V* J, h - (if (setq dash (car patlist))- c. t& W2 w. t) D. F: t6 L, A
- (progn; I# D! B) F! \) j( E- k N9 d
- (setq dash (fix (* fx dash)))
( ?* l& _ u8 d1 X! D - (cond5 B6 t3 R5 ?/ }/ t4 ~4 K8 ]
- ((= dash 0) (setq dash 1) (vi))/ \1 l \$ F h2 R6 x Z6 ~( _4 p4 n
- ((> dash 0) (vi))
1 m; c' K9 q- X - (T
7 e D7 Q& [+ Q; {2 n - (if (< (abs dash) 2)
1 `- s$ e; |% n' a0 [; r" \ - (setq dash 2)6 ]% `6 O" @. w# F8 g& X) G. g
- ), b. k4 _1 E' u( M3 G1 _
- (setq x2 (+ x2 (abs dash)))
9 U( W% X. y# F, G - )7 F$ k8 o2 P6 i5 v0 W
- ) l. y: v& H% F6 H8 C0 R
- (setq patlist (cdr patlist))
" `. i5 L* ?. E8 T9 } - (setq x1 x2)& w0 K: p, b; Y
- )
) u8 E6 Z5 b- t: d5 ~ - (setq patlist pattern)
0 i* ~6 e9 O& ?0 l. b2 Z% ~ - )
6 b9 c1 J& Q; M1 \7 e - )5 s \/ X+ m! p9 P7 y5 E- G5 p& c
- )
" ^, |$ z9 _" i9 ] - ;;; R& U0 d% x0 T0 }0 z
- ;; Determain state of xclip3 r' |+ B, S" m( U
- ;; Returns the group 71 value of the spacial filter dictionary.$ B$ F" j( F# r; p8 U- v, }
- ;; If the entity doesn't have a spacial filter dictionary, this
* V4 D) M, {( t7 ] - ;; returns 0. If it does it will return 0 or 1 depending on the% y7 z1 c) ?- y! M2 q' G4 u+ i
- ;; current setting of the state of the clipping visibility.: |# K! J2 T3 ]% i+ c
- ;;" Q* a* K9 k2 N7 s+ n
- (defun xclipon(elist)
6 Z- R) l% z7 g9 G4 F9 ?4 }" q$ d - (setq hasclip T)
; h8 ^! b) \* P( _# D - (if (/= (assoc 360 elist) nil)
9 l- p. \; ?9 t2 ^ ]: c - (progn
9 z: @% L) P+ ]9 E; N7 W5 s. J - (setq tmp (entget(cdr(assoc 360 elist))))- S) r- _/ b: C* E; ]7 Y
- (if (/= nil (assoc 360 tmp))
" j3 _( B% c" t" r - (progn
2 p8 a3 I& e8 u - (setq tmp (entget(cdr(assoc 360 tmp))))$ f { K: @9 _9 y0 y2 P* w5 K
- (if (/= nil (assoc 360 tmp))8 G F9 F: |- p5 ^
- (progn
3 N& \, [% a4 H" U, b7 V3 ]2 \. b - (setq tmp (entget(cdr(assoc 360 tmp))))
' H' M6 k4 X( c( q4 C/ X5 X6 v - (if (/= nil (assoc 71 tmp))
) ~* j' e4 `0 ?& V0 p - (cdr(assoc 71 tmp))
" y3 ?% _* t: R: j' u - (progn 6 b) g( R( g8 g0 X* t5 K0 V! z
- (setq hasclip nil)
# g" e# U; J; U: ~$ @9 G! S6 b - (eval 0)
) W: T d/ ^! }$ x( Q - )0 t* t7 i$ s* t
- )
1 e* n2 }; q/ B, x1 F9 V - )/ _, y' z8 K% I( @5 B
- (progn , E$ ^! N. }3 K8 w
- (setq hasclip nil)
, g$ H% r+ y) I$ D - (eval 0)7 v$ k% H7 B# P. j4 Z' _
- )
z- M, s* A9 o' q2 b/ O# F - )
+ h; q$ }6 ~# o7 J/ y# z, u) R# X2 e - )
/ k& M5 a* W; M6 [$ c; T - (progn ' x; m- B- `) K: l- w% B7 V
- (setq hasclip nil)
% Y; i3 c0 n, i* x8 ^ - (eval 0)
) U! f0 w! z+ r+ f% x2 T' L8 U. g - )# l' S* w" y. a/ ]* L8 E4 m
- )3 N' S( s' w3 m: f5 l: A2 W
- )
5 S/ p/ S3 a* ?. e+ c - (progn 8 u+ a7 P K1 S, Y1 b( b
- (setq hasclip nil)
2 v; v+ q/ }4 n8 y/ X - (eval 0)' C M# F/ H& e3 _
- )
5 n4 Y* R5 |5 T - )
8 P$ W. U$ a9 X" c# r - )
! s8 s3 J7 u* y2 |3 ]1 F8 C7 ^ - ;;# f4 o7 ~; A, w6 |3 l' c4 M
- ;; Draw a dash or dot in image tile6 @3 ~# L; j# R/ W
- ;;+ U: {$ E4 v! Q J
- (defun vi ()! m8 C( _. P3 w9 v1 v; f2 _) T7 L5 R
- (setq x2 (+ x2 dash))3 y/ j5 e2 {8 H' ~, {5 z
- (vector_image x1 y2 x2 y2 color)$ z. j& c# K7 ?# L# s$ U
- )
' l: c& g* N0 l: B/ z; Y - ;;
! [9 m6 a! G+ d8 [4 m - ;; If an item is a member of the list, then return its index number, else! P1 a4 F' _1 x' Q- C* ]' j" C+ l* [
- ;; return nil.! f% X: g- E3 W2 z
- ;;! D8 e5 v% l& P4 s8 K% h* j
- (defun getindex (item itemlist / m n)
7 ]9 i$ e9 `# x$ F2 I8 i - (setq n (length itemlist))
7 I! p8 J0 |5 N3 q' {! O. Y; d9 Q - (if (> (setq m (length (member item itemlist))) 0)1 B A! ^1 }$ F; O6 {/ a' |- k
- (- n m)/ s( `3 {, f5 Z0 c9 ^: _
- nil
( e$ }3 o/ O; O( r2 k% @ - )
. g% s) P! ^: C: C$ X" V - )
, e9 p) O2 }8 S - ;;8 W: D9 v, U# Q) K p4 E
- ;; This function is called if the linetype is set "BYLAYER". It finds the
2 G% }4 k) b) r - ;; ltype of the layer so it can be displayed beside the linetype button.
/ ~4 Z3 X. I: n6 k$ h - ;;
) U# m8 B _7 i - (defun bylayer_lt (/ layname layinfo ltype)
. q G3 g: `+ i" j( Y! T6 {3 e - (if lay-idx3 `, [- h) T+ R L
- (progn# k x! q4 i! m1 N6 d0 ~$ D; W$ U
- (setq layname (nth lay-idx laynmlst))8 g% Y' F O% j. i$ y9 H/ b1 X
- (setq layinfo (tblsearch "layer" layname))# O( D, y5 [& T, {7 s* y. X
- (setq ltype (cdr (assoc 6 layinfo)))
$ t D+ e# s4 ~+ T - "BYLAYER"' q5 L) z# \9 A0 t( o3 T/ b% U
- ). M' } M7 g3 {7 h9 P! d
- "BYLAYER"
! Z$ m+ n9 {$ {& H6 `7 b/ T% d - )
( m% ], f# N3 e - )9 b+ w- o# y1 O3 [6 V4 w7 A, r
- ;;
% P: r( B! v; ? c, z7 ? - ;; This function is called if the color is set "BYLAYER". It finds the color& Y! m- T7 L( v) ~% v1 `1 t
- ;; of the layer so it can be displayed beside the color button." o0 P* ~+ _; j- z/ L2 X; p5 |
- ;;
/ F; |' I# r3 o6 Y: h/ | - (defun bylayer_col (/ layname layinfo color) L& a$ v" W. G N8 v, K
- (setq layinfo (tblsearch "layer" elayer))
) `7 H& q( V9 x6 g6 y3 z1 ]# k( N - (setq color (abs (cdr (assoc 62 layinfo))))
$ S' i: ^- p1 ^& s, P5 N - )0 S" f9 k3 d- [5 A( X
- ;;( c0 v) R; {3 s4 m) k* F
- ;; Used to set the color name in layer subdialogue., G" T% D( x* I* w
- ;;: [, i6 i( N4 m* C& F4 O3 T5 A
- (defun colorname (colnum / cn)) L/ P9 H, z& J9 r. u
- (setq cn (abs colnum))
8 L7 d0 I0 [! { - (cond ((= cn 1) "red"); s. W. D" u0 `% @0 [% X
- ((= cn 2) "yellow")
* m5 X3 K) m$ H" I* v - ((= cn 3) "green")0 N; y/ O% c0 ^3 j: L0 u; ~
- ((= cn 4) "cyan")
+ P/ T$ [5 r8 m. g5 Z: q - ((= cn 5) "blue")- }7 G1 c! r' A4 v% J" {# `# o
- ((= cn 6) "magenta")
+ o' Y7 A% F0 q - ((= cn 7) "white"), }( `; ^$ K" J! w2 l# b
- (T (itoa cn))2 w& G9 e* U7 K( a/ ~" ?
- )* a- C5 Z# F( n6 V& W z2 H) ~$ X
- )
0 r. W$ H1 D5 \- K- ~ S - ;;
% G! h6 Q2 U) Y+ A7 a. I$ S - ;; If their is no error message, then close the dialogue.
* ?0 e: o+ X5 z4 y, d - ;;
3 J, m- w) R8 A, ~8 H6 F - (defun dismiss_dialog (action)/ U9 m C9 W+ G0 Y5 @3 Q3 ]
- (if (= action 0)
# K/ p, K; z+ |" n) W4 B5 m - (done_dialog 0)0 I. N% u- U% Q% W
- (if (= (get_tile "error") "")
9 _8 C: D$ v6 y - (done_dialog action)9 ^3 o; T5 m% t: F8 Z* c
- )
/ R/ c/ j5 Y) P$ z: G* s9 s4 _2 Y - )
2 V9 F$ V- d. G z! ?) I H L - )8 U% G1 B) D4 b: [4 t
2 d/ U5 }1 N( I8 U: g! l" J' ^9 W- (defun test_ok ()
* E8 s% f4 C. f! U - (if (= (get_tile "error") "")- Z" H/ @ j- G1 |
- (done_dialog 1)
: g$ X n: J7 f% g0 ? - )
4 ]8 O# x" s% ^2 ]4 {" D - )
, e L% F: N4 p - & ^+ s; L$ G, k. B0 v# O) c
- (defun cancel ()
* i1 I! X8 E9 d8 g* w - (done_dialog 0)* O/ Z4 r* @/ s; j$ f: @
- )% A8 I9 H% W& ?6 T) P8 n4 l
- $ s& F/ i5 `7 f1 Y4 f! w; X
- ;;; =======================================================================
, k( }% D) \8 n) }2 H: b4 A0 o - ;;; SETUP layer and linetype lists for application, and initialize all
2 c5 A0 o. k& x& V6 h& _- c - ;;; program variables.
1 q% O) L$ |3 [0 X9 o - 1 p9 d4 k# F' m; K$ T- O/ B
- (setq elist (entget ename)
2 D" b7 f$ j5 A: p Q/ c8 D - old-elist elist, w4 U& e3 N |5 X
- modlist elist
( T9 o6 @% m& f! a# l3 V% \ - etype (strcase (cdr (assoc 0 elist)))
0 ~, G3 E3 B( K5 u; E - ecolor (cdr (assoc 62 elist))
1 y! S; S" v2 l( D" [: c - elayer (cdr (assoc 8 elist)), W- i9 q+ k8 J, I" `+ Y
- eltscale (cdr (assoc 48 elist))& |8 `0 E9 l6 x/ z3 F5 ]
- ethickness (cdr (assoc 39 elist))) ^/ i9 C" j+ X( M/ @; r0 V( x
- eltype (cdr (assoc 6 elist))
( R, y2 b# j8 |6 z0 q - )
7 \+ |, j7 w4 |, c% W7 e - (if (= (assoc 210 elist) nil): d/ Y' U2 i. U3 ]7 X
- (setq extru (list 0.0 0.0 1.0))& f. a" B, w+ a$ b8 V- p, j
- (setq extru (cdr (assoc 210 elist)))1 M9 g4 H- F# Z
- )% z- S& r K. R1 M1 [
- % B" T$ L1 @ r3 r# n6 L: W6 {
- (if (not ecolor) (setq ecolor 256))! W) f% J$ \( j& n2 r) c+ j3 F0 c
- (if (not eltype) (setq eltype "BYLAYER")): V) ~, b Q4 Q! x! ?4 G+ m1 @5 R
- (if (not ethickness) (setq ethickness 0)) y5 f2 w J' {6 @9 Z4 v
- (if (not eltscale) (setq eltscale 1))
" p6 I: |1 k" F& j0 K - ) ; end ddmodify_init
8 J3 G1 q( _ T/ u" G - 4 Z6 ?5 Z& L/ ^3 @9 x0 J" @ n
- ;;; --------------------------------------------------------------------------
% L" `! C3 p* V - ;;; Function: DDMODIFY_SELECT' `$ A1 c# \7 _" s4 ^
- ;;;
" w/ y* D6 b: \% X& } - ;;; Object aquisition function.
. B f5 s: g5 O - ;;;* R) ^0 m! T. i' ~) I
- ;;; (ddmodify_select), a% K1 k& H$ b: ^! z
- ;;;
) z- `! q4 ]1 t! y4 p( \3 |8 i& E - ;;; Obtains object to be modified, in one of three ways:, _/ l$ e: c, Y! n5 N% C3 W
- ;;;
7 b2 S3 U' Y/ W! _: ^; I - ;;; 1 - Autoselected./ [* G0 K, W2 _1 ]6 f( ]+ M1 y
- ;;; 2 - Prompted for.
% u( i3 l6 Z: d4 n8 p, m6 s0 u0 B - ;;; 3 - Passed as an argument in a call to (ddmodify <ename> ). ^+ z, }: H* _. w" s/ u
- ;;;
6 n4 T2 a A6 I( K c. {0 c - ;;; The (ddmodify_select) function also sets the value of the6 v: y8 F- L% O. z g
- ;;; global symbol AI_SELTYPE to one of the above three values to" j6 @" |) E3 a# C1 t! I4 q' w! f
- ;;; indicate the method thru which the object was aquired.( O8 s9 y q5 M }" }
- ;;;
5 z, Y2 x/ e, u& O0 w* S - ;;; This value can be useful to applications that want to RESTORE6 a& @, c+ q) {5 A1 o8 l% n
- ;;; an object that was autoselected to its previous selected state
0 r4 a2 m) J2 M& A e) b$ V i. P - ;;; when they terminate, although there doesn't appear to be any
" \+ b6 R9 S' g& j! l) _+ ` - ;;; way to do this right now.( Q0 a8 e9 r5 s& I. w
# z) J4 F. y& j+ }2 X- (defun ddmodify_select ()0 D. h; B7 c% j j3 I: V
- (cond8 N+ V* T- z' ]5 g. Z3 K
- ( ename ; (ddmodify) was called4 ?" {& t) @: y) T9 W5 x Q
- (cond ; with an <ename> argument9 b! F! W% ?. t) I) a6 C
- ( (entget ename) ; If object is non-deleted! [0 y0 v8 _7 i0 B# U8 O8 M
- (setq ai_seltype 3) ; then return its ename.
, N- Q% @* J8 G) \! t R - (ai_return ename))))
! m! f# E) V' u
2 d4 |/ z) z: k4 G# M! @. @- ;; return auto-selected , see ai_utils.lsp6 S$ v* t$ L& A+ k7 d
- ( (ai_autossget1 "\nSelect one object to modify: ")) m% g( x* m- R
- - K- h2 a0 r1 S; a- T9 f
- (t (princ "\nNothing selected.")" w( q" L2 F6 }" V! Z1 D
- (ai_return nil))- I: d3 q, {' h. H. U+ t8 Q
- )
; B4 I0 U* U3 N, L* }$ x - )
$ N5 l; t) J+ l) o* V( L - * m' ^7 g! i) T* Y, P( n: `
- ;;; ============= Command line interface function ======================= b5 z; j' r5 ?8 D5 ^
9 n% n& _. \) Q) c" Q+ }5 W( C5 f- (defun C:MMO ()' ]2 D: Z$ N7 R. n3 n
- (ddmodify nil)
" ?! N2 k' i1 ~+ \3 G1 W - (princ): }: H. }9 I1 D5 O. Y5 T! ~
- )
. e5 I& b/ y5 T+ x+ u6 H
9 r" Y$ K3 d, ]; E6 t6 k+ p7 A: n+ j, x$ w& O- ;;; ================== (ddmodify) - Main program ========================
, ]1 T, k2 i$ e5 ` - ;;;
: X& \6 p+ i1 _/ S- H2 b - ;;; (ddmodify <ename> )) |$ Y' Y- J6 N( C1 m
- ;;;
. p& ~# r8 B& ?$ ?- U7 r% L - ;;; Main program function, callable as a subroutine.
$ a! k. n' ^3 o# ~1 x - ;;;
/ Y7 U8 l: S3 g I8 J* W; ` - ;;; <ename> = object name of the object to modify.. B0 K+ {$ W. E) E, g
- ;;;5 x" C) T7 Z/ K
- ;;; If <ename> is nil, then user is prompted to select! Z q8 ? I) F2 X6 I% h
- ;;; the object interactively.+ K+ W F+ q3 j, ^/ `
- ;;;; F0 S U# B, @$ Y& i
- ;;; Before (ddmodify) can be called as a subroutine, it must
2 T+ L4 {. H( \( D! \5 o( d+ v - ;;; be loaded first. It is up to the calling application to0 Y6 f& F. H2 r
- ;;; first determine this, and load it if necessary.* g V( _$ o8 @+ p* b9 C
4 d% a8 P1 x$ U
2 E7 }& R$ x6 ^" \3 Z. a6 M- (defun ddmodify (ename /
% b( h8 ]" A, T+ [' D - 2ndpt ell_calc_area move_pt1 templist# Y, U$ X- p7 R1 K9 o0 r% h
- add_mdash ell_tile n tempmod6 r2 J% S0 D) Y( A9 _& z& K
- alipt eltscale name tempst_ang' @2 U) l. ]( n
- ang eltype newpoint test_ok6 Q) Y: d& o: k. ^, r1 \
- arc_calc emod next text
) N3 I- k% y* q9 r( L, o - arclen end_ang next_vertex th-value, w: n5 R8 r4 M' u$ `- H/ O+ }( E
- assoclist endpt obl tile
' @4 v1 A+ |" | - atprompt errchk off tile_rect/ j. K2 w" C W6 k
- attag ethickness old_majrad tilemode
4 t8 V* Z, a0 d! L/ H - attprompt etype old-closed totang7 m; [$ X7 t* `: P& c
- bit extru old-closedm tstyle7 g; [' C! n$ B* c0 A
- bit1 fchk old-closedn u$ j0 N" B. \! w& k* e
- bit-10 first-10-rec old-elist undo_init
, P3 L% c" v5 ~+ W2 d - bit-11 first-10-time olderr upsd
* Z& [9 H+ ]. A- `( r - bit2 first-11-rec old-fit v
. o3 Z5 x( v1 ]8 [* o- J- h - bit3 first-11-time old-idx va
0 q* r$ a5 f0 G+ F; W0 _ - bit4 fit oldlist value
+ M7 _- C7 M' w8 A. v+ Q( m - bit70 frozth old-spltype ver_4
; B8 G8 Z9 N+ W! r5 C - bit-70 f-vis old-u ver_ang1
z! o+ m. j( D Z3 W - bit75 fx old-v ver_ang2- ~% C4 H- A! K7 p
- bk-up get_color on ver_col
3 v4 U$ z+ c5 R" H7 C& C - bkwd getcolor onoff ver_colsp
( c) E* U7 x* D& L! B1 I% [ - boxlength getindex on-off ver_eangle
+ A/ o: D7 t* W1 g8 I' Y. W7 t - bylayer_col getlayer patlist ver_hght' b: e7 N0 A1 v" _( |$ J F
- bylayer_lt getltype pattern ver_majrad
+ j; |7 B1 R1 U A6 U9 w# W+ H0 G" a - calc getthickness pltype ver_obl
& h2 a1 I s) `" T, Q# ?, i - cancel globals polytype ver_pt1
* g% }0 a( K; T1 M9 O3 S - cir_calc ha pre ver_pt20 |2 R: _5 F# C9 \' \/ D
- closed ha-prev proplist ver_pt37 P9 I6 |& w( O4 t3 X9 [0 j' y/ X
- closedm help_entry pt ver_pt4
2 E( p/ r% M% k, K3 g2 f - closedn hght pt1 ver_rad
8 ?( X! `7 y. u8 S' Q+ S - cmd icvp pt1_eq_pt2 ver_rot
4 _) |% q+ u9 P, x1 H - cn image_add_vector pt2 ver_row
: |9 ~+ q3 [/ c - cname image_clean_variables pt3 ver_rowsp" d% a1 t7 u9 `" I0 l* P
- cntl-pt-indicator image_cross_product pt4 ver_tag M- { `7 h) [2 p# I& ~0 S" _ H- G: t
- code_71 image_disp_opt ptype ver_u$ ]6 s$ z/ x2 H. x, z, o9 C q) U
- col_tile image_dot_product radius ver_v
4 Z! q5 l# f; f# L/ e - col-idx image_normalize_vector rational_spl_flag ver_wid
a- | c1 @# Y( S c9 e% J - colname image_rotate_vector reset ver_x1
2 j' r6 r/ G# Q4 p: r7 r0 q# _9 Q - colnmlst image_scale reset_flag ver_x2
A8 T& F8 y$ M, d' D+ l - colnolst image_scale_vector reset_lay ver_x3
2 q1 Q& @; u& Q- M1 j' {" F - colnum image_update reset_lt ver_x4/ c' l4 J- H+ r4 b3 g) I: s
- color index reset_uv ver_xline_pt1
5 J; Q/ e' \+ H2 Z5 x0 [ - colorname inv rot ver_xline_pt22 k9 b& L$ L& `7 J* B) C$ ~3 P- q
- colorno item rows ver_xline_x12 Z, t9 T0 g, b
- col-sp item1 row-sp ver_xline_x2
' v$ Y- s3 R$ }; t - columns item2 rrat ver_xline_y1
% Z: T, b1 j2 f - con itemlist s ver_xline_y2
9 e( \; Y3 r+ B8 L# a, v2 E - coord jlist set_action_tiles ver_xline_z1; I: z$ C5 X2 \
- ctr jlist_act set_just_idx ver_xline_z28 o, x5 Y* O1 | {& [% C
- cur-10-rec just-idx set_tile_bk-up ver_xscl5 ?- s( @6 `( L
- cur-11-rec layedit_act set_tile_cntl_pt ver_y1
0 c( A2 k( o# } - cvpname lay-idx set_tile_data_pt ver_y2
2 f; h8 s) k. Z( z+ P: L! n3 R x - dash layinfo set_tile_dirv ver_y3- D3 Q" y. N) n5 Z' H- |, X
- dashdata laylist set_tile_edges ver_y4: D* t+ K1 `' y9 p, J2 H8 J2 i
- dashlist laylist_act set_tile_endang ver_yscl
( t3 C2 ~& B' x7 h - dashsize layname set_tile_hght ver_z1' v2 p7 p% m6 ] j
- data-pt-indicator laynmlst set_tile_icvp ver_z2! z {1 j9 x( b' x& ^" w# E
- dcl_id layvalue set_tile_just ver_z3
* j0 y1 b# u$ @4 M5 ?8 H. J0 d - dd3dface line_calc set_tile_obl ver_zscl$ p* ]. l9 S& r- [
- dd3dsolid linetype set_tile_prompt verify_a7 b# U. G6 D5 H) A [5 i- \
- ddarc list1 set_tile_props verify_d
2 `" j4 T) C- Z' v2 k0 F - ddblock longlist set_tile_pt1 verify_i! m/ x- G" S- v2 Z, {- y
- ddbody ltabstr set_tile_pt2 verify_xline" _ L7 v+ b. D( c" m' H$ I4 x7 A
- ddcircle ltedit_act set_tile_pt3 vfy
% a) v) X+ v% i. T - ddellipse ltidx set_tile_pt4 vi. p/ j6 ~( e$ ~0 Y
- ddgetprompt lt-idx set_tile_rad vlist0 V2 h! E/ P! n" \
- ddgettext ltlist set_tile_rc vname3 @# F4 \3 |: a- e/ y, L
- ddimage ltlist_act set_tile_rot vpf
9 v4 z3 N* V; T ~, m9 l - ddimen ltlist1 set_tile_scale vpid
6 p4 y. w. w; \1 O3 S" o* t. f% I - ddleader ltname set_tile_spline_props vpldata
) r G6 W: `) K* d0 f7 r - ddline ltnmlst set_tile_stang vpn- D; |+ s( s6 k, P* f4 I
- ddlist ltvalue set_tile_style vpt# k6 I; V* e! c" w! F
- ddmline ltype set_tile_tag which_tiles- l$ T T" x2 @ r( N( ^4 `) k) a* ~2 i
- ddmodify_err m set_tile_text wid
. _& N4 N- m) g/ h. M k8 F# X - ddmtext majrad set_tile_vpt x8 p2 Q8 v6 }0 V; C5 F$ j- m: ~
- ddpline make_lay_lists set_tile_wid x16 M- J, U% k8 Z; ? Q! F1 r; g5 O$ c
- ddpoint make_lt_lists set_tile_xline_pt1 x2) z: s+ y' `+ T/ \* D s
- ddray mdashlist set_tile_xline_pt2 x3; k2 @. f( {) H5 g" X
- ddregion minrad setcolor x4. u8 p* e; ^8 k3 {# B+ l
- ddshape modify_3dface shght xdlist
) r7 l& F6 p( h } - ddsolid modify_3dsolid showpt xline_pt17 u6 _; m$ z+ x) h1 B" m
- ddspline modify_arc size xline_pt2( i6 K( y$ a% e/ N+ V! l' C
- ddtext modify_block slist xline_x10 |+ s3 y9 x* \5 g# c/ p
- ddvport modify_body sname xline_x26 P4 R; F7 i4 d/ Y
- ddxline modify_circle sortlist xline_y1 ?. ?# |) q, N% ~) \, X; H$ S
- denom modify_ellipse spltype xline_y2$ f- w6 Q1 P& H* X$ R" ~) Q1 `9 l
- dialog-state modify_image ss xline_z19 ?5 K0 v# [% k
- dir_pt modify_line st_ang xline_z2
; k( R& X; i$ x, n% M7 x - dir_ptx modify_mline stpt xscale
3 s$ r$ G3 S4 [; ]" D - dir_pty modify_mtext style_act xx) g" g" s' d$ K5 l. V2 C1 f* G: l
- dir_ptz modify_point style-idx y# b* K( h2 r& O! m9 T7 o
- dismiss_dialog modify_polyline style-list y12 h2 N7 d H' N
- drawpattern modify_prop_geom tagval y2
" k8 f6 X4 e) F/ u) `$ Z. C% y' M$ ^ - echo modify_properties temp y38 `: [5 R, D. N2 @5 |
- ecolor modify_ray temp_color y4
! {9 I0 o8 B/ K$ e: M - edge1 modify_region temp_dir_x yscale- _, ?0 j! f9 w& B
- edge2 modify_shape temp_dir_y yy
- r9 Y8 A% [+ f+ |! M) `: @( r; X - edge3 modify_solid temp_dir_z z1
6 R2 V6 {4 W ~ - edge4 modify_spline temp_xline_pt1 z2$ a/ J( A4 y( n7 g% W, W
- edgetest modify_text temp_xline_x1 z3) {) Y, N) d1 @; U9 S! ~
- elayer modify_vport temp_xline_y1 z4
' v+ m$ E( d1 ?; N2 a3 _' b6 w1 J - elist modify_xline temp_xline_z1 zscale8 s& @" r+ ^' o) u2 K
- ell_calc modlist tempend_eang zz
, h% G; f- @& f6 U9 s - dir-idx safe_ddedit ver_MtextWidth xcliponoff
( i4 L" ^* I' W' A - MText_style0 @2 e6 \7 G% b6 t
- )9 I# O5 d: d$ a9 s, a V" p
- 0 b: Q' c ^5 [* X/ ~
- (setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho+ U( j; ?1 W+ d5 H5 t4 O1 p
- old_error *error* ; save current error function# g3 v' u. J9 i' J* H3 Q7 P
- *error* ai_error ; new error function
, T, T5 n) I9 H" _ - )
y! W1 u" y" O1 j" q
5 _5 D, G7 q- f9 g$ O& }$ f/ l+ Z1 Z- (setq old_pickstyle (getvar "PICKSTYLE")) ; save old pickstyle) y4 O. M R& l
- (setq new_pickstyle (logand old_pickstyle (~ 1))) ; turn off group selection
; V7 F1 f: m0 W - (setvar "pickstyle" new_pickstyle) ; bit and set to new value
8 n% t h9 e& V - 7 s2 p1 T: L# J. G0 c5 y
- (setvar "cmdecho" (cond ( (or (not *debug*) (zerop *debug*)) 0)- f! ^/ m5 M6 }. F, J9 v
- (t 1)))
% v; \; d+ ?9 K0 ]8 y - (cond+ L% }; C+ h! B
- ( (not (ai_notrans))) ; Not transparent? ^; `4 C% Y2 u, n
- ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
! U: z* P S! Y: X1 L" \2 y( L - ( (not (setq dcl_id (ai_dcl "ddmodify")))) ; is .DLG file loaded?, P0 j# ^4 c8 H* p, F& B( r+ [4 w
- ( (not (setq ename (ddmodify_select)))) ; object to modify?
% z. B7 p1 B; i5 P3 `
0 q% [/ ^1 m z6 C& \, H- (t (ai_undo_push)
, W& J* L# N& j; a# X - (ddmodify_init) ; everything okay, proceed.
a" d+ w2 B0 w2 H - (cond
T) H" w, K ~" b; x5 [( Z3 P - ((= etype "LEADER")( `. l( u0 O7 y# p, P R
- (setq help_entry "modify_Leader_dialog")
% C$ Y7 ?! z5 O `. g+ ~' C - (ddleader)- u. m4 ^( B, j% `/ n
- )1 N$ C5 o. x" b( A
- ((= etype "ARC")
! N$ d) D/ T, U- y: s- `6 @ - (setq help_entry "modify_Arc_dialog")( k c, M& p, R* V
- (ddarc)" z |% \# m1 n/ [9 ~" H2 ^
- )
: W$ @1 u! E; b$ ~, v+ e' U - ((= etype "ATTDEF"): n# x1 C8 Y& K, K* g
- (setq help_entry "modify_Attribute_Definition_dialog")
4 B! V4 P# k7 V: M% e - (ddtext)6 h# H( u1 J8 L& V
- )
: H8 x: D2 u# Z9 E. j5 i - ((= etype "CIRCLE")3 l0 U( w4 y# v- Z# `
- (setq help_entry "modify_Circle_dialog")1 p6 C0 z8 S( t1 f5 C4 O
- (ddcircle)
1 W# f0 `7 K' A0 N" b - ): n% w) t5 K" u3 a8 i- C1 {9 I( E
- ((= etype "ELLIPSE")* N7 x2 K6 J* h8 }
- (setq help_entry "modify_Ellipse_dialog")8 M* f' q/ P1 v9 r* o
- (ddellipse)
# h/ T! ~2 \! J3 t+ P& V) h. L1 _ - )
5 P6 X! ?3 M2 L2 k! D3 D4 P - ((= etype "3DSOLID")
1 y* y# U: ] F! L - (setq help_entry "modify_3d_Solid_dialog")# c. K. y0 w) ?# O5 K& V
- (dd3dsolid)" Y& P F( J( H: b; w. w! W% R
- )5 C# i8 t" v R6 f
- ((= etype "BODY")/ Y. d2 ]5 `" P, D& ?1 E( F
- (setq help_entry "modify_Body_dialog")3 W& N8 t4 s' O$ A v5 q9 p: i3 Z
- (ddbody)0 [# b9 V: a8 v* _$ C! h
- )
. N" l. u- t) q; h5 i1 W$ { - ((= etype "REGION")
, C' T( M3 X9 m4 m - (setq help_entry "modify_Region_dialog")
; w* K: N2 ^$ i* a5 z - (ddregion)
3 @) P1 @( L& V% c3 ?* d( q# ` - )' s! G$ g2 f/ b5 a5 e. v
- ((= etype "HATCH")8 q7 x- A1 |$ {. u! }' R
- (setq help_entry "modify_Hatch_dialog")
4 y! }6 G, ?1 h5 Q( O - (ddnewhatch). H1 h; o. F% [8 s' h3 L
- )
% g% j2 G) S) c/ W$ k. [ - ((= etype "SPLINE")9 H3 Z7 ]$ Y% p3 H9 }" h# Y# A
- (setq help_entry "modify_Spline_dialog")& m( Z% u r3 g4 k$ s
- (ddspline)
8 P- y" K9 d3 D" b - )9 A4 w! `, @7 ]$ k2 @
- ((= etype "INSERT") ; see ddblock for help_entry
# P* P# P2 p1 }4 H5 U+ e, o! V - (ddblock)1 H. c- O: T( }7 c) s
- )
; U/ H, \7 O) a. d+ o - ((= etype "LINE")
) n [* ~9 b o0 H/ o- W - (setq help_entry "modify_Line_dialog")
8 ]% a3 k; ^8 y! q - (ddline)
$ j5 m6 S% _+ D7 ~ - )
- s% A# F; S0 _+ D - ((= etype "MLINE")- ^, c$ G; f& k2 }- w8 n: P
- (setq help_entry "modify_multiLine_dialog")) }1 ]6 @: p1 [+ k- P n! C
- (ddmline)
4 o, c! Q3 j" R% B7 g - )
( a T1 S5 z3 e7 b7 g8 E# d - ((= etype "RAY")
$ ^7 O, D' B7 J) H- t3 g - (setq help_entry "modify_Ray_dialog")
" t/ f" v5 u5 t - (ddxline)
6 Z! B \) g% g - )# e/ ?# Z& z" {
- ((= etype "XLINE")# {$ l, z7 g' H) f; K( X
- (setq help_entry "modify_Xline_dialog")' t) K5 c T& E0 [
- (ddxline). g; c2 ~7 ]) S+ ?
- )% Q5 \0 K- p6 S, K o& X- h
- ((= etype "POINT")" z i+ g: O( ^/ u9 R" x* s
- (setq help_entry "modify_Point_dialog"), J' h, o3 ~5 F8 x' A; y* D# p7 s
- (ddpoint)
' U: G1 O8 B1 \) j9 Q2 L: V: f - )$ g9 _" j* c( c2 M- U/ m }. f
- ((or (= etype "POLYLINE") (= etype "LWPOLYLINE"))# ~ K1 J G; t2 D6 c0 j4 t! P
- (setq help_entry "modify_Polyline_dialog")
# ?4 l C: q* e" ] - ;; If a 2D pline, check to see if it is planar to the current
- }1 O% E4 d: h( x5 ` - ;; UCS, reject if not. To see if the pline is parallel, }9 T; E/ g8 c/ o2 Y# I
- ;; the 210 group (WCS) is added to the current UCS origin (WCS)
9 ^; Q7 c& ~$ W - ;; and then converted to the current UCS and checked to see if
# y; u( Y1 k* G( D - ;; it is equal to (0,0,1).: n P/ M& o% L9 D
- + O. H% c! u6 ]8 w' X6 ?
- ;; Incase the 210 is default and not in the dxf list.
6 |+ ~) l; ^( A# g U - (if (= (assoc 210 (entget ename)) nil)1 M/ |4 Z n/ H0 E2 Z$ o' `6 y
- (ddpline)
: q! V9 |3 a/ A) A4 \, B, J# Q9 c1 l - (progn5 v; C! V! H8 n7 n# _; S
- (if (and (zerop (logand 120 (cdr (assoc 70 (entget ename)))))' Z0 E2 M w- P% P. [3 Y
- (not (equal '(0.0 0.0 1.0)
6 {( X+ V2 \ M! b) F* o2 n - (trans (mapcar '+
. [, s" ~% W) N& _( a2 ]/ z9 M - (cdr (assoc 210 (entget ename))): R I/ n; |' V% {& f4 h) u0 G) p
- (trans '(0.0 0.0 0.0) 1 0)( |# q$ p& G9 q# J9 C5 l3 Q1 x4 J$ i
- )& `' y+ D% F& K9 x K; T
- 0 1! x; O/ {# Y$ A; e4 D: p
- )
8 ~2 u- m; p% N! W: p' z - 0.0000000001 ; fuzz
8 N' W& `. Y( D; I8 w2 C4 B) { - )
: d$ ?, i+ F* j - )7 C5 ]7 U G8 Z+ O$ H
- )4 W6 t) E3 m" c O
- (princ "\nThe 2D Polyline is not parallel to the current UCS.")$ K5 [8 Z& [% o) b/ D9 o
- (ddpline)9 x- _: f; N: _/ o% J' W
- )
/ r7 s7 u% m( Y% j - )2 g9 k5 z: ~* V n$ V) Z$ |* C$ p
- )) |) J$ X: c0 J5 Y. l# ]/ ~' o) ]
- )
( J/ I4 G F7 C' ` - & a3 @$ R$ [" K4 }8 ~9 N" p
- ((= etype "SHAPE")* e5 z0 ^9 q b) [& v# n
- (setq help_entry "modify_Shape_dialog")
, s2 R4 y. K% f# Y* W - (ddshape)) Z( i c# d$ E% K; @4 U% g0 m
- )9 D* u* P/ j& ?& c* o8 J
- ((= etype "SOLID")% A9 p0 { q3 ]% k( v
- (setq help_entry "modify_Solid_dialog")% M8 Q% y" W0 f) c! s5 ?2 \6 k
- (ddsolid)% e g" F- N ~3 U* u
- )
+ K( ~' T1 h1 a3 J3 z. f1 A - ((= etype "TEXT")
+ J+ v& ? A7 G k6 K" m4 E9 ^1 Z - (setq help_entry "modify_Text_dialog")
; g* a0 D+ s0 i, G2 \, N - (ddtext)$ N1 H2 x: ^* n8 y9 ]
- )% l y$ v7 j/ {' t
- ((= etype "MTEXT")
D: d3 X+ _3 i/ x- h$ L - (setq help_entry "modify_MText_dialog")
% x9 ` w3 \" u: L3 u% s e - (ddmtext). L8 l& Q8 ^0 H1 V
- )
7 P7 k& i. I# Z - ((= etype "TRACE")' n- t# t7 _, u& T( q) J
- (setq help_entry "modify_Trace_dialog")
$ |$ H* B9 ]+ f - (ddsolid)
& h C2 V7 }1 g" g8 K' _ - )
0 K) {# _$ F" G7 ]3 k - ((= etype "VIEWPORT")/ n# \6 ?4 c4 }! h/ K1 i
- (setq help_entry "modify_Viewport_dialog")
+ @ H3 y8 }: C) y- o. j - (ddvport)
* g1 g" d% i m/ k p j - )
; ~$ v) A' q- `2 G% i" T; ~( y# t - ((= etype "IMAGE")
" F! ]4 q, v0 ?( F s& s - (setq help_entry "modify_Image_dialog")
# t4 B4 f2 {' w9 ~4 u - (ddimage)5 t" W. Y3 Q/ X1 e- H
- )
' C! o* n9 H$ V - ((= etype "3DFACE")
, ]7 c5 }" z/ i0 y- x% z - (setq help_entry "modify_3D_Face_dialog")" |9 _; [# p/ K* d
- (dd3dface)% c& Z, p9 X2 T2 L
- )9 n, v0 u" c& n
- ((= etype "DIMENSION"): ]& x& b6 m. i
- (setq help_entry "modify_Dimension_dialog")3 T( e. [- }7 ^0 t; A
- (ddimen)
% a" p& g& X! p3 t( f - )
: Z. X$ d6 y& V7 {. R - ((= etype "TOLERANCE")
; D2 C1 U6 W+ {5 s - (setq help_entry "modify_Tolerance_dialog")2 W5 t h- m& {* f/ z" d7 w1 c( J
- (ddtolerance)* w$ J3 w c2 d w
- )
0 }: a, q8 } G( s - ;; Fall-through condition changed by MCAD for MDT 1.1 release.1 j8 j- h' e& h# S& S: u2 w" G% v! T0 p
- ;; This allows DDMODIFY to work on any custom object or any new object type: m) O7 }% h9 P) U/ ~% m8 M
- ;; that isn't specifically handled above by calling the more generic DDCHPROP.
3 N8 f$ V q2 D; I - (t- ~2 {9 F0 v1 {. B4 N3 {- T0 o
- (if (and (not ddchprop) (not (load "ddchprop" nil)))
, Y0 A4 v& O9 K B D. I# Q - (princ (strcat "No dialog support for object type: " etype ".")))3 d% ~5 j, v# c* ~$ w# ~% N
- (progn4 G1 q& n" O) v- H$ g
- (setq tempss (ssadd ename))7 z, X d4 O; n9 u% e0 {/ J- \
- (ddchprop tempss)5 c G9 _; R' O1 ~4 B$ P& Z$ r7 r
- (setq tempss nil)% t( e( P2 z+ p, i) ?, l/ J
- ); |4 c/ m7 i3 b1 p) B
- )
6 }7 T+ g, ~* r; j4 p - )
& W S* Y) g8 E6 h - ;; Previous fall-through condition.
& }% o& a9 D' e; ]* o - ;; (t (princ (strcat "No dialog support for object type: ". ]# O; B3 Y) ?2 g5 _+ b
- ;; etype "."8 V2 I; G( t( {' D* M
- ;; )
/ w! W1 N9 u& _* Z/ A1 e6 ~1 g! H - ;; )
* k" A6 ?7 k8 o/ M - ;; )+ s- G& x9 D4 I! \* ]
- ;; )
6 _2 |5 q3 f/ q - (ai_undo_pop)
$ Q6 A k3 G( z% P - )9 `( E' [9 M6 s- ~8 R: ^
- )
) F5 \9 s" E5 X& c @) A0 e _ - 6 \/ t) ~6 ~& b( B; p, Y
- (if (eq new_pickstyle (getvar "PICKSTYLE")) ; if user didn't change pickstyle% g7 d( A. r4 j" Y9 t
- (setvar "PICKSTYLE" old_pickstyle) ; transparently then set it back" ]/ {; c7 U9 b
- ) ; to what we started with! I+ j7 n7 f) E/ v3 X* g9 O v
2 _+ `% p1 P% ]/ `* L1 ?- (setq *error* old_error)1 M/ G0 Z p3 z& v6 b) b: i& ~
- (setvar "cmdecho" old_cmd)
7 W0 k: n8 ?; \7 |. e - (if (not reset_flag) ; if object was modified, then( S" a; @* S+ s9 B/ O% W9 _% M
- (ai_return ename) ; return it's ename to caller
1 S4 N6 u% M. L6 P: g$ U - )4 ^# J+ E6 F2 r/ X( B. O
- ); P0 g1 s* U2 Q! A3 o5 Z+ V
- % ~; M9 N* h' X R1 U) p, L8 ^9 ?
- (defun checkForLockedLayer (ename)% p" m' k! ^" O/ W9 B
- (setq layername (cdr (assoc 8 (cdr (entget ename)))))+ [/ x& f' b: c0 M
- (setq layerflag (cdr (assoc 70 (tblsearch "LAYER" layername))))# D$ r* }( q; U% U4 m% ^ L
- (if (= layerflag 4)- }0 d- m& U& B [
- T5 E" L! |9 U: x/ n# j
- nil3 B% E! c6 {0 X/ c3 C5 K/ G
- )4 }5 I1 T2 ]9 E# i9 ^
- )
+ S8 v4 x, Z' L! j: I" y' { - ' _$ G: V" T0 m! z
- (princ " DDMODIFY loaded. ")
% x+ y* N+ q" F A# r; d4 V8 `/ W$ x - (princ)
; D6 u/ ^: g4 V# Q: x) N - ;;;???;;;---------------------------------------------------------------------------------------
. E$ T$ ~8 |# j* f4 Z$ D1 n. g3 {) ?
% a i; ^8 v7 Z: p9 x6 V- ; Next available MSG number is 8
* p! H1 j5 X! c! Y! Y - ; MODULE_ID DDUCSP_LSP_- O, s( p5 F& a
- ;;;$ f0 h6 o' ?6 g# ]2 n
- ;;; dducsp.lsp% t s+ t/ L+ {; W, w# I; T3 d2 r
- ;;;
4 D9 O3 K2 P7 j" m D' Q7 {9 ~ - ;;; Copyright 1992, 1994, 1996 by Autodesk, Inc.3 z" v3 X3 }. {0 m! O. \& C) n6 b
- ;;;
* \- X7 W5 |) l C - ;;; Permission to use, copy, modify, and distribute this software
7 d. l' \ n v2 a1 U - ;;; for any purpose and without fee is hereby granted, provided9 V! n+ o8 @( k
- ;;; that the above copyright notice appears in all copies and2 |* c& Z. P' O# }. z
- ;;; that both that copyright notice and the limited warranty and& D! F3 A7 B4 \1 O6 ^
- ;;; restricted rights notice below appear in all supporting
4 {" U; L* y( m. N/ g, l9 I6 R- L8 N - ;;; documentation.
$ q! @! L3 I+ M- f - ;;;- T) V0 J! p5 M% V
- ;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
# b& U9 t: V/ Q - ;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
, i$ D% M5 Z! ]) g7 y/ ~) ?# [! f - ;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.7 D. d6 u' h+ W9 C; n+ t1 V
- ;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
- z0 d) F, ]# f ?3 f - ;;; UNINTERRUPTED OR ERROR FREE./ y) v3 ~- u6 s( u& h3 g
- ;;;# p( [; |# s }
- ;;; Use, duplication, or disclosure by the U.S. Government is subject to
3 [: w4 ?3 k8 _- [ - ;;; restrictions set forth in FAR 52.227-19 (Commercial Computer0 l u5 W5 j& `( C- H
- ;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
0 Q; E7 I$ Q; H; H) q( P8 [) u - ;;; (Rights in Technical Data and Computer Software), as applicable.
" n. H; f( f9 k/ c1 c/ W- @ - ;;;
) [# L z/ |. p3 Y o! n - ;;;.( S3 h4 _' k. k3 n5 M2 A/ W% N
- ;;; C:DDUCSP - User Coordinate System presets dialogue.
0 x" Z b7 D4 l - ;;;
% C& V, c% T V$ k: x! A& I - ;;; Uses DDUCSP.DCL for the dialogue definition. The
0 K7 g, Y' v% S4 v8 k% Z" n - ;;; slide images are in ACAD.SLB.' r, d3 C9 c8 H4 \9 w+ w
- ;;;
3 J* l! O- r9 m9 H( I$ h b - ;;; ===========================================================================5 v! @9 T# A, \+ u
- ;;; ===================== load-time error checking ============================
1 E2 i5 M. U$ O' g6 Y; L( | - ;;;+ ~" X g$ d+ Y& B: |
% I; o( _: A: s, i7 o- `9 |- (defun ai_abort (app msg)
3 F6 {5 R" E% ]. ~" S: v2 O/ @ - (defun *error* (s)
) J! ^% m, I- M: t( S- L0 C - (if old_error (setq *error* old_error))- k: _( Q2 c0 l2 G7 G
- (princ), b8 c! m# U- i1 Y# p8 ?: Q
- )6 H! D$ Y( ?: F& e. q) D
- (if msg( v+ \" ^% J$ X- J
- (alert (strcat " Application error: "( [2 t3 P* e, z8 q, p
- app
, o% P) d0 ]4 o" P3 B! d8 g - " \n\n " R/ g" \8 c: V/ F. u. U3 v( f
- msg) Z" ], ~+ z" N% X3 o
- " \n". U% v5 ?5 X8 E( s$ l* ?1 D
- ): {% j4 `( \) n P% g q/ X2 k2 d/ A
- )
( E! p/ p3 T/ O1 ?! w4 a P6 m" K - )
$ a6 ?; q/ Z0 M+ G% `2 v0 p1 u; a7 n - (exit), o. U$ p* t! B/ C& k* L! |
- )% C; ]* i% d* D, y" f, Q# _0 ~1 z
- # X! T1 ~; d8 S1 E' O9 x% X) n
- ;;; Check to see if AI_UTILS is loaded, If not, try to find it,
' ~* H0 F4 X) }, o" K8 }, R( N$ c5 R - ;;; and then try to load it.
0 [1 j0 W9 y2 E( V2 P( C% N [ - ;;;
4 ?0 A4 {3 W& I; x# N+ b; l - ;;; If it can't be found or it can't be loaded, then abort the
! ]: Q5 I+ X& E+ Q' ^9 M! ~) C - ;;; loading of this file immediately, preserving the (autoload)% N; l1 C1 j! F4 B# B
- ;;; stub function.2 b" @4 h, g# ^# x, X- w- n7 n' f
- + D- t& n3 h6 X n! i. @* _8 n
- (cond, [3 C, x8 s1 p# d/ B0 ?
- ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
" p2 T" h0 @5 Z0 O: V
7 C" O- S# U0 H" R1 P- ( (not (findfile "ai_utils.lsp")) ; find it4 X1 J6 j3 m/ [9 H
- (ai_abort "DDUCSP"( M/ g* u( u2 g
- (strcat "Can't locate file AI_UTILS.LSP."
$ [5 o) `4 H% v - "\n Check support directory.")))
0 b1 q8 S# ^- n; t0 [
; ^; q/ Q% z& S% k2 w9 Y- ( (eq "failed" (load "ai_utils" "failed")) ; load it
, h+ P" g+ S0 [$ \7 v8 ~- e - (ai_abort "DDUCSP" "Can't load file AI_UTILS.LSP"))
' [* C4 @2 C+ D - )
! J7 w( g o( C- f7 q) i' h
q o- R% \- r. O- i- (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
5 l+ J. { X2 L+ K% ?" z% {! `- h - (ai_abort "DDUCSP" nil) ; a Nil <msg> supresses
# c/ G# N& ?: y' z2 R" M: d - ) ; ai_abort's alert box dialog.
g, H; a/ _! i; { y. D$ R" E - + c0 M3 Y. l2 j5 g- o/ |& \
- ;;; ==================== end load-time operations ===========================: j" ^. q3 T3 h" x2 Y6 q& K
/ B8 \% i, i" ^- H- (defun ai_ucsp_start ( / program)6 T4 |. k9 N/ ^; }
- ;; Get program name. E6 \! \2 X2 |. \: W
- (if (not (setq program (getvar "program")))4 }1 X5 m, @1 X& S3 l( P
- (setq program "acad")
& {1 G) H1 S" s - )
$ b$ m$ r# @$ U; P( a" s& r - (foreach v0 '("world" "left" "cview" "top" "front"
; ?2 C' o1 U; N; W0 {. x/ ^ - "bottom" "back" "right" "prev")" O) j* G$ H- y% a7 o
- (start_image (strcat "ucsp_" v0))
e, n. D: F9 \9 K( [% t ` - (slide_image
0 G' w" Z* I1 `+ \5 V# ~7 I - 0 03 D: ~" v3 Q+ @% M6 f9 g
- (- (dimx_tile (strcat "ucsp_" v0)) 1) (- (dimy_tile (strcat "ucsp_" v0)) 1)
& ^; ~* } N5 G" j9 L: ` - (strcat program "(u-" v0 ")")- L! Z' C3 t) O& D# e
- )- T! P! ~( C7 S0 M- Q! R: ~
- (end_image)
! j3 |1 h- }. _; B0 P, R - )
* b6 I$ E1 `# g( F - )
, c) h( ~ w- t; V( a9 A+ E
+ E, [3 H4 S. }+ c1 c$ S- (defun ai_ucsp_set ()
" }+ h# I2 I' e9 v$ M V% g( p6 [ - (if ai_ucsp_sv$ \: h7 q+ [3 g( \ R0 Q
- (command "_.UCS" "_V")
. v3 z$ `( D( \2 ~ - (if ai_ucsp_prevs; T, W, `# a2 y3 G( r
- (command "_.UCS" "_P")8 L+ ?: l/ o8 h% j' \) q; j
- (if ai_ucsp_chg# F9 ?+ X1 H9 p! Q" ]
- (progn9 ]. ^+ k& ]" X
- (if (/= ai_ucsp_a "*")+ T6 P, E( y8 ~
- (setvar "LASTPOINT" (trans (getvar "UCSORG") 0 1))5 Y+ p* [! b: B9 K
- )
" b0 a \8 `2 Z9 B - (if (< ai_ucsp_pick 6)$ {* \2 Q6 V4 j; X) W& P. g
- (setq ai_ucsp_set0 "@")
, @" V5 b. E* @ - (setq ai_ucsp_set0 "*0,0,0" ai_ucsp_a "*"): W [& x4 f& {( @( S+ U
- )
; P9 h' Q2 b8 o - (cond ((= ai_ucsp_pick 0)
y/ r4 U* ]8 Q6 s! M - (setq ai_ucsp_set1 "0,-1,0"4 x6 i+ R( R, `3 a8 O
- ai_ucsp_set2 "0,0,1"5 M% Z& b8 W, {2 B9 v6 [$ @1 F; \
- )
- z& N6 Q$ n' G/ \) f - )
9 h4 t# K0 a4 H" Z* u) M5 h5 _ - ((= ai_ucsp_pick 2)2 y z0 l$ X. U
- (setq ai_ucsp_set1 "1,0,0"/ x* Z/ S2 D8 `- M2 d+ W
- ai_ucsp_set2 "0,0,1"
& g! ~* p$ P* n) y% }* Y/ ]& a - )
( M" Y/ J! R( @$ ^$ G' h5 Z - ). l. R& ^# }) X+ q
- ((= ai_ucsp_pick 3)% \) H# D! N6 c3 s# d0 W
- (setq ai_ucsp_set1 "1,0,0", y& ]6 T7 Z5 @( N# k' N- h3 @
- ai_ucsp_set2 "0,-1,0"2 v8 {7 H( X& ~2 F" o: f; s! _
- )
: ~$ t, f3 c# H: @+ j - )
7 G$ k5 D5 B* D) F# c, i4 R - ((= ai_ucsp_pick 4)9 H7 X0 U# e( Y, s7 B2 J
- (setq ai_ucsp_set1 "-1,0,0"
) V2 `- j3 a; \ - ai_ucsp_set2 "0,0,1"% G% M, |6 B [/ F% B
- )6 Q. ~* W! Q/ ~* e9 ?' A( a* e- e
- )
! U: D7 m2 c" X9 k [ - ((= ai_ucsp_pick 5)3 ]. p; ]7 g: d- q1 n
- (setq ai_ucsp_set1 "0,1,0"* T2 N4 E& D) F% v. |9 y
- ai_ucsp_set2 "0,0,1"
w; H* q* C- k- U* G* { - )
- [: l& @+ N' q - )* S6 ]& a$ q7 w( T7 r
- (T9 |7 a6 l1 ^, E$ s- u8 J
- (setq ai_ucsp_set1 "1,0,0"5 D# V4 y& i. G! v0 R
- ai_ucsp_set2 "0,1,0"
]% J. |, v. } - )
6 @5 s! E( U h/ L9 u - )
6 x# _, p5 i7 A* X( E1 }7 ^ - )
+ o7 _& N% v$ x- R& | Z1 U1 A - (command "_.UCS" "_3P" ai_ucsp_set0 2 }) p. q& l. ?; Y( e2 ?+ X' v
- (strcat ai_ucsp_a ai_ucsp_set1) 7 O! V/ y# I' [/ [$ h" p) f, u1 Q
- (strcat ai_ucsp_a ai_ucsp_set2)
. B( i: A2 n1 N; b7 Y# \1 n - ) X a8 M/ ]8 \9 O$ B5 c% c
- )7 B4 ~3 T2 r+ D' g" S+ J2 ?
- )
" F! |6 h$ ?( W f" \* ] - )
) U; j; ~# s" F6 c. R - )! S# P( A* u$ C0 a9 [' ?5 j6 t% G# f
- )
2 s( @5 ]* Q% O& v& d( m/ C1 I% ?+ M
+ m7 U! _8 N$ @+ E, @& M9 ^: L2 U! Z( k- (defun ai_ucsp_p (val currtile). p/ N. I0 C* C4 B7 h+ N
- (mode_tile ai_ucsp_currtile 4)
" H) s% L( P. s1 L+ A' K0 b - (setq ai_ucsp_pick val: p7 F7 }; f, I8 |8 Z- r3 H* Q R8 Q2 L
- ai_ucsp_sv nil
- P5 I7 G8 l' r# S2 O! d; b) W - ai_ucsp_currtile currtile+ N) Z$ Y4 w; D( @ @
- )
. i, D4 S) Z5 L- O h5 x9 Y7 [3 X - (if (/= val 1)
2 }; u* _$ z4 D9 T3 r$ ^& @ - (setq ai_ucsp_chg T)* ]& v& _' H8 r3 ^: l0 J
- )
1 D; [3 D4 E2 ` K( h3 p - (mode_tile ai_ucsp_currtile 4)
9 j1 l6 M5 G* s H* r - )' k# ]: r/ h* k2 A' m( E
! i' ~1 _9 L1 n* c& ~7 i/ C; X: C0 |* k, g- (defun ai_ucsp_swcs ()
5 c9 y6 K$ G% E5 a6 D- M8 z - (mode_tile ai_ucsp_currtile 4): N2 q* s! J0 q/ _5 |
- (set_tile "ucsp_a_wcs" "1")" f7 X# m" W/ o d
- (setq ai_ucsp_pick 6: o( u: I+ c* g& U( N, ?) T; k
- ai_ucsp_sv nil7 _0 r% N# l2 T8 A/ M$ I
- ai_ucsp_currtile "ucsp_world"6 T+ o+ X% n' G$ u, N
- )* L9 y2 z; T2 k f/ {& G
- (if (/= 1 (getvar "WORLDUCS"))* P4 C' U* \0 G1 M3 e: B! X
- (setq ai_ucsp_chg T)$ l: [1 S3 F+ L4 {$ ~# g
- (setq ai_ucsp_chg nil)1 g6 K6 [3 |! t; a/ ^' G
- )
8 j0 M; H/ @2 \& y) n - (mode_tile ai_ucsp_currtile 4)+ l; B; V4 X% W* k' o
- )
& ^& B. X# l* K) L1 o4 J8 A - 1 m5 W3 V/ o6 N7 M
- (defun ai_ucsp_cview ()
3 y( b" P3 ?8 [/ Y, H0 |7 y - (mode_tile ai_ucsp_currtile 4)
6 E4 G7 c/ ?) e7 M2 ~3 y - (setq ai_ucsp_sv T
: q& x) V6 k' ?" Z% M - ai_ucsp_chg nil* o4 s: O {- G& y) |* t
- ai_ucsp_currtile "ucsp_cview"
9 k! l9 O, o; y- v0 L- V3 x - )
: c+ Y8 X7 Z! |8 k5 p; b! a - (set_tile "ucsp_a_wcs" "1")
8 j7 H8 j8 d) W1 S1 G3 R - (mode_tile ai_ucsp_currtile 4)
- k2 z+ h7 Z/ G$ { - )
) {. \ c; u1 I( e, d% L0 [) ?, t9 D) y
$ k) l: L* P- g) R4 C% l- (defun ai_ucsp_rucs (typ)- L- l r- D, ? z4 B
- (setq ai_ucsp_a typ)( y& K& h4 w9 |+ w5 Q( p% ~% Y$ N
- (mode_tile ai_ucsp_currtile 2)
3 e$ @" ]; x7 M, H - )
4 ?# `2 I6 b! F# c& t6 `; Q9 _
+ v( ]0 [. B, J0 ]# ~( M! ]- (defun ai_ucsp_prev ()
& |( D9 N! J8 d! J$ k - (mode_tile ai_ucsp_currtile 4)
$ c1 j4 R. l2 S9 g. N8 x - (setq ai_ucsp_prevs T
- Q# z0 O9 e' B8 o/ ^ - ai_ucsp_currtile "ucsp_prev"
: y$ A* T3 G# W3 Y% [* c - )4 K3 d7 l4 n7 t1 V
- (mode_tile ai_ucsp_currtile 4)" @% {% Q5 q- Y
- )
8 \) D: X. y2 u/ Q; p% L$ ]1 e - 7 F/ D& t0 m4 z
- (defun ai_ucsp_main ( / ai_ucsp_pick ai_ucsp_sv globals)
* }; Z; l1 r! f! p - (if (not (new_dialog "dducsp" dcl_id))
# x4 H# C5 X; S4 r3 T$ | - (exit)
7 B- c1 T, F D- D# N z& }1 [. j - )- n. F! M2 L/ m4 o% a
, Z- O) s( N7 ?0 i! `- (ai_ucsp_start)
, }. I# _) ^" w, R) D% H* Y - (setq ai_ucsp_a "@" ) p: d0 [/ j7 x5 ]+ q
- ai_ucsp_pick 2) X# Y; G3 X, P: Y! r
- ai_ucsp_currtile "ucsp_top"2 i$ q7 S& s, O% t) h: G& a; m
- ): A- D1 R6 f1 B
- (if (= 1 (getvar "WORLDUCS"))" _7 T. @0 j, C* s
- (progn
- u4 f4 w1 S5 d7 C- X# i" l - (set_tile "ucsp_a_wcs" "1"): [0 J' t% D& ^
- (setq ai_ucsp_currtile "ucsp_world")" T9 o% ?- O' B* q3 r
- )
8 ^* B# O; ]- g7 } - (set_tile "ucsp_r_ucs" "1")! g8 h! h( }, f+ e' P# @: ^! z
- )
/ M M3 }) `( Y - (mode_tile ai_ucsp_currtile 2)1 v# o- p" j# a. W; [/ T; g! k8 z
- (mode_tile ai_ucsp_currtile 4)8 K! R( Y6 d$ |
- (action_tile "ucsp_world" "(ai_ucsp_swcs)")
8 V2 v4 n4 V6 |- {) i; h% P4 Q+ D - (action_tile "ucsp_cview" "(ai_ucsp_cview)")
" D5 x. m5 e b/ R- c' G - (action_tile "ucsp_left" "(ai_ucsp_p 0 $key)") i: c+ y* c S4 D, N. V* f3 J0 ]
- (action_tile "ucsp_top" "(ai_ucsp_p 1 $key)")
+ }, O5 Y( |( v# M/ K/ B - (action_tile "ucsp_front" "(ai_ucsp_p 2 $key)")
' |1 t }. E/ l7 `+ A - (action_tile "ucsp_bottom" "(ai_ucsp_p 3 $key)")
0 S8 r8 y4 \7 \! Q6 X9 \ - (action_tile "ucsp_back" "(ai_ucsp_p 4 $key)")& S6 X% l, R0 J& J0 B6 V0 `
- (action_tile "ucsp_right" "(ai_ucsp_p 5 $key)")
4 g$ E4 ~2 h7 y' N9 {" m' N - (action_tile "ucsp_prev" "(ai_ucsp_prev)")6 K" N$ R# n, O
- (action_tile "ucsp_r_ucs" "(ai_ucsp_rucs \"@\")"): p6 V( z: M8 N; R i
- (action_tile "ucsp_a_wcs" "(ai_ucsp_rucs \"*\")")
. a0 ]" ^& `6 Q! V( q1 F7 H - (action_tile "accept" "(done_dialog 1)"); V* J4 i% V3 N
- (action_tile "cancel" "(done_dialog 0)")
9 _; P! X( r% W- S: i/ W - (action_tile "help" "(help \"\" \"DDUCSP\")")
+ U+ x) Y! Q) H+ P$ m3 I) C1 ?) ~ - (if (= (start_dialog) 1)
8 M; `; Y; h. Q, c( i, c0 O% b - (ai_ucsp_set)
0 A! r( U6 V7 A1 ]0 m, a - )
$ D% p: A, ^- y/ A5 M- a% O - )
9 ]( U% e) m3 Y - 6 O+ G, n( n" \' v9 @
- (defun c:UUS ( / app dcl_id old_cmd old_osmode ai_ucsp_prevs + u3 U3 e% B! _0 J4 `+ }7 f5 R
- ai_ucsp_sw undo_init)
4 |7 _& I) ~2 U% a# J0 [$ A. M1 N
3 W; M4 a! O! A( X" ?$ h9 T5 Y- ;; Set up error function.4 U' ?5 V/ {5 w4 S1 m
- (setq old_cmd (getvar "CMDECHO") ; save current setting of cmdecho
$ j1 Y, e' F# Y - old_error *error* ; save current error function
; o' |7 ^& R' ]9 ~1 M - *error* ai_error ; new error function
5 F W) l2 M3 t& } - old_osmode (getvar "OSMODE") ; disable OSNAP for duration" T( t! U+ E& @ n; q
- ), `* [& ^" }# N2 d' e
3 s$ u2 c/ q3 F, g9 f- (setvar "CMDECHO" 0)3 t! U s0 I, R+ W, S N
- 1 N& {3 @/ N0 c1 t+ H9 T
- (cond; w/ I+ t/ C$ r0 _) I" H& w
- ( (not (ai_notrans))) ; transparent not OK+ j ]) _2 p' e$ X0 k* v5 w
- ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
# Y+ k) U% Y( { f* C' Z# N - ( (not (setq dcl_id (ai_dcl "dducsp")))) ; is .DCL file loaded?" |2 `0 a1 Z6 o. h; }
- (T (ai_undo_push)
" ?6 ^! R) ]+ G! _, j4 d8 n0 c - (setvar "OSMODE" 0)
* X$ y* k) b) t E# ?' F, p* U - (ai_ucsp_main)# Y' H* i% }! k( Z. X
- (setvar "OSMODE" old_osmode)
3 o. A# x& f1 A9 L - (ai_undo_pop)
* m- S: s9 q" S- e9 R$ w6 F: M - )5 H' R" L9 f" O, b
- )! ]/ u# F* D$ _/ @" _
: S& e1 ^+ I, t) Z9 w, ?- (setq *error* old_error) 7 T. C& X- u! O7 O& \
- (setvar "cmdecho" old_cmd)
7 J2 Y) ^4 m5 \+ s6 u
4 F2 X) T6 E0 u$ M' R! f4 Z {+ q- (princ)
% F' Z6 W' l9 e W* v - )# |! H! y9 S/ h0 G/ x8 f
; x/ S L5 f: }4 ~; K( |% F- (princ " DDUCSP loaded. ")5 a- y8 W% a/ Q0 G$ T( S
- (princ)
- X, a$ Y' |# l7 A0 Y
4 ?8 Z( \5 F8 ^" j( M8 x5 M- ;;;???;;;---------------------------------------------------------------------------------------
* l1 v+ c" b; `- ]9 I; B
F: ?+ [; U6 l# s- ;;;----------------------------------------------------------------------------
* S9 h1 H0 R4 S5 X2 p r, u/ d - ;;;
+ W: v; U$ x9 U6 P: R - ;;; EXCHPROP.LSP
5 B" y, N4 i {+ U1 y - ;;; Polyline and text modification capabilities added by
1 }; y0 b* W% T* w! o5 v6 _; J - ;;; Randy Kintzley # _& k7 f3 R) ?9 m: I- a: e$ I
- ;;; 7 r# n( {+ Y' [# L
- ;;; Copyright (C) 1997 by Autodesk, Inc.
* M) `# H5 V* B2 i% A - ;;;. t0 V p# M9 B$ u
- ;;; Permission to use, copy, modify, and distribute this software* D7 J: H4 e( t2 o! `6 @
- ;;; for any purpose and without fee is hereby granted, provided
, J8 e9 A' V5 q/ A* a9 L - ;;; that the above copyright notice appears in all copies and
6 v& j B7 N+ ? - ;;; that both that copyright notice and the limited warranty and
4 ]6 h& k3 z3 _: I" F - ;;; restricted rights notice below appear in all supporting- E( a. r$ V/ j4 |& G
- ;;; documentation.
* t, z: A. A+ L - ;;;
9 L0 J% P' `/ j* v - ;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.7 |# m! {1 I2 E9 ~( N% g
- ;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF, p+ |; {/ _9 z
- ;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.! \3 p, T" I; S: k! W1 o
- ;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE4 O% \" J1 c! f1 q3 D9 t! n. V
- ;;; UNINTERRUPTED OR ERROR FREE.
9 b7 Q! B5 }; f% |1 A% L7 a" M - ;;;
1 j9 P' }& x$ U Y @( K7 e - ;;; Use, duplication, or disclosure by the U.S. Government is subject to
4 _2 y# O; M3 A; U% R V5 D - ;;; restrictions set forth in FAR 52.227-19 (Commercial Computer
2 z& L, ?. i. H* W - ;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
* `9 i4 U/ u2 [ A- e - ;;; (Rights in Technical Data and Computer Software), as applicable.) v- N1 U: Y* A3 H G+ n, _, G8 h
- ;;;
6 \2 s( G) v2 h8 V- r; m. e - ;;;.
) n3 {1 ]# j4 v' x! a+ y - ;;; 28 February 1997; J$ t9 @3 j: ]9 f$ n
- ;;;* s! n8 ~8 O/ _. `- \
- ;;;
6 |5 a- `9 d/ j - ;;;----------------------------------------------------------------------------
& G( N! V1 i" s - ;;; DESCRIPTION) |' u, w' U8 W3 n5 I* d# u
- ;;;----------------------------------------------------------------------------4 j# `, `. v# i0 u" m! T# N7 M
- ;;; C:EXCHPROP is an extended or enhanced version of ddchprop. This
' B8 k; }( z; w0 L- q7 w1 \9 M - ;;; command gives the user the abilitie to change several characteristics ; p/ h" {; c) B! N, O# i
- ;;; of selected polyline and text objects. ) ~$ W! P/ o. Y& P4 `
- ;;; The style and height of selectected text objects can be modified : [: X- V! I; D( [9 I
- ;;; (including text, mtext and attribute definitions) as well as, width and
8 ?! j; ~0 X' d9 @, z2 X - ;;; elevation characteristics of selected polylines (includes lightweight and
8 {7 y. K. d r. V$ `6 q7 _$ ? - ;;; traditional polylines.)& n' _$ d6 G: r7 \" {$ j0 u- Q
- ;;;----------------------------------------------------------------------------3 h/ ~7 x7 n/ D! J7 K$ [
- ;;;----------------------------------------------------------------------------
$ x* k/ X; v- X) Y9 x: R - ;;; Prefixes in command and keyword strings:! [5 m( u, o& G, h; Q, d. B
- ;;; "." specifies the built-in AutoCAD command in case it has been4 y3 @4 L5 r* c# q8 }! J$ T: A; s
- ;;; redefined.1 V+ }9 U3 l6 J% k( k+ r
- ;;; "_" denotes an AutoCAD command or keyword in the native language* k- ^4 L: \# u% r/ L) _
- ;;; version, English.
# s- f, u( N' c' p( @ - ;;;----------------------------------------------------------------------------
- y7 ]0 @1 I$ @$ ]5 Z7 `2 p - ;;; s. S! f. {$ P0 u& |) `- g5 M
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; }7 A2 t; }% b3 z% }9 h9 Z$ H, ? - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;GLOBAL INFO.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2 ~# x0 f6 |! h. p) l1 P# f: b
- ;Functions created as result of loading file: exchprop.lsp
# v g: `5 I. l2 M/ y - ; DDCHPROP2
9 N: m& s- |2 a2 S' U - ; DDCHPROP2_INIT
2 ~9 O. ?1 F- I3 \ - ; DDCHPROP2_SELECT* ~* T, x5 Y( ^2 y2 ]# {8 [; Y
- ;
: S& A% H+ u0 {3 [& [* s) Z$ E - ;Variables created as result of loading file: exchprop.lsp; H, e: v0 t% p5 @6 @" s
- ; OLD_ALLOC$ ]. Q5 v7 O& H" j0 t" a4 o
- ;! ~# b) ]7 m2 T' n
- ;Functions created as a result of executing the commands in: exchprop.lsp
/ t. H0 I. ~! ]9 B; h8 N - ;
0 l6 E) i* }& T% Z# p5 U' \ - ;Variables created as a result of executing the commands in: exchprop.lsp
, M5 u4 B. O. K" X1 z: Z - ; AI_SELTYPE
; l# E8 z& V* B7 v9 {- R( |4 D - ; BONUS_ALIVE) k9 L- _! f. z
- ; BONUS_OLD_ERROR
# a ?# U6 c4 s( X3 f/ a* \ - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;GLOBAL INFO.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6 H; ^) R! r" x - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8 \' L1 C% `! S" w' L - 0 W9 J1 p# b; J, b; Q: J
- ;;;
& g8 H$ ~& E @/ `" F- v/ i - ;;; Avoid (gc)s on load to improve load time.5 F9 ^4 B2 Y6 N4 D) z
- ;;;; }/ u0 R0 W; D3 {
- (defun do_alloc (/ old_allod new_alloc)# q5 a. U* p$ b
- (setq old_alloc (alloc 2000) new_alloc (alloc 2000)); G9 Q( T; q/ d" e9 ~
- (expand (1+ (/ 4750 new_alloc)))* s8 R; ^. I; @7 {/ o
- (alloc old_alloc)& K+ F7 c3 k! a7 z& `1 O2 m- `
- );defun
; k3 o* T, t/ c, u
- v P+ E4 }& \# {* G2 Q9 W& s- ;runs at load time - rk$ h3 h U* U. T% f8 u
- (do_alloc)& }* @4 Q. B* L9 Z
- (setq do_alloc nil)# Q3 I; B7 B" [- h4 C3 r- T+ G
- ;;;
1 |9 m# e5 Q( Q8 j6 `/ B! G9 {: _( e - ;;; ===========================================================================
7 D. G( e& D1 A y - ;;; ===================== load-time error checking ============================3 z/ _3 T( Z6 ~9 }
- ;;;0 O; b( q' V; T! J6 A" N2 a/ t! G
- # R7 T8 z. G/ u
- (defun ai_abort (app msg)
. b( E& r! n9 E! R - (defun *error* (s)
* \$ C. n3 @. G4 V% F - (if old_error (setq *error* old_error))
: X8 ?# q- u) @9 S - (princ)6 }$ S6 _9 t5 A+ o
- );defun& @' }, Y: t6 n8 r
- (if msg
* a4 d- b0 p3 G' `7 W" @* s - (alert (strcat " Application error: "4 t/ ^# h3 M: Z) r0 G5 H3 a
- app
% y/ T8 { p5 I, A - " \n\n "
' w( w& C' T, G0 N- u7 y2 y+ b - msg5 T) A; Y& T9 p, ^2 m
- " \n"
" w- o- s; c4 s! Y& z5 D2 x& h9 q - )
4 V" ?8 t4 O @7 l: f( y) y - );alert
( M# r/ `- R3 u C/ U( i - );if: j4 {4 Z$ E k- n" \6 U c2 l
- ;(*error* msg)
l* T, N3 }) t. u% v - (exit)
$ K; Y$ E8 N! L6 w - );defun ai_abort. g9 k, f4 I# _" l+ T
- 7 c. C6 h% d. B% k5 J
- ;runs at load time - rk% y L( f- a |0 f, U7 t
- ;(if (and *error* ;added the if wrapper around this - rk.
9 h/ H1 H% O; } ^2 Q2 p* y - ; (not old_error)
/ E( P$ V; ?' f. s& l - ; );and 4 N3 z! D6 Y% q# @1 C( s
- ; (setq old_error *error*);setq
/ U# F0 s3 [; s* L2 j - ;);if
; U; b9 @1 K; G7 B - ; T5 W+ X( }" Q' P; i, n
2 J0 @9 v( ]" A. o- t* J- ;;; Check to see if AI_UTILS is loaded, If not, try to find it,) w+ O( i& b' R% F. D4 J, P3 n
- ;;; and then try to load it.5 A' X. o" o( j( E
- ;;;
/ r8 }. o- P3 r/ n0 S7 O - ;;; If it can't be found or it can't be loaded, then abort the4 g& I' A2 ]7 e: H9 {
- ;;; loading of this file immediately, preserving the (autoload)
, l7 q- r( T* D Q" X: L' U, S - ;;; stub function.& W5 l/ z2 p. {2 a0 s$ u
- 0 B; W w2 I, q; o& G$ K4 V
- ;runs at load time - rk.
- a, f( O5 _2 Y) s# y, T0 i/ a - (cond6 b+ e* [: I, Y& \# z
- ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.. N' V. b1 ?; y
- ( (not (findfile "ai_utils.lsp")) ; find it
( W ~, G6 i; G$ @; V" p5 F+ O - (ai_abort "EXCHPROP"
+ ^$ C3 M% s( j, d; Q - (strcat "Can't locate file AI_UTILS.LSP."
/ |3 f q+ Z% N - "\n Check support directory.")) b! Y4 ]4 E: E7 W p
- );ai_abort- }3 N- ^; d) v6 [0 I2 z
- )9 G- k2 I, `8 K2 x. B% ?
- ( (eq "failed" (load "ai_utils" "failed")) ; load it
4 r* L5 \$ _& F7 h) e2 `7 _" H8 j' \ - (ai_abort "EXCHPROP" "Can't load file AI_UTILS.LSP"). y5 b: Z: h- Y8 `! `
- ). ^- l" G( X7 M- z% T: a% `2 c
- );cond close
1 U' ^" Q" D: A, \. I- F - / s7 [8 a5 v' B" b( c
- (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
/ v# m7 t* H8 N' W5 C4 \# S - (ai_abort "EXCHPROP" nil) ; a Nil <msg> supresses
" ]. @3 L* |0 A* `! }) {. f - );if ; ai_abort's alert box dialog.
3 F. c6 q' E& ~& O
7 L# T- @. A& o, d. H$ ?9 d- G& b, q- n- ;;; ==================== end load-time operations ===========================
+ w7 p- ~. Y% n! n9 h - # b( |9 q5 H3 |4 \+ M9 I% P
- ;;; Initialize program subroutines and variables.6 @8 j$ A3 b2 V+ C) h
' m' Z6 T/ [9 t- L- (defun ddchprop2_init(): y* i4 y2 C, e8 f/ j
, F0 r1 k2 F" a/ ^
e! U7 d7 ?' T- q. R% C
2 L$ C! \( B7 u" r* Z) G% |, x& S& Y- ;;0 j7 K9 @. D8 `0 i! i9 k0 `( C2 d" L
- ;; Define buttons and set values in CHPROP dialogue box
4 C c8 q$ k' \& d4 Z6 q - ;;- O5 \: l8 g; H; k, t+ {: l3 I1 B7 L
- (defun call_chp2 (/ cmdact p1 p2)9 O, y( w* C3 O% s
- ( e. p! h2 I/ r ]
- (if (not (new_dialog "ch_prop" dcl_id)) ; u3 P' s* W: j# X/ @+ U w7 I
- (exit)- B/ K, K6 Y2 i
- )
" i" G5 V: Q' g* k( B
: X* z$ `+ V! v1 G% p1 z% Q* u8 s- (set_tile "error" "")9 W7 _6 P9 V- l G8 E
- ;; Set initial dialogue tile values
_2 H, c4 h3 Z) Q: P - (set_col_tile)# X! p/ m' S, H& N* y4 {
- (set_tile "t_layer" elayer)( `7 a7 I+ M. ~# R
- : j4 H' J3 W0 i, \& E' N- F6 M% \
- (cond
& c0 D/ H, E4 | U, p - ((= lt-idx nil)' K, o* b+ j+ T; h/ X2 a
- (set_tile "t_ltype" "Varies")
- B! s& ?% ?. s! |6 |, ] - )/ ?' ^/ J/ u% L0 Z+ M% _& i
- ((= lt-idx 0) ; set tile "By layer & layer linetype"+ E: p/ V1 c( f$ o/ x# m9 c* P
- (set_tile "t_ltype" (bylayer_lt))9 k5 K% c& a V; F. ~; T
- )" u1 i6 E/ A' n8 C' e7 N
- (T
: Q6 r) m9 W3 X/ K; S# } - (set_tile "t_ltype" (nth lt-idx ltnmlst))
8 M( c6 ^7 O. d6 d - )
6 ?2 R: \% O j* b8 W - )
! t7 ^$ K) X1 @/ [ - . ]% P$ M, j8 G( o* {+ a
- (if (or (= ethickness nil)
7 q3 @) _$ s8 i6 ` - (= ethickness "")8 [: s# M, l! x. a
- (= ethickness "Varies") 3 ^7 j+ P0 y6 ]5 [0 K5 g* Q
- );or
! W: n) S. }6 }& a( I3 B" L - (set_tile "eb_thickness" "")
" w7 r% C2 K/ q9 y% U" ]3 c4 u ? - (set_tile "eb_thickness" (ai_rtos ethickness)); [ O) F$ b2 S& R" m* u4 n4 B" g
- );if
! f" }9 K( @. e- D1 K - (if (or (= eltscale nil)
# m8 E" b2 V# s- C* n$ C d - (= eltscale "")
! H' T) F) X& E- ]9 j& t. `) N - (= eltscale "Varies")9 a" i1 {4 r8 I1 f" D+ i+ R5 Y
-
$ M* V3 t- N! d/ |: y& u - ), G& [% Z E# ?; s* z
- (set_tile "eb_ltscale" "")
2 n; E3 z- z+ K5 G+ {& x; A - (set_tile "eb_ltscale" (ai_rtos eltscale))
6 b# A1 ?0 V9 a6 L; F6 ?/ ` - )% g/ K* n2 }( B" R( K C8 h9 v! n
- (if
2 `+ C0 D/ { f2 Q3 o6 U1 Z - (numberp ewidth)9 a9 o7 J% Q e' ?0 O3 q7 m* U
- (set_tile "poly_wid" (ai_rtos ewidth))
6 R) `8 H5 G: m' ]1 `; P, p8 |! ? - (set_tile "poly_wid" ewidth)
4 n% T. q `4 h! o/ ? - )% \& r- m5 {. [1 m6 q, g* y! r# c @
- (if5 `' Y# m8 y- ~ l: R
- (numberp eelevation)) q9 @8 m% {. o* ]9 v
- (set_tile "poly_elev" (ai_rtos eelevation))
& w1 |4 C0 i. Z' W( a- W$ h) Y# K - (set_tile "poly_elev" eelevation)
) B3 H0 P# U$ p" w" ^% P - ), G# o2 B, u9 a8 d e3 f- c. N
- (if. N% o L1 h& B: a/ x# ]: ?
- (numberp eheight)
v3 ^+ K8 C; }5 H - (set_tile "text_hgt" (ai_rtos eheight))9 G d) J e: x
- (set_tile "text_hgt" eheight)0 o( p$ b8 E. w j+ j8 ]8 z
- )) B8 Q. s* d. B o/ x+ ~; B
- (if (not estyle)
: N. i4 ]; \ r% t4 \% X - (setq estyle "")
W# c8 }8 I' n) w( J4 P8 G - );if
# o% T! y: j3 A1 [& u6 a! D4 } - (setq hair_style_list (tnlist '("style" 16)));setq
+ X/ D3 y( D: Q' c( R4 v8 q4 G( ` - (if (not (member estyle hair_style_list))
; r; s( ^* f x( p/ [ - (setq hair_style_list (append hair_style_list (list estyle)));setq$ S) @& @8 {3 e' m T
- );if [3 C& j% b0 ^. A
- 5 R h% D8 q0 X2 |1 _. \
- (setq hair_style_list (acad_strlsort hair_style_list));setq
/ R: }; m, Y% d: C! I6 ] - (mpoplst "text_style" hair_style_list)
% j1 Z) m9 L0 G - (set_tile "text_style" # s0 S7 O# m: D" w* X5 i3 m1 Z2 A
- (itoa (position estyle hair_style_list))
e2 @ i5 R: k# ]+ p- k8 k - );set_tile
. t+ |1 J7 P z- S0 O" L - # q' r1 m. ]3 C
- ;; Disable tiles if need be... ;@RK/ e& i3 J- O& f
- (setq a 0)6 R7 W( i! U! w/ [3 A0 S) v( a
- (while ( < a (sslength ss))
- X1 R( @: y0 b3 V Q! k* d: Z" k$ f) F - (setq which_tiles
% f+ w1 w. z7 Y E& `6 N* j - (ai_common_state (cdr (assoc '0 (entget (ssname ss a))))))8 f: g+ E- }4 y
- ) ^% \" D; p" _, W1 p6 F3 ?. }
- ;; If all fields are enabled, don't bother checking anymore.0 X% X" v; z7 W3 P# w
- (if (/= which_tiles (logior 1 2 4 8 16))
) t0 T% }8 }7 t5 A - (setq a (1+ a))
1 O/ D* H9 ?, Q+ G3 c) x2 J G - (setq a (sslength ss))
1 x/ j/ P! |; G - )
4 n$ m8 Y. c& A- k - ) F$ R) V0 `2 D0 U
- ;; Layer Button and Text Field5 w1 x) g3 c y5 T2 a( w2 R$ M9 a4 t
- J& F# B. j( N$ V) V8 R& _* M- (if (/= 1 (logand 1 which_tiles))7 A" i5 I I1 t8 Z" s0 x) W5 c4 g
- (progn7 Z! K' x o, x) a8 g0 P
- (mode_tile "t_layer" 1)
! L: f9 M7 k/ ^8 ], b+ n; K: ? - (mode_tile "b_name" 1). S+ z. j" c+ b' r
- )
8 c! @0 @. U, d% P0 @ - )
/ G8 g* Q- c6 B5 ^
7 N1 t! _9 ~2 z- ;; Color Button and Text Field3 s- i( Y8 H2 G
- (if (/= 2 (logand 2 which_tiles))* s5 Z9 t7 m) P, C/ e
- (progn1 o t2 v+ N `# y! ^+ x1 i+ V& w3 O
- (mode_tile "t_color" 1)
# S, ?( q" Q; Q- s+ ? - (mode_tile "b_color" 1)( L" G+ ^/ ?. [) v2 m
- (mode_tile "show_image" 1)- v* A3 E) \- m' \0 U
- )
( G+ @, N9 v& N$ C - )# c' b+ F4 J: g7 i% b, O
- ;; Linetype Button and Text Field9 y5 F# C; v) s8 G: B% [
- (if (/= 4 (logand 4 which_tiles)), u: W6 N5 C7 V! R
- (progn/ s# G3 m& r2 V% k1 w, ?
- (mode_tile "t_ltype" 1)
9 t) D) f9 z" A6 L& y! u1 b - (mode_tile "b_line" 1): M6 v4 h7 y3 y! H' ~% V" z" |; d, y0 q1 U
- )( `- N$ y: ?+ T2 B( o z8 S2 M! [& m
- )
% E2 U5 ]$ ?+ M1 T l. I/ D - ;; Linetype Scale Edit Field
# B6 f- C5 r2 K) k% n - (if (/= 8 (logand 8 which_tiles)), K+ k1 ~; o, |/ ?8 A* u/ |
- (progn
' m1 ~$ \- m. ~; c, e* k+ ] - (mode_tile "eb_ltscale" 1)
( i: ]5 |, H. C( J9 Y# A - )
; r% l2 e- B" j& O( e2 b - )
0 h) x& C8 `. W3 Y9 f - ;; Thickness Edit Field.
# q) d% {! X! N% X0 o - (if (/= 16 (logand 16 which_tiles))- H+ }8 X8 l7 t+ W
- (progn
# v& l# {+ d. a: y - (mode_tile "eb_thickness" 1)- p$ g V* t5 N( {4 P
- )
. Y$ a( C3 E% }, z - ) W" i3 R" B+ R" D3 b
o1 d2 ]1 g9 b8 b- ;; Polyline box and tiles @rk 10:05 AM 1/30/97
. Y4 q5 i* u1 C2 a2 s% |7 | - (if (not (= 2 (logand 2 eflag)))1 m V0 Y& w' y. b- G# i% i+ f' B
- (progn
8 O6 j) T4 L! s" T2 {" e - (mode_tile "text_hgt" 1)% y( Q& w6 c8 ~$ ]$ |1 }5 z, z# P( v8 L
- (mode_tile "text_style" 1)
1 Z$ Z9 n. |$ r% Y9 E5 E! S l$ o - );progn1 A1 Z% V3 `$ o5 R9 M! }( X
- );if
0 |7 e: P- H& V x) i - (if (not (= 1 (logand 1 eflag)))3 s0 l8 W6 m( W
- (progn
& l( q2 e& ]$ X6 ^9 H5 i9 ]& Y - (mode_tile "poly_wid" 1)% Q. r2 B/ Q( p" z- o0 j
- (mode_tile "poly_elev" 1)
1 G7 K$ I" |0 q" V5 W. t: ?1 z% R* r - );progn then disable polyline fields. ^/ P- @# ]$ }3 M
- );if
' ?/ N/ D3 d' s( y* h$ h$ [9 L - 9 \0 \( w$ K! T: [& Q# s; A
- ;; Define action for tiles5 n: [2 \) Y; `$ k
- (action_tile "b_color" "(setq ecolor (getcolor))")
# }2 i* E) y1 B" ~4 ` - (action_tile "show_image" "(setq ecolor (getcolor))")8 E) i9 g# y+ }
- (action_tile "b_name" "(setq elayer (getlayer))")" ^7 ^0 z6 C; w: s1 O2 u- p& R9 t/ z
- (action_tile "b_line" "(setq eltype (getltype))")
9 r5 c! b% x4 ? - (action_tile "eb_ltscale" "(getscale $value)")- u) k* }; D* ~9 h+ V( D
- (action_tile "eb_thickness" "(getthickness $value)")( n/ M. u& Z% B) s) k6 J% K0 y6 e
- (action_tile "poly_wid" "(getwidth $value)")
5 h5 x( t" j8 u - (action_tile "poly_elev" "(getelevation $value)")7 H+ k" R; K, i3 [) n* s
- (action_tile "text_hgt" "(getheight $value)")0 f3 I' _. L; n6 n
- (action_tile "text_style" "(getstyle $value hair_style_list)") ( }: b4 Y. V7 k2 s' Q# f
- (action_tile "help" "(help \"AC_BONUS.HLP\" \"EXCHPROP\")")
+ O' p! A6 a. F6 P - (action_tile "accept" "(test-main-ok)")+ o$ J8 _4 M' E
/ v8 t6 s. V/ W/ e1 T- (if (= (start_dialog) 1)# p* w3 i4 J. e* [. d4 g) u1 H
- (progn1 X! ~- D0 H( ^! l5 y
- ; Update special properties for polyline and text selection-sets.
4 g: ~9 b+ W6 f! X+ ^ g# U -
# ]5 t( ~6 k" z" ?. Z7 d* X3 w" p - (if (and (= 1 (logand 1 eflag)) ; polylines rk chprop. Z. O% x& J* ]0 p, I
- (or ewidth
/ [5 ^& b) s) U - eelevation
6 E2 h/ Y3 U! x" W+ B, @1 p - );or
1 v7 E2 o, l4 n) c/ G - );and7 w$ J3 q* N2 w. V. W% B
- (progn
# q7 [5 h! O. U( v) \ - (setq ss-index 0
* J; f. {1 [% C9 v# H8 m+ m - ss-length (sslength poly_ss)
. ?/ P4 o5 D2 ?- K5 s. O* o4 [ - );setq
: s h4 F7 O: D0 w5 _6 y; n4 e# s - (while (< ss-index ss-length)8 t; K6 j% S* q1 J2 K: `
- (setq ename (ssname poly_ss ss-index)8 G* X! g+ C9 }' n- _( U6 K
- elist (entget ename)0 I' T6 y/ l3 g) s; ~+ j
- );setq
9 E- n+ e4 [. k& w) j3 g) Q - (ucs_2_ent (cdr (assoc 210 elist)));this function lives in ac_bonus.lsp
1 c3 N& b* H& Q! C/ ^! q - (if ewidth
: C* |) q3 ]1 k6 o - (command "_.pedit" ename "_W" ewidth "_x")
& o0 j6 z4 ~) r" u/ ] - );if
6 B4 `& q! L9 {/ [2 |9 m) z - (if eelevation
6 u* x* B8 b0 T - (progn
8 D9 I( x/ D) J" u4 L - (setq p2 (list 0.0 0.0 eelevation));setq/ w' r0 q- ]) W9 Y
- (if (equal (cdr (assoc 0 elist)) "POLYLINE")
' z/ _: h0 U1 R: D: b6 I+ [" J" W' K) _ - (setq p1 (list 0.0 0.0: L0 v/ a8 A7 [# h! U: }$ a
- (caddr (cdr (assoc 10 elist)))
+ g/ f8 O5 o4 T1 I - );list5 L& |+ }8 t, d$ f( E
- );setq
, A4 m9 K2 q! w - (progn# {% p! Y" Z" o$ C# i& ~: F
- (if (assoc 38 elist)7 N6 Y5 D! |/ l2 i; ?/ [3 J8 _
- (setq p1 (list 0.0 0.0( }$ j7 c9 P, y4 q- k0 q' }
- (cdr (assoc 38 elist)), M# x2 Y7 x4 f {/ h$ G" H
- );list* l3 ?$ C( _6 P8 E& y! g
- );setq
4 [$ ^( _- \) p! m5 ` - (setq p1 '(0.0 0.0 0.0))$ K+ A d+ V( `& V& P
- );if- U5 v) B1 F9 v; S+ k' @. |
- );progn 0 E7 h% Z5 _6 g8 c l" l7 v
- );if
& w1 ^7 f# g- \7 M. L - (command "_.move" ename "" p1 p2)6 w0 n# b; q! S- ?3 P0 ]
- );progn then change the elevation of the polyline
1 X! j; Z8 e9 H1 \2 Q) z' x - );if
1 J9 X' g( X, ]' Y( e I5 | - (command "_.ucs" "_p")
; S% y* f1 G0 H0 M- a; c - (setq ss-index (1+ ss-index))
2 [; o$ @8 y. N# [7 n - );while3 v* J$ \4 J7 N& C( K' D+ C
- );progn then polylines are in the selset4 r5 Q! j& q; l( t8 x
- );if% m2 C2 b/ @, T8 l- ^: b
- (if (and (= 2 (logand 2 eflag)) ; text
0 U. i: |7 g( o3 S - (or eheight , I: |8 W: N5 K9 |" [8 s
- estyle* s4 Z/ k, G- h
- );or: J" r! l6 l& E7 ?$ a8 K4 b
- );and
* _$ H8 ? u3 d" y - (progn5 |' |! A9 \) e. W
- (setq ss-index 0 ss-length (sslength txt_ss))
% V" `% n* i; y' t) M - (while! `0 M+ u# P& [/ d
- (< ss-index ss-length)
6 o M1 A2 O* e" J: x" n9 F - (setq elist (entget (setq ename (ssname txt_ss ss-index))))
7 @( w; j3 H2 h( W$ n - (if (numberp eheight)
; p9 h1 F; b! B! Q; Q - (setq elist (subst (cons 40 eheight)# ~8 D2 y+ l1 D- j6 T& F7 h# Q
- (assoc 40 elist)6 o; ?& N' j( v0 O) i' l, A, y( m! K
- elist
6 K* Q( A1 \9 l( H' f9 H7 q6 q - );subst
0 G0 q: _" l+ X4 ~ - );setq# [2 { k. g# M1 w/ `2 \
- );if
" ]2 F: j, e1 q- O - (if (and estyle ;(not (equal estyle ""))' m7 Y* `! u! |6 R& \
- (not (equal estyle (cdr (assoc 7 elist))))4 J' k# i" V5 b2 l
- );and2 u6 w) q+ W2 B* F6 _. S
- (progn
" l( f6 m$ w1 l4 t" c' | - ;rk. This needs to be implemented as per mtext font issue in ; ddchprop_notes.txt
b) e, d5 D/ c+ x# e. C - ;(if (equal "MTEXT" (cdr (assoc 0 elist))); O# y$ X+ n7 F
- ; (setq elist (fix_mtext_fonts estyle - q' i. b9 x3 W. b6 B+ B% m6 g, h L
- ; elist5 }0 I7 y1 a& D# h
- ; )
+ j7 L& B6 K. `* O$ o( H- X - ; );setq then, k, O$ `9 [ Q, V3 N
- (setq elist (subst (cons 7 estyle)6 n6 \7 R6 ]9 A2 X) ~: \3 @) e1 R# {. G
- (assoc 7 elist)
% r& {8 \& W8 r2 J - elist- j0 ]8 q! s; z3 ^
- );subst6 i- }3 Z0 d/ J# n* f, t) o' }
- );setq else3 [' x: i1 X: Y
- ;);if 3 D, Q9 U% Z8 }' s9 S, j
- );progn
I7 P! ^2 F2 Q; J6 @+ k: [0 |- { - );if
) {' ^" P9 d7 M7 U! W. p. H6 ~# }, y- i - (entmod elist)% b6 T: z$ ]8 i! L) N
- (setq ss-index (1+ ss-index)), `7 V& S) y% K7 q( h+ n
- );while. q0 q O1 L8 F* C7 r
- );progn then( R; }6 |* V+ C4 q
- );if) n/ C9 G. {6 g6 K0 e+ Z. {9 d x
- , D# u- {+ \; N M2 L4 ]" r
- (setq cmdact (getvar "cmdactive"))5 H3 O) y; x D* M4 T1 ]% m
- (command "_.chprop" ss "")
4 K2 z/ @0 L; t- K7 {; i* M - (if (/= cmdact (getvar "cmdactive")) ; Is CHPROP actually running?
- v- j6 |, q1 l; [/ Y. ]! ^% V3 W - (progn
1 a0 F9 F( V+ q5 r - (if ecolor
7 Z/ X* T+ }/ y - (progn- F) \. E+ H( t. [' e3 x, A
- (if (= 0 ecolor) (setq ecolor ;|MSG0|;"BYBLOCK")). ?" J6 a8 {) n. \, b- v
- (if (= 256 ecolor) (setq ecolor ;|MSG0|;"BYLAYER"))6 J' v- ^6 ^% \# o4 d y( [$ d
- (command "_c" ecolor)
$ q' G2 s4 k& T s' Y4 f" { - );progn then
4 x4 O# B, P0 h1 ^* ]# d; R: D - )) |1 |" O. _* C, F; Q
- (if (and lt-idx. @0 U/ p( L [/ B' @, [: ~
- (/= eltype ;|MSG0|;"Varies")8 ]2 V4 {4 \. E$ t# F
- )
6 I/ t( L& X' R6 \0 x" g - (command "_lt" eltype)
+ Z0 B3 R$ h p# I& x0 E6 r - )9 V. Z# O3 d S1 X# T1 b
- (if (and lay-idx
8 C3 }: x; B! t7 [! | - (/= elayer ;|MSG0|;"Varies")
6 R& n4 y( K3 Q - )
" }- ~6 t- u% v, v4 G7 c1 n9 @ - (command "_la" elayer)6 c K! K7 r* g% |& b
- ) ~* n: g) P4 ?$ H9 r1 L
- (if (and ethickness " D( A3 {3 `: d$ k: u5 {
- (/= ethickness "")6 N: p9 W0 Y; ]
- (/= ethickness "Varies") 8 z. b# F7 d Z. N& \
- )# A) `/ V3 v8 t" Z5 M0 |1 N
- (command "_t" ethickness)
" [! l5 E' c3 t i - ), X8 H. g9 }7 o$ I2 X
- (if (and eltscale (/= eltscale ""))
) u) s O- u+ T6 K0 E% U g7 X - (command "_lts" eltscale)! f+ h% P: o, S# |3 N( s
- );if
$ T8 N) T# @5 J8 F" M7 @ - (command "")
1 [5 v) d* T" a$ g5 N7 V: X& D - )
1 Q, l8 {. I2 n: C" \( A8 g - (princ "\nProperties unchanged") ; CHPROP didn't like our SS set
0 z. Y" J' k- O- L7 N3 a, i( H - )
9 [( v7 ?, ?. _: d
& g3 ]0 c5 i& \' ?9 r! n- );progn then OK was picked in the dialog.$ O+ c J+ X& X! U1 E, r4 l
-
2 T: i# R8 B. l, |) X - ;; Fred GERBER - 25-AUG-94
z. ~4 x1 @8 p: z1 O) W - ;; Don't print the "Properties unchanged" message when the user cancels/ x; ] Y: I/ h4 E0 [' ?' X
- ;; the dialog because he knows that already (otherwise he would have
_: P, n" o2 ]( F& C: y- A, ~3 z. p - ;; hit the "OK" button). Display the message only if CHPROP fails for
. g7 p! |( ?7 y - ;; some reason, because it is not the expected behavior of the command.
9 b5 V7 L' L5 V: V1 G* m8 g( k P - ;;
/ ?" I" u1 l( E. V - ;; (princ ;|DDCHPROP2_LSP_8|;"\nProperties unchanged")3 w8 ^8 C) F9 }; H. }* k
- );if6 h' g h/ o7 j9 m/ g. f4 W
- (princ)& f8 U: t3 N8 ]% D
- );defun call_chp2
0 \: U- B( J ]0 l* q6 K1 p - ;;
' {/ v. q. m2 F5 n M& E - ;; Function to set the Color text tile and swab to the current color value.0 W) Q3 y: T% l7 D. [
- ;;- l4 S1 X7 R% E) M( Q. H
- (defun set_col_tile()
5 v: F6 a! K+ |5 I6 C! e# \0 H, ? - (cond
2 X" ?% y2 {4 T! [: {# p - ((= ecolor nil)8 h* O1 S0 e1 |* O& A! Z9 B" v9 Y
- (set_tile "t_color" "Varies")
* ~* C4 V) ?* U - (col_tile "show_image" 0 nil). I9 C; e! w* Y9 C8 E2 B& c+ E
- )2 I/ I) H* M' ~
- ((= ecolor 0)7 _" T, W& ~8 \7 x* N
- (set_tile "t_color" "BYBLOCK")% B6 e y- B; n: |. D, l; B5 J
- (col_tile "show_image" 7 nil) ; show BYBLOCK as white
& C" h+ J$ U- p+ C* K+ ^: ~. t - )
7 B6 _* F5 ~, e3 B - ((= ecolor 1)
2 q9 n7 l' i5 c0 Y5 H S. y: A$ N- { - (set_tile "t_color" "1 red")
1 j ^6 ?2 e" r - (col_tile "show_image" 1 nil)7 j0 l/ l3 h% ?0 g) O, b% |
- ). ]! ?' I2 M/ y/ h
- ((= ecolor 2)# |7 O% y: h. Y& U+ N
- (set_tile "t_color" "2 yellow")
. s0 p/ K0 A' y! x; K - (col_tile "show_image" 2 nil)
$ j8 p1 R/ Y6 o" ~ - )0 l. s$ E. [/ u# }' }: c) J }
- ((= ecolor 3)
1 R& A( |5 `6 G f+ H( V - (set_tile "t_color" "3 green")
6 w3 ]9 E; J4 A - (col_tile "show_image" 3 nil)0 e% Q" r x$ r
- )
1 W5 i" |, S8 U5 x$ a4 R - ((= ecolor 4)
: d5 g! i9 ?& I+ }0 N- c' F9 ? - (set_tile "t_color" "4 cyan")
3 S* h# z* w) R9 }# }' s - (col_tile "show_image" 4 nil)
+ X, V8 q1 W! f! [3 u - )% {, i# {$ m! r: \
- ((= ecolor 5)/ @1 b8 i$ n* W( W
- (set_tile "t_color" "5 blue")9 j+ W/ G7 s# X
- (col_tile "show_image" 5 nil)( [1 W; f b( T/ z
- )
# ~0 t" k; I" E! e; g - ((= ecolor 6)
) }8 ~/ I- @; M2 e - (set_tile "t_color" "6 magenta")
; o$ v3 q) A. D" S - (col_tile "show_image" 6 nil), E ?6 v( _- v+ D2 z
- )# ~7 q m" I3 z- N- o; C- Z
- ((= ecolor 7)$ O' ^) Q0 k& [' u% @: Y( H! k
- (set_tile "t_color" "7 white")
) V) U" ]2 k% j% D+ \. d3 \# ^2 p - (col_tile "show_image" 7 nil) B$ U* _$ m I8 x% r% L' r" H
- )5 E3 E0 ?+ q& E( y+ X0 v
- ;; If the color is "BYLAYER", then set the tile to [- H+ Q w1 Z1 E+ @. g
- ;; show it's set By layer, but also indicate the
/ [6 G/ n% f. L. M - ;; color of the layer - i.e. By layer (red) e3 U* c$ d' E) A3 H. Q0 n
- ((= ecolor 256)
$ y! \% a# c, o N5 k9 S - (set_tile "t_color" (bylayer_col)). |4 k8 H' `- l4 z2 ^, \! ^
- (col_tile "show_image" cn nil); L9 h% V0 [) n7 q' r8 F: \
- )' v0 `2 g: \1 d7 Z k1 A+ h( h
- (T5 }* O u( ]0 P9 D b2 s
- (set_tile "t_color" (itoa ecolor))
4 S2 d. @* _, G/ |7 p, a3 X+ _) Z6 u - (col_tile "show_image" ecolor nil)
0 S1 S1 q+ I6 {: f% v1 ^8 D - )# ]" x/ {9 z& y. q$ x. C% D
- )
* z7 Z$ i G- l* p - ); f. T3 {! g& ?6 e$ E
- ;;
0 a* i9 L# ^$ a+ u' h - ;; Function to put up the standard color dialogue.! @6 p6 Y. y9 g
- ;;
: K2 s' Q4 a3 k% T- L( O - (defun getcolor(/ col_def lay_clr temp_color)
2 \# g, Z8 }1 I" ~ - ;; col_def is the default color used when rq_color is called. If ecolor3 I& J2 f2 L5 X
- ;; is nil (varies) then set it to 1, else use the value of ecolor.+ h2 U0 }+ C$ ~' v
- (if ecolor
1 R- N0 e( ?. _3 c5 Z2 m - (setq col_def ecolor)$ X% P3 }7 s8 G" v! x5 @: P O
- (setq col_def 1)
8 V3 z; R' C5 X - ): C- w1 ~9 a* {9 H. F/ u
- " C5 y9 u( s' p" {2 `
- ;; If we're working with a single layer, get its color# L) l0 e& C5 q8 _- a& J+ ?
- ;; for use in the color swatch if the user selects color BYLAYER.. w+ m8 C( i5 A( B3 n
- (if (/= elayer ;|MSG0|;"Varies")4 N! q5 z5 x4 H; I2 _5 R
- (setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))
+ o' ~6 i2 ]( J - (setq lay_clr 0)
* o7 m, Q- ]3 T/ X$ s# S. T; ~ - )- Q0 I. s- Z+ X8 N" s Q
- (if (numberp (setq temp_color (acad_colordlg col_def T lay_clr)))# n$ i* v3 V) a% l# v
- (progn" N. r7 t8 c& o s. Z
- (setq ecolor temp_color)
; K" i% A% C5 W - (set_col_tile)
! d% x' h4 }# v) V - ecolor1 S7 P- h( e& e2 C* _" W/ h
- )6 B* z+ E: e: r7 k% A2 Y6 Q
- ecolor
8 A6 a$ [9 Y; K- p8 P% b - )8 v$ P% W0 a- V+ b( X. M [2 b! E/ |
- )( t" D( o7 X( z' A
- ;;0 S) Y% q! Y. {8 Y5 r
- ;; This function pops a dialogue box consisting of a list box, image tile,- T) L, {; D4 G, p% K+ z9 d! W
- ;; and edit box to allow the user to select or type a linetype. It returns
9 I1 l4 ~4 C, ~$ L0 c( X - ;; the linetype selected.
- }: _3 Y, H$ \: ^ - ;;
# B# r" I; \. J" D: B- M - (defun getltype (/ old-idx ltname)
) x6 w! I4 c; e& M% \6 J* l& b - ;; Initialize a dialogue from dialogue file
7 ]) `) u6 H3 O$ m+ Y6 O- @2 \ - (if (not (new_dialog "setltype" dcl_id)) (exit))! s! r7 f! h1 j. f' i
- (start_list "list_lt")
7 V' C7 t/ `- Z& Z. X - (mapcar 'add_list ltnmlst) ; initialize list box i$ E( ]8 N# ?% X3 N
- (end_list)
6 N; g6 f* Q9 t4 n: {0 o! M - (setq old-idx lt-idx)5 A% j+ v- z) R% [
- ;; Show initial ltype in image tile, list box, and edit box
$ X4 B6 \8 } P6 n' v9 B - (if (/= lt-idx nil)
- @ e9 u0 I: k* X. `/ o& Y - (ltlist_act (itoa lt-idx)); F0 l. p4 O' n) W q- p0 l* G3 `
- (progn
+ I3 I( v. v* a5 a+ Y( t1 k+ v/ Q - (set_tile "edit_lt" "")2 {8 p4 N- M: g0 c1 j8 E
- (col_tile "show_image" 0 nil)
( Q; R$ t2 M) ?" x& n* L - );progn else" t) H5 i3 }) o& }$ f; Z
- );if0 G i. ]! \3 M2 J( M
- (action_tile "list_lt" "(ltlist_act $value)")
`7 [ V8 o4 D( i; M& U- L - (action_tile "edit_lt" "(ltedit_act)")2 E# {' X! p( j" E& e8 Z2 ]) b
- (action_tile "accept" "(test-ok)")- L. I# j& v7 W" Y2 e
- (action_tile "cancel" "(reset-lt)")7 @' G- @9 y! r6 O8 }
- (if (= (start_dialog) 1) ; User pressed OK
$ Z8 O! E; H$ [1 [! Z" [1 c! n - (cond9 p9 J1 a* d i0 O+ p; @6 D* [, S
- ((or (= lt-idx nil)
" D9 g2 U9 z/ P0 p* z - (= lt-idx (1- (length ltnmlst)))9 \* @" Z4 i8 T \7 q2 F1 e
- );or
' P2 y9 F" m* E1 j% g) r; V+ [ - (set_tile "t_ltype" "Varies")
+ U' d) r" ]' ?! q( _) `+ R; t' B j - ;|MSG0|;"Varies"' p4 A# ~' ?' u, Y/ a
- )0 `3 ]: _& \, i+ @" S
- ((= lt-idx 0)
. [# |3 h7 T' \- ?0 o! J - (set_tile "t_ltype" (bylayer_lt))
" r. g' O9 T. W9 } - ;|MSG0|;"BYLAYER"! p8 B( u- w# |
- )
9 O( V$ v2 v2 V" D/ o: y - ((= lt-idx 1)
p) ?% O" l1 |: n, z5 }, A - (set_tile "t_ltype" "BYBLOCK")
% b: A4 X+ \2 c+ A# m9 C - ;|MSG0|;"BYBLOCK"
6 ~5 ~) `$ n+ q - )
: s5 c# X" U" x+ c7 G- r( q - (T
! L7 v2 U8 @) U - (set_tile "t_ltype" ltname)8 D% c S, {4 j$ Q' M
- ltname, B+ \6 z2 O' B; B: n ~ s, X
- )2 a$ H! M: g. e+ I
- );cond then7 r% `* j. v( D, K7 l
- eltype+ D( q7 [: P# p" s/ G. [3 f
- );if8 h. ~2 p& t2 l. N6 j* j) d
- );defun. Y0 Q9 E8 h8 o _7 u* t
- ;;
) a) }; N0 x/ R - ;; Edit box entries end up here
' n. S7 f, V, w( x d1 O& T1 I - ;;6 I+ v9 g; k3 V d+ M' W
- (defun ltedit_act ( / flag)6 c1 V6 P9 \2 Z5 j; V p" P
- ;; If linetype name,is valid, then clear error string,; h$ i, ?( o1 X; [
- ;; call ltlist_act function, and change focus to list box.1 h& M7 H" n+ |9 l: S
- ;; Else print error message.$ L! I: ]5 e( v* P" s6 V4 L
- ! u, j2 Z8 U, q( |, u, O
- (setq ltvalue (xstrcase (get_tile "edit_lt")))) \9 k" c1 M! o( V
- (if (or (= ltvalue ;|MSG0|;"BYLAYER")
, C' i( M# [! K6 g( ~$ B - (= ltvalue "BY LAYER")* {. P/ V7 R! l
- )
# [+ d/ U e: q+ p8 w - (setq ltvalue "BYLAYER") L }9 m: x. f( \; L& Z
- )
a, m2 e+ M- N0 q/ ^7 K, t! m - (if (or (= ltvalue ;|MSG0|;"BYBLOCK")1 J; a2 C. x; c& F
- (= ltvalue "BY BLOCK")/ U2 S1 u; I; Z7 q# a& A
- )
& M4 p2 u- d6 }% ~" l1 e: b) s( @ - (setq ltvalue "BYBLOCK")% ~, L: e1 l4 W2 Z
- )
( J) H* @+ j# r# T- e/ b8 W - (if (setq lt-idx (getindex ltvalue ltnmlst))4 @# d" X% ?7 z" s
- (progn
3 Q X) Z/ q; r - (set_tile "error" "")
0 Q$ r1 U. n D* B; Q' D9 X - (ltlist_act (itoa lt-idx))0 y p) z$ b8 a& ~/ Q8 e0 f
- ;(mode_tile "list_lt" 2)6 O! T- C- ~1 A p/ |5 N; E" B
- );progn then
Z. j) @6 T) n0 T - (progn
" r& U7 s- H' p8 Z0 R, E$ G3 F - (if (/= ltvalue ""), S! E+ Q8 p S: ]. x
- (progn
9 n* \# z% _; Z/ A- r - (set_tile "error" "Invalid linetype.")) Y2 B; [8 h8 J. d3 O
- (setq flag T)6 w- m+ P% k2 B
- );progn- M/ S/ G' g- F: N7 Z0 `
- )! c$ p% k y' a Z- w0 o
- (setq lt-idx old-idx)9 K9 b5 A9 p3 S/ {" f
- );progn else
e/ f I* J" |# G. F- d; | - );if
, a' \2 i0 a1 w5 m& Q' e - (if (and (not flag) ;added so a return will take you out of the dialog.
" `( r* H. a& y+ }3 u - (= $reason 1). S7 |: ]; y+ u+ N
- );and
& n. o; ?3 O2 A - (done_dialog 1)
( `" i$ T4 z' M, A/ ` - );if
; C1 X3 q8 D$ {; c5 J - );defun ltedit_act
4 x; y. Z/ m1 l: |9 c e! F# z - ;;
0 }0 \# F1 w. ?* |9 @) Q: O$ w - ;; List selections end up here
, a8 i2 ]- \; F% \. r( }9 w7 U - ;;
! c) P' D T5 x* U0 l - (defun ltlist_act (index / dashdata)* P f o# p$ N f
- ;; Update the list box, edit box, and color tile% G: t( V9 o7 x# a: ]0 P( t* r
- (set_tile "error" "")
$ X( V& K* F! Z6 g: B( }& W# s - (setq lt-idx (atoi index))
2 p7 `+ _3 L1 \ - (setq ltname (nth lt-idx ltnmlst))0 ^3 C# I$ D4 J- ^. k2 o
- (setq dashdata (nth lt-idx mdashlist))2 ]4 Z+ m4 X) p
- (col_tile "show_image" 0 dashdata)
/ v# ]2 ?: S8 }8 O# Q/ Y# V! ~ - (set_tile "list_lt" (itoa lt-idx))
; o4 r. I7 D! P2 ?+ m J, b - (set_tile "edit_lt" ltname)
' _. |5 ?" \* R - )0 `) o8 n: `8 m
- ;;& X1 L$ k7 \# X m0 Y0 v" r+ @
- ;; Reset to original linetype when cancel it selected2 U9 D- v4 |, d W
- ;;# i1 I; S1 D0 J8 o- p
- (defun reset-lt ()7 R- v. Y4 c x4 @/ v5 u
- (setq lt-idx old-idx)
% G) a" Z0 u/ \) A$ `1 k4 y$ s& c - (done_dialog 0)
4 H1 H9 g7 A5 @2 ] - )' V+ {. C$ G( k, j" L6 @, Z
- ;;/ C1 `8 h* K. T; c$ m4 H' n& |
- ;; This function pops a dialogue box consisting of a list box and edit box to
- ~* G( m6 V" |; K/ w( I - ;; allow the user to select or type a layer name. It returns the layer name
7 E( G9 ]. r" t* z$ T - ;; selected. It also the status (On, Off, Frozen, etc.) of all layer in the; A7 Z) N, C2 E
- ;; drawing.
# x# [0 z1 ?4 m: o$ a - ;;! V6 A; c* ]; ~. o% H: F
- (defun getlayer (/ old-idx layname on off frozth linetype colname)
5 `8 }4 I$ v+ ~) |1 P - ;; Create layer list the first time the layer
) q& ^) k5 i; j t - ;; dialogue is called.3 y( D0 ], h$ p4 h2 O
- (if (not lay-idx)" t7 `5 K3 E& _" K& n$ ?: P f n1 Q
- (progn3 U- _& j( U% k/ n9 W# k
- (makelaylists) ; layer list - laynmlst6 c, Y) o# u) S
- ;rk
. c- P+ H! q- D3 B, J$ y' P - (setq lay-idx (getindex elayer laynmlst))2 J( ~- R6 y& m; K9 D
- );progn) s Q T) `* o0 A) k& U. G, S1 L1 f) @
- );if
2 R" F( k6 i' E* y ^
% x' w* [8 o1 k: A5 m* a( C- ;; Load a dialogue from dialogue file
6 T! b1 Q, u2 g4 w# F - (if (not (new_dialog "setlayer" dcl_id)) (exit)) p% ]9 z( t/ c
- (start_list "list_lay")
0 K" S9 L; T$ y. u) t3 s$ Y7 v - (mapcar 'add_list longlist) ; initialize list box, j- [ {9 L) H! H
- (end_list)
+ N- M, R3 a4 N& k - ;; Display current layer, show initial layer name in edit
K3 G: T/ K6 m$ @# N" z0 s+ Y - ;; box, and highlight list box.
, i2 |/ M2 J! S t* y' b9 X$ ~ - (setq old-idx lay-idx)
0 L. `' B% M/ e; i ~( A' F7 S - (if (/= lay-idx nil) (laylist_act (itoa lay-idx)))
' [& z9 v9 t. G- P! t+ J - (set_tile "cur_layer" (getvar "clayer"))
, x: q3 @, ]+ [+ }4 w+ p# z: S - (action_tile "list_lay" "(laylist_act $value)")3 F$ e# k- `: C% U
- (action_tile "edit_lay" "(layedit_act)")
% X" W- O7 l, ~8 y - (action_tile "accept" "(test-ok)")9 G9 j$ Y! o V- V* Q; S
- (action_tile "cancel" "(reset-lay)")& Q2 I ]& [" E2 A
- (if (= (start_dialog) 1) ; User pressed OK
$ R: b+ Y$ F+ c - (progn' j% W" F" c. _# n+ z! ?5 z
- (if (or (= lay-idx nil)
& y& o2 [) }- ] - (= lay-idx (1- (length laynmlst)))
; w" [ k. x# |- u - );or$ {% t- p7 a) N W s+ \
- (progn" y. D5 J8 q6 O
- (setq lay-idx nil) 2 X* t: l( n" W% N" E3 y; d7 |
- (setq layname ;|MSG0|;"VARIES")
! m$ g! L) O; a7 O/ S - (set_tile "t_layer" "Varies")$ U6 ?% m, r! e$ K, h! \, K+ I, d
- (setq layname "")
5 j# l- i( |3 D6 F - );progn$ ^/ |7 ^; v2 i1 P: r
- (set_tile "t_layer" layname)
! M# {# ^& ?9 Y$ Q( \ - );if
4 s) v8 H9 ?/ Y$ D+ {3 ` - ; If layer or ltype equals bylayer reset their tiles
7 I' e. ?2 f) B8 o - (if (= lt-idx 0)5 I, u. @9 @& ?; R! }' Y
- (set_tile "t_ltype" (bylayer_lt))# y$ m `% g$ J+ x
- );if! F3 V% V* m2 c* ^: V
- (if (= ecolor 256)8 R, `2 N' W( z. S2 G8 m
- (progn
0 D5 x# K& j2 ?9 Y: q, M* T0 p - (set_tile "t_color" (bylayer_col))
0 c! m' \: t: o6 N0 j& V - (col_tile "show_image" cn nil). E6 \: `7 b% D; [/ X {& G! s) @
- )3 f8 F* G9 S6 \* S6 u M
- );if. E ~- g* S& X# J8 H% [7 {- G4 z
- layname
1 P- W+ P5 l! j k" S: `! k4 ^ - );progn
, S8 k# y" E7 P/ V6 ^3 V - elayer
b# n+ V! V9 g, q+ \( H0 p# A - );if+ a+ n% x8 a5 m2 q- x
- )4 v: a( Y5 ^ ]
- ;;. @) I8 U3 T- T9 o; b
- ;; Edit box selections end up here
4 X' H! W5 D) X, h3 j - ;;
6 [- w/ @. |$ W! N& c - (defun layedit_act()! h! M3 b; v% R3 `8 N$ c& V
- ;; Convert layer entry to upper case. If layer name is" X! r' ]9 n3 C2 e p- Y8 h
- ;; valid, clear error string, call (laylist_act) function,
/ d7 v; \9 s& _$ X6 S - ;; and change focus to list box. Else print error message.% a$ w2 U# L) z) Q
- (setq layvalue (xstrcase (get_tile "edit_lay")))# y- I. N- C% G+ s: b
- (if (setq lay-idx (getindex layvalue laynmlst))
$ ^ V4 N5 z. C# S4 O- |/ w4 j - (progn
5 u: U7 a6 p# A5 @6 y% c" N - (set_tile "error" "")
; z* W6 \, e2 e* n2 C8 ]) Y [ - (laylist_act (itoa lay-idx))
/ e) N0 I m5 [/ i2 f$ }- d - )
/ C% T4 k" z: t$ W# S9 ?! S - (progn
3 E9 U* X4 J% D( ^& x* v" l - (set_tile "error" "Invalid layer name.")$ M$ C0 I8 ?( ]* O5 w
- (mode_tile "edit_lay" 2)$ p C2 T+ B; |/ ~* D
- (setq lay-idx old-idx)& h3 S0 M) P5 |
- )+ c; S% [5 k, ?# B, U R6 ?
- );if
9 x1 V" M% U3 j" v$ N* G - );defun
- C1 w! N% ?1 M - ;;5 O# A9 h8 w$ b
- ;; List entry selections end up here
. x' U* @! |0 y8 k: U; W - ;;
5 V2 A5 O. d$ w: d7 Y# R - (defun laylist_act (index / layinfo color dashdata)
" Q: L, L" Q) t2 v - ;; Update the list box, edit box, and color tile. k4 ?! m& \$ v* P6 B. {
- (set_tile "error" "")4 J7 o- e3 u2 F# s1 d$ K# y
- (setq lay-idx (atoi index))
, \6 U5 v; A8 b2 `4 @ - (if (not (equal lay-idx (1- (length laynmlst))))
+ }, W9 K, k8 v9 v- Q! s1 ` - (progn
5 e$ T" t, \6 ^; B9 C - (setq layname (nth lay-idx laynmlst))% H( j8 y+ ]* J! u L
- (setq layinfo (tblsearch "layer" layname))
0 V% Z, z% i; Z1 P; _8 K0 f - (setq color (cdr (assoc 62 layinfo)))
; I4 ~3 q. z9 g/ I V7 { - (setq color (abs color))
+ x2 B* T0 I' \) b - (setq colname (colorname color))
/ J5 ] B4 r1 S" l7 T9 R1 m - (set_tile "list_lay" (itoa lay-idx))
: H+ Y: [. U$ L8 |! n - (set_tile "edit_lay" layname)
4 T1 k( E+ w. s' w) B; p. G6 I - ;(mode_tile "list_lay" 2)& E, }# V: J0 a6 C: M
- );progn then
) f, t& }2 l8 u6 F8 | X' \ - (set_tile "edit_lay" "") 3 r" e; m- U6 s/ }
- );if
, O' o b( q) W! w - );defun laylist_act$ y. A& D! J5 K l s# n# r
- ;;
& V* P9 }7 n1 u, ]: m4 D - ;; Reset to original layer when cancel is selected
. w' v8 y2 V. V, j7 O, u - ;;
0 B& V7 u V2 \, o( q - (defun reset-lay ()
, ~" ^; X! S0 f$ Y( X - (setq lay-idx old-idx)
0 X$ V% i- E" F! l0 ?% l8 e - (done_dialog 0)
) S' m c5 u$ p0 \+ @: i0 {5 K - )
! c: @) f3 N. k: H. Y, Z% ?
/ p% O0 o7 h3 X8 w4 S* {- ;; Checks validity of linetype scale from edit box. It checks to
; K2 {2 `" G+ ?1 W - ;; see if the value equals "Varies".7 S) H) ~1 M. f! q8 T+ K/ H! m
) H( C( a8 b1 ]2 O' U# p7 d- (defun getscale (value / rval)4 q1 {0 X$ {2 R# @, D
- (setq value (strcase value): e6 G/ ?2 v3 a$ M
- rval (distof value)
, L* V# y: z( v3 {* u+ s4 u - );setq! G9 M* z" b9 I# ?( J5 @
- (if (or (= value "")
0 G: I4 [' E, d' d* n' Z - (> rval 0.0)" ~$ B5 Z3 _! X2 u
- ), f# b; `! e# M6 K
- (progn
" t. q, U2 D4 m1 D& Z4 q/ D - (set_tile "error" "")
! w2 w) J; ~' t* b - (if (= value "")' q9 h8 U: q1 o3 S& ~3 g5 d
- (progn' m5 d$ r5 J% U9 R
- (set_tile "eb_ltscale" "")4 ~* Q, J: s1 v3 ?
- (setq eltscale nil); A4 l3 Y& ^% x% e% C" d
- );progn then
% u6 C7 K, ]; Z1 q$ k' G1 y - (progn6 N0 B) ]: A; L
- (setq eltscale (distof value))3 I3 W% Q- ^- B4 a3 y
- (set_tile "eb_ltscale" (ai_rtos eltscale))% I; z' `/ G! ?
- eltscale4 w i; C2 E/ j/ H3 \) T, w
- );progn else1 {% O3 d& @" ?# M+ B& E5 t3 c
- );if
9 f: L( B- L0 a9 c3 m - );progn8 X) I' @& i4 \& W9 w+ y
- (progn
6 @6 }! r$ h+ u - (set_tile "error" "Invalid ltscale.")* {# R) L$ _ X
- nil: d+ t* M! A. ~$ r$ o9 W* t
- );progn else6 A9 z) O' Q4 ~' z. H4 x+ p/ r
- );if
9 G4 T: [/ K. A/ a - );defun
: \; @- x% c; r. P3 D w' T" ~ - ;;% t4 g" V3 C# R" M
- ;; Checks validity of thickness from edit box. Since (atof) returns 0 when a
# f( g Y6 I4 F/ m - ;; string can't be converted to a real, this routine checks if the first
( q4 k* R8 f2 i- d& E5 x+ v - ;; character is "0". It also checks to see if the value equals "Varies".
: B# }+ l+ Q8 i4 `7 A8 R$ x: W ?/ Z - ;;
/ z0 V7 M0 f8 F, W4 [/ L - (defun getthickness (value)) z6 {8 g, D; E/ F' n8 P9 M& V: f9 ?
- (setq value (strcase value))
3 d# J) K) j, @# }; Z9 Z' _ - (if (or (= value "")
% Z+ t4 k6 g' j& a5 ~; f, J$ _ - (distof value): _5 g1 \$ A: Y7 f. E6 ^' T
- );or
/ t0 s* b; a! j4 `( ` - (progn
1 d' y) x+ ~- D6 f/ n5 _: V - (set_tile "error" "")3 ^: Z: e3 F( x u, C" M
- (if (= value "")+ n: V* N6 x$ b
- (progn
0 E( g# z7 Z; s u: ] - (set_tile "eb_thickness" "")
# w' ?& l3 Q- q - (setq ethickness nil)' k1 X* l# \8 t1 O6 o- g: f( W4 v: {! ?+ m
- );progn# T3 ^3 N9 R* W$ k; D. |% n
- (progn0 G; r$ _* ]) d! y0 y
- (setq ethickness (distof value))# j( V' e$ j/ U0 ]0 G
- (set_tile "eb_thickness" (ai_rtos ethickness))" m. D4 V ~% z4 m8 v$ ?# X
- ethickness. I9 K4 o$ r8 w9 w- @" {
- );progn8 G1 K/ X7 r/ Y. K
- );if# X* x: O& f, ?) r
- );progn6 ~& a2 D7 s( N* c w# d
- (progn1 d3 K1 l4 u$ E
- (set_tile "error" "Invalid thickness.")
5 y0 T3 S" t/ k+ A; ^ - nil z6 Z# `+ ~) k; h
- );progn
4 y9 E' ~2 r5 Y$ K0 O& L5 [! { - );if
3 A$ e) d' j _6 Z9 R' _ - );defun 1 V1 {% _0 K$ H; A" @" Z# M! o
- ;;. {$ H& ]6 F7 }8 `$ E4 Z( C
- ;; Checks validity of polyline elevation from edit box.2 X4 w8 p6 r/ _
- ;;' Y% `$ e! K6 \8 Y# O9 h; X1 G
- (defun getelevation (value)( i1 ?, }0 S4 v1 G& D. Y: j
- (setq value (strcase value))
: z: P/ n" H5 ]# Q9 F - (if (or (= value "")
# y4 P% ~/ n0 s( z+ ^# ? - (distof value)
, C6 _2 l3 e" Z3 s& D. q - )
5 h X/ _! Y8 b6 @$ X, N - (progn
% n) n% n+ h/ ^ U% F - (set_tile "error" "")
7 Q3 B. J% v- U - (if (= value ""), h# k. Q" n$ l! v" C- @/ A
- (progn
. z$ B4 ~9 \6 V, f - (set_tile "poly_elev" "")
) Q: \! K. g1 m& D, R' V - (setq eelevation nil)8 L* E/ m2 r' \- b
- );progn
& v- p+ L9 u) | - (progn
! M3 s; z* l% j5 U+ o - (setq eelevation (distof value))) J5 H2 i( U* @" @, Z0 c7 _
- (set_tile "poly_elev" (ai_rtos eelevation))2 G6 y2 `; y3 q# O# Q( L$ w
- eelevation" l' ~8 q' r b! _ ^6 w+ ~/ _
- );progn
9 |! l/ q1 M% e6 U$ \4 H - );if" _ I) Y# w# k" Z3 L9 q2 d4 Q7 @
- );progn
: F: V3 H1 x4 Z+ {) g - (progn2 v, w. ^! O! v
- (set_tile "error" "Invalid elevation.")2 \/ Z& R6 i) ^5 \2 p3 J6 T
- nil
' k# E0 z# Z( V - );progn
$ |" g* ?! N p5 | - );if
; T5 S2 E5 W4 E - );defun
8 c! f$ t! U+ `; ~ - ;;
' N t: n: d% h& A# s3 h4 h - ;; Checks validity of polyline width from edit box.
9 C( e" ^+ {$ P' g2 j7 R5 p - ;;
& Y4 f. G& u5 R/ ?7 z - (defun getwidth (value / rval)8 L4 i6 N) k8 V5 U9 n: i% {
- (setq value (strcase value)
! E v! T# Y4 ^" Z' e& ?0 ` - rval (distof value)
; ^% y: \7 _1 G( ?7 l" g) D3 u - )
4 l+ P' e q! X* W - (if (or (= value "")
, Z* t% S W& z' B# W- `) E - (>= rval 0.0)
8 D# R0 @) ]; f - )$ d6 C B8 a j7 G
- (progn
& x5 X/ G' ^. n& I - (set_tile "error" "")
% V) r x3 v Y, n V( x6 B q# } - (if (= value ""). v9 O% f5 w5 @6 B. Y( X6 H0 H' Q) Q6 ^8 z
- (progn- _& x$ s* L( w' z! \
- (set_tile "poly_wid" "")& k' l( d& B) f- u* ]
- (setq ewidth nil)
6 d: } L; c+ w0 T( y( @4 q, r. m% z - );progn! ]! ^$ x! H* i( k& P" s
- (progn
( J0 h4 |. ^4 Z7 K6 U - (setq ewidth (distof value)), j- C3 @, n+ k/ }. `* N1 k& \
- (set_tile "poly_wid" (ai_rtos ewidth))( d8 L" a C; J# f# Y; X
- ;width) R( M1 U# n* `! i! Q9 `* }
- );progn9 i# | K4 {# D2 L- I
- );if
6 ]0 l% v( b2 P! `) @- L - );progn
9 L( {1 u+ _) w& X: u, r1 u# A - (progn
: K F8 g n. I; J& d* n% ? - (set_tile "error" "Invalid width.")( S% e2 D6 N! {
- ;(setq ewidth nil)
8 g5 ?& C! h$ Y8 @" _ - nil 4 q7 k( f# `3 G5 U9 N
- );progn+ i# h' H4 l* h7 c& d
- );if
9 I+ n# ^8 t- J; B1 E+ Q. ?" ] - );defun: O6 i6 o2 z- F7 D7 b. K
- ;;
3 {- j- ~, s- k5 @1 z - ;; Checks validity of text height from edit box.
s7 O5 a0 O* c. N - ;;, i. L8 j2 l5 z' {0 n
- (defun getheight (value / rval)1 b* P" h6 F& Y* N; W7 w
- (setq value (strcase value)
7 U9 h& d) r: ?0 r3 y0 i - rval (distof value)
+ F: m& e+ Q) E, V - )# {0 m0 Z. q7 g
- (if (or (= value "")
* e' w) K5 m* Y: F - (> rval 0.0), ^4 S2 r3 l8 f1 v. x6 W
- )
, H: Y8 ]; O" t& \ - (progn$ ^, Y. s( W: I8 q# o% b6 O) f
- (set_tile "error" "")4 f: X, O1 v. |7 j3 K; b: J3 n
- (if (= value "")
8 T* }. X6 d! K! A - (progn
: u3 l5 K* j0 _/ n* V' @ - (set_tile "text_hgt" "")
$ F2 t8 C2 e+ e/ c9 }5 q - (setq eheight nil)) O! _* i) V5 g6 H1 I9 \- G0 g- O
- );progn
! F- M7 @7 f e3 c- O - (progn1 S) ?2 T! V: f' v9 d, v) t
- (setq eheight (distof value))
: e9 B9 ~' M4 L. c1 g p - (set_tile "text_hgt" (ai_rtos eheight))
3 h; j9 \+ h( H8 D' I4 L - eheight
% j; e, F- B+ p' _% } - );progn6 l, h2 M" p( p* i
- );if a: G$ @* W @1 s6 L
- );progn* r% Z% D9 x4 V$ i0 I
- (progn. T- U' a) v/ S/ c q# m: A: h
- (set_tile "error" "Invalid height.")# [& W6 r! U* r, G
- nil
5 V; H) G s6 [ - );progn2 s7 H8 ^! x0 Z. U& r! u
- );if$ Q- f: ]$ e7 D/ P! U. U
- );defun
D" u8 l4 u0 J S
3 g9 `: j9 B% u2 N- (defun getstyle (value lst / rval)- y# i( a0 V$ y" @2 z6 _
- ;(setq value (strcase value)) i c( J4 P% A' W
- (set_tile "error" "")% g5 U# ~$ l9 `
- (setq estyle (nth (atoi value) lst))9 L& p$ Y: |0 i% {/ Z' F1 }$ t3 E
- (if (equal estyle "")
7 a- |% ?) x! k' t0 [+ @$ o" U, N& m - (setq estyle nil) _/ D4 o5 X& ^& A- A+ c* y
- );if
4 w2 B7 g- @! c8 j! M& V* q - 6 p! d" a$ N7 T. v" V/ v! E
- );defun getstyle) w, p7 K& l- c9 C, n- A
0 d9 W0 v( U6 [' S" h' H- ;;& F& y7 j! s# V
- ;; This function make a list called laynmlst which consists of all the layer
; Q% C" p0 N% r# b - ;; names in the drawing. It also creates a list called longlist which
% I# l8 {% H3 W3 c - ;; consists of strings which contain the layer name, color, linetype, etc.
% q7 _( H+ N( n; E; z1 W8 w - ;; Longlist is later mapped into the layer listbox. Both are ordered the
; R: k- y y+ s2 u$ v3 { - ;; same.
- B3 Y( h1 F. X L/ P9 [ - ;;" @0 }7 Z7 T T
- (defun makelaylists (/ layname onoff frozth color linetype lock vpf vpn ss cvpname% I& _3 s! l. z' E4 Z5 v
- xdlist vpldata sortlist name templist bit-706 R- [- @- `( z9 e% w5 P" h
- layer_number
: {" D. J u7 ]4 ~, V" R+ k+ L - )' u7 C% X6 I* {' z9 k
- (if (= (setq tilemode (getvar "tilemode")) 0)4 `9 r* ^# N- V* W- Q
- (progn
! s' J+ @6 H, ], b - (setq ss (ssget "_x" (list (cons 0 "VIEWPORT")
" I: Y/ K2 `, U$ u- W - (cons 69 (getvar "CVPORT"))9 N: S0 n9 a1 B$ e# M
- )
) O* I' M/ W; r" k. l8 Y - )0 h; ?, N; k, m1 G. x) Y
- )6 a9 g6 D) P9 U
- (setq cvpname (ssname ss 0))
& ]% L2 k7 b4 m3 t - (setq xdlist (assoc -3 (entget cvpname '("acad"))))3 K0 ^. q7 ^/ ]; ]& z
- (setq vpldata (cdadr xdlist))
2 N# Q0 y$ y: W$ ]# K* w - )
! \& C# U9 }- }. ^ - ); q5 E2 c) @* _" A& ?/ V/ d, U
- (setq sortlist nil)1 G9 k- d4 f! s
- (setq templist (tblnext "LAYER" T))
) x! e. Z; |) D. _; Q, o' V5 h - (setq layer_number 1)9 A- S& n7 i9 ~7 _5 a4 K; X
- (while templist/ `% l$ w3 u; e, C. O
- (if (not (equal 16 (logand 16 (cdr (assoc 70 templist)))))
* a8 ^8 ]5 \" M. ~: s - (progn
; Y, S; y, U8 ?1 {( y, W' \+ q - (setq name (cdr (assoc 2 templist)))
( J! N- X8 [6 x; k5 H s - (setq sortlist (cons name sortlist))) L; y @! C) I$ T# p9 z" _
- ;; Not dead message...& [( N6 R3 N8 x8 V* ?) T
- (setq layer_number (1+ layer_number))
+ `0 ^1 Q7 U1 t - );progn
$ T+ M5 u5 E1 h+ {4 ~" d3 V+ A - );if) E+ I8 u0 o1 y& G% i
- (setq templist (tblnext "LAYER"))7 @+ b% a& h0 |% T. T) Q7 z
- (if (= (/ layer_number 50.0) (fix (/ layer_number 50.0)))
0 x2 I( P: h4 T% [. c - (set_tile "error" (strcat "Collecting..." (itoa layer_number)))
2 @4 {3 h! ^6 j1 q% b! V% Y - );if/ P* _* g% r$ P6 I4 X. c- k
- )
3 D. W4 j2 F& p - (set_tile "error" "")
5 N% ]2 a' W2 P" `/ `/ n - (if (>= (getvar "maxsort") (length sortlist))# C1 Z$ R$ R7 Q/ ?
- (progn/ A6 a2 Z f: n9 n
- (if (> layer_number 50)0 m* x3 f) d. x" w5 f
- (set_tile "error" "Sorting...") w6 i; V( H. F/ a; a* @2 H
- )/ T2 n6 m+ t6 g& p; m5 k' S' y4 w* t
- (setq sortlist (acad_strlsort sortlist))6 T/ f% x* G7 ]/ s) ~
- )2 q4 d/ G4 _; ^0 q
- (setq sortlist (reverse sortlist))
+ x% j* K9 I* E- d' H/ N$ B - )
$ K; i, y' N& I$ y' F6 U - (set_tile "error" "")+ T! Y2 Z( ^, @* [" s1 \% B
- (setq laynmlst sortlist)' n k5 s2 }' Y" [8 _- v& M
- ;rk ! A& |& A, @% K" {3 i) e
- (setq laynmlst (append laynmlst (list ""))) " S/ L3 [+ c8 w) b0 u
- 0 `; O2 ~% [' h0 `+ Z4 {, E
- (setq longlist nil)% i) h4 h% p0 v8 Y" S
- (setq layname (car sortlist))
' t8 d& {2 x' X& w- c: L3 o' q - (setq layer_number 1) U( Q* r* X9 @* s# |7 a( g
- (while layname
% y0 d |( y$ y: r" d9 n Q E - (if (= (/ layer_number 50.0) 2 @6 `: ]8 a- @- _
- (fix (/ layer_number 50.0))
. p" k/ ?. x! x - )
+ T% i/ O9 L6 n: e6 R7 o% A; T - (set_tile "error" (strcat "Analyzing..." (itoa layer_number)))1 `. V7 U Y- t* D; Z- R
- );if2 O0 W9 w) V J2 i$ t( L
- (setq layer_number (1+ layer_number))0 `" c9 L/ f7 Y0 y1 E
- (setq laylist (tblsearch "LAYER" layname))
: s# V" M0 ]1 Y+ \4 f( C - (setq color (cdr (assoc 62 laylist)))
4 o% i4 \% i$ R4 ~" h4 a - (if (minusp color)
$ R3 h- V: ^9 z/ d# w4 h, K - (setq onoff ".")
/ T6 [# v3 z4 o( M( e2 c1 i; d) y - (setq onoff "On")8 i7 _. _9 U1 R9 ]) B' e
- )
+ w5 R& B+ }2 s: ^$ e - (setq color (abs color))
/ d/ E6 g. Q+ b* e7 O - (setq colname (colorname color))
/ P+ z$ b( ?5 @7 T" ~" a" r - (setq bit-70 (cdr (assoc 70 laylist)))/ n' j, c g3 F; e3 C3 q! R# p
- (if (= (logand bit-70 1) 1)6 @2 V! f: S$ u. s( s" R. [
- (setq frozth "F" fchk laylist)9 T! i1 M+ q$ h) E7 z( S$ w
- (setq frozth ".")7 m. M E7 G7 l) B1 a9 y
- )
5 ]! y0 J- S G0 [ - (if (= (logand bit-70 2) 2)
6 P" z1 ^' \: D. U/ S - (setq vpn "N")- a0 ]$ P# L2 _- A( r
- (setq vpn ".")
! Y. }0 d& b5 x; z - ); s& f9 V4 ^+ P0 `$ _- R( G
- (if (= (logand bit-70 4) 4)
& x9 A: ~* S' x @ - (setq lock "L")- s' X& K. G; w, o- `$ g4 X& h5 D
- (setq lock ".")
$ s8 z5 v% [' X9 W, Y$ J - )9 X9 n: Q# |, Y! n5 a
- (setq linetype (cdr (assoc 6 laylist)))2 {8 \' K5 g- ^, R' _
- (setq layname (substr layname 1 31)). _' f) Z9 D1 m% Y y( }
- (if (= tilemode 0), p) n' |$ P5 i' J' X/ i; p
- (progn
; T7 l2 n! a' l) _ U - (if (member (cons 1003 layname) vpldata)* C- g0 ^) z: S" p. m) t& ]5 i
- (setq vpf "C")
$ U6 |0 R) ] N V5 [ - (setq vpf ".")
* ] Y: _2 h% _9 } - )& X4 o( {4 j' n, S( o5 [6 U# W& N r
- )
* D, s- e+ [8 O3 Z3 R# s$ n - (setq vpf ".")7 H6 |4 `$ h+ B: j% q& {7 v
- )2 _7 A; S ?5 ~
- (setq ltabstr (strcat layname "\t"
; X G' a" R/ l: X6 [) q* c - onoff "\t"0 y. e) b1 O) y: i# Q4 x. y
- frozth "\t"
1 ~% ~( e* `* g# q - lock "\t"! [" f9 \( j( B% x
- vpf "\t"
3 I# ~ n9 V: O9 ?6 L - vpn "\t"
+ |+ C; q* \+ a - colname "\t"
0 |) H! c4 N _2 f' C - linetype! }( I# p$ y: x* _
- )
! r3 \- H7 K! l+ _7 v - )% j5 g3 y# U; Y
- (setq longlist (append longlist (list ltabstr)))
9 P R: r# ]/ K. @$ p - (setq sortlist (cdr sortlist))
( m' L5 h4 e- j. @1 V5 R" V - (setq layname (car sortlist))
: j6 a- z9 _+ w; U$ C - );while1 `+ p+ G7 @) a. A& Q$ k& U
- (setq longlist (append longlist (list ""))) H% I1 C+ z, u* ?% M& j
- (set_tile "error" ""); g$ K7 U8 N8 F0 X
- )3 H$ a t5 j1 I7 v
- ;;
+ {: A& `% C: c: [% B! b* ?2 { - ;; This function makes 2 lists - ltnmlst & mdashlist. Ltnmlst is a list of4 p( w: E% q6 P& j* ~% @
- ;; linetype names read from the symbol table. Mdashlist is list consisting! C5 D; b" l3 G# F" c
- ;; of lists which define the linetype pattern - numbers that indicate dots,' B7 |1 H! i5 |
- ;; dashes, and spaces taken from group code 49. The list corresponds to the- V) G. [ \6 r4 g
- ;; order of names in ltnmlst.
4 w! k5 z! {1 Z7 j5 p {% f+ t9 r1 A+ P - ;;* Z* N! Y5 Q8 W3 G. m
- (defun makeltlists (/ ltlist ltname)
; F2 v8 v+ G# ~- R" C - (setq mdashlist nil)
4 {0 r1 h! g0 m3 u7 U - (setq ltlist (tblnext "LTYPE" T))
% S! j2 S9 \2 V$ m, b - (setq ltname (cdr (assoc 2 ltlist)))& ]: H) _+ t' `% g
- (setq ltnmlst (list ltname))8 N2 X1 B G7 k% h. w
- (while (setq ltlist (tblnext "LTYPE")). r( F3 T: P# U w4 ^
- (if (not (equal 16 (logand 16 (cdr (assoc 70 ltlist)))))
8 g* t6 e+ p/ }* z2 Y - (progn , S7 z) N$ ]) A0 E4 ~4 a5 ]
- (setq ltname (cdr (assoc 2 ltlist)))
" d) g4 n+ I2 K6 l$ _2 j6 P - (setq ltnmlst (append ltnmlst (list ltname)))
; u: S9 b7 z* [# ?9 J }$ P- { - );progn
1 z+ [+ D4 j1 G+ x' j& K0 ^ - );if : S6 P0 t. ^' a2 I( W
- );while) W6 @5 @2 O4 n; u- F% f/ r, r% S
- (setq ltnmlst (acad_strlsort ltnmlst))' S& F \1 c, X6 G. K
- (setq ltnmlst (append ltnmlst (list "")));add by rk % Z! f5 x# m! Y- ~ w/ ^
- (foreach ltname ltnmlst
( w& d' F* g/ Z C2 j* w - (setq ltlist (tblsearch "LTYPE" ltname))- o" _8 y+ c f9 E2 g7 c" f- X
- (if (= ltname "CONTINUOUS")
, L& Q% G: j9 S - (setq mdashlist (append mdashlist (list "CONT"))), ]- @+ V6 Y; e; D. G
- (setq mdashlist# p$ K5 X, U; p0 N( V/ M- a
- (append mdashlist (list (add-mdash ltlist)))
# z/ t8 }; I O2 k - )4 I% E1 g2 Q- E( T% g K
- ). q1 w# _5 h9 A. S% K
- )9 Y, a- l% X U! Y6 E
- (setq ltnmlst (cons "BYBLOCK" ltnmlst))5 u$ l; q& g2 G/ H/ w5 l. t" N' @
- (setq mdashlist (cons nil mdashlist))4 G( u* V% G+ o) A( n
- (setq ltnmlst (cons "BYLAYER" ltnmlst))' X5 n' @5 s6 T7 n( ]4 D# N# S
- (setq mdashlist (cons nil mdashlist))8 S5 Z( g5 N2 W5 C
- )7 `& o5 m* a+ K& R
- ;;( ^1 Q# Q/ U& h+ s, }5 ]- \, K! m
- ;; Get all the group code 49 values for a linetype and put them in a list* C P) x$ K( Z0 O" w, @$ n
- ;; (pen-up, pen-down info)
1 ?7 t1 u% h5 Q0 O! N; }6 C - ;;
" L2 ?" ?" e$ ?3 U& Q% u2 h8 H. } - (defun add-mdash (ltlist1 / dashlist assoclist dashsize)& K8 M. E: J0 X$ N( Y1 O
- (setq dashlist nil)# @2 w& f9 B: J& d ~
- (while (setq assoclist (car ltlist1))
4 H) e" G* [0 ^ - (if (= (car assoclist) 49)
4 D4 I. t* u0 _ e0 v1 N - (progn
; e7 ~, l/ L& H* L - (setq dashsize (cdr assoclist))3 V5 B' L6 R4 V& i/ f1 ]
- (setq dashlist (cons dashsize dashlist))0 J5 t) a7 q% ~1 i- q- R. e! I
- )" k8 _9 ?8 C' z, `
- )& [9 {( K! W: b6 L3 Z+ `$ G
- (setq ltlist1 (cdr ltlist1))* U% Z8 _* {( X0 I
- )
6 T( |0 L/ g: Y+ p. s - (setq dashlist (reverse dashlist))/ A1 ^/ Y' k+ m2 K) b% L$ U1 z
- )
& B0 C) t" U8 Y3 i$ l - ;;
}9 @" r+ F- H9 q# F4 s - ;; Color a tile, draw linetype, and draw a border around it
( r% I* C1 Y- e0 j% j4 w6 {3 ` - ;;
9 a% b0 O, d; L% `2 z3 S% B - (defun col_tile (tile color patlist / x y)
' ^' S8 x( ~0 {2 ]4 R - (setq x (dimx_tile tile))& _: J, {. {6 d! j
- (setq y (dimy_tile tile))5 a/ X) [8 z; b
- (start_image tile), L% W( c; v: T4 Q4 Y
- (fill_image 0 0 x y color)
3 B( E g" X2 c4 \ U4 f- y - (if (= color 7). d1 D( t2 ?0 c) M8 H: Z% Z
- (progn3 O4 \, d% s, r5 M
- (if patlist (drawpattern x (/ y 2) patlist 0))
* ?3 L- c3 E/ `% D# P - (tile_rect 0 0 x y 0)9 X+ K% q B t2 V
- )
1 j. T; ~1 |9 {+ U* E - (progn
% }- T) k+ ]' E- _$ r" K1 R3 m* \ - (if patlist (drawpattern x (/ y 2) patlist 7))% g- Q. Q4 I. W5 E
- (tile_rect 0 0 x y 7)
+ @, q9 P; z! y% e- m6 {! m6 g - )1 k# ` ^0 x# e7 I9 I2 p
- )
; k! K2 Y" H6 I3 {; s6 S. T - (end_image)0 E) k% S6 C7 l2 l6 R2 a
- )
( j8 _" [* u* [! d/ w+ Y* |; d9 d - ;;. W+ Z4 ~- ]$ A: B* o4 j
- ;; Draw a border around a tile
* t ~/ g, F' g$ L- _) U - ;;" Q0 |5 t2 O7 v& G" A+ v0 U0 F7 C# F
- (defun tile_rect (x1 y1 x2 y2 color)
% b5 F0 X- b1 h; O - (setq x2 (- x2 1))
, L1 [; c- `' B - (setq y2 (- y2 1))
% a) b, R4 ]- C3 E r - (vector_image x1 y1 x2 y1 color)
, l- m" J" P3 t; @ - (vector_image x2 y1 x2 y2 color)
. L% h# |. ]" _$ y+ j - (vector_image x2 y2 x1 y2 color)/ |5 v! b2 [( t$ y% [
- (vector_image x1 y2 x1 y1 color)
, J3 d$ S [' ~0 M$ N1 N - )# V- u- [( C( H/ K
- ;;7 |) B: }. K9 U" W! R6 I# S
- ;; Draw the linetype pattern in a tile. Boxlength is the length of the image+ p0 J4 g! J1 p1 j
- ;; tile, y2 is the midpoint of the height of the image tile, pattern is a
L& t" o0 o) }1 n - ;; list of numbers that define the linetype, and color is the color of the
0 b0 w/ \. q0 ~1 W - ;; tile.
Z Y8 U2 f( { Z - ;;
9 h+ |0 R) j- d" K/ s9 b; l - (defun drawpattern (boxlength y2 pattern color / x1 x2
0 l. N6 N8 w8 y% a% u- C% O - patlist dash)" ]/ p' W: @0 C- w1 g+ x* ?
- (setq x1 0 x2 0)) R" e% g: K' e. o
- (setq patlist pattern)' \: t: I8 B i! S7 B( n% Q
- (setq fx 30)
) G8 I9 C8 M6 W, h( d9 l# L; b - (if (= patlist "CONT")2 I {0 z5 J) \6 k- e
- (progn
" P) U, c# s8 O; `; ]- J7 z% C$ X - (setq dash boxlength)
* L' x2 ~; l' n% h - (vi)
3 {. x7 D/ E4 i' |$ \2 g - (setq x1 boxlength)
) u1 a" S9 Q$ z+ O. N [( U% h - )) ^$ H6 H: y4 V4 t9 D
- (foreach dash patlist
' d3 j; [5 a4 H& B6 j9 R/ r - (if (> (abs dash) 2.5)
% l- r0 z# c7 z% @% M - (setq fx 2)
2 A. s* `: _4 j - )$ a, G% u# E, J9 ~, v
- )
: ~% P/ ?( F1 H* h1 U% W - )
0 P) |2 r3 D0 L1 w& B, [( M; ] - (while (< x1 boxlength)& l; p3 C0 P3 | y
- (if (setq dash (car patlist))7 H/ p$ j6 b5 y
- (progn8 Q4 s- I! C$ k
- (setq dash (fix (* fx dash)))5 W/ Z# Q0 C& J+ q% X! c, d: s
- (cond- N7 \1 T( O! y* I
- ((= dash 0) ~3 P0 i+ N* F+ `" d) ^% P+ t
- (setq dash 1)* F u) R4 x% |% f8 G! e
- (vi)0 m4 q, c {( h0 K/ O' h/ j( o
- )+ p S$ V: O+ p. G9 ?
- ((> dash 0)) |1 _4 O- \0 X2 U/ F. M$ Z
- (vi)+ J! J: a) r* b; @6 P& @8 G
- )* S" R- G9 v2 ]( q9 L" G
- (T8 a+ \0 {, { s- R
- (if (< (abs dash) 2) (setq dash 2))
% R, G' x4 D/ E5 \0 L - (setq x2 (+ x2 (abs dash)))
8 i1 c* ~( P N* p4 R: q - )2 g' W. n4 s8 h4 e- x% ^$ a
- )
% g, s6 A- _4 m @$ I5 E# q+ Q - (setq patlist (cdr patlist))) I7 `3 Z6 E8 F0 S8 S% i' k g
- (setq x1 x2)
. s& t, ] [7 R, Y9 \, O - )# T, S5 N8 C& D: ]: c% |$ T! i
- (setq patlist pattern)7 N( j+ C M s* j
- )5 c, D- u! ?+ W P9 v3 `, x7 t
- )/ g& F7 T$ a* f$ h) c b1 v, p" K9 p
- )
+ B7 \/ c$ g/ j - ;;; u, L2 T7 P' I6 w
- ;; Draw a dash or dot in image tile# w/ w" ^) y; G
- ;;4 V8 s% n! L, h! K6 v' }
- (defun vi ()
$ u' V6 @2 ^" c' m - (setq x2 (+ x2 dash))
; Z9 h* X0 m% N: s$ x" v - (vector_image x1 y2 x2 y2 color)+ M+ ?6 T7 D+ b- v/ V
- )
, j& ?/ r5 V D1 e2 Q+ e% {8 g# Q - & N0 H! `! O# p) C6 b' o( G( y
- ;; This function takes a selection and returns a list of the color,3 d# a4 Z9 P1 ~; G; T; h6 p
- ;; linetype, layer, linetype scale, and thickness properties that
5 Q' t/ T0 f- ]" I6 z6 V - ;; are common to every entities in the selection set - (color
B% s- A8 X$ e; J - ;; linetype layer thickness). If all entities do not share the same
9 L" R: u2 w8 D; R& F* D' g/ c! J# b - ;; property value it returns "Varies" in place of the property
, }5 x7 _0 F" V8 o0 \2 d, ` - ;; value. i.e. ("BYLAYER" "DASHED" "Varies" 0)4 g. C( H6 M" X& O' q! s
- ;; The last item in the return list is an integer flag for the
" l7 P5 E& X7 T+ M9 u* `. c - ;; homegenity of the selection-set object types.
4 a5 V1 ?/ y/ B6 Q$ N3 h/ K; `* j - ;; 1 = All polylines9 A5 K0 m# N& Q3 r% p
- ;; 2 = All text or mtext or attdef, or a combination of the three: C/ k. B# H% l. n2 O' U: f) x* a- U
- ;; -1 = Any other mix of objects( r3 e0 O. P$ g# w9 q2 x# ~
4 y/ B8 N- @- L3 v- (defun getprops (selset / sslen elist color ltype layer ltscale thickness1 k J/ N& I/ g/ o6 @% S' H: V& F. K
- width elevation height go ctr
* \$ Z) t- N" i, [ - eflag
8 e& H5 t1 t6 W" b% | - etype temp
0 k$ y" ]# @! t+ _6 M - txt_ss ;;;;rk 11:24 AM 1/30/97
% \9 C+ e1 B3 a7 z. ` - tmp ' d. Z7 ~/ z( |/ S) b
- poly_ss
* }. }, d% e# ]' u: x6 i - style/ `, g+ L3 D+ H5 r
- )
# M p3 ?7 s5 `' y - - m5 [: {' \( d. a
& x- R' `% S2 @# y- (setq sslen (sslength selset)
% a: M) [9 s1 n' h - elist (entget (ssname selset 0))% s- f; \# F. h9 g1 X6 k* b
- etype (strcase (cdr (assoc 0 elist)))( I" y; [; C1 |+ D: }: m
- color (cdr (assoc 62 elist))
# w3 h& \8 x# W7 m' u - ltype (cdr (assoc 6 elist))2 @4 v4 S/ r! G: H8 x
- layer (cdr (assoc 8 elist))6 `; v) k9 ~7 G7 w! ]
- thickness (cdr (assoc 39 elist))
" z, |$ e* ? S/ V - ltscale (cdr (assoc 48 elist))/ s: q% m$ k+ d6 J! b4 I' m
- );setq2 w( n7 p& C5 {& Q7 ]/ A! ]+ ~5 i
- % @7 Y; O5 V# p. ]: L6 [- s2 m
- (if (not color) (setq color 256))5 k4 M( Q* x) U' N# ^* g
- (if (not ltype) (setq ltype "BYLAYER")). W/ p9 u, ^! ~& ~
- (if (not thickness) (setq thickness 0))
( [4 j0 T5 x2 w( I - (if (not ltscale) (setq ltscale 1))1 b; W0 Y z- O F: I; Z
- % D: _& C& F d7 T9 ]- w) b
- (if (not width) (setq width ""))3 a. ?$ i: L9 |
- (if (not elevation) (setq elevation ""))
8 q5 o1 f: p* d; S# J4 q - (if (not height) (setq height ""))
* K( x4 E' N1 `9 N% c( A
! U4 _' A5 W# z C7 ]: t- D4 @6 F- (setq go T ; m" ?( N8 }1 C2 `0 e3 j
- chk-col T
- L7 Z. w% r" L3 J. ~ - chk-lt T
u" N3 x6 K8 P% C- @% G - chk-lay T ! b0 f* O1 t/ k! Z3 F1 N
- chk-lts T ) @" s! W7 P/ a2 l: _1 s" @
- chk-th T
6 [( d1 l' A! W+ z0 f$ s+ B, ^ - ctr 0
% q+ d3 h3 T/ a1 A5 I9 i$ b7 x - );setq
, B) n( X* ?# R1 Y" A! C" `
; j, T# ^3 t# X9 Q- ;; Page through the selection set. When a property0 p2 ~4 f; u2 j0 U* a# T7 Z% {5 ?8 @
- ;; does not match, stop checking for that property.
6 o9 k5 p. @1 L( e3 C. y - ;; When the selection set is not homogenous, stop checking., H) z+ ]5 L2 y% W/ B) O& q
- ;; If all properties vary and the set is not a type 1" T4 e8 o4 k# m$ q1 k4 \( m8 B) d5 J3 H
- ;; (polyline) or type 2 (attdef/text/mtext) set, stop paging.1 q6 x i. ?- l8 \% W8 e: F _# }1 q1 O
2 `+ w0 X( m& ?7 Q5 A2 y- ;Lets set the eflag so we know if the selection set includes any
$ N! K# \' V0 d% K! O3 \ - ;combination of polylines, lwpolylines, text, mtext or attdefs.# s5 h: G1 J! P& ?# D6 ~
- # I, s) {, s% k5 n, ^8 I- q. c
- ;watch out for 3dpolyline and 3dmeshes here! @rk 10:17 AM 1/30/97
3 ~% l9 ^. f) H3 \; Z" ?/ B/ h! b - (setq eflag 0)1 ]9 T6 C, j( v
- (if (setq poly_ss $ F' U; Y: k$ S9 J0 s% p5 f* _
- (ssget "P" (list '(0 . "*POLYLINE"); ]1 `& u s5 u6 H9 S
- '(-4 . "<AND") ' G- V" l0 U4 O. K, B' X, J
- '(-4 . "<NOT") '(-4 . "&=") '(70 . 8) '(-4 . "NOT>")
. X4 `8 F4 I/ v0 G8 w! ? - '(-4 . "<NOT") '(-4 . "&=") '(70 . 16) '(-4 . "NOT>")
0 ]5 J Q! W3 W% {' e - '(-4 . "<NOT") '(-4 . "&=") '(70 . 64) '(-4 . "NOT>"); x' n2 V- E5 g
- '(-4 . "AND>")
' s' s) i% h* Z - );list4 G4 e: G6 ]6 o
- );ssget get 2d polylines (legacy and lw)1 \1 g9 _! M( f/ [9 i: H% ?
- );setq$ V+ \) j" y, E& w8 X$ l* I8 v- m2 O
- (progn
0 f e- F: s" Z j( X4 ^ - (setq eflag (+ eflag 1)); n* W" `. s, x* t
-
1 E) p) i& b- w1 r6 m. N - (setq tmp (entget (ssname poly_ss 0)));setq) _9 p9 s3 X9 T( I
2 S. D1 I0 a3 \8 k) O7 q3 n0 O* F- (if (equal "POLYLINE" (cdr (assoc 0 tmp)))3 W; O, n: s% ^2 m& |: |' r
- (setq elevation (last (cdr (assoc 10 tmp))))" C. E L* G6 B" u1 a2 t. y
- (setq elevation (cdr (assoc 38 tmp)))( a% J; ?9 m! U5 {
- );if
; H# ~ T8 H7 j. d, u) o+ U - (if (not elevation)
* D# m* t# p# J. P4 h- r( \ - (setq elevation 0.0);setq
0 U! p. ?* d ?# \) A1 f - );if
6 @. c( p; C2 O4 Z! r/ Z) p
n; |" m2 N& x/ J- (setq tmp (ssget "P" 8 q. k. k5 Q* `, f; K
- (list
) j/ a# z- p- G4 o( \ b - '(-4 . "<OR")" F& }6 M9 q' T. ` S F
- '(-4 . "<AND") ( [: @. J {& |: m
- '(0 . "LWPOLYLINE")8 U* k' Q2 Z* l, E) M ]/ D: ~
- (cons 38 elevation)/ _( o0 m) t3 G) l
- '(-4 . "AND>")
9 g- G! K6 ], c% n - '(-4 . "<AND")
K- O2 k4 T+ u! D - '(0 . "POLYLINE")) [. ]9 K# g6 t% z3 R0 Q
- '(-4 . "*,*,=")
( i( c- h5 p% V2 h - (cons 10 (list 1.0 1.0 elevation))
) z- L" H( C& S. q/ H: {" a - '(-4 . "AND>") 7 |1 c" F- I( J1 c8 P z" n5 s
- '(-4 . "OR>")
. q. R' L7 l- g8 V - );list' e0 c" G# y+ j7 C( B2 L- i6 _
- );ssget% T: o0 X( ^: q3 |+ N2 |" d
- );setq$ i. E# z* |( a7 w
- - P8 k# F2 [9 Q4 Y# m
- (if (and tmp
- @5 [& @/ X1 A. G+ M8 f! d - (equal (sslength tmp) (sslength poly_ss))! ^" t% }1 |3 K3 n
- );and4 G3 Y2 L. g. m( E
- (setq elevation (ai_rtos elevation));setq
' Z3 ]2 f% }0 O: f - (setq elevation "")
, X4 e/ v# T' E7 m# }$ V - );if
3 M+ m3 M0 G! A) V - * m+ \! L4 I* V" ^, Y# K
- (setq width (pl_width_getter poly_ss));setq
: v/ d, v% {% ?1 ^" N5 ~$ N; [7 ] - ' l3 x+ P3 C1 b8 ~# S/ Q+ \3 ~
- );progn then 2d polylines and/or lwpolylines are in the HHHHHOUSE!
' V& M! h0 z: Z - );if
+ g! o; u0 ~, W7 C0 r) V - (command "_.select" selset "")+ i( r9 g( {6 b
-
6 \" P( H* g' e8 u8 a% }( \& N - (if (setq txt_ss ; }; E0 z( n- K0 r L2 Q
- (ssget "P" '((-4 . "<OR") (0 . "TEXT") (0 . "MTEXT") + i/ [* |+ Y9 Y& N' n' ]1 N; u
- (0 . "ATTDEF") (-4 . "OR>")). J6 X4 j- {' E2 z+ T
- )
* }7 g4 X: V% d9 q% O - );setq5 \. a! ?/ J D
- (progn
2 u; f+ K2 f0 U9 X. r - (setq eflag (+ eflag 2))' {, S2 b! @. O
- (setq height (cdr (assoc 40 (entget (ssname txt_ss 0))))- x4 t% U2 X; y0 }- F; P0 o# {; o
- tmp (ssget "P" (list (cons 40 height))) , Q- t) K5 Y& ^: L1 O
- );setq " N4 W" _: J; R- O7 v1 A
- (if (and tmp
( L4 D2 e% K9 b# k - (equal (sslength txt_ss) (sslength tmp)) }9 [* {) ]! J& n, C5 l4 V3 p" @ |2 \
- );and
0 M0 X' b* ^" P0 O4 Y - (setq height (ai_rtos height));setq ;@rk need to translate from float
1 g- j! D9 [1 L3 |$ B- U& D9 X, k - ;to string and back again easily$ G- b& m0 N5 Q [1 r# A2 V6 u
- (setq height "");setq else the height varies , e8 K* U6 t& a7 z2 s$ Q" w
- );if
# |& z4 O; n7 t5 y. }' h - (command "_.select" txt_ss "")
8 y" j l. C/ g+ J8 R6 X# d% Z8 J1 I - (setq style (cdr (assoc 7 (entget (ssname txt_ss 0))))7 y8 A2 z& R; k( X, S
- tmp (ssget "P" (list (cons 7 style))) ; t" Q3 w4 b/ w7 F- s* h
- );setq 0 ], y5 o# P7 j4 C
- (if (not (and tmp! c5 ]' s. ]# [; h
- (equal (sslength txt_ss) (sslength tmp)) ' c" E U/ a' [
- );and/ y$ r! N5 N. c# J. A- y& G" t$ l
- );not* R6 k, ?8 Y# i& v2 B, k4 ~' G" q
- (setq style "");setq then the style varies
5 K/ \2 [( V- U' t" B - );if
) J. F+ K9 ?/ a, z - );progn the text type objects are in the selection set
: Q3 y! U5 p5 P+ d - );if
+ t$ w" K6 l0 r7 L( I - (command "_.select" selset "")7 K, G8 Z: }3 g" J
-
! ~" Q8 }8 n; M/ h - (while (and (> sslen ctr) * ?- w9 U3 z7 k B$ L. r
- go( C& f! C( X+ r/ `" I
- );and2 d7 ~+ i$ S+ s# a
- (setq elist (entget (setq en (ssname selset ctr))))6 `& v3 l6 n9 G' H9 ?7 q4 _9 l- _
; t- n/ O& f+ R- G# L* G- (if chk-col (match-col))
' t* L& i: E% }2 x$ ]9 }$ {5 ]0 V9 l - (if chk-lt (match-lt))
3 Y4 D, K' j. h& j0 O - (if chk-lay (match-lay))8 i3 t$ L/ `# ]
- (if chk-lts (match-lts))* [" K8 N7 F- e8 z
- (if chk-th (match-th))
/ N7 g F" M. O5 S3 K2 D% `
4 ~- E4 S3 z' G* ~ m6 O& s. C- ;(if chk-etype (match-etype))) n* V2 f5 H4 ]
- - a: d; L) u$ y2 C% }8 Q
- (setq ctr (1+ ctr))( ^! G" D0 j4 o; i
- (if (and (not chk-col)" o$ S: c: I9 S L) f6 D
- (not chk-lt); a1 ^" r% y2 |" V7 Q
- (not chk-lay)8 X8 P' _3 W+ I9 P! D$ Y$ D1 h8 B
- (not chk-lts)' y+ u- o/ @. ^$ _
- (not chk-th); ^5 z# b9 ?8 }% |2 e4 F. e
- ;(not chk-etype)# Y0 S% T! V Q9 ]/ s2 V+ R, }+ b
- );and3 ]$ P2 i P) @' n) Z& L* I4 x
- (setq go nil)9 P% w7 Q! s9 r4 z* M3 q
- );if5 q7 B- a( _# u* t( ]$ v
- );while3 U! h* Y& T2 n- }/ }
-
; N" ^8 z9 B5 Q" u) p - (list color ltype layer thickness ltscale
7 M/ t/ F+ ]" x/ ~8 k6 a, K - width elevation height eflag
3 v T( ^- L6 q) ?0 ]2 ^$ B! s" n2 { - style poly_ss txt_ss
- _" M* t/ j: Y5 F4 N0 k1 S4 y. O- K7 M - )$ Z/ y: F' R3 \3 h
- );defun getprops1 e7 ~) [3 Q1 p, u6 |% J
) h D, I9 r9 w! W. P- ; This is a speedy little routine to tell whether the polylines in
4 ~! D. w7 A0 Z, G9 W( K: Y - ;the selection set argument are of varying width or a constant value. + o, `5 }0 u8 Y# B) s. `1 x
- ;Looping through the vertex's has to be done for old polylines when
, k# Y+ n0 ]9 J9 Y9 l7 c - ;the polyline header has width values of 0.0. Basically, in this case, ( M, t+ k3 ?4 X5 n
- ;information in the polyline entity header is abmiguous. Width values & X7 O2 w7 ]4 i0 [2 [/ O* u
- ;of 0.0 in the header entity could mean the polyline has a constant * |7 v6 j$ R r8 l/ V
- ;width of 0.0 or it could mean that the polyline has vertex's of varying
7 J1 ]! q* b* x1 D* v - ;width.
, F/ G6 Q& a4 C, ~3 o( s0 ]$ u - ;
, {; V9 f) }$ A& a# { - ; It's all in wrist. Err a.., I mean it's all in the 'if'
- A2 R& \/ b8 G j# H& r - ;;) k) P, g$ q3 {4 I( E3 c
- (defun pl_width_getter ( ss / ss2 ss3 n na e1 width width_a width_b flag flag2)
# x' ]4 j9 W% s9 N! m, S - : `6 j; p- P. G V7 a$ _& Y
- (if ss 3 q" o2 w/ L5 [, [: k& D k. q
- (command "_.select" ss "")
. x h6 B$ T, Y! I% } - );if( v# u3 i( M$ k. y, T' O+ D
- (setq width ""0 O3 s1 E8 z$ V
- flag nil% P2 D" K; p2 M8 n
- flag2 nil& U7 G1 U6 ~' H0 R
- );setq
7 h( V6 J2 o7 d1 F+ ^; Q5 E - (if (not " D0 ^6 l. k3 h* s" I% }( F1 p( r2 w2 B7 c
- (and ss0 f. N2 R. R4 Y$ {8 a
- (setq ss2 (ssget "p" '((0 . "LWPOLYLINE"))));setq
1 s% u+ K1 |! v, e8 U4 y5 _ - (setq na (ssname ss2 0)4 s) U0 D3 t; W1 G
- width (cdr (assoc 43 (entget na)))
5 X$ O: `& K7 a2 }! A) w( W - );setq/ k, y' G9 a; V) d- b/ X$ a* {
- (setq ss3 (ssget "p" (list '(0 . "LWPOLYLINE"), ~3 ]/ H [) l$ C4 o+ @- y" W
- (cons 43 width)9 H% u- P( V& m1 m# j& O
- );list% \( v/ P0 I" B" {) o& r, p. U
- );ssget
- F$ M9 u5 h9 W - );setq! d/ |; o( g( G5 T! H- A% Y& D3 c$ D
- (setq flag T)
+ g5 _+ \: ^3 E* Q& G - (equal (sslength ss2) (sslength ss3))
8 T4 S( b3 p9 r t2 A6 p - );and d" p) J, q8 l" V2 H8 \
- );not
$ k1 D9 k( Z8 D! r9 T# F - (progn$ `! `3 j. Y6 m
- (if flag/ f$ o; H+ ?+ t |
- (setq width nil)
" E5 m& q: b7 D$ Y. N; D2 K" { - );if
' a( W0 K2 {; K1 _; x5 g7 h0 B - );progn- i6 n. B$ }, }* w+ J% y' Z7 x. x$ H
- );if ' ?6 Q& X6 y; t, X/ X, L
-
; K9 P5 _$ X3 `7 y+ y - (if (not
7 `, g1 {7 F5 @ - (and % Q, `3 R' I6 [: ?, N+ q- Y2 E6 X
- ss2 N* I c2 c0 v
- (progn (command "_.select" ss "")
+ a7 I1 ^ l/ }( M- `6 K - (setq ss2 (ssget "p" '((0 . "POLYLINE"))));setq
, L7 p- d; D' Q% O9 C0 N& a - )
9 C% \6 }' J% C+ s2 s8 ^ - (setq na (ssname ss2 0)( s# V$ h9 q( l2 V
- e1 (entget na)1 o2 r* k: g3 C' ?% G/ A
- width_a (cdr (assoc 40 e1))0 M/ \& d7 @9 q% f* e, W
- width_b (cdr (assoc 41 e1))( K( S# ]5 L# Z V/ l
- );setq1 m- S0 z# F, E( c
- (equal width_a width_b)" w: b1 z4 ~8 E' r/ }
- (setq ss3 (ssget "p" (list '(0 . "POLYLINE")9 \3 L$ \9 q- P% I3 m
- (cons 40 width_a)! c9 y. p I; N) U" p" T
- (cons 41 width_b)
) I4 W! Q2 t/ C( R - );list* R% W! L/ F2 @3 _# E3 Y5 D I% j+ g
- );ssget0 B) r* ^) \. T9 q
- );setq
i* `, [& O6 H- Q( ^' T. E5 } - (setq flag2 T)# Q4 c! a2 e. @" I
- (equal (sslength ss2) (sslength ss3))0 x8 c3 c' l) w5 z
- );and ' u# B! K: U: Y" X* {6 C& i
- );not
/ O$ u5 x! `: ]/ D - (progn
5 g$ k& `3 }* u# J0 s& ` - (if flag2) p4 i/ H0 ]" ^1 r
- (setq width nil);setq
" `/ Z+ J4 \+ U& q - );if
0 e D" ^! d4 [ b3 T - );progn then, q" m# W( P( f5 l" Y4 _. d
- (progn
6 o5 r$ x- h9 |2 |, @2 P+ C - (if (or (equal width "")( F" C6 t+ n5 D+ i& ~/ V
- (not flag), Y) \1 S" M( [; r
- );or8 s8 t& a. E! Z/ M t+ N r
- (setq width width_a)
/ i2 u: i' l6 \7 k* {& K, H - (progn
$ B1 Q0 p3 l7 N" ?0 S - (if (not (equal width width_a)). I+ H2 ]* m1 _9 k) Z$ F# N; G
- (setq width "")* V9 u# s) y( v4 P6 \ {6 c3 l
- );if ! O$ ^1 A5 j1 {) v0 ~9 y9 q
- );progn9 m# `* u1 K4 R) g7 R
- );if
$ a. k6 ]! R; S! L. _ - );progn- `2 D' y- k, w: N* C t! D. E# }
- );if( s- y/ C' T5 F" G$ j
-
& ?6 ?( H# J) u
" }, ]; K* J/ Z" L2 L7 T& [- ;now for the special handling for old polylines P" L' Z T" L5 l+ E9 {
- (if (and width 4 i$ H0 k4 H, }4 y: Y8 s! v9 c( t) T
- (equal width 0.0)/ I* K; S+ R( ^4 L% w
- flag20 y) ?0 b" Z( N9 L4 _/ W
- );and
1 w4 } v7 s4 Q) V7 ?& O0 S - (progn& e' n M4 J! A% O8 `4 d
-
0 N4 @0 M+ E1 M' o% l - (setq n 0);setq
3 C0 R' d2 }) K - (while (and (equal width 0.0)
6 Q( P$ O( O7 Z/ y1 \% n - (< n (sslength ss3))
$ J% f. D9 k* J& m4 ^& | - );and
" p5 p! P. K5 r* ]* F9 }9 u8 ` - (setq flag nil
6 x) s" {, \% ~- m+ _" q' G - na (ssname ss3 n)) k: y2 `5 c3 R e5 x4 }
- na (entnext na) {7 Y; p: X" L5 z/ g2 T# k" x
- e1 (entget na)
% N8 x" t! G4 |; }8 d. h) J - );setq) a+ r7 T$ H) z8 c3 `* J
- (while (not flag)4 e6 m, Q: k' X
- (if (or (equal (cdr (assoc 0 e1)) "SEQEND")" c8 n, ^4 o$ ~4 u+ D
- (not (equal (cdr (assoc 40 e1)) 0.0))
" C* J) \+ o2 u) _8 k* {. t, e - (not (equal (cdr (assoc 41 e1)) 0.0))
/ V- P! H. D+ J" B. P& L5 _: Y - );or
# S) e7 Z& J s - (progn
; P. @5 \2 q, X4 U/ j- t& Y7 Y# r - (setq flag T);
( r+ E" c% I+ l U - (if (not (equal (cdr (assoc 0 e1)) "SEQEND"))
" G# M* ^& b2 ?4 a5 J+ k0 n - (setq width nil) . s- I1 ^% T1 {1 {
- );if. F5 [4 n) f; R" F B9 X( R
- );progn then jump out of the loop
0 a3 s3 v6 D! T9 j# O4 f - (setq na (entnext na)
0 b" g, o( ^- T" F4 K' z - e1 (entget na)& V! z; q3 I5 y2 M) i. V
- );setq " t1 ~: C/ O+ b2 d. D
- );if , F+ [. a. D- p: z# H9 U; `* i
- );while$ T& l% E+ S9 U$ C. L7 O3 r
- (setq n (+ n 1));setq
6 e+ c! M/ p7 @) K9 v" r. b - );while
, y# P9 e. l- O, \ -
0 L' o. D3 R; i2 } - );progn then it's a legacy
, C* X3 m7 G. ~+ ?3 W - );if ;legacy polylines that may have varying widths
# I( T# V. J# j( _4 ]4 s! g - 6 w7 d& L8 R& x7 x5 c6 [. O; X- `3 Q
- (if (not width)# I( o' s9 L+ I( b
- (setq width "");setq
* F% J, C) ^9 v3 R - );if
' G8 ?) T5 J$ I9 g - (if (not (equal 'STR (type width)))* ]9 G" H: G$ R
- (setq width (ai_rtos width));setq 9 m! h1 i9 X. }5 f: x( P
- );if
/ {/ f$ d, e' M- Q1 o - 5 B: M- T6 E, Q
- width " t- |" \$ F- Y# D( c
- );defun pl_width_getter2 R, P: N4 [- K- J
- ; ]& R1 H7 H+ J! S& o
- 3 i0 D/ S5 n+ @
- (defun match-col (/ ncolor)
4 e; L: K- O3 Z8 x {+ n1 K - (setq ncolor (cdr (assoc 62 elist)))4 P' s# d, E% J4 d" Q
- (if (not ncolor) (setq ncolor 256))
" g1 F3 F, M. h& k" }& h D - (if (/= color ncolor)
7 Z, W/ j$ u# y. Y' L - (progn
+ X& B. o/ U) Y# O% O - (setq chk-col nil)" B2 r; c- e" g5 F
- (setq color nil)
, O8 D1 f( ^. ~+ t5 C: g# P - )
# }( Q/ {+ a+ o, w - )
$ C3 G2 p% f* a3 a1 U: N% r+ X - )
. M: h3 O5 y* [4 u q - / K1 x% q& X0 U$ W6 n; Y4 o8 [; D
- (defun match-lt (/ nltype)1 e& l+ T, `, E/ m2 L* q* D
- (setq nltype (cdr (assoc 6 elist)))
$ H4 p$ |9 L" y8 C \; k- [ - (if (not nltype) (setq nltype "BYLAYER"))) m; C, z* }7 ]. u2 { q. X! E
- (if (/= ltype nltype)( k, O ^+ O+ g5 S8 s
- (progn
" @+ H: d! D e! V - (setq chk-lt nil)0 S- ?& C$ f3 ^, B6 {8 \
- (setq ltype ;|MSG0|;"Varies")1 g5 t% u" R1 u% V0 L
- )3 U: p4 S# e( u9 x; l
- )6 C" z i X$ j8 d; W
- )1 x) E; U. |% l6 f! e
- $ g% ]% v: {& \+ ~
- (defun match-lay (/ nlayer)4 ^7 L5 S0 B1 ~2 R1 l) A
- (setq nlayer (cdr (assoc 8 elist)))
. Z3 @. z8 h/ C1 {: O* o8 d/ a) k/ K' m - (if (/= layer nlayer)8 f5 S& l8 R7 y8 I% C2 w
- (progn
0 G/ U0 c" B: ?" p3 ^ - (setq chk-lay nil)
6 C F0 I3 [) ^6 c3 t$ u) y - (setq layer ;|MSG0|;"Varies")) \7 i) R0 c! W* F1 i5 E' b
- )
! h% P4 r0 N! f - )4 Y; a7 Z/ S; r7 n& p
- )- L# C1 ~0 T8 i4 @& ~/ E- g5 ]9 e( p& w
0 l0 W; U) S& N- (defun match-th (/ nthickness)$ R& J6 I! Y2 e8 I: L
- (setq nthickness (cdr (assoc 39 elist)))0 }7 ?( M, W) V5 h: I
- (if (not nthickness) (setq nthickness 0))# k" O \" ^1 Q3 ~3 t
- (if (/= thickness nthickness)
# B/ v* p; [3 A' L! ^3 g4 `2 p: Y q - (progn7 [0 v# p, [) X& |' O
- (setq chk-th nil)
- `' Q3 w2 Z- o) i - (setq thickness ;|MSG0|;"Varies")
5 h+ d5 d& T3 u p. K7 Z - )
7 |7 Y* [( m( C u& j7 ^ - )/ W, Q6 h3 x& x: q- n2 H f5 n
- )
4 v7 }8 y- N- N) H. w( y - ! z% q4 M, Y1 G8 Q! N4 l
- (defun match-lts (/ nltscale)
- C( m/ ^; S( R - (setq nltscale (cdr (assoc 48 elist)))
6 G; n! S5 a* `6 O - (if (not nltscale) (setq nltscale 1))
: o- u7 w' o/ m# j - (if (/= ltscale nltscale)2 G6 a/ r8 v2 Q7 D w( V" G! W
- (progn
3 ]5 S. w% T# S) }8 q - (setq chk-lts nil)5 L& N" e( `; i# E' b
- (setq ltscale ;|MSG0|;"Varies")
( ~: n# }+ K$ Z4 R5 N2 g - )5 b: D' d0 o4 S% D9 M
- )5 B; w/ f* `- e0 G @+ \" l
- )
7 v" e3 ?7 ^. p- C& t% R
3 k- k: s5 }, E4 Z- ;;0 x {' t+ }( j5 j9 K9 i
- ;; If an item is a member of the list, then return its index number, else$ K l+ {# e+ F; b! J
- ;; return nil./ s3 z8 S$ x( ~* |5 I- B8 r4 e
- ;;! f+ ]5 h9 s1 ]! T! o
- (defun getindex (item itemlist / m n)
$ K& x A0 A3 n1 r6 H7 [ - (setq n (length itemlist))- I9 f5 r5 R% [: v. Z
- (if (> (setq m (length (member item itemlist))) 0)
8 j7 |2 A6 P1 V* X* \: u( `4 J1 q - (- n m)
& c% T ~1 r0 m - nil
0 X- J4 v. w& p - )! M: j2 c3 ?4 }# {
- )0 p' l- C9 S9 ?: E1 h/ ]! a& a
- ;;
# `. l% Q Y- G - ;; This function is called if the linetype is set "BYLAYER". It finds the
! W0 z y" M" D9 D - ;; ltype of the layer so it can be displayed beside the linetype button.
! G5 P. o6 x- B3 i5 a3 A) K' t - ;;( S1 f8 O J) B. ~
- (defun bylayer_lt (/ layname layinfo ltype)
9 d- I$ _* o4 v/ O; n - (if lay-idx7 G- U0 Y2 B3 Z# V# C7 Q: ~
- (progn: R" K, C4 k( k4 [
- (setq layname (nth lay-idx laynmlst))
9 F: q$ b5 }3 W3 j0 a - (setq layinfo (tblsearch "layer" layname))2 Q$ K( R9 I- @# e- w! u* J3 Q
- (setq ltype (cdr (assoc 6 layinfo)))
( ^' B9 P6 ]7 s1 R2 b/ D3 J - (strcat "BYLAYER" " (" ltype ")")* }8 }. ~/ Q0 S9 D" l0 b
- )
( d& u+ m+ _7 x% [ - "BYLAYER"
- \* R2 K5 l, R: O( t6 b9 D - )
& x% E, q9 Z! U - )- F, W+ I0 }/ S( d6 c& x8 p2 f
- ;;2 _9 t5 U9 g( ^, B1 j- O) l
- ;; This function is called if the color is set "BYLAYER". It finds the+ X7 v$ C( p$ ~' ]( i+ S6 l/ E
- ;; color of the layer so it can be displayed beside the color button.! \+ v8 x* L2 n( \
- ;;
" t, a2 c4 m& \/ R, Q - (defun bylayer_col (/ layname layinfo color)# z! m. l& v+ J1 s) w, @/ X( Y2 g" c
- (if lay-idx
" C7 m! b9 `9 Y8 m4 h3 O - (progn l+ L& t( J; _7 g+ `* m
- (setq layname (nth lay-idx laynmlst))
% u0 }& l1 G) e - (setq layinfo (tblsearch "layer" layname))( V' d& [# i0 S2 Q4 x
- (setq color (abs (cdr (assoc 62 layinfo))))/ N) G/ E( `% ~& _
- (setq cn color)
, k. Y! |1 Z( F2 s: I s' ~ - (strcat "BYLAYER" " (" (colorname color) ")")% o. g W& Q$ G- k
- )
1 X5 _6 u! P6 e6 b! \; h. ~ - (progn* ]$ q; ]) j. i$ I- Q
- (setq layname elayer)) i; e/ ^9 X$ j
- (if (and (/= elayer "")
0 ?7 N, I9 y- x" _* { - (/= elayer "Varies")9 J: {4 l) n1 y) q
- );and8 f, q8 l. e$ b" U1 p% ]0 J
- (progn
* \& f& t* _: D6 J1 X6 ` - (setq layinfo (tblsearch "layer" elayer))9 q/ Z8 B- o: {! S
- (setq color (abs (cdr (assoc 62 layinfo))))4 c3 i z1 r* F5 ?% Y" f0 i7 p
- (setq cn color)& X$ X5 S' L7 z4 Z- H5 B
- (strcat "BYLAYER" " (" (colorname color) ")")
' q, X/ Y$ `3 m5 E - )1 M: W% X F; T6 S3 o9 X
- (progn/ O2 Y8 I/ |. V* f' M5 Q
- (setq cn 0)" E: i) _# D4 N# j7 Y# W
- "BYLAYER"; S- G7 m3 v, t V' q& b1 z) _
- )8 h5 R" t6 m, q( M3 G$ K
- );if( c: p1 X9 W/ `, }/ I! D( N1 w
- );progn# v0 c) y( b. _# |* i; m
- );if/ ^2 m2 \- ?( j8 e5 C3 z7 i
- )# h2 ?" }- o8 r$ o/ Q+ O, m8 B
- ;;1 F( N$ Z* P0 C/ n
- ;; If there is no error message, then close the dialogue G4 a+ C* |+ P( {
- ;;
+ p; s8 a5 t3 O' \4 c, G8 k/ x - ;; If there is an error message, then set focus to the tile0 d$ [4 H* {: o# y* ^
- ;; that's associated with the error message.
( w: _& U9 ?+ }$ |. s8 x - ;;" r, `$ p2 k# I% [( B8 E
- (defun test-ok ( / errtile)
, G/ L" F. g4 a$ X$ k3 h - (setq errtile (get_tile "error"))" O. [: v) p0 o. r4 V& |" c
- (cond
5 L" U# X1 k$ `! \0 ^ - ( (= errtile "")
# @, G- W, h- u0 \3 Y @! D - (done_dialog 1))
# n/ ^" p6 R5 {: M# Y - ( (= errtile "Invalid thickness.")
4 o: p' m+ O- p9 k - (mode_tile "eb_thickness" 2))6 n* h0 Z9 N# F$ Z; ]% `
- )
3 A- k1 C+ A* Z& j( S - )
9 A% B+ x1 q. N O* f - ;;
, [. }/ J# R9 R# M: r - ;; OK in main dialogue.! j' _% {8 g) g& C- X
- ;;& n; {: @9 r& I& X3 V# {
- (defun test-main-ok ( / flag) L5 V3 t) H: l8 T
- (setq flag T) & M* z% ], t7 P( x- A' T v
- (if (not (or (distof (get_tile "eb_thickness"))8 S+ {- i- ^& v; \. ~/ o4 ~
- (= "" (get_tile "eb_thickness"))& B( t( o/ a/ S6 w# W
- );or
* D+ K) }: J: M) e, } f3 @0 w - );not
( `* r5 c, U/ k" k8 G1 y3 g - (progn4 e4 Y3 c+ O# X f
- (set_tile "error" "Invalid thickness.")6 x3 P I4 a2 t$ g+ Y
- (mode_tile "eb_thickness" 2): b4 \; F8 q* W# @% P
- (setq flag nil);setq
& _" ?! l( [6 `4 [2 E - );progn1 k/ T( B4 q1 Z0 g/ }
- );if
. p6 x" K1 d1 T' {2 f; \ A - (if (and flag
$ v7 N3 R' ] {# |% u) w - (not (or (< 0 (distof (get_tile "eb_ltscale")))+ a# J. q+ R5 [! q g2 ? c
- (= "" (get_tile "eb_ltscale"))! x3 i9 @. _( ^' B2 V
- );or
. i7 C/ h1 i" w2 D - );not. n0 n+ d* |' t8 V6 G5 N d
- );and
( q7 n8 ]) K8 U - (progn) K. R `9 N$ \/ |; W- M
- (set_tile "error" "Invalid ltscale.")3 U2 H$ X( G6 [/ \4 H+ r
- (mode_tile "eb_ltscale" 2)7 l0 J1 d7 E: S6 p
- (setq flag nil); # L$ p$ }: ^9 e# D: g9 E ~
- );progn then3 \* |8 L j ~9 g8 s- h- f% g& X
- );if
0 Y" H# W' {. D& K/ T# W - (if (and flag
, V# q$ N4 C* j& G* b' T - ; Don't test the tile's value unless it's enabled.- F1 E3 S9 i2 ^5 |
- ; We're not set up for the display-only value/ S9 b6 r0 v! k. q, E) I
- ; of "" here in the error handler.9 P: ~% [- w- R3 R) j
- (= 2 (logand 2 eflag))
- I- |! U: R2 h - (not (or (< 0 (distof (get_tile "text_hgt")))+ Q. r( _4 G0 Y* j H# ^4 i
- (= "" (get_tile "text_hgt"))
' P" C3 K" ?# N. q2 f0 L: j; P. U - );or3 l/ `" _0 A- [( F# @ v) m/ u
- );not
7 A' v" B, z) k" Y( d. A) }4 Q - );and3 V. V9 N6 v1 X6 B% S, n
- (progn0 f1 r, E' v$ `# H9 `$ A
- (set_tile "error" "Invalid height.")6 _& F" Q6 N- Z$ X! B. f. ?: e
- (mode_tile "text_hgt" 2); H; Z0 p# ~5 q+ ~& u' ?- ]
- (setq flag nil);) P! w6 u, O. }4 @$ I
- );progn then
6 A Q9 } \3 m& O - );if
1 \ `1 |9 P: V3 O4 J$ w - (if (and flag, R% j# m( O5 K' {0 E6 t
- (= 1 (logand 1 eflag))
( e7 B0 s* C( e- _3 Z - (not (or (<= 0 (distof (get_tile "poly_wid")))" v2 r- E8 I7 j4 ~% z- a# D/ ~- Y( R
- (= "" (get_tile "poly_wid"))' z; [; a; |2 D7 t" U
- );or6 j; w5 }6 B0 F }2 M
- );not+ J% w& @$ E0 a" d3 e
- );and9 L/ s& h6 Y8 b z+ l1 B5 }2 p: a/ M
- (progn, \4 Z$ `- `3 A; _9 w5 ]
- (set_tile "error" "Invalid width.")
/ K2 W: @5 @7 Q6 F - (mode_tile "poly_wid" 2)
4 s& |/ e8 G6 M9 M: D. k' ?! c - (setq flag nil)3 E1 g) T W1 j+ x
- );progn then: k$ E$ X0 g+ p* q# J9 ^: Y& x
- );if
. `& {, Y1 X: p4 J - (if (and flag$ ?" L' o" G4 U; x. [' `
- (= 1 (logand 1 eflag)); ]1 V& ]) m7 R
- (not (or (distof (get_tile "poly_elev"))7 h w9 T5 ~( }, |) p+ h m# S
- (= "" (get_tile "poly_elev"))3 u( Z0 _ G1 d: q# i1 J
- );or
( A" I, O! s$ [ - );not
2 z# g0 u0 p) f# S- z0 R4 } - );and
% f E; i+ b) h3 [( a. l - (progn
5 E# Z) s6 ` H& h8 P - (set_tile "error" "Invalid elevation.")# t7 L$ G( C) F# D; {; X: r
- (mode_tile "poly_elev" 2)
1 a7 W$ v Y) q - (setq flag nil)8 J# I1 d- Z& s4 y1 c) r
- );progn then
- [5 A1 [: F8 R# X - );if
* R4 T% ^8 o. x' }( e- E - (if flag
% s6 {8 Q7 o+ y/ r* e3 X. c - (done_dialog 1), v6 h2 L2 o& S
- );if: r* D7 e3 Y* o/ f A1 f
- );defun test-main-ok
) v5 T+ ]! B B$ H - % [: e+ Q" L% ^6 w( n# H
- ;;4 Y+ q( I9 F+ X: p, ]4 O. l
- ;; A color function used by getlayer.
: X# E) Y* u, L$ X) i, P - ;;9 t6 f: i$ [+ V O: {2 B
- (defun colorname (colnum)
* j; V4 f2 U+ g3 T! |. B - (setq cn (abs colnum))
) t' w/ @2 [) Y2 C; J0 P" `* t1 I - (cond ((= cn 1) "red")7 k! Q0 i) j+ S0 m o( }# w* C
- ((= cn 2) "yellow")
/ X ?6 l7 U$ k) E+ k# @; u, F - ((= cn 3) "green")% Z7 o1 ^" ]; U( n
- ((= cn 4) "cyan")& ?* \; U* T, e+ r
- ((= cn 5) "blue")* X# `: N9 o9 s1 g, ~
- ((= cn 6) "magenta"): P+ U3 q7 K6 |+ j0 I k
- ((= cn 7) "white")
1 W2 {/ y' v0 r. @9 \ - (T (itoa cn)). {* m0 H m, ? S [9 p; p
- )0 r: n1 |8 |' h8 I0 U
- );defun
# r9 K0 a9 d' _5 |5 V V - ; Q F6 A3 _; m6 m- i# e7 N
- ;;; Construct layer and ltype lists and initialize all$ R0 Z) d9 m' ]: [2 W7 K' o, P
- ;;; program variables:- _% J9 ^( a. r
9 x! S* ]$ G- n6 n' V" \- ; (makelaylists) ; layer list - laynmlst
# e9 I5 j" i2 u: C+ Z4 A - 2 [: @# L1 E f' z, N, _
2 L- e) r. e0 d- (makeltlists) ; linetype lists - ltnmlst, mdashlist4 E6 t7 c& D* E# n+ J1 K! b [
' m( P$ `% B3 V- V! U& s% O- ;; Find the property values of the selection set.
: I$ n' i3 {" i6 z( C - ;; (getprops ss) returns a list of properties from: Z5 `4 {: B1 Z, {
- ;; a selection set - (color ltype layer thickness HEGHT STYLE WIDTH).7 \: `7 h5 M' i
" p: s* M+ p2 t+ ~3 \7 v" L- (setq proplist (getprops ss));@rk interesting things happen here
. g/ g$ M. {7 G - & ^ T/ ~! o2 B5 w
- (setq
, Q" ]7 c: { h6 Q2 f& ?4 h - ecolor (car proplist)1 t% F% ?) k1 W
- eltype (nth 1 proplist)
5 ?8 ^6 j8 f% b& V - elayer (nth 2 proplist)2 m$ O' @6 Q# F9 a" C
- ethickness (nth 3 proplist)
9 ?1 I# j+ S" U; \ - eltscale (nth 4 proplist)
( o1 b9 n8 }" `# G- R - ewidth (nth 5 proplist)
# n q4 x) U$ c+ [% g - eelevation (nth 6 proplist): i) f- I( J8 ^* [4 l- X& h
- eheight (nth 7 proplist)3 W5 |$ m2 M3 @& G) y5 u& m0 D
- ;etype (nth 8 proplist);commented out and replaced with the line below. RK.. G( j% @! p/ f& ~& @. P
- eflag (nth 8 proplist); r6 F" e6 Z/ k/ w8 C! j- t( q- m: q
- estyle (nth 9 proplist)& u% a$ l g: P. l
- poly_ss (nth 10 proplist)" S: W+ v0 s c% U- i# U
- txt_ss (nth 11 proplist)/ S- D% j: G& E7 N( x2 k' B, P
- );setq5 L( J$ @' |4 A' B- E
/ Y7 b% @: Q! [1 c0 Z: m* d3 Z- ;; Find index of linetype, and layer lists/ t, y1 D2 i" k" Y7 f. v+ z
- (cond: T- U0 q9 O. [2 j% |! h
- ((= eltype "Varies") (setq lt-idx nil))
# z+ l. U+ _1 n3 w$ v/ U - ((= eltype "BYLAYER")4 z- J& R1 L4 B+ J% j$ E: w* u8 s
- (setq lt-idx (getindex "BYLAYER" ltnmlst)))5 d/ v5 v6 q9 F q
- ((= eltype "BYBLOCK")* d& d) n( C+ ^0 I: k
- (setq lt-idx (getindex "BYBLOCK" ltnmlst)))
# F8 y8 i% g, b' t - (T (setq lt-idx (getindex eltype ltnmlst)))* Y+ t% W. }' e" h- u* H( m; b
- )
& Q& C) K5 N( F" i# N - (if (= elayer "Varies")
" Q9 ~8 v7 p( W; s - (setq lay-idx nil)
2 \6 ]4 c. n% _( ~ - (setq lay-idx (getindex elayer laynmlst))
' S) N4 z1 B. D3 d7 @, F - );if
) R' e: k3 K' N) ^& |1 P$ I8 a2 v9 ? - (if (= ethickness ""). R* @/ `8 `! g7 a5 `# H# f
- (setq ethickness nil)0 U7 T3 V% R6 O j. I
- );if
0 ~, m. K& t4 j* D! L- Q; [. W - (if (= eltscale "")
2 q0 o. l2 T5 g2 X8 E* {" n - (setq eltscale nil); f3 c# W% @$ q/ y+ r" |* t( P2 d8 S
- );if. T% B: C0 S5 [: p
- # h, J" I0 c; w8 t
- );defun ddchprop2_init ; end (ddchprop2_init), E2 t0 Q( F1 U* R
- + E5 |* l X- k8 k
- ;;; (ddchprop2_select)
, n: w0 l4 ^% ?0 e - ;;;% C; c: G. X) P) W6 I
- ;;; Aquires selection set for DDCHPROP2, in one of three ways:' a7 _: y+ |8 F: K0 R G
- ;;;
) w5 e T2 l; a- i/ f6 ^9 }( `5 } - ;;; 1 - Autoselected.9 G* o2 y6 C6 @2 H9 o0 b+ ^% ^
- ;;; 2 - Prompted for.4 T; |6 \) Z9 |
- ;;; 3 - Passed as an argument in a call to (ddchprop2 <ss> )
) `7 C5 s2 v# e0 \, X6 f& u% Y# k - ;;;6 d( ~7 B4 L; k- E. P. [
- ;;; The (ddchprop2_select) function also sets the value of the% b" W! u' }0 W& r: o7 F7 c
- ;;; global symbol AI_SELTYPE to one of the above three values to) F: G w1 s' l I6 u# o/ H6 d
- ;;; indicate the method thru which the entity was aquired.
% W# E/ |' W: h5 d8 N4 P# Y& l
& @( P% f, J4 `* Q' J
* d9 y+ X- a- r, Q( n, U: b- (defun ddchprop2_select ( / )/ F9 k5 f8 R! ?1 _, u) y
- * L( ^$ O) _0 Q% N% ^6 \
-
" r' F* A5 m0 U e. P+ b8 i- m& R - ;returns only entities in ss that are in the current space.
/ { D, Z7 ^; _7 Y I' b$ M. y - (defun ss_in_current_space ( ss / a cur_space ss2)
% V W( \) }- e' K$ V - % Y" F6 U0 D: A& K' r
- (if ss
# G1 u& F# Z' _4 T5 U - (progn) C7 A+ K6 N: A6 g2 X
- (if (and (equal (getvar "tilemode") 0)# X! ^9 G- ?( j; y+ b
- (equal (getvar "cvport") 1)
0 z. m7 z4 U# v3 t - );and
/ ^. p, b: u$ v( j# _* ~: @ - (setq cur_space 1);then paper space is where we are.
0 R. y* U) P& E8 H L - (setq cur_space 0);else model space.- O4 s a. |8 G! T3 [5 j
- );if5 {+ W( ?+ J( u% D7 B, i3 z4 M) G
- (command "_.select" ss "")3 f9 R! T& _* Z: ]0 g
- (setq ss2 (ssget "p" (list (cons 67 cur_space))));setq
2 n4 U+ ?- C* } - (cond ;;;;;tell the user what's going on." @& l2 G$ s& M7 t3 d) `: ^
- ((not ss2) (princ "\nNo objects found in current space."))
}" Z6 Q6 m, {, u) C! O' h - ((not (equal (sslength ss) (sslength ss2)))
3 X# D8 s$ J8 g2 r( x& j5 k - (princ (strcat "\n" (itoa (- (sslength ss) (sslength ss2)))5 d5 U3 ?3 h6 M2 Z( U' S3 O. s! @
- " object(s) were not in current space."- U7 ]$ J! E6 i1 l2 V8 w
- )+ c/ ?) j# D& u! I
- )$ m4 a+ R# A/ N
- ) / }8 r& L2 t" L! \" y6 P4 J3 K
- );cond
) G/ j& \, q7 `/ g$ ` - );progn then9 ]% `7 X5 ^: P8 ?6 ~1 H1 q( D( J
- );if ; }; Z0 @+ L. c8 Q" w7 r
- ss2
. G' _% M8 V$ u- i - );defun ss_in_current_space2 H+ G8 I9 C: A; j Z
8 f* T4 b' v$ |- x0 A; q- " B5 w" d/ m( b1 k3 G+ y& \) h9 j
- ;;;begin the work of ddchprop2_select
% }4 W% K3 \+ D8 T' U7 L a -
+ X, `6 w5 ?, f7 b1 H/ c7 J - ;; temporarily restore original highlight setting.3 q, J7 ~' M8 \7 i
- (b_set_sysvars (assoc "HIGHLIGHT" (car bonus_varlist)))' m7 i5 [$ X7 d @$ g/ i0 d' m7 h
- (cond
/ O6 U& b& c7 N. B6 i - ((and ss : g( G8 y0 `, Z S. v
- (eq (type ss) 'pickset)
8 |1 e- S& d, h4 e1 Q& e - ) ; selection set passed to
( e) x; I6 W4 S - (cond ; (ddchprop2) as argument; `* J0 s( W3 i2 I
- ((not (zerop (sslength ss))) ; If not empty, then$ z9 m% |2 d( H2 y
- (setq ai_seltype 3) ; then return pickset.
9 c/ K5 k! l; w; e, V - (ai_return ss)
/ a# ?1 q5 ?$ d, _ - )
9 v( v! @, ?7 m; k+ w: {/ D - );cond close+ b. z" P' y- H3 U5 m
- );cond #1' c2 e9 K% _+ ?& V6 k9 R. i1 ?% |
- ((setq ss (ai_aselect))) ; Use current selection
3 @: G# R) H' P9 {3 q - ; set or prompt for objects; L' N6 W7 W0 F/ b g9 h7 f; `
- (T (princ "\nNothing selected.")( D: u# p+ C7 `5 @6 V; @2 B# G: Z! ?
- (ai_return nil)7 F& E( M7 c1 J4 i
- )
; J0 ^1 W/ d2 e, p9 a - );cond close- |5 J& t2 _. t9 R1 a& }
- (b_restore_sysvars)
- G d5 V& U$ D b - 0 E" o T1 W5 d6 A$ t. P- S( ^: a
- ;(if ss( ~1 S8 t. `) \$ S
- ; (setq ss (ss_remove_locked ss))
0 S1 N( X0 C% g) [ - ;);if
! B% o1 J3 ^ Z+ Z! p `/ m - (if ss, x% |5 P+ a d/ V" H3 O
- (setq ss (ss_in_current_space ss)) $ |( ]% j# ^1 k; \% j/ n3 P- x! H$ @
- );if$ q* L! Z% y h7 v- F
- ; U. s6 S# f7 D
- ss0 Z3 @4 P5 H$ U% }( b0 E. [
- );defun ddchprop2_select
' \2 T6 P5 Y$ s8 g - 0 L/ B. q( D" C3 x( ]2 C2 Y5 I
- y4 k7 X3 R4 `2 Q. v; t) v
- ;;; Define command function.
0 q. U7 I" `# @9 F# F - (defun C:CCH ()6 O6 @% W5 j3 N" }
- (ddchprop2 nil)
$ L2 z% S6 `# y# k( A6 ~9 t - (princ)
4 {9 w: D, S: l" a4 L( V$ C - );defun8 W0 r( j* t4 t
6 S) T% ]7 f5 r0 w) }' D2 G1 _
2 ` q0 g: X* ?6 \2 V3 K$ @- ;;; Main program function - callable as a subroutine.
8 n4 L% X/ u" W - ;;;, v2 F% P" B* V9 X# w& U
- ;;; (ddchprop2 <pickset> )1 ]. `9 r) `( j0 F% d) n0 _
- ;;;* w; e- x6 @% Y) B9 [$ H, } G
- ;;; <pickset> is the selection set of objects to be changed.+ G M+ s! Z; \$ Y
- ;;;
! p4 A, N4 B2 y/ w$ K - ;;; If <pickset> is nil, then the current selection set is: G$ R" ~, i$ B9 c
- ;;; aquired, if one exists. Otherwise, the user is prompted
9 U3 y! b; \# U+ e3 d - ;;; to select the objects to be changed.
2 {) F: Y" g, w8 D5 U - ;;;
; o: b1 O0 Q/ s: Q A, r5 K - ;;; Before (ddchprop2) can be called as a subroutine, it must0 \) o9 U7 I& _( |- a
- ;;; be loaded first. It is up to the calling application to: P/ I p6 I# h7 i2 o3 Q
- ;;; first determine this, and load it if necessary.
# T/ r0 h ], @, d) U) M+ B
! |7 y5 R) Q% i' L- C( I- (defun ddchprop2 (ss /( b& c& `. E$ I0 H2 S7 [
7 d i% {+ e9 \4 }' `. D- ^1 H. o- a
0 r: d& ]" j9 K8 L - add-mdash( }: ~( ]5 Q. [1 o$ |
- assoclist3 f) s$ K& e2 o3 f- {" G, L; G9 d+ Q+ }
- bit-70
6 B' z D& M; d* P4 W - boxlength. P- y1 G! M S* l x
- bylayer-lt
; O% P9 Q+ ]1 h& S4 v - bylayer_col6 ^% b7 u2 L( S# ]) t; c
- bylayer_lt" p) ~5 V/ L" F5 `
- call_chp2
& V, I1 N) X, Q# T1 A - chk-col
* T2 c* z% C1 H$ j: z - ;chk-etype ;var removed by rk - H9 {$ S4 A) |
- chk-lay
, p8 f8 O* A, T5 X# V }3 a/ x0 b& e - chk-lt
3 F* }8 x1 O5 U2 U3 G* n - chk-lts ;var added by rk & r3 ]0 {! w3 T5 z8 l# f
- chk-th5 M5 D* ^, c; Q. l/ R! f2 A
- cmd
: p- }7 E4 @6 D8 {( c$ @ - cmdecho0 {; z0 G2 b0 x( k, g2 P6 F6 F
- cn
/ D l6 @; e3 o2 H) X$ i8 K - cnum) d7 J' _3 J4 h' d1 M. k! A* i% k! s7 V
- col-idx+ N( P [: u3 ]8 X0 h( \0 k4 v. D2 f
- col_def* d( G' l% d+ G0 d( W) `; u
- col_tile+ o @! d; o/ t4 |+ D
- colname
' _2 Q1 x3 ]5 v" b7 T$ ? - colnum+ a/ {5 e/ ]2 A0 D5 P* F) |
- color6 r) M- O# g+ \/ G4 u# i/ g
- colorname
, {) H9 P! B. e# j( t - cvpname
: F' t9 `, f+ O# S9 W: f; h% n/ D) c* G - dash
) n% J3 @" T8 P$ h" | - dashdata
$ x% K/ d6 m! Z$ C - dashlist
) K/ k# {0 B9 L$ T! ]2 ]7 t# X - dashsize! ^% J+ x0 Q1 v9 _+ s% Y
- dcl_id/ R6 D: O" I- c9 C
- ddchprop-err
" n" m- F) i3 [$ P" Q1 v - drawpattern" j9 M0 j0 {$ M- D8 W
- ecolor
. F7 w0 M* w7 ?- o! Q/ [ - eelevation
W' H! |2 b5 {4 V6 l2 X - eflag
' C1 V! v* [" R2 a% `. Y - eheight
; }* m5 u. D% J" t - elayer1 c: Z g/ k r$ m l3 s' ~; p; H
- elevation
; }" u/ E9 c) A1 p" O! _& I% P9 n) O - elist3 W7 Y7 ~* t5 ?8 k$ X0 z
- eltscale
. F9 h6 w5 v4 f5 M9 G- [ - eltype
) Y4 `% w5 i! T) c! F - en
: F: i) |/ n, D$ o' B8 _2 p \ - ename
5 x, A( |; X/ d - ESTYLE ;var added by rk
5 Y' a- a7 z, |' P - ethickness
; Q" Q3 b* v1 t7 m, C - ;etype ;var removed by rk# q4 d( v3 T0 Y% Q) t" V: G
- ewidth
t; f% A! ?$ y* L3 J- w - fchk
0 c1 g+ G$ i: M - frozth4 W$ k% _7 n" `3 t+ k/ {2 {; {
- fx
2 N& X0 U" b0 @* d, J+ G I1 S - getcolor
. o$ E% n0 s' P7 J; L - GETELEVATION ;function added by rk
0 i; Z$ \: R* F& H) |/ i4 ~& s - GETHEIGHT ;function added by rk
6 I. ]3 X& N: T7 D- k! W - getindex( d Y' h% a/ g" t5 g& w
- getlayer
/ d" e3 g7 Q) _6 @8 a4 N" M9 P - ;get_locked_layers ;function added and then removed by rk
1 T7 Y2 w. ?' ~ - getltype0 v# y* O) ~$ b+ G3 C% S" q1 o
- getprops; X, T* {8 A+ V
- getscale ;function added by rk) L" Z$ ]. v9 `( n
- GETSTYLE ;function added by rk. u2 Z% F3 m- k( k8 F
- getthickness& x V: G* {: K, u% n/ g* H
- GETWIDTH ;function added by rk
# k! X% l. w4 y! Q* }" T0 V" O - globals7 [4 D; P$ S* O5 D
- HAIR_STYLE_LIST ;var added by rk
) A5 l" m2 @+ y* U+ W! ?8 Z4 Z0 n - height
+ `9 y; l6 U( d - index! e2 e$ ]: e( e8 j
- item
5 P& |0 C3 r1 J) o$ C( ^+ L - item10 K: D* g" y2 v$ m% X7 C) V
- item2) D/ q) h3 o ]+ G6 Y4 |
- itemlist6 F$ v8 m4 a7 M
- lay-idx) V7 ^8 O8 j% j: x" u' Z: S% M
- layedit_act" |, N* {- V, g" t9 {# T
- layer6 `0 S% a# V" G. z* H; h
- layinfo
8 ^; W Q$ h$ n. j) q - laylist5 ^" X0 a8 L' @ S% b& ^
- laylist_act# J2 P- b9 |& d, z& z
- layname; X. d3 b7 u$ g2 K( W! ?8 B
- laynmlst! y9 ~, K4 W' b
- layvalue% z" b+ k" g9 x e& s' W
- linetype
3 o" [: h- a& Y' `" E/ q - list16 ~5 x% [4 L9 v2 h
- longlist
Z1 s7 Y, _* `, M- `9 } - lt-idx
3 `/ k! @4 C. O& s. L$ R# N - ltabstr- v ?) k* v6 o' `
- ltedit_act: B' H6 f( B% B6 ` a) }3 d2 A1 _/ E
- ltidx6 r* X |9 G6 Y- ^4 L% g
- ltlist ]+ h7 L- Q8 Y1 L; t1 ]8 M9 [4 B
- ltlist1$ O; \' n9 q: [% Y# R: E. M2 I
- ltlist_act9 z! @; L' ^+ [, d( n1 j3 i
- ltname$ }7 \: Z- h# j
- ltnmlst, G+ B. s f3 L% E$ q& p
- ltvalue( f- q2 a# x0 O
- ltype
0 E% g# e% K$ E* G9 a9 x: M - m
# ~* T. y$ s! v* z# {* P - makelaylists
5 H* v- l1 f! `2 ~" U$ K9 f - makeltlists
, G5 Q5 g/ W M e - match-col
; N! B' U) d6 V h8 y - ;match-etype ;function removed by rk8 l% M1 Z( K! \' E+ F/ f
- match-in
% v% I5 g8 m3 Y: d - match-lay
6 q [- o) `: c; V - match-lt# v8 Z$ q, P* U$ B) n/ W' p
- match-lts5 {9 K' e/ [' z6 l/ u
- match-th
# _2 a) k, r8 y; j2 P7 u - match_col
, u- M6 d' d- g! M) Z) A8 Z - mdashlist2 B; f$ S4 N; C( \# }8 D5 {' ?* r
- ;MPOPLST ;function added and then move to ac_bonus.lsp by rk- [' N6 A, \% z" d
- n! H& S v8 h5 F" e' V- I a. `3 X
- name' m; y4 t0 z( ]; c- u, E# C( J
- ncolor, J+ M3 M E7 s5 n4 ^
- nlayer5 K& a+ X* B" N, H/ B
- nltype; x! j8 T \" y
- nthickness2 ?8 E/ {4 U+ X+ |/ c& i1 G
- off
* X$ a9 N6 \3 @ _& G - old-idx# B% f; ]' [, J( `/ x+ Y* j
- olderr
" m2 Z# ~2 [9 r3 F! ]- m- Z* d - on
+ b3 K9 y2 z& G - onoff2 ^7 U( s2 D! n Y: R5 l
- patlist
5 ~& R9 Z9 K- s, u, M - pattern/ H: M0 u: _: m/ u- S
- PL_WIDTH_GETTER ;function added by rk9 a6 R' O6 s9 l6 H6 i
- POLY_SS ;var added by rk
+ u$ C3 e$ s' @0 @$ o+ z - ;POSITION ;function added by rk and then moved to ac_bonus.lsp: j- e2 X6 O8 `. i6 W
- proplist
3 [ Z( R( R" \+ p9 a7 O+ w - reset-lay! y) @3 q5 W3 e l3 Y7 y
- reset-lt
' P% W- q( S+ I - s
& Q& [. [0 T7 s; V* } - selset z8 j6 d. _+ Y2 ?" h, D! Y" F. d
- set_col_tile2 t$ E4 r" L( |8 a& m1 r
- sortlist
$ Z0 n. @, b- w; Y. w9 j - ss
, a F Y- F& p- ~ - ss_in_current_space ;function add by rk.' {1 ^ }8 s, i Y! Z: G4 y& l# R R# R
- ss-index: u! h/ _. `5 E! C- |
- ss-length# b& v5 S; Q+ A# Q
- ;ss_remove_locked ;function added and then removed by rk.1 ?% U3 \# w8 ?. K: @
- sslen+ X5 L( x6 N1 K* i! z; Z# p4 O7 ]
- temp_color
1 u1 \# M. B* B" Y9 d0 ?- F; `# i - templist
5 n9 l# x9 v+ S9 \; d - test-main-ok+ L& A* L8 f. y% Y4 m, y% B5 _
- test-ok
! u2 M7 [9 S2 ]+ S1 Q7 B - testidx
" L9 e4 S# q7 j' U - testlay2 a+ H) m, g' ^0 {
- th-value
% N* a# c S6 \5 z A" |0 a" `& @ - thickness
3 r; n7 a' @4 r0 O" A - tile- U: o. |; t |8 C( H7 p
- tile_rect
2 y! X: ?+ W! J) L1 b) Z - tilemode/ q* L+ s3 b: z9 u
- ;TNLIST ;function removed and moved to ac_bonus.lsp by rk" H# I2 c, n3 q
- TXT_SS ;var added by rk
8 L/ n- L" z& x - ;undo_init ;removed by rk.
4 B' S" e) V }+ o9 b/ ` - vi- K* Y4 |! N, M( w# ^, A
- vpf
' m X o, `% N; D3 n% e - vpldata
& o& n. u; v: ^ R0 j P - vpn
, M P4 K9 v9 J8 k5 h - which_tiles
/ M$ \% Y# J# B6 N2 D! S5 ? - width6 W; u% u$ }5 S: _1 ?* v5 ?. Y* m
- x* u& j4 c- [0 U; D
- x1
: R$ k; |" k& r2 | - x2+ }' {' q- F) n5 B! `3 B
- xdlist- b; ^2 [6 O# D( [- q
- y
! D; x& Q. z; m7 | - y1
' {8 y2 f: J) J. X - y26 D% E7 v( W- K7 I1 k8 x E
- )9 q: Z- t; V/ g4 v7 `9 k4 M
- 0 m% T, e8 N- c5 M
- (if (and (not init_bonus_error)
; W( e0 }/ Q+ P* C& p6 k/ k - (equal -1 (load "ac_bonus.lsp" -1))
) L9 c5 L8 M( i6 l# r5 `: [8 O9 n - );and w2 F* n6 d8 j& w
- (progn (alert "Error:\n Cannot find AC_BONUS.LSP.")(exit))
2 e0 \( j0 i. o% [, H! z1 O5 H - );if
: b6 @& o- W! x - (init_bonus_error (list5 y, d% L& w) v0 T
- (list "cmdecho" 0
# h8 i* q1 N8 I- V ] - "highlight" 0
/ M* B6 G: V$ q! Y+ y! Q - "regenmode" 16 m( D2 N/ c& W4 \3 o& }
- "ucsicon" 03 R7 I5 v, R# O9 V, {, b
- ) ) t# n% P6 x# t ?
- T ;flag. True means use undo for error clean up. ) G" }: V# |, N( e( M' S% Q
- );list
4 i; m% q5 V B! L$ P - );init_bonus_error' s9 u4 E/ h/ }" f4 z4 c
! \( r/ t: W' `/ A @2 h% |) ^- (cond
1 [" P! A5 ]8 v: v K' { - ( (not (ai_notrans))) ; Not transparent?
_& K6 @( X, t5 \6 y2 | - ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?; D" E, _9 h2 S
- ( (not (setq dcl_id (ai_dcl "exchprop")))) ; is .DCL file loaded?
* w! Y, B" h# p$ V- a( Y3 t - ( (not (setq ss (ddchprop2_select)))) ; objects to modify?
; u) E0 C$ H# [5 ]$ _ - (t D! K N- m, |
- ;(ai_undo_push)
" v5 z. }) G" O: \9 X/ |2 O - (ddchprop2_init) ; Everything's cool,
9 W8 ~/ D& B- \3 X0 }4 x+ E0 y - (call_chp2) ; so proceed!
) E( Q; P8 w1 d% m3 N$ [6 w - ;(ai_undo_pop)
: @! \, v3 n1 K4 C - )9 a1 }8 F `' k( g6 T& P* z. o2 q
- );cond close
B, a( U% Q; v1 n$ |% I& j; @ @, L
; _1 B1 G* W( Z: u- (restore_old_error)
0 N& @2 h7 ~5 Y+ a - " a' E0 q( r' _
- (princ)
; g- B6 S. ?+ Q - );defun ddchprop22 }! m# e% P( @
/ f0 D5 X( q F7 u/ @5 q$ {) j2 m- ;;;----------------------------------------------------------------------------9 L- V- d: y# v0 D. p1 u2 M# M9 H# C
- 6 U7 r" s) J6 j" A, x
- (princ " EXCHPROP loaded.")6 R0 V- ?9 m% d- }0 y
- (princ)& A: w: u* w- z9 P
- * m) U% p7 b1 G( w0 W3 w$ h: Z
- ;;;----------------------------------------------------------------------------
* ~; r% v( c9 [0 H# u5 S, @ - ;;;---------------------------------DDCOLOR_LSP--------------------------------6 W1 r! ]9 M* X5 \; x; A
- ;;;---------------------------------------------------------------------------- ]! Q2 |# A2 |: l
- 4 {. v+ `/ g3 R$ U
- ; Next available MSG number is 24 . W# r) O/ n- [6 T
- ; MODULE_ID DDCOLOR_LSP_4 b* m+ E& r! |% o& |/ r
- ;;;& I" p7 n, N7 e5 Z' ^( Q
- ;;; ddcolor.lsp
, j% a. ~$ ~1 }7 g - ;;;
4 c' g! w0 ?9 Z, `% Z7 W - ;;; Copyright 1990, 1992, 1994, 1996 by Autodesk, Inc. e0 l7 j' ~2 k8 {# F5 f
- ;;;
8 z3 u5 V6 j+ v! A0 \9 n3 W - ;;; Permission to use, copy, modify, and distribute this software
. E! w5 Q$ c2 ^2 r - ;;; for any purpose and without fee is hereby granted, provided3 S% X; L! c x. x4 l* S2 F" U
- ;;; that the above copyright notice appears in all copies and
9 _' B" J: c: I% J% D3 V" ]# r - ;;; that both that copyright notice and the limited warranty and
" E1 z( R2 c* b, @' M - ;;; restricted rights notice below appear in all supporting% v- K# P+ G$ K; \; F) P
- ;;; documentation.+ g3 |$ i( R( {/ u: K, C# _
- ;;;1 v, o P6 H' U5 |* s8 h
- ;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
$ s0 f: E: y- T4 v+ ^& U! A: u7 l+ Q/ ? - ;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
8 O9 v: s$ w+ u( R8 B, N8 r3 F - ;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
+ E) ]9 L* m6 r* M: D% M - ;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE* i* |) m: C8 J1 x; y7 G
- ;;; UNINTERRUPTED OR ERROR FREE.' G- t* u W5 i! B' W2 \
- ;;;
8 G) d% B; V3 B - ;;; Use, duplication, or disclosure by the U.S. Government is subject to
5 @7 w/ T1 l: u) t - ;;; restrictions set forth in FAR 52.227-19 (Commercial Computer2 K, [, i j! \, t
- ;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) : P$ d4 ]9 c% s( q7 X: g8 e
- ;;; (Rights in Technical Data and Computer Software), as applicable.
% W5 [5 ~6 ^/ ]/ z5 V! S `/ y - ;;;
$ V! j, R3 z& @" U' X; A - ;;;.) G" V+ _5 r0 Y8 ]3 V
- ;;;
8 ~- X' A! t& {3 l - ;;;----------------------------------------------------------------------------
/ n) H! m: b. v( f6 h1 P2 g: a - ;;; DESCRIPTION
) r1 f' k) \& [1 |" U9 N - ;;;
. q9 i" s; v. d* u J+ `) r* [) f* h - ;;; Chromatic Pallete style color selection dialog.* [% G" S; @) R9 L3 G J1 T
- ;;;
" {% N( B$ b" S! J9 j7 g - ;;; Globals:
2 A9 d( _$ \% l1 B' Z, g8 h - ;;; # D" s5 q% Q8 t5 A
- ;;; chroma_color - Integer color index. The last value selected& H, B- \5 i/ K
- ;;; by the user in chroma dialog. It is not cleared or reset! K# ]" `! L7 k. z! o2 Q5 l
- ;;; by a cancel. Only used for communication between callback
' u, K2 z1 q: n/ }; B% [ - ;;; functions and the (chroma) funciton.
5 M4 e h9 V) D! K$ r - ;;; 2 v% a& t* G' _- e
- ;;; Depends on the definitions for the dialog provided in chroma.dcl.% o, n( N9 p; F+ \
- ;;;
& s+ k- P5 H) w: ]2 D' ^+ u - ;;;
. j# G3 p1 H, r7 W/ X0 t1 { - ;;; C:DDCOLOR -- Dialogue front end to the CECOLOR sysvar. Uses the chroma
6 `- f0 L4 q4 z! J* g5 | d - ;;; pallete style color selector.
) K$ g- h- K% D7 K' i - ;;;
$ o1 c; P1 t+ |0 f+ q - ;;; ===========================================================================
2 |$ A7 {& p" G - ;;; ===================== load-time error checking ============================* H- H. p* j9 e% x* C
- ;;;, i% f6 @% Q" ^! G% p; X6 e
+ x% e* `- Z+ Z, |- (defun ai_abort (app msg)
0 [) n0 O6 U! E. C s& ^ - (defun *error* (s)
. ]- x% t5 N. P- I+ }: q8 L - (if old_error (setq *error* old_error))
" b I- d5 [( S! Z, m5 r - (princ)
, C8 p2 B) i6 A- q - )
* H3 a& i$ E$ [# p' T/ Z4 Y1 D - (if msg
$ a7 r% x" h6 v! a, R$ j3 M+ D6 G - (alert (strcat " Application error: "7 Y" b) |$ [; m+ Y5 V) j5 @
- app
; f0 K; ~0 L: ~, C6 j1 ^3 E - " \n\n ": P, ~4 ?" p- T/ U( g# w- V; m6 C
- msg- w3 x5 w, C' b7 ?
- " \n"1 Z7 c0 g2 a' T6 z8 C0 L, c1 X- ~
- )
: \- g9 m3 S y! b/ C! w5 V3 c - )- o+ \2 W! ^9 V8 a
- )
' ?' F. T2 J$ y0 t, b; L - (exit)
# | t9 T) i+ X - )$ P+ ], [9 j' m0 K
' F. o/ I+ y' U* h. i7 U( h/ t2 o- ;;; Check to see if AI_UTILS is loaded, If not, try to find it,
% |0 U: r# \1 K% l- d+ l" Y3 X - ;;; and then try to load it.5 H. k4 |) k% x* \
- ;;;
9 r- l/ R) X% K7 C. X! D - ;;; If it can't be found or it can't be loaded, then abort the
' O4 W$ P4 q) Y% G4 y M - ;;; loading of this file immediately, preserving the (autoload)
1 g2 v) x' L$ _. S5 k* V, f, }1 x# c - ;;; stub function.
, c( \7 w; y( W0 N ^6 z
" X( V. s9 l" }- (cond+ N! v. O- {+ g3 ~
- ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
( Z" s* N% C# q3 _$ \! _ - e' n. ]& r: t, S! }7 [
- ( (not (findfile "ai_utils.lsp")) ; find it" r! y+ \+ w; n! B H
- (ai_abort "DDCOLOR"
$ A/ ^6 o' \! c) i9 _* ] - (strcat "Can't locate file AI_UTILS.LSP."
- i+ F- D. R7 P0 {. d- {, ^ V8 o - "\n Check support directory.")))' I7 d n i& y* ?0 \
5 q/ z: `; G8 U" X: [! u- ( (eq "failed" (load "ai_utils" "failed")) ; load it: e- s+ x) m% M l
- (ai_abort "DDCOLOR" "Can't load file AI_UTILS.LSP"))
0 P7 e1 W0 ]7 N3 f$ R - )
1 U( ^' w+ F1 p F
5 H @5 ]4 y# ?6 c! @' ]3 o- (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
2 y! s5 I) `2 D* G( d2 ` P - (ai_abort "DDCOLOR" nil) ; a Nil <msg> supresses4 d3 Q3 f& b/ [: A+ _- I
- ) ; ai_abort's alert box dialog.1 D. B/ D# i7 L- g+ a% z, q% \8 T
; J- F0 y7 M D) E# y, P4 f& C" N- ;;; ==================== end load-time operations ===========================
3 i9 S' w3 j5 r* n2 S; m( Y
! O3 V! ]) J D$ P- (defun c:ccc (/ co_oce clrx co_err co_oer lay_clr)
) l+ L4 T" I% k5 J - * l2 v! A5 x7 l- Z+ T( n5 D' F$ d
- ;; Main Color function, called by setup code.$ U: J; S$ W1 b- q! t& v7 E. V
- (defun ddcolor_main()
' H- h/ a$ U2 z( Z0 B4 c9 {# g - 1 `, X b4 @' `( n
- (graphscr)
$ u9 i. Z6 Z: a! x& z- \3 N - % n) P: T5 {) o0 I
- ;; Get the color of the current layer, for possible BYLAYER color swatch.5 I' C; D5 k# H3 D7 o
- (setq lay_clr (cdr (assoc 62 (tblsearch "layer" (getvar "clayer")))))
! z7 P1 K+ C% z8 k; z, z( a - * G4 M# _3 t; L% M1 ]
- ;; Call the dialog here...2 ?- K/ x1 t @$ \+ Z
- (setq clr (acad_colordlg (cstoci (getvar "cecolor")) T lay_clr))
9 i" }; h- T$ t' ` - / V" P5 [! g5 x( E+ s& X' ~9 @
- (if clr; g7 D, Q1 d& \% o5 m- c
- (setvar "CECOLOR" (citocs clr)))4 } h5 M: p$ ]' ^# |
- )! u0 v( t3 n f5 j2 Z- R9 E
- % W! K) q v9 r. |# i; a
- ;;;" w' H. r- h% @
- ;;; CSTOCI -- Color string to color index
- }! Y: j T- Y( h9 i; N8 r - ;;; Convert an arbitrary case string into a color index.) E6 Q9 q7 p S; `
- ;;; Returns nil if string is not a valid color.3 Q5 F8 @8 N& Y% b2 k0 a
- ;;;
- Z0 M2 ~" Z/ D; l2 ~ - (defun cstoci (str)
5 F: H6 s5 ]! q a% S2 k - (setq str (strcase str))& I! y5 I L0 p4 F4 C2 i+ V
- (cond
- f) L; g, H1 {& n! {4 Z1 }0 O6 s9 C - ((= str "RED") 1)' X/ Y" F" s" k0 @9 Z7 n
- ((= str "YELLOW") 2): `' R$ y! C s8 y
- ((= str "GREEN") 3)! z* e. ]0 J: L, o
- ((= str "CYAN") 4)
, x1 Q( d& q6 u& p- T7 H - ((= str "BLUE") 5)1 o4 c1 {+ f% U3 J
- ((= str "MAGENTA") 6)
: q; M# n" l \ - ((= str "WHITE") 7)& Y/ W. p9 Z3 b( A$ s- P- I. p
- ((= str "BYLAYER") 256)
6 R6 X9 ]6 g( G4 N2 p _0 E! Y - ((= str "BYBLOCK") 0)# g+ o7 e. W1 L7 p
- ((= str "BY LAYER") 256)! s# l' t* m' d1 |+ ?, G9 D
- ((= str "BY BLOCK") 0)
9 f1 t& a$ D# P" P - ((and (< 0 (atoi str)) (> 256 (atoi str))) (atoi str))5 E! Y' c2 M* O6 J2 [7 M2 g4 W
- (nil))
& T8 U* l- j$ U5 `9 G - )
+ L2 C h9 D; B- s# S6 y7 } - - `3 Y; e4 }4 `/ a. x
- , Y+ i; Z% S0 b. ~9 }
- ;;;
6 b- B V) U; q E - ;;; CITOCS -- Convert color index into standard color name.2 I# H; Z4 x \6 J6 ~
- ;;; Will return the standard and logical color names as text
0 E" K& P& `4 d. o8 j - ;;; strings. Returns nil for out-of-range color indicies.! b6 Q* J' _- ?
- ;;;. P# |4 g3 w+ K l
- (defun citocs(i)! s, t* g5 g9 P
- (cond' t9 l3 V) m1 c1 r' g2 }
- ((= i 0) "BYBLOCK")
8 X( O! S/ Y% |! l2 h - ((= i 1) "red")
8 o* h, t" T% V& c/ g - ((= i 2) "yellow")$ k! n% c4 V3 J+ B' X$ _
- ((= i 3) "green")
E* l/ Q1 Y* r% o1 {. j$ ~ - ((= i 4) "cyan")
. v! `0 r6 }2 a0 N! U& B0 N - ((= i 5) "blue") n/ w& m0 Y/ L- m0 w; Y! r
- ((= i 6) "magenta")& t r% B3 Z6 k
- ((= i 7) "white")
% U% L/ ^/ J- y( S - ((= i 256) "BYLAYER"). j* R7 e6 m. B, z6 H' v
- ((and (< 0 i) (> 256 i)) (itoa i))
+ c; L$ z8 K& f1 D" O, w - (nil))+ v" x9 t2 A( ^' ?
- )/ @. F) c, W6 f! m5 E, X, I5 ^
. x8 z D6 ]; O3 D- ;; Start of ddcolor4 h, J2 `4 G8 G5 B7 J
- (setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho
* P, u/ W+ h. k% D+ Y W! h - old_error *error* ; save current error function
9 @8 O* d+ j) L - *error* ai_error ; new error function
: j, K. x8 k; l: L7 S - )! f8 @, a8 i) N8 J, p/ V
- : q0 v5 o9 X/ @8 I9 P6 W, h' j
- (setvar "cmdecho" 0)
; ?3 g. V0 o1 J: d S
1 H/ B6 k/ L, A; n6 p8 }- (cond, k. Q; O4 L" \& |: `& T
- ( (not (ai_trans))) ; transparent OK8 G- [+ @' i" y: u, J
- ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
! v( N- N, m+ _6 D$ O, K6 u
7 h, m% i4 ^8 d! _! @( u, n2 n$ p- (t (if (and (/= 1 (logand 1 (getvar "cmdactive")))" X- R; [: }6 x) d
- (/= 8 (logand 8 (getvar "cmdactive")))# C1 v' F' K5 ~. C% V K. W
- )3 B0 D& q% Q# c+ \3 b: Q' N
- (ai_undo_push)
6 H7 o, o/ Q" I( @# ]. j6 v - ). j7 E' F4 J5 J1 f( m5 [& D2 B
, z# r; k+ E0 {, w& q* Y- (ddcolor_main) ; proceed!0 H/ z& i( L/ @
- * s3 x- G7 ~& G! h, L) A
- (if (and (/= 1 (logand 1 (getvar "cmdactive")))
1 f" w) F6 g# H1 }* h4 l( {0 u - (/= 8 (logand 8 (getvar "cmdactive")))
+ U7 r8 i" ?; P7 U* R4 H" K - )
1 f- a$ N% ~" f/ C$ U6 j - (ai_undo_pop)
1 m9 I7 c# \7 i' X- K - )
/ j, D4 ^. K) {; U/ d1 Z) R: S8 ? - )
& n2 m& Y* y# L: ~1 E - ) b( i) N, h$ ?7 M- @
- & M. i, n2 v; y
- (setq *error* old_error) 1 R- d& I. @0 g+ h* _8 b6 \, L. d3 c
- (setvar "cmdecho" old_cmd)
?; M: z9 P0 z1 n - (princ)
. K4 \9 l. y0 a: C# e; Q3 u' _ - ' H# _0 p: M2 E. {' f
- )
0 X! @! ~& U' k% w3 F1 W, s
+ R+ w ~! Y: X4 m0 v) m% w/ t- ;;;----------------------------------------------------------------------------
" d V9 J9 @( |$ a! O- D- y
+ {; {& d6 s+ q0 o9 O$ v- (princ " DDCOLOR loaded. ")
# I9 R! N# m; R) {5 c1 U - (princ)
& @* {2 Z! W7 g4 d1 s
! _2 K3 L) D$ X. R4 P- ;;;--------------------------------------------------------------------------;
( l( e9 a$ g3 r7 ` z/ |& `8 i! E - ;;;---------------Chon NHANH Nhieu Doi Tuong GIONG THUOC TINH----------------;
* G( u$ m8 K* y% G! e3 `4 v - ;;;--------------------------------------------------------------------------;1 I% m+ x# ?, n+ G
- ;;; ssx.lsp6 E) B! a5 N. I. n* `& X9 j* T# V
- ;;; Copyright (C) 1990 by Autodesk, Inc.
; G/ Y# `7 X+ j5 t - ;;; Copyright (C) 1991 by Control Systems, Inc.
# K( B! L* t) W$ _ W7 V - ;;;
0 P7 p" _: I# s- G, ~ - ;;; Permission to use, copy, modify, and distribute this software and its
7 K( F3 _5 U7 v; g3 v x! w# Y - ;;; documentation for any purpose and without fee is hereby granted.
( w. m, c5 G# p5 N: J0 Y - ;;; f3 q/ ]5 O; e
- ;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.$ \ @* g/ v7 h/ z& A1 S$ j
- ;;; ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
+ q: F0 B$ H% X( ~/ p+ R - ;;; MERCHANTABILITY ARE HEREBY DISCLAIMED.
- G7 P6 Q1 s" G1 w# M+ N- ^9 w - ;;;
; B1 n) H+ ?* ~+ K+ T7 @ - ;;; Larry Knott Version 2.0 7/18/889 h$ g( {# g' _% V
- ;;; Carl Bethea & Jan S. Yoder Version 3.0
" F- m: {1 H; V: t, U - ;;; Enhancements to (ssx).6 z( { _" k O' @9 d* @
- ;;; 15 March 1990 5 z) }5 W% V9 N
- ;;;" |. j# D2 ]7 q$ J
- ;;; ARTIST Software, Inc Version 4.0 December 1991
* C' A( A. K+ e2 ]" p& c - ;;; Modified for FLEXICON usage. If the variable FLEXVAR = 1,' _3 }+ z- T/ `9 P" z
- ;;; use Flexicon menus
2 H q; @2 A- |) }' y C - ;;;$ Z; p; s8 L7 v) n, @/ Z
- ;;;--------------------------------------------------------------------------;
" m% `. Y0 ]6 l, Q/ H$ g - ;;; DESCRIPTION5 r* ]! J" v! X* _6 N; X- |
- ;;; SSX.LSP " e. `: p0 u6 G# S; {$ u; ]
- ;;; 5 M/ w( d0 c2 e5 t3 C. ^2 m
- ;;; "(SSX)" - Easy SSGET filter routine.
, x# y6 U0 k( D& U - ;;; + @' a8 j& P" o7 b( I, i$ q
- ;;; Creates a selection set. Either type "SSX" at the "Command:" prompt 3 j- C* N" w3 n( w' q2 c# w2 E
- ;;; to create a "previous" selection set or type "(SSX)" in response to ' z1 F# y( u2 \5 | O$ y% t
- ;;; any "Select objects:" prompt. You may use the functions "(A)" to add 2 l+ | K0 [! p: L' P' j; i
- ;;; entities and "(R)" to remove entities from a selection set during & I5 j7 H/ L4 C# G4 A
- ;;; object selection. More than one filter criteria can be used at a
, n. N' [7 y1 T# H0 H! w% [8 ] - ;;; time. 2 O, l# K3 N. y3 X
- ;;; 2 Q5 G, h$ u! A5 v j
- ;;; SSX returns a selection set either exactly like a selected
l5 q4 k# x" M& P - ;;; entity or, by adjusting the filter list, similar to it.0 d9 D$ [1 _3 {" o
- ;;;- s9 L; Q0 N4 U0 x. l3 l2 C
- ;;; The initial prompt is this:
( m! [; Q: z( `4 x - ;;;
j9 a, E% M8 O' p$ B; }+ g5 x - ;;; Command: ssx
9 _, s, j9 {3 m N/ Z+ o# p a - ;;; Select object/<None>: (RETURN)* n. d: `$ ?, r: V4 \
- ;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector: 3 B! R( X! i" e1 x F- n9 Z+ ]) A
- ;;; 7 M. ^ b4 W% w& I+ a
- ;;; Pressing RETURN at the initial prompt gives you a null selection
/ l* A# O& R2 I: v) x2 O - ;;; mechanism just as (ssx) did in Release 10, but you may select an |$ ^; Q$ R D9 S+ c
- ;;; entity if you desire. If you do so, then the list of valid types # G H$ i2 g# T+ F( U D
- ;;; allowed by (ssget "x") are presented on the command line.) R# m4 q3 f+ \- j' c E! |( |2 H
- ;;; . c- k O: n$ N- K1 S: z+ S
- ;;; Select object/<None>: (a LINE selected)! x* G# b M2 e( }* L8 b2 {+ m. |
- ;;; Filter: ((0 . "LINE") (8 . "0") (39 . 2.0) (62 . 1) (210 0.0 0.0 1.0))
( n( _. ~4 \" p3 Q0 Q3 z+ b, ~$ m - ;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector:
+ r+ v' r2 M T" H7 e% N: U4 c7 Z - ;;; * j$ ^! T, t* Z, E1 M
- ;;; At this point any of these filters may be removed by selecting the
+ [7 d& t# ?7 E% n6 r/ U - ;;; option keyword, then pressing RETURN.0 a7 ?! _0 [" S( }
- ;;;
% R* v/ H1 g) C0 B! v; E6 `- ]% C - ;;; >>Layer name to add/<RETURN to remove>: (RETURN)9 w% X6 H+ `2 ?8 U4 ~3 Y& n& u
- ;;;
' z) B4 H: [$ B - ;;; Filter: ((0 . "LINE") (39 . 2.0) (62 . 1) (210 0.0 0.0 1.0))
7 ^8 l' I" f4 h8 i ~0 _ - ;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector:
! z( U3 d* c& g8 c6 X/ A7 _4 A4 c& | - ;;; 8 J. J7 d. |- l
- ;;; If an item exists in the filter list and you elect to add a new item,
# D! `1 J5 ~. }4 e: a7 o. l& @ - ;;; the old value is overwritten by the new value, as you can have only & z% F0 S5 K, K$ i: G( D
- ;;; one of each type in a single (ssget "x") call.5 ?+ }1 p( Q8 d4 W# T/ e" p
- ;;;' T- D* {% w8 x4 x$ |
- ;;;--------------------------------------------------------------------------;
% A: r, B/ E: j6 [* Y; x" W - ;;;& [# ^; N2 z" E4 f7 J; k
- ;;; Find the dotted pairs that are valid filters for ssget
# ?+ x4 H) M+ Q/ ?. l5 b - ;;; in entity named "ent".6 C3 c# U8 r: \4 ~# V" B6 b
- ;;;
4 B& ~0 s: [$ @. i Y! Z! [8 a# l - ;;; ssx_fe == SSX_Find_Entity
" z4 m8 a" u$ Z- ?8 }: q3 h+ l - ;;;
8 m" ^2 w+ x* `" H2 n5 C" d Y - (defun ssx_fe (/ x data fltr ent)( r0 F& A* Z6 w/ ~9 x1 r5 r
- (if (and (= flexvar 1)(/= t2 "Pick"))
s( `6 n* U6 O7 E T/ S) o% F - (setq ent nil)
' H! g# L7 K/ C6 @& r3 g1 T( |/ _ - (setq ent (car (entsel "\nSelect object/<None>: ")))
! |- w9 b' z" n, g( \( P& t - )9 Z l* y) e8 ]3 L1 t$ B( [$ F
- (if ent8 I9 q7 k& D+ S% i# Q
- (progn* c" S4 F$ v$ h* `
- (setq data (entget ent)); }; V2 o6 ^/ \0 e1 ?6 } M6 |
- (foreach x '(0 2 6 7 8 39 62 66 210) ; do not include 38
6 P0 M4 ?! M0 Q1 O6 [ x7 P7 R - (if (assoc x data)7 s0 f1 ?* P7 @( D# e
- (setq fltr 0 L0 l, b1 N) t" M, \
- (cons (assoc x data) fltr)
! d) l+ f4 [3 x0 w; L w - )
" `6 V, h a) k$ L* [7 L+ u - ): ]4 g2 I* F2 z& P
- ) . _- D7 s$ F( k! c+ r, f; V
- (reverse fltr)
# c2 z+ N3 f+ c2 v- D3 l2 p - )3 W( _ k4 p2 L" P# p
- )
. B6 w4 m9 |3 A - )
/ ] Z% I. i5 h- o - ;;;
! F$ y ^. h# \8 u6 z) d - ;;; Remove "element" from "alist".7 z3 Q' Q8 s/ G; M
- ;;;/ _# }( p) j3 v" m* a: [% Z/ F
- ;;; ssx_re == SSX_Remove_Element" [4 E, @1 Q0 i+ `
- ;;;
0 g& Q' |+ a K - (defun ssx_re (element alist)
! j! g4 T( O4 Z8 \ - (append: V2 e% V3 I' X j' y2 H& w
- (reverse (cdr (member element (reverse alist))))
/ v$ m8 ~2 g! \' a - (cdr (member element alist))
. s4 Q' t$ Q# \8 [0 g - ), M- j2 l" K( A
- )
. J( i# q+ w" b9 b& r: A2 w; K4 o5 F. f r - ;;;% a# S1 j/ U& y0 R# ]
- ;;; INTERNAL ERROR HANDLER
/ K- Y; d) ~% B - ;;;
" ?% j! D3 s* T. i" T - (defun ssx_er (s) ; If an error (such as CTRL-C) occurs* H5 q2 A4 i. E
- ; while this command is active...& q5 K0 f1 C+ a! D; a$ w
- (if (/= s "Function cancelled")
) y! Z0 r+ p- u9 U& G! d7 y - (princ (strcat "\nError: " s))
3 M8 z2 R5 r! K' m( P. o - ): {; `3 u( F9 o
- (if olderr (setq *error* olderr)) ; Restore old *error* handler j( B, Y; P5 k Y6 W" [* ^
- (setq flexvar 0)
: O& b+ z$ [+ S5 H3 E, b- u% T# j/ {9 q - (princ)8 s: M' D/ A# V0 ^% g
- )/ Q; C! Z. @4 s. d
- ;;;
, n" X( K8 \+ o- g+ a - ;;; Flexicon call routine S5 e I* \5 ^0 u
- ;;;5 [. W" V: N- e; B
- (defun flexmnu (a)
6 }; }2 v. ` h' i - (if (= flexvar 1)
5 t5 {! C; H' T0 I; L - (command "FLEXICON" (strcat "FLEX" a))
& B0 F' x J2 Z - )
) T7 S0 F- n; O1 j$ o3 s. Z - )' X6 V% w2 s# d* o, q
- 7 P0 d8 }. g& f2 o
- ;;;
" i; A; Y6 W, S1 r - ;;; Get the filtered sel-set.
3 ^7 H2 t2 t) o+ \ - ;;;
4 N" I" ~$ ]" D - ;;;
, y- i4 s; X0 f+ M: | - (defun ssx (/ olderr)
3 w6 ^3 H( u) H" O- T - (gc) ; close any sel-sets
+ I" z* U! _+ N/ p4 q* v4 z - (setq olderr *error* $ ]7 K' Z. _. Y$ ]9 \
- *error* ssx_er / R( u3 y8 m9 b, Z3 q
- )$ v" D- Y5 j, r, J" r. F
- (setq fltr (ssx_fe))
9 j f' w9 Z/ G& i) e# r - (ssx_gf fltr) 2 }* V- o; v4 c- K4 g% i. X
- (if (= flexvar 1)- z& o- ?& w: m; U$ o/ i% I' s
- (progn
4 @6 P H; l3 \1 [ - (prompt "\n \n \nNow select the required EDIT command and (P)revious.")
$ }8 _7 Q* m$ E' d. O2 i! U x2 ^. z6 J - (flexmnu "EDIT")
* g/ B$ m/ F/ U' q M/ E( I - )
u& D3 d( y/ S; ^* F6 \ - (command "p")
) {5 b) F# D2 N3 |, h$ M# r - )1 u0 f1 |$ s& g
- (princ)% P0 x- i' \6 n* K6 Z/ n8 V
- )4 u: ]6 f7 b& L8 s$ A4 `0 i7 v/ S% f
- ;;;/ E# L# x: B( h2 ~( b/ P
- ;;; Build the filter list up by picking, selecting an item to add,! k, b1 m9 E3 z4 B) X; m$ c0 w
- ;;; or remove an item from the list by selecting it and pressing RETURN.
4 M- n' Z% h( {7 R3 v - ;;;
" y+ o" Q' P+ V8 ? - ;;; ssx_gf == SSX_Get_Filters1 X& g0 _0 S; U. b: G& a
- ;;;* a. h, s/ u- t+ k& }
- (defun ssx_gf (f1 / t1 t2 t3 f1 f2), z5 p/ X$ O+ s- Y2 O; w M
- (while
$ D* ? A: ^! i$ R - (progn$ G6 y0 ^$ B$ H% I
- (flexmnu "SSX")7 e" P5 J r: j* ?: b0 A
- (cond (f1 (prompt "\nFilter: ") (prin1 f1)))' T0 O$ P8 H1 M7 s6 Q* q: w$ c
- (initget
4 ]9 W. z- T& m0 C5 ~; A- N+ a% \ - "Block Color Entity Flag LAyer LType Pick Style Thickness Vector")
% z: P, Y. M2 a$ Y - (setq t1 (getkword (strcat: x' I! G* `/ {
- "\n>>Block name/Color/Entity/Flag/"
% r. s0 {2 a0 n7 p: O( e# P - "LAyer/LType/Pick/Style/Thickness/Vector: ")))
8 m) o! t* C% I& N/ R" A3 `3 g - ); }% F# @! t5 H( |
- (setq t2
: K% t- N: j3 [; Z/ A. G$ z - (cond
6 \6 \5 ~4 J* d$ |1 a C; w - ((eq t1 "Block") 2) ((eq t1 "Color") 62)" C( A5 \ v2 ?+ C% D
- ((eq t1 "Entity") 0) ((eq t1 "LAyer") 8)
. y9 I" C9 ?, f; R9 }2 x - ((eq t1 "LType") 6) ((eq t1 "Style") 7)
/ o8 x/ b$ _; P9 \* @) o - ((eq t1 "Thickness") 39) ((eq t1 "Flag" ) 66)
1 p2 \6 o3 e+ C# ~, F% ^: U - ((eq t1 "Vector") 210)) K# Q/ b) P; H% x, u0 l' q
- (T t1)7 s+ N- n2 i8 p! a/ A0 Y
- )+ T4 F! ]8 u0 n* `% W( X8 Z
- )+ X h# J( Z9 d1 F
- (setq t39 d7 C2 a6 G$ o' l
- (cond
2 i" i, Y: \2 L0 K - ((= t2 2)
1 r% m! @: V% k# j2 u- g" z - (if (= flexvar gtads 1)
7 C6 [! A/ G1 e2 L6 @4 l' ]6 Z - (progn9 n* h! A' l f- p J# O
- (prompt "\n>>Block name to add/<RETURN to remove>: ")6 e$ E( i; U( @6 ?. Y
- (gttable "BLOCK")
) Z; F& k7 _/ `% `$ i - )) D* t& }7 W4 r
- (getstring "\n>>Block name to add/<RETURN to remove>: ")
+ E" P9 U- ]' A5 f1 R: x$ R - )
, ?% F/ c3 _3 H& d7 Z* |6 c - )
# ~ A& I; _: [2 z1 E# { - ((= t2 62) (initget 4 "?")! u! r$ n9 \, a8 Z) N
- (cond/ ~* A! q! l# p- l% }( E
- ((or (eq (setq t3 (getint ' S. s% G7 S0 z8 J2 h7 k
- "\n>>Color number to add/?/<RETURN to remove>: ")) "?")
8 t$ k: G( T% c" u t2 ] - (> t3 256))
$ v- P* l8 K2 K! `" h T1 s3 y - (ssx_pc) ; Print color values.. B3 _8 k1 E! M4 [9 j
- nil
: `5 b# L1 T3 v8 ?3 v; @ - )' S O ^, G# s7 l
- (T L# C, j ~ H. v" X& ]3 r
- t3 ; Return t3.
5 ]0 T8 D( K. r( n. E, F7 z- S9 x; D& O - )
+ g: ~3 F; `6 o; B, Q3 A/ n - )
% A% F0 |1 q6 U - )
4 N3 q6 ^6 l! o& o9 T - ((= t2 0) (getstring "\n>>Entity type to add/<RETURN to remove>: "))
8 U. W1 ^5 \! t - ((= t2 8)
3 w2 a# U( V& p9 _# m - (if (= flexvar gtads 1)
( F d+ k x& f - (progn+ j1 n( r6 I$ D8 {2 M8 A
- (prompt "\n>>Layer name to add/<RETURN to remove>: ") Z3 X: c7 T' }: a4 }
- (gttable "LAYER")1 S2 {& ?; e' I4 v
- )) q- k* N! D, P
- (getstring "\n>>Layer name to add/<RETURN to remove>: "): e( b4 ] T$ q6 x9 p- L( F9 i
- )
! e9 A7 e# [4 B4 f. j - )3 X/ c, {% ]( Q; ?9 ~2 _) d8 U
- ((= t2 6)
! N2 ~! D2 X# h! O. ^ X - (if (= flexvar gtads 1)
' u4 B! X) j/ | D% A: P* _( ~ - (progn
0 h! h+ U/ y4 |. O' Y - (prompt "\n>>Linetype name to add/<RETURN to remove>: ")
8 v' x, @6 y* C6 R: f1 E' z9 j - (gttable "LTYPE")5 h& D, n+ } Q
- )
" Z- e1 w$ B# q5 N - (getstring "\n>>Linetype name to add/<RETURN to remove>: ")6 E( w/ T. X' ]. P9 j( o" Q5 b% E
- ). f8 s& o$ f( {# ]
- )! L- V, V. c, H% t9 m5 Q' W
- ((= t2 7) $ M/ d/ t9 |9 g" b9 |! v+ ^
- (if (= flexvar gtads 1)6 O; ]- v; @9 A8 k7 B
- (progn
6 H. w0 i" L+ r+ \ - (prompt "\n>>Text style name to add/<RETURN to remove>: ")
; V- m# {! l; T8 q: i0 Q7 m/ u( L9 Y - (gttable "STYLE"). T1 \( s6 F$ [) q! }, b
- )
9 ^% N6 w4 ^0 t# _7 O$ W) D - (getstring "\n>>Text style name to add/<RETURN to remove>: ")
& ~/ I; |7 ^5 s, F - ). w8 T0 y2 A$ p; H, F# k9 G, k2 \6 q6 R
- )
6 E$ G% Z( {: K9 n8 X+ h - ((= t2 39)
7 A' q0 L L6 M9 D - (prompt "\n>>Thickness to add/<RETURN to remove>: ")
% v/ z1 m# r( ^% u7 | - (if(= flexvar gtads 1)(gtfnum"Thickness to add:")(getreal))7 J- U. D. x; \$ z# p
- )# ~6 ?8 u' u2 h ]' S$ H% {6 c5 ~
- ((= t2 66) (if (assoc 66 f1) nil 1))
+ A' U/ z6 e# O5 v - ((= t2 210)
& Z! Q0 @3 ?' H% V' \: s - (getpoint "\n>>Extrusion Vector to add/<RETURN to remove>: ")7 O' [, [8 Z7 J" n E$ r6 l4 `/ J
- )
}5 `, C; u. x) g - (T nil), S! }3 ~. z6 R' \6 y+ W: \: b/ _
- )
$ `+ I5 l# x9 C' M - )) v L; I* R d6 \! ?! T
- (cond
3 ?3 ^/ p% `% }4 O7 B* p - ((= t2 "Pick") (setq f1 (ssx_fe) t2 nil)) ; get entity
3 I4 E: t: ^8 ~; H3 K - ((and f1 (assoc t2 f1)) ; already in the list1 v( k4 Y% @* L/ z# f) y% e
- (if (and t3 (/= t3 ""))7 S1 h g( T5 |9 c! _- n: S
- ;; Replace with a new value... 0 x/ z6 _4 }: X- D
- (setq f1 (subst (cons t2 t3) (assoc t2 f1) f1))
* F6 N- o6 G7 d/ s T" U, t - ;; Remove it from filter list...9 C9 x5 b% I; E2 ~5 F$ g8 z: W
- (setq f1 (ssx_re (assoc t2 f1) f1))
2 A9 C+ r8 E2 F t% \) N; T: r - )
9 @& |: U, A/ U7 S$ P2 z- ` - )
) R& Q: s1 z3 D4 o2 Q - ((and t3 (/= t3 ""))& q$ E% r8 h: ]( j
- (setq f1 (cons (cons t2 t3) f1))% m( a" p: J& j% u+ h' m
- ), \# T- F% r9 P3 D& d9 w* W" S
- (T nil)8 n" R1 [$ h3 c, n# Z2 v, O
- )
, C7 B' b0 E6 T, o% b; i* p - )
" j% m! [. M' y - (if f1 (setq f2 (ssget "x" f1))). \# O; v U- X' p& y3 ]
- (setq *error* olderr)4 ^+ T, M P) h3 ?: l9 z
- (if (and f1 f2) % @0 W1 v7 Z0 X4 C( Y0 _
- (progn
2 P$ K; v6 F4 H* P! B& K - (princ (strcat "\n" (itoa (sslength f2)) " found. "))+ K: ?4 C p7 |- U/ b3 P
- f2
3 r' H5 n( { p9 B; }% A - ), f1 H1 ~8 R f* @, H) D
- (progn (princ "\n0 found.") (prin1))" R3 ]. U v6 i; M
- ): W# x( a7 V6 Q
- )
7 [$ W3 U: s% I9 y - ;;;4 _6 `1 [9 ^) V6 ]) D' |
- ;;; Print the standard color assignments.
4 c+ K8 Y& ?+ p# x; m' a+ K - ;;;4 W2 k+ U- x5 v- A/ F* W
- ;;;
! l3 D0 ]: ~& q( @+ Y$ {, v) a - (defun ssx_pc ()) r* ?8 |1 w( W# ~' J
- (if textpage (textpage) (textscr))
6 U. F7 y6 y* z - (princ "\n ")
% _# m. T9 d2 o; {4 b - (princ "\n Color number | Standard meaning ")
$ Z- z. Z3 o5 s# _7 h @; g. l - (princ "\n ________________|____________________")$ W7 m% g0 S% r" R2 P) o0 }) ^9 q
- (princ "\n | ")
- e0 n. v* R( s9 h5 @2 } - (princ "\n 0 | <BYBLOCK> ")
4 i6 }, G' @# `, W) d% ` - (princ "\n 1 | Red ")2 B" a6 T- n: z( x
- (princ "\n 2 | Yellow ")
' J _, @% ?5 S6 ~! q A - (princ "\n 3 | Green ")9 T3 y& I' w' W3 \& x) i
- (princ "\n 4 | Cyan "): T3 S- B+ W1 S7 |9 z0 B7 g
- (princ "\n 5 | Blue ")! ]6 C( c, @; V& Z# X5 A4 L
- (princ "\n 6 | Magenta ")
) O( d3 V* u; P, r! T# X& V; E; ^# ^ - (princ "\n 7 | White ")3 p* h( u8 {, R/ ?
- (princ "\n 8...255 | -Varies- ")8 m4 G: K, d; ]/ ]2 P& ?- z& M0 a
- (princ "\n 256 | <BYLAYER> ")
1 E! [* b- x8 N2 i" u& A- Z: t1 m - (princ "\n \n\n\n")
, |; Y1 ~8 w+ S3 b; [/ g - )
: D: s6 l' F! D: i3 C& A - ;;;: C( g5 J, G' ?* m8 y. h5 U. U
- ;;; C: function definition.
$ z5 Y& c& w+ V: ?% w! j# Z, l - ;;;
: Y9 i. b( C- @! X - (defun c:ssx () (ssx)(princ))
9 j! v/ A7 y( D' `. Q/ @& r& L; u1 V) r - (princ "\n\tType \"ssx\" at a Command: prompt or ")
) F% z, K4 X0 d7 T5 Z2 N - (princ "\n\t(ssx) at any object selection prompt. ")" N7 J# i; d* J* V4 s* Y
- (princ)
7 F' S2 f0 p; {
5 R0 M) a* _/ l _2 K8 i- ;;;--------------------------------------------------------------------------;+ F4 Z; g5 ?% E) y4 @* l' G
- ;;;--------------------------------------------------------------------------;
. A* G3 U& A! u$ }- Z+ } - ;;;--------------------------------------------------------------------------;" D1 P! x, N0 p: d2 I
- (defun S::STARTUP ()
% t" X$ q- E: i4 Y1 R - (setvar "cmdecho" 0)
, z' A# c1 @% @# e4 x' n5 p - (setvar "cmdecho" 1)
; z; L- U5 a( A4 U0 H - (setvar "LTSCALE" 10)
! e1 { h$ h* x - ' `7 z% `8 R1 d* ^( L8 [9 M+ y
- ;(command "_load" "chenKH.fas")
6 U) ?0 U- f/ G - ;(command "_load" "ctcot.fas")
9 s% r4 A; O9 W, E' @4 A! L - ;(command "_load" "damdoc.fas"), t4 K, O3 ~% Y) V
- ;(command "_load" "ghichu.fas")% X9 F5 {$ P5 j4 {. _
- ;(command "_load" "hamtutao.lsp")
# x! S3 F5 }$ p% L - ;(command "_load" "KHOITAO.fas")
x: e: @0 h6 u( ~4 A8 T - ;(command "_load" "KHthep.fas")
6 b) U6 ^5 q! }% x8 `; V/ t: Z$ a - ;(command "_load" "mbmong.dcl")
# H7 Q9 S' w: ^7 L - ;(command "_load" "mbmong.fas")
. k" @9 w& i& K8 ? - ;(command "_load" "mccot.fas")" v- Q- V* ^5 W& g. M. B. |/ l2 u4 k
- ;(command "_load" "mcdam.fas")
' I; |. Q' f2 M3 C- ] - ;(command "_load" "mcmong1.dcl")
( r$ W; H% }; o3 \5 _7 E - ;(command "_load" "mcmong1.fas")
" D& o' {: C I- C* s - ;(command "_load" "mcmong2.dcl")
4 G# r1 r0 Q% J: @8 [/ s- n - ;(command "_load" "mcmong2.fas")
) T$ y6 ]7 ^$ ]( H3 G* ^5 J# `# u - ;(command "_load" "mcmong3.dcl")
6 d% C' g2 i% {% P - ;(command "_load" "mcmong3.fas")
7 m, ^9 z/ l7 q+ D - ;(command "_load" "mcsan.fas")( v& R3 p+ a5 D9 L- ?& a
- ;(command "_load" "thepdai.fas")
) |( R9 q% @9 b f - ;(command "_load" "thepdoc.fas")) u7 J9 I1 i, [2 X8 x* C7 J
- ;(command "_load" "thepmb.fas")- h$ W1 K% S( g- x. H
- ;(command "_load" "thepphbo.fas")1 s' p6 d& }4 K2 S% v! j9 j/ f
- (command "_script" "thongso.scr")
6 l. Q. y4 i& W+ h5 S! w) K+ X - ;(command "_load" "thongso1.dcl")
f3 _6 e6 I: a9 o$ i - ;(command "_load" "thongso1.fas")" X1 L6 q3 |1 q3 Q
- ;(command "_load" "thongso2.dcl")2 _/ u. L8 n& E
- ;(command "_load" "thongso2.fas")6 Z$ X6 }0 \5 K2 d
- ;(command "_load" "tietdien.fas")
) s) I' }) x+ _/ t - ;(command "_load" "vehan.fas")* }. `6 B9 c2 G1 j) F% ~9 e
- (command "_load" "phamDuy782006_TKT.lsp")2 y5 S$ _& d w/ o E
- (command "_load" "phamduy782006ganhtd.lsp")) y5 p) B; W# k H6 L' M) W
- (command "_load" "phamduy782006ganhtds.lsp")
9 R8 S4 k& K3 }' N+ X - (command "_load" "phamduy782006htd.dcl")
6 D+ e# H9 B- _ - (princ)
" N1 g$ `( y" G# x. q. E - )
- g e5 ]& {) O% x/ N% X - 2 ?+ {; B1 q4 ]* y
- ;; Silent load.
) L% x% |) c; d Z1 _6 ? - (princ)
6 r" R- {+ \- L- R+ f) |+ Z" `8 a4 G - & s+ H% X$ ?# W9 V4 s* h7 c8 ]
- 5 `2 f. l1 O; s7 R/ A+ K; R$ p' Y
- ;; Silent load for the Express Tools.
4 G1 u% N' a2 O7 ?1 p* b" t - ;; Altering this line will affect Express Tools functionality( C i' g5 r8 I1 O% C" e
- (load "acettest.fas" (princ))! p: q) T- y) T% I+ e, f7 [
- �32
Sao chép mã # p2 @9 r) H$ Z1 \% V1 j( f2 H
00st Cách Thêm Menu & Lisp Vẽ & Fonts Chữ mở Gõ Chữ Administrator để Gõ
5 `1 R/ t8 b% r9 D$ X6 ?6 j |
|