VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Excel-AutoCAD find/replace

5 REPLIES 5
Reply
Message 1 of 6
ToddC
921 Views, 5 Replies

Excel-AutoCAD find/replace

Just my 2nd day working with VBA, but bare with me. I want to do a find and replace using AutoCAD and Excel. One column in Excel for the text to find on AutoCAD dwg, and another column to use for the replacement text. I've found some great projects on the internet linking AutoCAD and Excel, but I'm a long way off from actually doing what I want. Does anybody know of a similar program to do what I'm trying or can you point me in a direction?

Thanks
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: ToddC

Have you got anything so far? Do you know VB at all? You will have to give us a starting point. JR Walker "ToddC" wrote in message news:33467741.1079472486355.JavaMail.jive@jiveforum1.autodesk.com... > Just my 2nd day working with VBA, but bare with me. I want to do a find and replace using AutoCAD and Excel. One column in Excel for the text to find on AutoCAD dwg, and another column to use for the replacement text. I've found some great projects on the internet linking AutoCAD and Excel, but I'm a long way off from actually doing what I want. Does anybody know of a similar program to do what I'm trying or can you point me in a direction? > > Thanks
Message 3 of 6
ToddC
in reply to: ToddC

I've been able to connect up to Excel from AutoCAD. I'm just not sure if a find/replace text is the route to go or if I should use attributes. I don't know how to read text from one cell to find on the drawing and then how to replace it with text from another cell on the drawing. I'm just learning VBA, but was hoping to find a similar program to the one I'm trying to write to get me started.
Message 4 of 6
Anonymous
in reply to: ToddC

If you are getting to the individual Excel cell objects, then you can pull their values. Make sure the values are strings and then store the values of the "before" and "after" values. If the objects are in AutoCAD and are just text, create a selection set of all text and then cycle through them until you find a matching "before" value and then change it to the "after" value. Is this helping any? JR Walker "ToddC" wrote in message news:18941100.1079552831971.JavaMail.jive@jiveforum1.autodesk.com... > I've been able to connect up to Excel from AutoCAD. I'm just not sure if a find/replace text is the route to go or if I should use attributes. I don't know how to read text from one cell to find on the drawing and then how to replace it with text from another cell on the drawing. I'm just learning VBA, but was hoping to find a similar program to the one I'm trying to write to get me started.
Message 5 of 6
ToddC
in reply to: ToddC

I know exactly what your saying. I've connected up with excel, can put info from the drawing into it, but I haven't been able to go the other way from excel to the drawing to insert text. And then I'm not really sure how to find text and then change it in the drawing. I was also thinking about using attributes instead of text. Ideally I'd like to insert a block w/attributes, have the attributes loaded into excel, go into excel and place what I want the attributes to be, and then populate the drawing. I'm reading AutoCAD 2004 VBA by Joe Sutphin and it's really helping out a lot. I guess I just need to familiarize myself with VBA and then come back after I figure out what I can't do.
Thanks for your Help JR.
Todd
Message 6 of 6
ToddC
in reply to: ToddC

Yes, it is helping. I think I know what I have to do. It's just a matter of programming it. Thanks for your help.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost