Message 1 of 6
ssget logical operator help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good day all,
The following snip on code is throwing the "error: syntax error".
(foreach sL sList (progn (setq tVal (cdr (assoc 1 (entget sL)))) (if (/= (vl-string-search " -" tVal) nil) (progn (setq sVal (substr tVal 1 (- (strlen tVal) 2))) (if (not (setq sFlag (ssget "X" (list '(0 . "TEXT,MTEXT") (cons 1 sVal) '(8 . "TEXT") '(4 . "<OR") '(4 . "=") '(67 . 0) '(4 . "=") (cons 410 (getvar "ctab")) '(4 . "OR>") )))) (setq dList (cons (list sL) dList)) ) ;if ) ;progn ) ;if ) ;progn ) ;foreach
At first, I thought that the problem may be with the (mis)use of the logical operator -4. So, I reworked the code:
(foreach sL sList (progn (setq tVal (cdr (assoc 1 (entget sL)))) (if (/= (vl-string-search " -" tVal) nil) (progn (setq sVal (substr tVal 1 (- (strlen tVal) 2))) (if (and (not (setq sFlag (ssget "X" (list '(0 . "TEXT,MTEXT") (cons 1 sVal) '(8 . "TEXT") '(67 . 0) )))) (not (setq sFlag (ssget "X" (list '(0 . "TEXT,MTEXT") (cons 1 sVal) '(8 . "TEXT") (cons 410 (getvar "ctab")) )))) ) ;and (setq dList (cons (list sL) dList)) ) ;if ) ;progn ) ;if ) ;progn ) ;foreach
...but, this still returned the same error.
Do you guys see the problem?
Thanks!
~Z