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++ […]
I know companies that spend a lot of money translating drawings. Typically it is a slow, tedious, manual process. Since often times the translators aren’t engineers, you can sometimes get embarrassing translations. If your standard notes are blocks, translating these notes can be done very quickly. SOLIDWORKS’ blocks have a “FileName” property that a macro can easily change. Change the “FileName” property and the block immediately changes to the new block. So if you are clever about your block naming strategy, a […]
Most people only use Visual Basic’s Message Box as an “alert” tool – a way to pass information to the user. Did you know you could use it to pass information back to your macro? The SOLIDWORKS API class teaches you to declare a variable and set that variable equal to the value returned by MsgBox. Works great, now the button the user chooses (in this case either a “Yes” or “No” button (most likely in this case “Yes”)) will be stored in the “result” variable. […]
My favorite new function in SOLIDWORKS Enterprise PDM 2013 -by far, is version free variables. (Special variables that can be updated on a datacard without having to bump the version of the file.) I’ll certainly be talking more about them later, but I just finished a quick test and couldn’t wait to tell you what I learned. I was initially worried because there is nothing in the API “What’s New” document mentioning any new functionality modifying version free variables. Turns […]
I don’t accept as many interview requests as I used to, but when Keith Rice from CADSharp contacted my publicist about doing an interview with him, I quickly sent my driver to deliver him to the ranch so we could meet. (I find the interview room much nicer in the ranch than over in the main estate.) Keith and I used to work together when he was here at 3DVision. Since we share many common interests we quickly became friends, thus I was sad […]
Today’s SOLIDWORKS Enterprise PDM post comes from a cool little API idea Lou Gallo dropped on me: poInfo.mlAddInVersion = Now.ToString(“yyyyMMdd”) Just like the fight club, if I have to explain it, you wouldn’t understand.
There are a lot of API snobs out there who feel their SOLIDWORKS Enterprise PDM code is too good to be run by just anyone, perhaps only members of a certain user group are allowed to run their precious code. Perhaps they are writing something that should only be run by administrators. I personally am a programmer for the people; but if you are related to Marie Antoinette, it is pretty easy to accomplish this act of discrimation. You include […]
Hey macro lovers! Have to change a lot of SOLIDWORKS file properties, but don’t want to your code to have to open each file one at a time?
When you are the Data Specialist Man, the world is your stage. Here is a little excerpt from a screen play I am writing for an upcoming movie, tentatively titled: “SolidWorks Enterprise PDM – The Movie” The scene opens with our hero [me] teaching an EPDM administrator training class. [Me] Now that the file is in your “Released” workflow state, it is read only for everyone, the only way it can be changed is to push the file through the workflow again, making a new revision. […]
Recently a customer asked me to write a routine to release ownership of every file in his SOLIDWORKS Workgroup PDM vault. I thought finding the files would be rather simple until I realized Workgroup’s PDMWSearchOptions (Workgroup’s API search function) does not support wildcard characters. While contemplating harakiri, I finally came up with this search criteria idea: objSearch.IgnoreCase = True objSearch.SearchCriteria.AddCriteria pdmwOr, pdmwOwner, “”, pdmwContains, “a” objSearch.SearchCriteria.AddCriteria pdmwOr, pdmwOwner, “”, pdmwContains, “e” objSearch.SearchCriteria.AddCriteria pdmwOr, pdmwOwner, “”, pdmwContains, “i” objSearch.SearchCriteria.AddCriteria pdmwOr, pdmwOwner, […]