Apply automatic (script) operation without user interaction

131 views Asked by At

I have a probably rather simply to solve (Auto-)LISP problem to solve. I have a script which works fine basically, but it requires me to manually select objects (texts in my case) and hit enter.

I want to select all text objects from all layers, and apply the same TCIRCLE operation on all of them. This command should later be applied with a script to automate imports, that's why there must be no manual interaction.

This is the working basic script which requires manual selection:

(defun c:MyTcircle ( / ss)
    (if (not bns_tcircle) (load "acettxt.lsp"))
    (if (setq ss (ssget '((0 . "TEXT,MTEXT,ATTDEF"))))
        (bns_tcircle ss "Variable" "Rectangles" "" 0.35)
    )
    (princ)
)

I've tried to create a filter collection with setq sset for the same type filters as above. But it doesn't do anything (no error but also no changes). So either my collection is empty, or the command isn't called right.

I'm new to AutoLisp, what am I missing that it doesn't work as expected on the filtered items?

1

There are 1 answers

0
Miiir On

You need to add a filter to your selection set. Simply adding a comma between the different entity types just gives you a malformed entity.

Take a look here for some information to get you started: http://www.afralisp.net/autolisp/tutorials/selection-set-filters.php