669423907 发表于 2018-8-2 17:46:59

如何过滤掉文字内容为 ※ 的文字?

以下是我写的:
(defun c:13()
(setq ss (ssget "i" '((0 . "~xline")(0 . "~ray"))))
(setq s1 (ssget ":s" '((0 . "*text")(1 . "※"))))
(command "select" ss "r" s1 "")
(setq s2 (ssget "P"))
(sssetfirst nil s2)
)

请问
有没有更好的办法,把两个过滤器整合为一个呢?

tryhi 发表于 2018-8-2 17:47:00

(setq s2 (ssget '(
                                                                       (-4 . "<OR")
                                                                       (-4 . "<AND")
                                                                       (0 . "~xline")
                                                                       (0 . "~ray")
                                                                       (0 . "~*text")
                                                                       (-4 . "AND>")
                                                                       (-4 . "<AND")
                                                                       (0 . "*text")(1 . "~※")
                                                                       (-4 . "AND>")
                                                                       (-4 . "OR>")
                                                                       )))

669423907 发表于 2018-8-2 22:41:03

tryhi 发表于 2018-8-2 20:39
(setq s2 (ssget '(
                                                                       (-4 . "")
                                                                       )))

谢谢大海大师

669423907 发表于 2018-8-2 22:50:52

tryhi 发表于 2018-8-2 17:47
(setq s2 (ssget '(
                                                                       (-4 . "")
                                                                       )))

请问如果要再加个图层呢?比如0层上※

669423907 发表于 2018-8-3 09:06:14

本帖最后由 669423907 于 2018-8-3 09:09 编辑

(-4 . "<or")
(-4 . "<and")
(0 . "~xline")
(0 . "~ray")
(0 . "~*text")
(-4 . "and>")
(-4 . "<and")
(8 . "~0")
(0 . "*text")
(-4 . "and>")
(-4 . "<and")
(0 . "*text")(1 . "~※")
(-4 . "and>")
(-4 . "or>")
:handshake
页: [1]
查看完整版本: 如何过滤掉文字内容为 ※ 的文字?