14
78
64
初露锋芒
;;; EXPLODES LINETYPES INTO INDIVIDUAL COMPONENTS;;;;;; By Dominic Panholzer;;;;;; Modified original TXTEXP.LSP from Express Tools;;; Copyright © 1999 by Autodesk, Inc.;; LINEXP.LSP modifications by XANADU;;;;;; Your use of this software is governed by the terms and conditions of the;;; License Agreement you accepted prior to installation of this software.;;; Please note that pursuant to the License Agreement for this software,;;; "[c]opying of this computer program or its documentation except as;;; permitted by this License is copyright infringement under the laws of;;; your country. If you copy this computer program without permission of;;; Autodesk, you are violating the law.";;;;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE;;; UNINTERRUPTED OR ERROR FREE.;;;;;; Use, duplication, or disclosure by the U.S. Government is subject to;;; restrictions set forth in FAR 52.227-19 (Commercial Computer;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii);;; (Rights in Technical Data and Computer Software), as applicable.;;;;;; ----------------------------------------------------------------;;;;;; External Functions:;;;;;; ACET-ERROR-INIT --> ACETUTIL.FAS Intializes bonus error routine;;; ACET-ERROR-RESTORE --> ACETUTIL.FAS Restores old error routine;;; ACET-GEOM-ZOOM-FOR-SELECT --> ACETUTIL.FAS Zoom boundry to include points given;;; ACET-LAYER-LOCKED --> ACETUTIL.FAS Checks to see if layer is locked;;; ACET-GEOM-PIXEL-UNIT --> ACETUTIL.FAS Size of pixel in drawing units;;; ACET-GEOM-TEXTBOX --> ACETUTIL.FAS Returns the textbox for any text;;; ACET-GEOM-MIDPOINT --> ACETUTIL.FAS Returns midpoint between two points;;; ACET-GEOM-VIEW-POINTS --> ACETUTIL.FAS Returns corner points of screen or viewport;;; ACET-STR-FORMAT --> ACETUTIL.ARX String builder;;; ACET-WMFIN --> ACETUTIL.FAS Brings in WMF file;;;(defun c:linexp (/ grplst getgname blknm FLTR GLST GDICT SS VIEW UPLFT TMPFIL TBX TMPFIL CNT PT1 PT2 ENT TXT TXTYP PTLST ZM LOCKED GNAM vpna vplocked) (acet-error-init (list (list "cmdecho" 0 "highlight" 1 "osmode" 0 "Mirrtext" 1 "limcheck" 0 ) T ) ); --------------------- GROUP LIST FUNCTION ----------------------; This function will return a list of all the group names in the; drawing and their entity names in the form:; ((<ename1> . <name1>) ... (<enamex> . <namex>)); ---------------------------------------------------------------- (defun acet-txtexp-grplst (/ GRP ITM NAM ENT GLST) (setq GRP (dictsearch (namedobjdict) "ACAD_GROUP")) (while (setq ITM (car GRP)) ; While edata item is available (if (= (car ITM) 3) ; if the item is a group name (setq NAM (cdr ITM) ; get the name GRP (cdr GRP) ; shorten the edata ITM (car GRP) ; get the next item ENT (cdr ITM) ; which is the ename GRP (cdr GRP) ; shorten the edata GLST ; store the ename and name (if GLST (append GLST (list (cons ENT NAM))) (list (cons ENT NAM)) ) ) (setq GRP (cdr GRP)) ; else shorten the edata ) ) GLST ; return the list ); ------------------- GET GROUP NAME FUNCTION --------------------; This function returns a list of all the group names in GLST; where ENT is a member. The list has the same form as GLST; ---------------------------------------------------------------- (defun acet-txtexp-getgname (ENT GLST / GRP GDATA NAM NLST) (if (and GLST (listp GLST)) (progn (foreach GRP GLST (setq GDATA (entget (car GRP))) (foreach ITM GDATA ; step through the edata (if (and (= (car ITM) 340) ; if the item is a entity name (eq (setq NAM (cdr ITM)) ENT) ; and the ename being looked for ) (setq NLST ; store the ename and name (if NLST (append NLST (list (cons (car GRP) (cdr GRP)))) (list (cons (car GRP) (cdr GRP))) ) ) ) ) ) ) ) NLST ); ----------------------------------------------------------------; MAIN PROGRAM; ----------------------------------------------------------------