Entmod/entupd problem

Discussion in 'AutoCAD' started by Blair MacKenzie, Apr 5, 2004.

  1. Still having a problem with entmod/entupd.
    Had a suggestion that I was modifying insert definitions and not block
    definitions.
    Have attempted to modify but again have got stuck.
    The insert definitions are updated again but when a attsync done on block it
    goes back to the original width factor.
    I'm sure it's really simple, but is beyond me. I've tried so many variations
    on the code but am getting nowhere.
    Can anyone please help.

    (defun c:test (/)
    (setq ss1 (ssget "x" '((0 . "INSERT") (2 . "TEST"))))
    (setq name (ssname ss1 0)
    name-l (entget name)
    next (entnext name)
    next-l (entget next)
    name (tblobjname "block" (cdr (assoc 2 name-l)))
    entname (entget name)
    blockrec (cdr (assoc 330 entname))
    )
    (while (/= (dxf 0 next-l) "SEQEND")
    (if
    (= (dxf 2 next-l) "TAG-TEST")
    (progn
    (setq wf 5);width factor for tag tag-test
    (setq next-l (subst (cons 41 wf) (assoc 41 next-l) next-l))
    (entmod next-l)
    (entmod blockrec)
    (entupd blockrec)
    );progn
    (progn
    (setq next (entnext next))
    (setq next-l (entget next))
    );progn
    );if
    );while
    (princ)
    );end defun
    (c:test)
     
    Blair MacKenzie, Apr 5, 2004
    #1
  2. Blair MacKenzie

    zeha Guest

    (defun c:test (/ ss1 name next next-l wf)
    (setq ss1 (ssget "x" '((0 . "INSERT") (2 . "TEST")(66 . 1))))
    (setq name (ssname ss1 0) next (entnext name) next-l (entget next))
    (while (/= (fld 0 next-l) "SEQEND")
    (if (= (fld 2 next-l) "TAG-TEST")
    (progn
    (setq wf 5);width factor for tag tag-test
    (setq next-l (subst (cons 41 wf) (assoc 41 next-l) next-l))
    (entmod next-l)
    (entupd name)
    );progn
    )
    (setq next (entnext next) next-l (entget next))
    );while
    (princ)
    );end defun
    (c:test)
     
    zeha, Apr 5, 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.