| Author |
Message |
David Zavislan
Guest
|
Posted:
Tue Jan 04, 2005 11:21 pm Post subject:
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.
|
|
| Back to top |
|
 |
Jason Piercey
Guest
|
Posted:
Wed Jan 05, 2005 12:34 am Post subject:
Re: Identifying attribute containing a field |
|
|
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@jiveforum1.autodesk.com...
| Quote: | 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. |
|
| Back to top |
|
 |
David Zavislan
Guest
|
Posted:
Wed Jan 05, 2005 10:13 pm Post subject:
Re: Identifying attribute containing a field |
|
|
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?
|
|
| Back to top |
|
 |
Jason Piercey
Guest
|
Posted:
Wed Jan 05, 2005 10:30 pm Post subject:
Re: Identifying attribute containing a field |
|
|
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@jiveforum1.autodesk.com...
| Quote: | 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.
| Quote: |
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? |
|
| Back to top |
|
 |
|
|
|
|