我似乎无法让这三个文本项不是一个在另一个之上:x
我已经拿了这个基本文件,并试图用它做一些更详细的事情,它也有同样的问题,但这段代码自1/20以来一直没有被修改过,所以我想知道它是一个系统变量还是什么。即使是在一月份,每隔一段时间,3个文本对象中的一个会在其他文本对象的附近或多段线的顶点处执行自己的操作。我很困惑。
;adapted from code from Jeffery P. Sanders(defun C:GA() ;turn the system echo off (setvar "cmdecho" 0) ;UNITS AND PRECISION (setvar "LUPREC" 0) (setvar "LUNITS" 2) (setvar "mtextcolumn" 0) ;layer settings(if(not(tblsearch "layer" "A-FLOOR-IDEN"))(command "-layer" "m" "A-FLOOR-IDEN" "C" "GREEN" "A-FLOOR-IDEN" "")())(if(not(tblsearch "layer" "A-ANNO-NOTE"))(command "-layer" "m" "A-ANNO-NOTE" "C" "8" "A-ANNO-NOTE" "")())(if(not(tblsearch "layer" "A-AREA-IDEN"))(command "-layer" "m" "A-AREA-IDEN" "C" "YELLOW" "A-AREA-IDEN" "")()) ;set up a variable to hold the area (while T (setq myArea 0) (setq SpaceType 0) ;select one object (setq ent(entsel)) (if (car ent) (progn ;find the area of the polyline (command "area" "Object" (car ent)) (setq x (getvar "Area")) (if(setq pt1(getpoint "\n Insertion Point: ")) (progn(SETVAR "CLAYER" "A-FLOOR-IDEN") ;SETS AREA in Square foot TEXT LAYER CLAYER VARIABLE TO A-FLOOR-IDEN(command "mtext" pt1 "@6,0" (strcat (rtos x 2 2) " sq ft")"") (SETVAR "CLAYER" "A-ANNO-NOTE") ;SETS OFFICE TYPE TEXT LAYER CLAYER VARIABLE TO A-ANNO-NOTE(setq SpaceType(getstring T "\n Enter Space Type ")) (command "mtext" (polar pt1 (* pi 1.5) (* 1.5 (getvar "textsize"))) "@6,0" (strcat SpaceType)"")(SETVAR "CLAYER" "A-AREA-IDEN") ;SETS OFFICE TYPE TEXT LAYER CLAYER VARIABLE TO A-AREA-IDEN(setq n (+ n 1))(command "mtext" (polar pt1 (* pi 1.5) (* -1.5 (getvar "textsize"))) "@6,0" (strcat (rtos n 2 0))"") ) ) ;close the if progn for point selection ) ;close the if ) ;close the if progn for object selection ;close the if progn for space type ;close the if progn for room # ) ;close the if statement) ; ends repeat ;reset the system echo variable (setvar "cmdecho" 1) ;supress the last echo (princ)