Rtext with Lisp

Discussion in 'AutoCAD' started by MarcelGoulet, Feb 10, 2004.

  1. MarcelGoulet

    MarcelGoulet Guest

    Hi,

    I would like to be able to insert some rtext containing some diesel expression but it seem to not work !

    Is there a special way to do it ?

    That expression doesn't work !
    (setq DIESEL_TEXT "$(getvar,"dwgname")")
    (command ".rtext" "Diesel" DIESEL_TEXTE '(0 0) "")

    Thanks
     
    MarcelGoulet, Feb 10, 2004
    #1
  2. MarcelGoulet

    OLD-CADaver Guest

    Autolisp won't allow re-entry into autolisp.
     
    OLD-CADaver, Feb 10, 2004
    #2
  3. MarcelGoulet

    hawstom Guest

    Could you just as easily do what you need like this?

    (command ".rtext" (getvar "dwgname") "0,0" "")

    The above is perfectly good AutoLISP, but I can't vouch for the rtext command.
     
    hawstom, Feb 10, 2004
    #3
  4. MarcelGoulet

    MarcelGoulet Guest

    I will just use regular text.

    Thanks any way
     
    MarcelGoulet, Feb 10, 2004
    #4
  5. MarcelGoulet

    Doug Broad Guest

    Hi Marcel,
    Some things to note:
    1) you can run rtext within a lisp program but there
    is a limit on the interactivity that is possible.
    a. (C:RTEXT)
    b. (vla-send-command (vla-get-activedocument(vlax-get-acad-object)) "(c:rtext) d ")

    Since a dialog box appears to enter the diesel string, that can't be
    entered via a prepared command string.

    2)Rtext objects can be created with entmake directly
    and so the rtext command is not necessary to create but
    the arx module is necessary to display the rtext.
    (entmake '((0 . "rtext")(10 10.0 20.0 0.0) ......)

    To get a handle on how to make one, use
    (entget(car(entsel))) to see what dxf elements are
    present. Take out the ename and handle objects and
    most of what is left will work.

    Copyright (c) 2004 by D. C. Broad, Jr.
    Don't reproduce except by permission ;-)
     
    Doug Broad, Feb 10, 2004
    #5
  6. Hi Marcel,
    Some things to note:
    ....

    Copyright (c) 2004 by D. C. Broad, Jr.
    Don't reproduce except by permission ;-)




    Do'h!!!
     
    R. Robert Bell, Feb 10, 2004
    #6
  7. MarcelGoulet

    Doug Broad Guest

    <Bwa ha ha>
     
    Doug Broad, Feb 10, 2004
    #7
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.