Textmask script creates weird wipeout frames

Textmask script creates weird wipeout frames

Anonymous
Not applicable
1,556 Views
3 Replies
Message 1 of 4

Textmask script creates weird wipeout frames

Anonymous
Not applicable

Hi,

Trying to use the following script to search for all cyan texts within layers starting with "PROV" and create a textmask beneath them and then close the drawing. It all seems to work OK, except for some small issues I was hoping to get some help with.

Attaching a picture of the weird result. Find below the code the Text window prints.

Except for the weird wipeouts, the script doesn't save and close the drawing. Is the script trying to run the "finnishing lines" before the c:textwipe is done? How could I prevent it if so? Include the end lines in the function?

Sincerely,

Fredrik

 

(defun C:textwipe (/ cyantext e i)
(load "textmask")
(setq cyantext (ssget "A" '((0 . "TEXT")(-4 . "<and")(62 . 4)(8 . "PROV*")(-4 . "and>"))))
(setq i 0)
(repeat (sslength cyantext)
(setq e (ssname cyantext i))
(acet-textmask-make-wipeout e 0) ;taken from the textmask lisp, as suggested in other posts
(setq i (1+ i))
(print i)
)
(princ)
)
(command "_.wipeout" "_frames" "_off")
(c:textwipe)
(command "qsave")
(command "quit" "y")

 

 

 

 

(_> (load "textmask")
(_> (setq cyantext (ssget "A" '((0 . "TEXT")(-4 . "<and")(62 . 4)(8 . "PROV*")(-4 . "and>"))))
(_> (setq i 0)
(_> (repeat (sslength cyantext)
((_> (setq e (ssname cyantext i))
((_> (acet-textmask-make-wipeout e 0)
((_> (setq i (1+ i))
((_> (print i)
((_> )
(_> (princ)
(_> )
C:TEXTWIPE

Command: (command "_.wipeout" "_frames" "_off")
nil

Command: (c:textwipe)

1
2
3
4 Unable to create wipeout object.
Unknown command "YES".  Press F1 for help.

5
6
7
8 Unable to create wipeout object.
Unknown command "YES".  Press F1 for help.

9
10
11 Unable to create wipeout object.
Unknown command "YES".  Press F1 for help.

12 Unable to create wipeout object.
Unknown command "YES".  Press F1 for help.

13
14
15 Unable to create wipeout object.
Unknown command "YES".  Press F1 for help.

16 Unable to create wipeout object.
Unknown command "YES".  Press F1 for help.

17
18
19
20
21
22
23
24
25
26
27
28 Unable to create wipeout object.
Unknown command "YES".  Press F1 for help.

29 Unable to create wipeout object.
Unknown command "YES".  Press F1 for help.

30 Unable to create wipeout object.
Unknown command "YES".  Press F1 for help.

31 Unable to create wipeout object.
Unknown command "YES".  Press F1 for help.

32
33 Unable to create wipeout object.
Unknown command "YES".  Press F1 for help.

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48 Unable to create wipeout object.
Unknown command "YES".  Press F1 for help.

49
50
51
52
53
54
55
56
57
58
59

0 Likes
Accepted solutions (1)
1,557 Views
3 Replies
Replies (3)
Message 2 of 4

hmsilva
Mentor
Mentor
Accepted solution

Hi Fredrik

try this revised code.to make wipeouts only if a valid selction set in the current tab exist

 

(defun C:textwipe (/ cyantext e i)
   (if (setq cyantext (ssget "A" (list '(0 . "TEXT") '(-4 . "<and") '(62 . 4) '(8 . "PROV*") (cons 410 (getvar 'ctab)) '(-4 . "and>"))))
      (progn
         (load "textmask")
         (setq i 0)
         (repeat (sslength cyantext)
            (setq e (ssname cyantext i))
            (acet-textmask-make-wipeout e 0) ;taken from the textmask lisp, as suggested in other posts
            (setq i (1+ i))
            (print i)
         )
      )
   )
   (princ "\n")
)
(command "_.wipeout" "_frames" "_off")
(c:textwipe)
(command "qsave")
;(command "quit" "y")

I did comment the quit command, for testing purpose.

 

If the result is the same, post a sample dwg please...

 

Hope this helps,
Henrique

EESignature

Message 3 of 4

Anonymous
Not applicable

Amazing! Worked like a charm!

Will try and understand what you did and why it worked so well.

Thank you,

Fredrik

0 Likes
Message 4 of 4

hmsilva
Mentor
Mentor

@Anonymous wrote:

Amazing! Worked like a charm!

Will try and understand what you did and why it worked so well.

Thank you,

Fredrik


You're welcome, Fredrik
Glad I could help!

If you don't understand something, just ask...

Henrique

EESignature

0 Likes