PDA

View Full Version : Changing attribute text strings using ObjectDBX



brett.hyland372887
2013-06-16, 05:57 AM
I am by no means a slouch in the programming sense, but seek the help of my peers...

I can invoke objDbx but seek any help with respect to searching through the blocks collection to change attribute text strings? My plan is to create a series of drawings based on a template and a series of strings from an excel spreadsheet. The opening and saving goes well, but at the point of my searching for text strings within attributes (eg AttVal1, Attval2 etc) the code says it is working, but it does not change and does not save this.

Does anyone have an example of iterating through the blocks collection of both model and paper space to find attributes and replace them?

Any and all help is appreciated.

Brett

BlackBox
2013-06-16, 06:44 PM
I'm confused....

You're asking for help coding for ObjectDBX in the RealDWG forum, and haven't posted any code... What API are you using (i.e., Visual LISP, .NET, etc.)?

You have to iterate both, the applicable Layout's Block (i.e., model, paper, or both), and the BlockTableRecord, iterating each matching BlockReference's Attributes, and correspond them to the BlockTableRecord's Attribute, only then can you change the Attribute's TextString provided the Object(s) are = OpenMode.ForWrite... And be sure to call <Transaction>.Comitt() when done (some of this is .NET API jargon).