spk-logo-white-text-short2
0%
1-888-310-4540 (main) / 1-888-707-6150 (support) info@spkaa.com
Select Page

MKSSI Environment Variable – an Integrity PLM Software Primer

I’m not a programmer by trade, so I’ve had to force feed myself a lot of knowledge – some of it makes sense, some of it is beyond me. I’ve written this post to serve as an Integrity PLM Software Primer for the MKSSI Environment Variable. I hope you find it useful!

Recently, we decided to start looking into things we can do with user actions and one of the things that had been stumping me was how to get at the current user session and grab things like, the ID of the selection, the username, etc. I had read on PTC’s website to use ‘set & pause’ in a batch script, but what I didn’t realize was that the batch script needed to be run as a user action.

Now, just running set & pause is going to spit out environment variables for just about everything on the system – not all that useful – but if you’re curious, just use notepad or some other text editor to create a batch file (text file with .bat at the end of it if you’ve never made one before). On the first line, type:
set & pause

Now go into Integrity and select Customize from the ViewSet menu:

Select the ‘Actions’ tab, and select ‘Custom’ from the ‘Action Group’.  You should now see a list of custom actions that can be run from that viewset.  From there, select the first unused action and click the edit button:

Add any other info you want, like an icon, or the Description, which will be visible when a user hovers over the icon, then click in the ‘Program Field’ and select Browse to locate your file.  If its not an .exe file, you’ll need to tell it to look for all items.  A quick tip, if you set the program path to: ..\youritem.bat it will automatically assume the path to the Integrity Folder. Click OK when you’re done.  Don’t forget to set the ‘Action Availability’ to ‘Visible, On Toolbar’ next.

If you haven’t given it an icon, it will look about like it does in the image above where it says ’12’ (yours will probably have a different number).

 That’s the basics of adding a user action, now lets look at what our script does.  Clicking on the icon will probably yield you something like the following:

Lots of stuff, but we can see all of the environment variables set for MKSSI, which is very useful indeed!

So how do we make this work to our advantage?  Here’s a quick example of what we did to our script do get some basic info for another program:

set MKSSI_HOST & set MKSSI_PORT & set MKSSI_USER & set MKSSI_ISSUE0

Since the MKSSI variables are being set by Integrity when you run it, you can call them like you would any variable in a batch script, for instance:

@echo off
set MKSSI_HOST & set MKSSI_PORT & set MKSSI_USER & set MKSSI_ISSUE0


ECHO %MKSSI_HOST%
ECHO %MKSSI_USER%
ECHO %MKSSI_ISSUE0%
pause

Would print out the value of the variables – or you could set them as arguments for some other script that can make use of the IM commands and say spit out a text file with all of the relationships to that issue etc.

Next Steps:

Latest White Papers

An Engineer’s Guide to CAD and the Renaissance of Product Design

An Engineer’s Guide to CAD and the Renaissance of Product Design

Modern developers are either upgrading their technology or falling behind. Discover how new CAD technologies and other product design tools are altering the engineering space.What You Will Learn Discover how technologies like Creo and Creo+ from PTC are helping...

Related Resources

Gitflow vs. trunk-based development: Which is better?

Gitflow vs. trunk-based development: Which is better?

Modern software development relies on version control systems to help teams manage changes, collaborate, and deliver high-quality code. Two popular Git workflows, Gitflow and Trunk-Based Development, offer different approaches to managing branches and releases....

Your PLM, The Cloud, and FDA Regulation: What You Need to Know

Your PLM, The Cloud, and FDA Regulation: What You Need to Know

Product designs, documentation, and processes aren’t just valuable intellectual property, they’re your license to operate. In the highly regulated medical device industry, these factors must be greatly considered. If you’re using a Product Lifecycle Management (PLM)...

Optimizing Design with PTC Creo and Windchill Integration

Optimizing Design with PTC Creo and Windchill Integration

Meeting the highest levels of product quality requires leading engineering and manufacturing teams to utilize integrated solutions. Bringing together advanced CAD and Product Lifecycle Management (PLM) capabilities can lead to lower costs and increased innovation....