Use Notepad++ to search API code

EmailFacebookGoogle+LinkedInTwitterShare

When you first begin programming for applications, the Internet is your friend, it is usually the fastest way to figure out how to write a section of code.

Over time your own personal code library is going to grow. You would rather use code from your own library – you trust it. The problem is that it is usually easier to find code examples on the Internet than your own hard drive!

I recommend trying the “Find in Files” function in Notepad++. [Notepad++ is a free (as in “free speech” and also as in “free beer”) source code editor and Notepad replacement that supports several languages. Running in the MS Windows environment, its use is governed by GPL License.]

Let’s imagine you are writing some code that needs to use the SOLIDWORKS EPDM command “AddTail” but you’ve forgotten how to use the command….and in which project you even used it!

Notepad++

As you can see in the image above, “Find in Files” is in the same dialog as “Find” and “Replace”. In this example Notepad++ is going to search my entire VS folder and all sub folders looking through all *.vb files that contain the word “addtail”. Doing so, Notepad++ may return something like:

Notepad++

You can then copy this found line right from the search result or double click on the file name and Notepad++ will open it.

This works really well with .NET code, because the source code is stored as a text file (*.vb). However Notepad++ actually does a pretty good job searching in SOLIDWORKS macros (*.swp, *.csproj) too! In the filter, separate the extensions with a semicolon.

extensions

The results aren’t as nice, I wouldn’t bother trying to open files with these extensions in Notepad++, but at least you found the file!