powerGate Server and the web

2015-06-19_06-49-26

In our last post, we’ve introduced you to powerGate 2016 and the BOM transfer dialog. This time I’d like to disclose a little secret around the powerGate Server.

powerGate is getting a lot of attention these days, and one of the common wishes is the ability to demonstrate powerGate live, running against an ERP system. Now, as there are so many ERP systems on the market, and almost none of you runs with an SAP or the like on his notebook, the question is, how to simulate an ERP system for test and demo purposes.

We came up with powerGate ERP. It’s a simplified ERP web page that allows you to display items and BOMs you’ve created with powerGate. This way, you can test powerGate right away, create items, BOMs, etc. and see the results in a nice web page that mimics an ERP system.

By now you’ll ask where is the secret? Well, the powerGate Server provides the data to the Vault client in form of a web friendly REST/OData API. Yes, the powerGate Client and the powerGate Server communicate via REST with each other, therefore any REST capable application can talk to the powerGate Server. Now, in case of the powerGate Client, we developed simple PowerShell command-lets like Get-ERPObject, Add-ERPObject, Update-ERPObject, etc. in order to read and write data from and to the ERP system. Such command-lets are used within Data Standard dialogs for the communication between Vault and the ERP system.

Your web browser (HTML5 + javascript) is a REST capable application by nature. So, we just wrote a few lines of HTML code with some javascript and created the ERP web application. The ERP web page reads data directly from the powerGate Server via the same technique as the powerGate Client, or the Vault Data Standard dialogs. This allows you to play with powerGate in your Vault by creating items, transferring BOMs, etc., and see in the browser the result of your actions. You can use the ERP page for simulating the communication between Vault and the ERP system, without carrying an ERP system with you.

For more information, download and installation instructions, read the wiki.

 

Posted in powerGate, PowerShell | Leave a comment

powerGate 2016 is ready

I’m so excited to announce the official release of powerGate 2016, the standard way to integrate Vault with any ERP system. It took a bit longer to get ready, as we wanted to add some cool features, like the BOM transfer dialog and the ERP navigator. Today, I’d like to present you the BOM transfer dialog.

So far transferring a BOM was just about pushing a button and wait…… Now, when you hit the BOM Transfer, you’ll get a very powerful dialog that shows you the file or item BOM and offers you a lot of features.

First, we start with the BOM preview. In the dialog, you’ll see the Vault BOM as a multilevel structured BOM. In a separate tab, you’ll see all the items that are consumed in such BOM, as a unique part list. This way, you have a very good understanding of what you are going to transfer to your ERP system. Both, the structured BOM view and the list of items are customizable, so you can select which properties shall be displayed, you can sort and filter.

Then comes the items check. You can test which Vault items, involved in this BOM, are missing in the ERP system. Via the Process button, you then start the item creation and thus prepare all the items in the ERP system. Alternatively, you may create the items in the ERP system separately and then just check if the list is now complete.

Finally, you can transfer the BOM. The BOM transfer takes care about external references, phantom components, purchased parts and the like. The BOMs will be created level by level.

BOM dialog

As the dialog is very interactive, you can follow the progress of every single action. Additionally, the procedures behind each action are PowerShell functions. This way, you can influence what should happen for each action, as which items shall be loaded in the dialog, which BOMs shall be ignored, how to check for the existence of an item in the ERP system, how the items shall be generated, and how the BOM shall be transferred. Each operation is a simple small PowerShell function called by the dialog, and you can configure and customized the behavior.

Got curious? Download powerGate and start messing around!

Posted in powerGate, PowerShell | Leave a comment

2016 is here!

2016

Over the last weeks, we have been busy getting the 2016 products ready for you. Finally, we are ready. powerJobs, vaultRuler, dataLoader, clever and myFile are available for download. powerGate will follow next week, and the bcpDevkit and bcpChecker will follow as well. The official announcement will be early next week, but if you like, you can already start downloading our products from the website. The 2016 products contain all the feature enhancements we delivered over the last year, so it will be easy for you to get started.

The biggest investment went into powerGate, the SAP/ERP connector for Vault. With the experience we gained over the last year in the ERP projects we ran with you, we made powerGate simpler and more capable. There are two main enhancements that are worth to be mentioned.

The first is the version compatibility. powerGate 2016 client builds on powerVault, the Vault API command-lets for Windows PowerShell. Such command-lets hide the Vault API behind simple commands, and therefore they are no longer Vault version dependent. In other words, from 2016 onward, your Data Standard customizations on the client side in the context of powerGate, will be Vault-version independent. Testing is of course always good and you may improve the client side behavior with every version, but you don’t have to due to API changes.

The second enhancement is the ERP neutrality. Yes, the SAP integration is still the default ERP connector you’ll get with powerGate, however, more connectors will come, and you can create your own. A simple .Net interface, with commands like read, write, update, and delete, allows you to create powerGate server extensions that can communicate with any ERP system. The client remains always the same, Data Standard with XAML and PowerShell, while the server can talk to SQL, XML, CSV, and any other type of API.

Over the next weeks we will tell you more about the single products and their enhancements. As for now, we just say “welcome 2016” and wish you all a good business!

Posted in Uncategorized | Leave a comment

powerVault in Action

 

In the last post, we presented powerVault, a simplified Vault API for PowerShell. We just released a small video that gives you an overview about powerVault, with some interesting examples. The samples shown in the video are posted in this blog.

powerVault can be installed in 3 ways. Either as stand alone, and here you can download it, or it comes via powerJobs or powerGate. Once powerVault is installed, you can fire up any PowerShell editor and via

Import-Module powerVault

and load the PowerShell command-lets. In case of powerJobs, the command-lets are automatically loaded in the context of the job. If you like to use powerVault stand alone or within Data Standard, then you have to load them one time.

In case you use powerVault inside a PowerShell editor or as a stand alone script, you will need to open a connection to Vault, like this

Open-VaultConnection -Server "localhost" -Vault "Vault" -User "Administrator" -Password ""

In case of Data Standard or powerJobs, the system behind already opened the connection to Vault, so no further login is needed.

In the video, we show as first example how to search for files inside Vault via the Get-VaultFiles and providing one or more properties to search on. If the –Folder argument is omitted, the search goes over the whole Vault, if the –Folder is set, the search is limited to that folder and sub folders.

$files = Get-VaultFiles -Properties @{"Category Name"="Base";"Provider"="Inventor"} -Folder "$/Designs/Assemblies/Metal Container"
$files | ForEach-Object {
  Update-VaultFile -File $_.'Full Path' -Category "Engineering" -Properties @{"Company"="coolOrange"} -Comment "powerVault is cool!"
}

For the files found, you can for instance update them and set the category, the properties, the state, etc.

As a second example we show how to search for released files and export the list as a CSV:

$files = Get-VaultFiles -Properties @{"State"="Released"}
$files | Select-Object Name, 'Category Name', 'Date Modified', 'Current Owner' | Export-Csv "c:\temp\releasedVaultFiles.csv" -Delimiter ';'

In the forth sample, we show how you can use powerVault to play with the Vault API and get a feel for it. Here we move a file from one folder to another, and in order to learn which commands are needed, we use the vapiTrace to trace the Vault API commands and then mimic the behavior in PowerShell.

We first get the file via Get-VaultFile by passing the fill Vault path. Then we get the Vault folder object via the Vault API using the $vault variable, which is set to the Vault service manager and exposes all the services. And then we use the MoveFile from the DocumentService for moving the file.

$file = Get-VaultFile -File "$/coolOrange/100006.ipt"
$fileDWF = Get-VaultFile -File "$/coolOrange/100006.ipt.dwf"
$sourceFolder = $vault.DocumentService.GetFolderByPath($file.Path)
$targetFolder = $vault.DocumentService.GetFolderByPath("$/Designs")
$vault.DocumentService.MoveFile($file.MasterId, $sourceFolder.Id, $targetFolder.Id)

As further sample, we import files from the disc into Vault and update the category, the properties, and set the references between the files.

$sourcepath = "C:\Users\Public\Documents\Autodesk\Vault Professional 2015 R2\Samples\Inventor 2015\Padlock\Designs\Padlock\Assemblies"
$CatchAssembly = Add-VaultFile -From "$sourcepath\Catch Assembly.iam" -To "$/powerVault/Catch Assembly.iam" -FileClassification "Inventor" -Comment "Imported via powerVault"
$CatchAssembly = Update-VaultFile -File $CatchAssembly.'Full Path' -Properties @{"Title"="Catch Assembly"; "Company"="coolOrange"} -Category "Engineering"
$ComboAssembly = Add-VaultFile -From "$sourcepath\Combo Assembly.iam" -To "$/powerVault/Combo Assembly.iam" -FileClassification "Inventor" -Comment "Imported via powerVault"
$ComboAssembly = Update-VaultFile -File $ComboAssembly.'Full Path' -Properties @{"Title"="Combo Assembly"; "Company"="coolOrange"} -Category "Engineering"
$padLock = Add-VaultFile -From "$sourcepath\Pad Lock.iam" -To "$/powerVault/Pad Lock.iam" -FileClassification "Inventor" -Comment "Imported via powerVault"
$padLock = Update-VaultFile -File $padLock.'Full Path' -Properties @{"Title"="Pad Lock"; "Company"="coolOrange"} -Category "Engineering" -AddChilds @($CatchAssembly.'Full Path',$ComboAssembly.'Full Path')

We also show how you could download a complete assembly with all components, with just one command.

$file = Get-VaultFile -File "$/powerVault/Pad Lock.iam" -DownloadPath "c:\temp\powerVault"

During the video, you will have a short view of the $file object that comes back, which exposes all the file properties, so that all you need is already there. Beyond the functions on files, powerVault also offers some first functions on items, such as Get-VaultItem, Get-VaultItemBOM and Update-VaultItem. Over the next months we will add more command-lets and we will keep the compatibility with current and future Vault versions, so that scripts based on these command-lets will run also in the future.

We hope you enjoy powerVault and the video!

Posted in Data Standard, PowerShell, powerVault, Vault API | 1 Comment

powerVault – Vault API made simple

2015-04-03_10-06-39

The first time we blogged about PowerShell was back in March 2012 (3 years ago). It was unknown in the Autodesk Data Management scene. Meanwhile it’s become quite popular.

With Vault 2015 R2 we took the next step for making the Vault API even more accessible. We created powerVault!

It’s a native PowerShell extension that allows you to talk with Vault via pure PowerShell command lets. With powerVault, you get command lets for dealing with files and items. For instance Open-VaultConnection for establishing a connection to Vault, or Get-VaultFile for getting/downloading a file, or Get-VaultItem for getting an item. But also Add-VaultFile or Update-VaultFile or Update-VaultItem. Such command lets make it very easy to either get information from Vault or creating and updating information in Vault. You don’t have to deal with the complexity of the Vault API, instead you can just execute the command you like and let the command let do the rest for you. As an example:

Import-Module powerVault

Open-VaultConnection -Server localhost -Vault Vault -User "Administrator" -Password ""

$CatchAssembly = Add-VaultFile -From "C:\Users\Publ... ...semblies\Catch Assembly.iam" -To "$/Designs/Assemblies/PadLock/Catch Assembly.iam" -FileClassification "Inventor" -Comment "Imported via powerVault"$
CatchAssembly = Update-VaultFile -File $CatchAssembly.'Full Path' -Properties @{"Title"="Catch Assembly"; "Company"="coolOrange"} -Category "Engineering"

$ComboAssembly = Add-VaultFile -From "C:\Users\Publ... ...ssemblies\Combo Assembly.iam" -To "$/Designs/Assemblies/PadLock/Combo Assembly.iam" -FileClassification "Inventor" -Comment "Imported via powerVault"
$ComboAssembly = Update-VaultFile -File $ComboAssembly.'Full Path' -Properties @{"Title"="Combo Assembly"; "Company"="coolOrange"} -Category "Engineering"

$padLock = Add-VaultFile -From "C:\Users\Publ... ...ssemblies\Pad Lock.iam" -To "$/Designs/Assemblies/PadLock/Pad Lock.iam" -FileClassification "Inventor" -Comment "Imported via powerVault"
$padLock = Update-VaultFile -File $padLock.'Full Path' -Properties @{"Title"="Pad Lock"; "Company"="coolOrange"} -Category "Engineering" -AddChilds @($CatchAssembly.'Full Path',$ComboAssembly.'Full Path')

The first line imports the powerVault into your PowerShell session (Import-Module powerVault). With the next few lines we connect to Vault (Open-VaultConnection), we add 3 files to Vault (Add-VaultFile) and then we update those files with properties and set the category. The Add-VaultFile command let creates the folder in Vault, if not existing, and handles check-out/-in in case a file already exists. The last Update-VaultFile also sets the references between the main assembly and the two sub assemblies. And why not even release the files:

$CatchAssembly = Update-VaultFile -File $CatchAssembly.'Full Path' -Status "Released"
$ComboAssembly = Update-VaultFile -File $ComboAssembly.'Full Path' -Status "Released"
$padLock = Update-VaultFile -File $padLock.'Full Path' -Status "Released"

As you can see, with single lines of codes and some readable options, you can import and update files into Vault. In a similar way you can get a file object with Get-VaultFile like this

$file = Get-VaultFile -File "$/Designs/Assemblies/PadLock/Pad Lock.iam"

You will notice that the $file object exposes already all the file properties, so you can access the title just by $file.Title, or to the $file.’Engr Approved By’ or $file.’File Name (Historical)’. Yes, the property names are exactly as exposed in Vault, including blank spaces and brackets. In such cases the property name must be set in quotes (‘…’).

Now, let’s download the assembly into a local folder

Get-VaultFile -File "$/Designs/Assemblies/PadLock/Pad Lock.iam" -DownloadPath c:\temp\padlock

You will notice that the assembly including children will be downloaded and the references will be redirected, so it’s ready to be opened!

And what if you like to get all files of a given folder?

$files = Get-VaultFiles -Folder "$/Designs/Assemblies/PadLock"

Or why not making a search in Vault for all the released drawings?

$files = Get-VaultFiles -Properties @{"File Extension"="idw";"State"="Released"}

Meanwhile you should get a feel for the simplicity of powerVault. For those of you who like to use the native API, no problem, as by establishing the connection to Vault (Open-VaultConnection), you get also the variables $vault (complete webservices), $vaultConnection (VDF) and $vaultExplorerUtil. And you are free to mix the command lets with the native Vault API. So, you get the best of both.

There are more command lets and even more will come. The current documentation can be found here http://wiki.coolorange.com/display/powerjobs/Cmdlets, however with 2016 versions (few weeks) we will create a dedicated area for powerVault.

powerVault is part of powerJobs and powerGate, so you can imagine how easy it is to write jobs with powerJobs or customize powerGate. And as powerVault is now a stand alone and free app, you can use it within your Data Standard projects or for stand alone scripts.

You can now download powerVault from here http://www.coolorange.com/en/download.php?product=powerVault

With the 2016 Version, a dedicated web page will come together with the wiki page. But as we are so excited about powerVault, we were not willing to hold this cool thing back for longer.

There is another thing important to be mentioned. Compatibility! As the syntax of powerVault does not change, the scripts you make with 2015 R2, will also work with 2016 and later versions. We will release an according powerVault version for each Vault version, so that you don’t have to care about upgrading your code.

Curious enough?? Get started by downloading powerVault, or if you already have powerJobs or powerGate just start a PowerShell. Have a look into your installed applications, as maybe powerVault is already there.

2015-04-02_08-58-30

Just one remark. As powerVault is built with latest technology (.Net 4), PowerShell on Windows 7 machine still runs with .Net 2 and does not load powerVault in the first place. However, if you start a PowerShell and execute the following lines, the supported .Net framework will be set to latest version.

add hklm\software\microsoft\.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 1
reg add hklm\software\wow6432node\microsoft\.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 1

Restart the PowerShell and you are ready to go.

Have fun!!

Posted in Data Standard, powerGate, powerJobs, PowerShell, Vault API | 2 Comments

New file inherits from template

2015-03-27_15-31-52

Recently, we received an interesting question about Data Standard. In Vault, it’s possible to create new files based on templates. The question was whether it’s possible to inherit the category and maybe also some properties from the template file into the new file dialog. Obviously, the answer is YES!

The first thing we have to do is to hook the SelectionChanged event from the template combobox. In this case, the combobox is bound to a fixed Data Standard property called SelectedTemplate, which is not accessible through the Prop array. So, we will hook directly the selection changed event from the combobox, called TemplateCB. We do this inside the InitializeWindow function, like this:

function InitializeWindow
{
 ..
 .....

 $dsWindow.FindName("TemplateCB").add_SelectionChanged({
  OnTemplateChanged
 })
}

Every time, the user selects a template, our OnTemplateChanged will be fired. Inside such function, we will take the file information from the selected template file and assign it to our dialog.

As the selected template path and template name are sort of internal properties, we will retrieve these information directly from the DataContext of our dialog.

$context = $dsWindow.DataContext
$path = $context.TemplatePath
$file = $context.SelectedTemplate

Now that we know which template the user has selected from which folder, via the Vault API we can get the file information. The following functions can be placed either in a separate PS1 file or somewhere in the default.ps1.

function OnTemplateChanged
{
 $context = $dsWindow.DataContext
 $path = $context.TemplatePath
 $file = $context.SelectedTemplate
 $template = $path + "/" + $file
 $folder = $vault.DocumentService.GetFolderByPath($path)
 $files = $vault.DocumentService.GetLatestFilesByFolderId($folder.Id,$false)
 $file = $files | Where-Object { $_.Name -eq $file }
 $Prop["_Category"].Value = $file.Cat.CatName

 $properties = GetFileProperties -fileId $file.Id
 $Prop["Title"].Value = $properties["Title"]
}

At the end we can set the current category with the category of the template file. In the last two lines we set also the title with the same value as the template, so in case your templates have some default values, they can be brought over to the new file.

Now, as the file object does not expose the properties, we need to pick them via the Vault API. For this purpose, I created another small function that retrieves the properties and returns an array with property name and value.

function GetFileProperties($fileId)
{
 $global:propDefs = $vault.PropertyService.GetPropertyDefinitionsByEntityClassId("FILE")
 $props = $vault.PropertyService.GetPropertiesByEntityIds("FILE",@($fileId))
 $properties = @{}
 foreach ($prop in $props) {
  $propDef = $global:propDefs | Where-Object { $_.Id -eq $prop.PropDefId }
  $properties[$propDef.DispName] = $Prop.Val
 }
 return $properties
}

You will notice that when you select a template now, the dialog takes a second or so to update. The reason is that collecting all the properties from the template is time consuming and delays the dialog refresh. If you comments the two lines

#$properties = GetFileProperties -fileId $file.Id
#$Prop["Title"].Value = $properties["Title"]

You will notice that the dialog is again reactive.

So, now it’s up to you to define which information shall be copied from the template into your new file.

Have fun!

Posted in Data Standard | Leave a comment

Data Standard Quick Reference

2015-03-18_09-11-23

During the trainings we held on Data Standard and the conversations we had with you, we realized that Data Standard could be actually summarized into a single page. And so we did it. The result is this document.

Data Standard Quick Reference 2015R2

On the first page, you will find a summary of the most used WPF controls, such as Textbox, ComboBox, etc. Sure, there are more controls and also for the described controls, there are more properties, but if you know/use these, you are good to go!

On the second page, you will find a short description for the Inventor and AutoCAD configuration file and a description for the PowerShell functions.

The document is not a “getting started”, or tutorial or a how-to. It’s a quick reference. It’s a document you could print and leave on your desk, and pick it up whenever you can’t remember the syntax. The content is extracted from the Autodesk online help, where it is described in a broader way. This document aims to summarize all the things you must know, or all the things you usually run into while dealing with Data Standard.

Finally, it also shows that Data Standard can be summarized on one page (front-rear), which says a lot!!

So, we hope you will enjoy this document, and as usual, if you have comments or suggestions, just get back to us.

Posted in Data Standard | 3 Comments