Results 1 to 4 of 4

Thread: Identifying attribute containing a field

  1. #1
    David Zavislan Guest

    Identifying attribute containing a field

    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.

  2. #2
    Jason Piercey Guest
    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



    "David Zavislan" <nospam@address.withheld> wrote in message
    news:5127067.1104862936757.JavaMail.jive@jiveforum 1.autodesk.com...
    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.

  3. #3
    David Zavislan Guest
    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?

  4. #4
    Jason Piercey Guest
    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



    "David Zavislan" <nospam@address.withheld> wrote in message
    news:5197254.1104945236517.JavaMail.jive@jiveforum 1.autodesk.com...
    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?

Similar Threads

  1. Placing block and moving Attribute field
    By Edward Bagby in forum VBA
    Replies: 1
    Last Post: 02-18-2005, 07:47 PM
  2. Field in Attribute problem
    By Matt W in forum VBA
    Replies: 0
    Last Post: 02-04-2005, 01:17 PM
  3. convert mm Field to m sq.
    By ajm in forum Customization
    Replies: 0
    Last Post: 01-20-2005, 08:59 PM
  4. field-p
    By Jason Piercey in forum Customization
    Replies: 3
    Last Post: 01-05-2005, 12:46 PM
  5. locking 3d field
    By ctsengineering in forum Drafting
    Replies: 2
    Last Post: 11-23-2004, 06:30 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
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum