pinkguju 发表于 2022-7-6 10:56:45

如果是这样,那么我的原始代码应该可以工作

Lee Mac 发表于 2022-7-6 11:02:26

我尝试了原始代码,它给了我相同的结果。列出文件中的所有内容,而不是不在文件中的内容。不在文件中的也会出现在列表中。

pinkguju 发表于 2022-7-6 11:03:35

刚刚测试了程序,对我来说似乎很好。。
 
在DIM上测试,例如。。。
 

Lee Mac 发表于 2022-7-6 11:07:05

字符串中有引号。
 
一旦所有字符串(“001”到“210”)都得到验证,我就有了一个脚本,可以将它们转换为文本。
 
如果我的数字没有引号,那么转换文本就不起作用。

pinkguju 发表于 2022-7-6 11:09:35

像这样的东西怎么样?
 
1

Lee Mac 发表于 2022-7-6 11:12:52

pinkguju 发表于 2022-7-6 11:18:16

I tried the original code and it's giving me the same result. Listing all the one that are in the file, as opposed to the ones that are not in the file. The ones that are not in the file are also coming up in the list.

Lee Mac 发表于 2022-7-6 11:20:10

Just tested the programs and it seems to work fine for me..
 
Testing on Dims such as...
 

pinkguju 发表于 2022-7-6 11:21:38

The strings have the quotation marks in them.
 
Once all strings ("001" to "210") have been verified i have a script that turns them into text.
 
if i have numbers without the quotes then the conversion text doesn't work.

alanjt 发表于 2022-7-6 11:27:43

What about something like this?
 

(defun c:Test (/ ss) (vl-load-com) (if (setq ss (ssget "_X" '((0 . "DIMENSION") (-4 . ""))))   ((lambda (i n / lst e)      (while (> (setq n (1- n)) 0) (setq lst (cons n lst)))      (while (setq e (ssname ss (setq i (1+ i))))      (setq lst (vl-remove                  (atoi (vl-list->string                            (vl-remove 34 (vl-string->list (cdr (assoc 1 (entget e)))))                        )                  )                  lst                  )      )      )      (cond (lst (print lst)))    )   -1   211   ) ) (princ))
页: 1 [2]
查看完整版本: 维度字符串验证