Dtext Error Trap Work Around?

Discussion in 'AutoCAD' started by TJARONIK, Aug 15, 2003.

  1. TJARONIK

    TJARONIK Guest

    Hello all,

    How about this. If I am able to get the dtext that I type into a group(setq XX), and then add a generic error trapping routine with the error trapping routine to restore stystme variables and then erase that group(XX), would that work? I have attatched some code below to kind of show you which direction I am going with this. Note: the error trap is not in there. Just trying to figure out how to get the dtext into a group first. The routine below does not work. hahahahahah

    (defun c:ET ( / DIMSCALE STARTPOINT TXT )
    (setvar "CMDECHO" 1)
    (setq DIMSCALE(getvar "DIMSCALE"))
    (setq STARTPOINT(getpoint "\nPick the CENTER point: "))
    (setq dtxt(command "dtext" "j" "Center" STARTPOINT(* DIMSCALE 0.12500000) "0.00000000"))
    (setq n(1- (sslength dtxt)))
    (while (>= n 0)
    (setq txt(entlast))
    (ssadd entlast txt)
    )
    (command "erase" txt "")
    )

    comments?

    "Catch" Ya Later,
    Tim
     
    TJARONIK, Aug 15, 2003
    #1
  2. TJARONIK

    Mark Propst Guest

    "0.00000000"))

    dtext command does not return a selection set
    try
    (setq dtxt(ssadd));create empty set
    (command "dtext"...
    (setq dtxt(ssadd(entlast dtxt)));put last ent in set
    ;or simply
    (ssadd(entlast dtxt));put last ent in set
     
    Mark Propst, Aug 15, 2003
    #2
  3. TJARONIK

    TJARONIK Guest

    I get a "too many arguments" error
     
    TJARONIK, Aug 15, 2003
    #3
  4. TJARONIK

    Mark Propst Guest

    duh! sorry bout that - misplaced paren...
    try
    (ssadd (entlast) dtxt )
     
    Mark Propst, Aug 18, 2003
    #4
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.