entmake

Discussion in 'AutoCAD' started by Jan van de Poel, Dec 15, 2004.

  1. Ok, tried following code several times.
    Will not work from within a routine, does work from the command prompt.

    What am i doing wrong here?
    ********************
    (if (= txt 1) (progn
    (entmake '((0 . "text")(10 4.0 4.0 0.0)(40 . 25.0)(7 . "vdlaar")(8 .
    "txt25")(1 . "My text."))) )
    ); end if 1
    ****** obove fails *****

    ********************
    (if (= txt 1)
    (entmake '((0 . "text")(10 4.0 4.0 0.0)(40 . 25.0)(7 . "vdlaar")(8 .
    "txt25")(1 . "My text.")))
    ); end if 1
    ****** obove fails *****

    ********************
    (cond
    ((= txt 1)
    (entmake '((0 . "text")(10 4.0 4.0 0.0)(40 . 25.0)(7 . "vdlaar")(8 .
    "txt25")(1 . "My text."))) )

    ((= txt 2)
    (entmake '((0 . "text")(10 4.0 4.0 0.0)(40 . 25.0)(7 . "vdlaar")(8 .
    "txt25")(1 . "Other text."))) )
    ); end cond
    ****** obove fails *****

    Could anyone give me an answer to get this stuff working?
    Regards,
    Jan
     
    Jan van de Poel, Dec 15, 2004
    #1
  2. Jan van de Poel

    BillZ Guest

    Make sure your text style exists in the drawing.

    (entmake '((0 . "text")(10 4.0 4.0 0.0)(40 . 25.0)(7 . "STANDARD")(8 .
    "txt25")(1 . "My text.")))

    Works for me here.

    Bill
     
    BillZ, Dec 15, 2004
    #2
  3. Sorry Bill, not for me.
    Style does exist, layer does exist.

    Like i wrote, from command prompt: Yes, from within lisp: No.

    Jan
     
    Jan van de Poel, Dec 15, 2004
    #3
  4. Jan van de Poel

    BillZ Guest

    Where is txt gettting it's value in ((= txt ?

    Bill
     
    BillZ, Dec 15, 2004
    #4
  5. Default is it set to 1
    (setq txt 1)
    Rest follows from the dialogue box:
    (ACTION_TILE "B_60" "(setq txt 1)" )
    (ACTION_TILE "B_90" "(setq txt 2)" )
    (ACTION_TILE "B_120" "(setq txt 3)" )

    Should work, use it in different other progs, first attempt to use entmake
    though.

    Jan
     
    Jan van de Poel, Dec 15, 2004
    #5
  6. Jan van de Poel

    BillZ Guest

    I don't think it's the entmake. After all it works at the command prompt.
    I would look at if the program is getting executed.

    When you close the dialog, what determines if the okay or cancel button is pressed?

    Bill
     
    BillZ, Dec 15, 2004
    #6
  7. You are so right Bill.
    Checked, rechecked, looked over it and still missed it.
    Now i found it.
    A stupid error, to many arguments under an IF statement, added a PROGN and
    it runs.
    <sigh>

    Sorry to bother you with this.

    Have a nice evening, i'm off home now (16.30hours here).

    regards,
    Jan
     
    Jan van de Poel, Dec 15, 2004
    #7
  8. Jan van de Poel

    BillZ Guest

    Sorry to bother you with this.<<<

    If I felt "bothered", I wouldn't have responded to the post. :)

    Have a good evening.

    Bill
     
    BillZ, Dec 15, 2004
    #8
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.