Results 1 to 4 of 4

Thread: object to field relation

  1. #1
    All AUGI, all the time
    Join Date
    2004-06
    Location
    Slidell, Louisiana
    Posts
    972
    Login to Give a bone
    0

    Default object to field relation

    I have several closed polylines with fields associated with them displaying the area of the polyline.

    How can i determine which field is associated with which polyline? Will it highlight the object? or is it trial and error.

  2. #2
    100 Club
    Join Date
    2015-09
    Posts
    154
    Login to Give a bone
    0

    Default Re: object to field relation

    courtesy of mr Lee Mac...

    select the field and it will highlight the referenced object.


    Code:
    ;;------------------=={ Get Field Objects }==-----------------;;
    ;;                                                            ;;
    ;;  Returns a list of entities referenced by a supplied field ;;
    ;;------------------------------------------------------------;;
    ;;  Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
    ;;------------------------------------------------------------;;
    ;;  Arguments:                                                ;;
    ;;  en - Entity containing field (Text / MText / Attribute)   ;;
    ;;------------------------------------------------------------;;
    ;;  Returns:  List of entities referenced by Field, else nil  ;;
    ;;------------------------------------------------------------;;
    
    (defun LM:GetFieldObjects ( en / _getfieldobjects )
    
        (defun _getfieldobjects ( a )
            (apply 'append
                (mapcar
                    (function
                        (lambda ( a )
                            (if (= 360 (car a))
                                (_getfieldobjects (cdr a))
                                (if (= 331 (car a)) (list (cdr a)))
                            )
                        )
                    )
                    (entget a)
                )
            )
        )
        
        (if
            (and
                (wcmatch (cdr (assoc 0 (setq en (entget en)))) "TEXT,MTEXT,ATTRIB")
                (setq en (cdr (assoc 360 en)))
                (setq en (dictsearch en "ACAD_FIELD"))
                (setq en (dictsearch (cdr (assoc -1 en)) "TEXT"))
                (setq en (cdr (assoc 360 en)))
            )
            (_getfieldobjects en)
        )
    )
    
    (defun c:STF ( / en lst )
        (while
            (progn (setvar 'ERRNO 0) (setq en (car (nentsel "\nSelect Field: ")))
                (cond
                    (   (= 7 (getvar 'ERRNO))
                        (princ "\nMissed, try again.")
                    )
                    (   (eq 'ENAME (type en))
                        (if (setq lst (LM:GetFieldObjects en))
                          (foreach ent lst (command "zoom" "o" ent "" ) (redraw ent 3))
                          
                            (princ "\nObject is not a Field, or Field doesn't reference any Objects.")
                        )
                    )
                )
            )
        )
        (princ)
    )

  3. #3
    All AUGI, all the time
    Join Date
    2004-06
    Location
    Slidell, Louisiana
    Posts
    972
    Login to Give a bone
    0

    Default Re: object to field relation

    Thanks feargt and kudos to Mr. Lee Mac.....great lisp routine. works great. just what i was looking for.

  4. #4
    Member vmichl's Avatar
    Join Date
    2002-04
    Location
    C.Budejovice, Czechia
    Posts
    34
    Login to Give a bone
    0

    Default Re: object to field relation

    Or you can try the free utility FieldLink - it draws temporary (or permanent) links/arrows between the pairs field-source object (works also on blovks and tables with fields).

    See:
    http://www.cadforum.cz/cadforum_en/f...bjects-tip6795

    Vladimir Michl, www.cadstudio.cz

Similar Threads

  1. 2013: Object Position in Field
    By kairichardson539909 in forum AutoCAD for Mac General
    Replies: 10
    Last Post: 2014-02-10, 09:26 PM
  2. object field values scales with VP?
    By randyspear in forum Dynamic Blocks - Technical
    Replies: 3
    Last Post: 2010-03-17, 03:26 PM
  3. select object then have area in field
    By ignjat123 in forum AutoCAD Fields
    Replies: 2
    Last Post: 2009-12-17, 08:09 AM
  4. Formula using an Object's Area Field
    By rklee in forum AutoCAD Fields
    Replies: 7
    Last Post: 2008-01-17, 05:44 PM
  5. Which object belong to this field? *
    By fk.50940 in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2005-05-28, 10:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •