Script within Lisp?

Discussion in 'AutoCAD' started by TCEBob, Jan 2, 2005.

  1. TCEBob

    TCEBob Guest

    The following works:

    (defun c:tmb( / ) ;textmask (to be made into an anonymous block -- thus
    ;stabilizing it so the text remains visible.)
    (while (= sset nil) ;either just started or selection is not as specified.
    (setq sset
    (ssget ":S" '((-4 . "<OR") ;make a selection set of only one object
    (0 . "TEXT")
    (0 . "MTEXT")
    (0 . "DIMENSION")
    (-4 . "OR>"))
    ) ;ssget
    ) ;setq
    ) ;while
    (command "copy" sset "" '(0 0) '(0 0) ;command ;duplicate it
    "erase" sset "" ;remove original, leaving new set as "L"
    "script" "tmsk" ;tmsk.scr must reside on the search path
    ) ;command ;this will mask the selected item.
    ;; more to come . . .
    (princ))

    ;|
    contents of tmsk.scr
    ;run textmask
    TEXTMASK
    ;you have created the text object as Last
    "l"
    ;blank lines for enter enter

    ;end - the following blank line is required

    |;

    However, I really hate to depend on scripts. Can the same be done within vlisp?
    Tried Command and Vl-cmdf without much luck. Maybe I could write out the script
    as a file or check for it, so I know it's in a findable location.

    rs
     
    TCEBob, Jan 2, 2005
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.