Identifying attribute containing a field

Discussion in 'AutoCAD' started by David Zavislan, Jan 4, 2005.

  1. I am trying to use Lisp or VBA to identify if the text value in an attribute was generated by a field. I have found the FieldCode method for Text and Mtext objects, but this method does not apply to attributes.
     
    David Zavislan, Jan 4, 2005
    #1
  2. Now, I have barely tried any programmatic manipulation
    of fields but maybe this will help you get to where you
    need to be? If not, just disregard.


    (setq obj (vlax-ename->vla-object (car (nentsel))))

    (if (= :vlax-true (vla-get-hasextensiondictionary obj))

    (if
    (vl-catch-all-error-p
    (setq
    result
    (vl-catch-all-apply
    (function
    (lambda ()
    (vla-item
    (vla-getextensiondictionary obj)
    "Acad_field"
    )
    )
    )
    )
    )
    )
    (vl-catch-all-error-message result)
    result
    )
    )

    --
    Autodesk Discussion Group Facilitator



    attribute was generated by a field. I have found the FieldCode method for
    Text and Mtext objects, but this method does not apply to attributes.
     
    Jason Piercey, Jan 4, 2005
    #2
  3. Thanks Jason. Your solution will meet my immediate needs. I have a program that updates attributes in blocks, but I did not want it to modify attributes containing fields. Your code lets me test the attribute for a field.

    I extracted the dictionary object that was returned with your code. It returned an AcadObject with the object name AcDbField. Are there any methods or properties associated with an AcDbField?
     
    David Zavislan, Jan 5, 2005
    #3
  4. You can find out what methods are available
    for a vla-object by dumping the object.

    (vlax-dump-object <vla-object> t)

    You might also see the thread I started yesterday
    titled "field-p".

    --
    Autodesk Discussion Group Facilitator



    program that updates attributes in blocks, but I did not want it to modify
    attributes containing fields. Your code lets me test the attribute for a
    field.
    returned an AcadObject with the object name AcDbField. Are there any
    methods or properties associated with an AcDbField?
     
    Jason Piercey, Jan 5, 2005
    #4
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.