SetVar works with checked in files

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 out we don’t need any new commands. SetVar will work even if the file is checked in. Couldn’t be easier.

In EPDM 2013, check in “objFile”, and this code still works!

varEnum = objFile.GetEnumeratorVariable
varEnum.SetVar("VersionFreeVar", "", "Jeff Is Cool")
varEnum.CloseFile(True)

  • Share this
Find Your Design Solution in the CATI Store.
Browse Products