block insert

Discussion in 'AutoCAD' started by avelazquez, Nov 26, 2004.

  1. avelazquez

    avelazquez Guest

    I found in the web a routine of how to insert a block with attributes and trim the line or pline outside the block. The routine requires DXF and USTR functions, I don't know much about those functions. Could somebody give me a hand, Thanks
    Alfonso
     
    avelazquez, Nov 26, 2004
    #1
  2. avelazquez

    ECCAD Guest

    ;* USTR User interface string
    ;* If BIT=1 no null "" input allowed, 0 for note, BIT ignored if DEF present.
    ;* MSG is the prompt string, to which a default string is added a <DEF> (nil
    ;* or "" for none), and a : is added. If SPFLAG T, spaces are allowed in
    ;* string.
    ;*

    (defun ustr (bit msg def spflag / inp nval)
    (if (and def (/= def ""))
    (setq msg (strcat "\n" msg " <" def ">: ")
    inp (getstring msg spflag)
    inp (if (= inp "") def inp)
    );setq
    (progn
    (setq msg (strcat "\n" msg ": "))
    (if (= bit 1)
    (while (= "" (setq inp (getstring msg spflag))))
    (setq inp (getstring msg spflag))
    ) );progn & if
    );if
    inp
    );defun
    ;*

    ;;
    ;; define dxf function
    ;;
    (defun dxf (code elist)
    (cdr (assoc code elist)); Find assoc pair, strip first element
    ); end function
     
    ECCAD, Nov 26, 2004
    #2
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.