Drafting Find & Replace

Valued Contributor
Valued Contributor

Hello all,

 

Has everyone ever written a Find/Replace add-in for drafting? The old AutoCad guys, who do a lot of schematics, are asking for it. I can write something in VB, but it seems and add-in would be more the way to go here.

 

I hate to say it, but the AutoCad Find/Replace is pretty slick, and very useful if you are doing an electrical schematic that you need to replace the phrase, say "122-3" or something like that about 30 times to "123-3".

 

If anyone has done anything similar to this functionality and is willing to share it, I'd be grateful.

 

Thanks,

 

Posted by: Bill Ledbetter
Post date: 3/7/2006 11:53:32 PM

5 REPLIES

RE: Drafting Find & Replace

Valued Contributor
Valued Contributor

Bill,

 

I guess it sounds easy enough. What in the Draft would be scanning for text in? Textboxes, etc?

 

Posted by: Jason Newell
Post date: 3/10/2006 7:54:35 AM

RE: Drafting Find & Replace

Valued Contributor
Valued Contributor

Hi Jason,

 

Yes, it would be textboxes only at this point. I've already went ahead and written it in VB6. And I found an open ER from UGS about the Texstboxes.WordWrap not being exposed to the API, which kind of throws another wrench in the toolbox.

 

Attached is my code in progress. Keep in mind it is sloppy and I'm not a programmer.

 

Feel free to make comments.

 

How much work would it take for a non-programmer to make an Add-in out of it?

 

Thanks,

 

- Bill

 

Posted by: Bill Ledbetter
Post date: 3/10/2006 11:57:22 PM

RE: Drafting Find & Replace

Valued Contributor
Valued Contributor

OK, I've taken a look at this and it looks very straight-forward. I'll see what I can whip up .

 

Posted by: Jason Newell
Post date: 3/13/2006 6:13:34 AM

RE: Drafting Find & Replace

Valued Contributor
Valued Contributor

Well I've looked into it and I have to say that I'm very dissapointed with the Draft API on this one. I've been unsuccessful in being able to reproduce the text highlighting like you can do with the mouse. I'd hoped to be able to highlight the words as I found them. Not sure where I'll go from here. I'll keep pondering on it.

 

Posted by: Jason Newell
Post date: 3/14/2006 6:58:09 AM

RE: Drafting Find & Replace

Valued Contributor
Valued Contributor

Yes, I found the smae problem. As an alternative, I was considering two options. One, extracting the X,Y position and setting the window position and scale (based on the text size). Two, temporarily changing the color of the selected string. However, I haven't yet tried either of these methods, so I don't know if it will actually work real-time or not.

 

Thanks

 

 

Posted by: Bill Ledbetter
Post date: 3/15/2006 12:40:13 AM