Editing Data Standard 2016 files with Visual Studio

2015-07-22_17-29-07

Since Data Standard 2014, a lot has been improved. The numbering, dynamic property, replace with copy, etc. With the new feature, new controls came in the dialog, which refers to DLLs. Such DLLs are needed in order to interpret the dialogs. So, if you open a Data Standard XAML file with Visual Studio, the designer will only be able to render the dialog if all DLLs are referenced. As recently this question come up several times, I thought it would be good to give you a summary.

These are the DLLs that you’ll need in Visual Studio in order to properly edit a Data Standard XAML file.

  • C:\ProgramData\Autodesk\Vault 2016\Extensions\DataStandard\CreateObject.dll
  • C:\ProgramData\Autodesk\Vault 2016\Extensions\DataStandard\Common.dll
  • C:\ProgramData\Autodesk\Inventor 2016\Addins\Data Standard\dataStandard.UI.dll
  • C:\Program Files\Autodesk\Vault Professional 2016\Explorer\Autodesk.Connectivity.WebServices.dll

Some of these DLLs are needed for the File.XAML, some for the Inventor.XAML and other for the tabs. However, as you probably will edit all of them eventually, just add them to your Visual Studio project and start editing.

Especially for the File.XML you will still see that the numbering scheme control throws an exception saying “Cannot create an instance of “DSNumSchemeCtrl”. Don’t worry about this. Visual Studio tries to instantiate such object and files. However, the dialog is visible and you can edit the XAML file.

 

So, in order to edit the Data Standard files, you will have to follow these steps:

  1. Create a new project in Visual Studio of type “WPF Application”. Preferable of type “Visual C#”
  2. name it “VDS”, or however you prefer
  3. Visual Studio will immediately open two files (MainWindow.XML and MainWindow.xaml.cs). Close both files, as we don’t need them.
  4. In the Solution Explorer (usually on the right) go the References and add the DLLs mentioned above
  5. In the “Solution Explorer” right click on the project and select “Add > Existing Item…” or just use the shortcut [SHIFT]+[ALT]+A
  6. Navigate to the Data Standard folder C:\ProgramData\Autodesk\Vault 2016\Extensions\DataStandard\ and either from the Vault\Configuration or CAD\Configuration select the XAML files you like to edit. ATTENTION!! Add the file as a link by selecting “Add as link”
  7. In the Solution Explorer double click on the XAML file you like to edit
  8. done!

I hope this little description will help you getting started with editing Data Standard dialogs.

Posted in Data Standard | Leave a comment

Vault Data Standard 2016 for Inventor – Replace with Copy

Did you already have a look at Vault Data Standard 2016 for Inventor? Maybe you have seen that there are new commands in the Data Standard ribbon. These commands for the new “Replace with Copy” feature help you to create new variants of existing designs.

Let me show you with an example, how powerful this new feature is. I use the Metal Container of the Inventor samples. This is a DWG file that references an assembly with 3 components. Now I want to create a variant “Aluminum Container” based on the Metal Container. The gasket shall be reused, while the Box base and the Lid shall be copied. The DWG file also should be copied, and the reference shall be set to the new “Aluminum Container” assembly, so that I don’t need to crate all annotations again.

The first thing is to open the assembly “Metal Container.iam”. There is no need for it to be checked out, as I don’t want to modify the assembly. Then I call the command “Copy incl. Drawing”

The Data Standard dialog for the copied assembly opens where I can select the new location and insert the metadata like the Title of the new assembly:

It’s quite interesting that the header and some property values contain a string “Copy of“ and then the name of my original file. Also a thumbnail of the original file is displayed, so I know which document I am working on.

When selecting OK the copied assembly is checked in and the Data Standard dialog for the related drawing appears. Again I can type in the metadata and after the OK the DWG file is checked in. The DWG is still open, and when I check the reference, I see that it points to the copied assembly. Also, all annotations are still there. The values in the title block are already correct as well.

Let’s go back to the copied assembly. I kept it checked out, as I want to replace the box and lid with an aluminum variant. I just need to call the command “Replace with Copy” from the Data Standard ribbon on each of these components. I can select the component either in the Inventor browser or in the geometry area. The Data Standard dialog shows up again and I can type in the data. The component is replaced with the copy after pressing OK. I just need to check in the assembly and I am done!

If you wonder where the “Copy of” string in the Data Standard dialog came from, have a look into the Inventor.cfg file (in folder C:\ProgramData\Autodesk\Vault 2016\Extensions\DataStandard\CAD\Configuration).

There you find an attribute “InitialCopyValue” that defines the initial value for the property where it is defined. So for the property Title, it consists of a UIString that gives back the localized string of “Copy of” and the original file name.

Enjoy!

Posted in Data Standard, Inventor | Leave a comment

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