A2K5 Linked Mtext Fields - suggestions?

Discussion in 'AutoCAD' started by Mike Weaver, Apr 21, 2004.

  1. Mike Weaver

    Mike Weaver Guest

    Given a first mtext object, call it the parent, and a second mtext object,
    call it the child. If the child consists of nothing but an object linked
    field back to the content property of the parent, what is the best way to
    find that parent object from the child?

    Here is a procedure that works, but I'm wondering if there is a better way.

    Thanks,
    Mike Weaver

    (defun c:MTParent( ;Find an mtext field's parent object
    /
    dictlist1 dictlist2 elist ent etype flist1 flist2 plist ss1
    )
    (setq
    ss1 (ssget ":S" '((0 . "MTEXT")))
    ent (ssname ss1 0)
    elist (entget ent '("*")) ;child mtext entity
    DictList1 (entget (cdr (assoc 360 elist)) '("*")) ;first dictionary
    DictList2 (entget (cdr (assoc 360 dictlist1)) '("*")) ;second dictionary
    FList1 (entget (cdr (assoc 360 dictlist2)) '("*")) ;first field entity
    FList2 (entget (cdr (assoc 360 flist1)) '("*")) ;second field entity
    PList (entget (cdr (assoc 331 flist2)) '("*")) ;parent mtext entity
    etype (= "MTEXT" (cdr (assoc 0 PList)))
    )
    (command "line" (cdr (assoc 10 elist)) (cdr (assoc 10 PList)) "")
    (princ)
    )
     
    Mike Weaver, Apr 21, 2004
    #1
  2. Mike Weaver

    Mike Weaver Guest

    Make that an Object field, rather than an Object Linked field
    Mike
     
    Mike Weaver, Apr 21, 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.