Identifying attribute containing a field
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Identifying attribute containing a field

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
David Zavislan
Guest





Posted: Tue Jan 04, 2005 11:21 pm    Post subject: Identifying attribute containing a field Reply with 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
Jason Piercey
Guest





Posted: Wed Jan 05, 2005 12:34 am    Post subject: Re: Identifying attribute containing a field Reply with quote

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 Reply with 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.

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 Reply with quote

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
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB