While not displayed

Discussion in 'AutoCAD' started by Adesu, Aug 4, 2004.

  1. Adesu

    Adesu Guest

    I've added program while on my code,but it program can not display,what
    wrong in my lisp,can somebody help me,thanks
    Best regards
    Ade Suharna

    ; Regis is Registration of drawing from drawing sheet to database (under
    construction)
    ; Design by Ade Suharna
    ; March 24, 2004
    ; Edit by Ade Suharna 13 July 2004
    ; Ade Suharna 04 August 2004 1).
    (defun c:reg()
    (setq oldosmode (getvar "osmode")) ; get osmode setting
    (setvar "osmode" 0) ; osmode set to 0
    (setq oldcmdecho (getvar "cmdecho")) ; get cmdecho setting
    (setvar "cmdecho" 0) ; cmdecho set to 0
    (vl-load-com) ; to automatic call
    (while
    (setq loc (entsel "\CLICK TEXT WOULD YOU CHANGE: ")
    deg (getstring "\nENTER NEW TEXT FOR REPLACE IT: " T)); 1).
    (progn
    (setq tex "TEXT"
    listpos (entget (car loc))
    degpos1 (cdr (assoc 1 listpos))
    texs (cdr (assoc 0 listpos)))
    (if loc (cond ((/= tex texs)(princ "YOUR CHOOSE OBJECT INVALID"))
    ((= tex texs)
    (progn
    (setq degpos2 deg)
    (setq ed
    (subst
    (cons 1 degpos2)
    (assoc 1 listpos) listpos))
    (entmod ed)
    (entupd listpos)
    ))))loc))
    (setvar "osmode" oldosmode) ; return setting
    (setvar "cmdecho" oldcmdecho)
    (princ)
    )
     
    Adesu, Aug 4, 2004
    #1
  2. Adesu

    Fatty Guest

    ;Hi, Ade!
    ;I'd check error and correct your prog:
    (defun c:reg()
    (setq oldosmode (getvar "osmode")) ; get osmode setting
    (setvar "osmode" 0) ; osmode set to 0
    (setq oldcmdecho (getvar "cmdecho")) ; get cmdecho setting
    (setvar "cmdecho" 0) ; cmdecho set to 0
    (vl-load-com) ; to automatic call

    ;|(vl-load-com) useless in current routine|;

    (while
    (setq loc (entsel "\CLICK TEXT WOULD YOU CHANGE: ")
    deg (getstring "\nENTER NEW TEXT FOR REPLACE IT: " T)); 1).
    (progn
    (setq tex "TEXT"
    listpos (entget (car loc))
    degpos1 (cdr (assoc 1 listpos))
    texs (cdr (assoc 0 listpos)))
    (if loc (cond ((/= tex texs)(princ "YOUR CHOOSE OBJECT
    INVALID"))
    ((= tex texs)
    (progn
    (setq degpos2 deg)
    (setq ed
    (subst
    (cons 1 degpos2)
    (assoc 1 listpos) listpos))
    (entmod ed)
    (entupd (car loc));error breakpoint

    ;|AcadHelp: (entupd en) ; Regenerates !entity!/text entity is (car loc))|;

    ))))loc))
    (setvar "osmode" oldosmode) ; return setting
    (setvar "cmdecho" oldcmdecho)
    (princ)
    )
    (c:reg)

    ;By the way, this likes me more:

    (while
    (setq en (car (entsel)))
    (command "_.select" en "")
    (command "_.ddedit" en "" pause "" "")
    );voila'


    ;;;Best regards,
    ;;;Fatty
     
    Fatty, Aug 4, 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.