(laylist)

Discussion in 'AutoCAD' started by masterbike360, Jan 14, 2005.

  1. I want to know if it's possible the catch/find a tag_promt (attribute) IN a specific layout?

    Thanks, Simon
     
    masterbike360, Jan 14, 2005
    #1
  2. masterbike360

    wcc Guest

    It's possible. It would be easier if you know the block name, otherwise make
    a selectionset of all block references in that layout then step through the
    selectionset. Each block reference support GetAttributes or
    GetConstantAttributes method.
     
    wcc, Jan 14, 2005
    #2
  3. masterbike360

    LUCAS Guest

    ;;BY LUCAS
    ;;(catch_tag "tag_prompt" "layoutname")
    ;;(catch_tag <tag_prompt-string> <layoutname-string>)
    ;;RETURN: ((<BLK> <ATTRIB>)(<BLK> <ATTRIB>) .....)
    (defun CATCH_TAG (TAG_PROMPT LAYOUTNAME / ENT N SS ENT_LST)
    (setq SS
    (ssget "x"
    (list (cons 0 "INSERT") (cons 66 1) (cons 410 LAYOUTNAME))
    )
    N 0
    TAG_PROMPT
    (strcase TAG_PROMPT)
    )
    (if SS
    (repeat (sslength SS)
    (setq ENT (ssname SS N))
    (while (/= (cdr (assoc 0 (entget (setq ENT (entnext ENT)))))
    "SEQEND"
    )
    (if (equal (strcase (cdr (assoc 2 (entget ENT)))) TAG_PROMPT)
    (setq ENT_LST (cons (list (ssname SS N) ENT) ENT_LST))
    )
    )
    (setq N (1+ N))
    )
    )
    ENT_LST
    )
     
    LUCAS, Jan 14, 2005
    #3
  4. Command: (load"CATCH_TAG")
    ; error: LOAD failed: "CATCH_TAG"

    I'm not sure if I use it right???

    Simon
     
    masterbike360, Jan 14, 2005
    #4
  5. Change:

    (defun CATCH_TAG (TAG_PROMPT LAYOUTNAME / ENT N SS ENT_LST)

    to

    (defun C:CATCH_TAG (TAG_PROMPT LAYOUTNAME / ENT N SS ENT_LST)
     
    Rogerio_Brazil, Jan 14, 2005
    #5
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.
Similar Threads
There are no similar threads yet.
Loading...