PDA

View Full Version : Text value filter


youngsoo
2007-10-17, 06:14 AM
I'm sorry.
I have to study hard English.
If you find any errors in my English,please correct them.

I don't know how to command ;;; (setq ss1 (ssget (list (cons 1 x)))).
How can I do?

Text value filter

(defun c:qts(/ ss ed tex texlist k sslist ss1 j sslist p1 p2 os)

(setq os (getvar "osmode"))
(setvar "osmode" 0)

(setq k 0 texlist nil sslist nil)

(prompt "\nselect text:")

(setq ss (ssget '((0 . "*TEXT"))))

(setq sslist (ssadd))

(repeat (sslength ss)
(setq ed (entget (ssname ss k))
tex (list (cdr (assoc 1 ed))))
(setq texlist (append texlist tex))
(setq k (1+ k))
);repeat


(setq p1 (getpoint "\nFirst rectangle point : ")
p2 (getcorner p1 "\nOpposite corner : " ))

(foreach x texlist

(progn (setq ss1 (ssget "c" p1 p2 (list (cons 1 x))))

;;;(progn (setq ss1 (ssget (list (cons 1 x))))


(setq j 0)

(repeat (sslength ss1)
(setq sslist (ssadd (ssname ss1 j) sslist))
(setq j (1+ j))
);repeat
);progn
):foreach

(sssetfirst nil sslist)


(setvar "osmode" os)
(princ)
);defun

'gile'
2007-10-17, 10:24 AM
Hi,

(setq ss1 (ssget (list '(0 . "*TEXT") (cons 1 x))))

CAB2k
2007-10-17, 09:11 PM
While you can use (cons 1 x) to match text values I think there will be problems
with upper & lower case. And most certainly with any mtext formating characters.

Your best bet is to ssget the text and then use strcase and wcmatch to verify a match.

If you could explain i more detail what you are trying to do perhaps someone could better
assist you in the code needed.

youngsoo
2007-10-29, 09:44 AM
Please, modify all problems here.

Please solve the problem of :
(prompt "\nSelect objects: or < all >: ")

(progn
(if (not (setq ss1 (ssget (list '(0 . "*TEXT") (cons 1 x))))
(setq ss1 (ssget "X" (list '(0 . "*TEXT") (cons 1 x))))
)



(defun c:qts(/ ss ed tex texlist k sslist ss1 j sslist p1 p2 os)

(setq os (getvar "osmode"))
(setvar "osmode" 0)

(setq k 0 texlist nil sslist nil)

(prompt "\nSelect Filtering Text Value:")

(setq ss (ssget '((0 . "*TEXT"))))

(setq sslist (ssadd))

(repeat (sslength ss)
(setq ed (entget (ssname ss k))
tex (list (cdr (assoc 1 ed))))
(setq texlist (append texlist tex))
(setq k (1+ k))
);repeat

(foreach x texlist


(prompt "\nSelect objects: or < all >: ")


(progn

(if (not (setq ss1 (ssget (list '(0 . "*TEXT") (cons 1 x))))

(setq ss1 (ssget "X" (list '(0 . "*TEXT") (cons 1 x))))
)


(setq j 0)

(repeat (sslength ss1)
(setq sslist (ssadd (ssname ss1 j) sslist))
(setq j (1+ j))
);repeat
);progn
):foreach

(sssetfirst nil sslist)


(setvar "osmode" os)
(princ)
);defun