|
发表于 2022-7-6 15:47:41
|
显示全部楼层
Actually, this is better (more options )
[code];;; ============= Namer.lsp =============;;;;;; FUNCTION:;;; Will label a Curve with Piece Code,;;; Module, Direction, Material, and Description;;;;;; PLATFORMS:;;; No Restrictions, only tested on ACAD 2004;;;;;; CURVE COMPATIBILITY:;;; Arcs, Circles, Ellipses, *Polylines,;;; Regions & Splines.;;;;;; AUTHOR:;;; Copyright (c) 04.2009 Lee McDonnell;;; (contact Lee Mac, CADTutor.net);;;;;; VERSION:;;; 1.0 02.04.09;;; 2.0 03.04.09;;; 3.0 03.04.09;;;;;; ======================================(defun c:namer (/ *error* APrec VCol tStyl tSze tLay tCol ptxt detxt cEnt cObj Area motxt dtxt mtxt tStr tBox tWid tHgt ClsPt btPt tpPt pt1 pt2 pt3 pt4 tAngl tObj) (vl-load-com) ;; ===== Adjustments ===== (setq APrec 2) ; Area Precision, integer >= 0 (setq VCol 3) ; Vector Colour, integer (0-255) (setq tStyl "STANDARD") ; TextStyle, if non-existent, Standard. (setq tSze 2.5) ; TextSize, real > 0, if nil, will be Textstyle dependent. (setq tLay "NAME") ; Layer for Text, layer will be created if non-existent (setq tCol 255) ; Text Colour, (255 = ByLayer) ; ======================== ; === Error Prevention === (or (and (eq 'INT (type APrec)) (>= APrec 0)) (setq APrec 2)) (or (and (eq 'INT (type VCol)) ( tSze 0)) (setq tSze (getvar "TEXTSIZE"))) (or tLay (setq tLay "NAME")) (or (and (eq 'INT (type tCol)) (</p> |
|