Pither Rukka 发表于 2022-7-6 10:07:11

显示并指出非原件

大家好,
你有一个lisp进行检查,并指出非原始尺寸选择(例如,改变文字为其他颜色),因为有时我有图纸,我只会检查改变尺寸,而不是改变对象。。。请

pBe 发表于 2022-7-6 10:14:50

您是否属于dimesnon覆盖?
 
试试这个
 

(defun c:test (/ sel objects)
(vl-load-com)
(cond
   ((setq sel (ssget "_X" '((0 . "DIMENSION"))))
    (setq objects (mapcar 'cadr (ssnamex sel)))
    (setq overides_selectopn
    (mapcar
      '(lambda (u)
(if
    (not (assoc -3 (entget u '("ACAD"))))
   (setq objects (vl-remove u objects))
)
       )
      objects
    )
    )
    (princ (strcat (itoa (length objects))
   " dimensions with overrides"
    )
    )
   )
)
(princ)
)

Lee Mac 发表于 2022-7-6 10:17:28

(sssetfirst nil (ssget "_X" '((0 . "*DIMENSION") (-4 . ""))))

Least 发表于 2022-7-6 10:25:26

查找任何“伪造”尺寸,并自动将其更改为一个名为fudged-DIMS的图层。
 
;;;
;;;FUDGE.LSP   Version 1.0
;;;
;;;Copyright (C) 1996 by Jay Garnett
;;;
;;;Permission to use, copy, modify, and distribute this software
;;;for any purpose and without fee is hereby granted, provided
;;;that the above copyright notice appears in all copies and
;;;that both that copyright notice and the limited warranty
;;;below appear in all supporting documentation.
;;;
;;;JAY GARNETT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
;;;JAY GARNETT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
;;;MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. JAY GARNETT
;;;DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
;;;UNINTERRUPTED OR ERROR FREE.
;;;
;;;DESCRIPTION
;;;Finds any "fudged" dimensions and automatically changes them to a layer called FUDGED-DIMS.
;;;
;;;By Jay Garnett
;;;Bolingbrook, IL
;;;
;;;E-Mail jgarnett@enteract.com
;;;

(defun c:FUDGE(/ DIM-TXT E1 FUDGED IDX SS)
(setq SS(ssget "x" '((0 . "DIMENSION")))
      IDX 0
)
(while (< IDX (sslength SS))
    (setq E1(entget( ssname ss IDX )))
    (setq DIM-TXT(cdr(assoc 1 E1)))
      (if (and(not(wcmatch DIM-TXT "*<>*"))(/= DIM-TXT ""))
      (if (not FUDGED)
          (setq FUDGED(ssadd (ssname SS IDX)))
          (setq FUDGED(ssadd (ssname SS IDX) FUDGED))
      )
      );end if
    (setq IDX (1+ IDX))
);end while
(if FUDGED
    (progn
      (if (not(tblsearch "layer" "FUDGED-DIMS"))
      (command ".layer" "M" "fudged-dims" "c" "magenta" "" "")
      );end if
      (command ".change" FUDGED "" "p" "la" "fudged-dims" "")
      (alert (strcat (itoa(sslength FUDGED)) " fudged dimensions changed \nto Layer FUDGED-DIMS"))
    );end progn
    (alert "No fudged dimensions found in this drawing")
);endif
);end defun

Pither Rukka 发表于 2022-7-6 10:25:44

谢谢pBE,
我的意思是,例程可以搜索已更改的维度(原始值已删除),然后对其进行签名(dimtext为其他颜色,例如,我的原始dimtext=红色,-->如果不是原始值,则将其更改为绿色)。
 
谢谢

Lee Mac 发表于 2022-7-6 10:34:46

 
大概
 

(defun c:FindDodgyDims ( / ss ) (vl-load-com)

(if (setq ss (ssget "_X" '((0 . "*DIMENSION") (1 . "*?*"))))
   (
   (lambda ( i / e )
       (while (setq e (ssname ss (setq i (1+ i))))
         (vla-put-TextColor (vlax-ename->vla-object e) acgreen)
       )
   )
   -1
   )
)

(princ)
)

pBe 发表于 2022-7-6 10:38:56

 
确实如此。
只有我的代码比李的长
您是否希望它也恢复为原始文本值,而不仅仅是更改颜色?
为了使其更具挑战性,显示低于原始值的“捏造”维度?
 
您是否将其用于错误/标准检查?

Pither Rukka 发表于 2022-7-6 10:40:24

谢谢大家。
 
谢谢李,你的动作很完美,做得很好。。。。。我是

Lee Mac 发表于 2022-7-6 10:48:28

乐意帮忙:眨眼:

Pither Rukka 发表于 2022-7-6 10:51:21

对不起,我忘了什么。。。
我尝试开发您的代码(FindDodgyDims),使非原始选定的也放背景色(dimtfillclr=白色),这样我们可以很容易地看到结果。
 
我尝试添加代码“VLA-PUT-TEXTWINBACKGRNDCOLOR”
 
但没有工作。。(因为我还是初学者)
 
你能给我一个正确的程序来添加背景文字吗。
页: [1] 2
查看完整版本: 显示并指出非原件