Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change XAML called when editing datasheet

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
mspace
409 Views, 6 Replies

Change XAML called when editing datasheet

I have customized the File.XAML to the customer specs and it is working fine.  I have also modified the Datasheet.xaml for files.  The "Datasheet contains many more of the specific file properties that we did not included n the "new file" creation XAML.

 

How can I get the "Edit Datasheet,,," command to call up the Datasheet.XAML instead of the File.XAML.  I want the user to be able to edit the Datasheet.XAML for the file properties.  The File.XAML we only want when new files are created.

6 REPLIES 6
Message 2 of 7
marco.mirandola
in reply to: mspace

in the folder DataStandard\Vault\addinVault\Menus you'll find .ps1 files which contain the logi behind the menu items. So, the EditFile.ps1 is the file you are looking for.

 

the EditFile.ps1 looks like this:

$vaultContext.ForceRefresh =$true
$fileId=$vaultContext.CurrentSelectionSet[0].Id
$dialog=$dsCommands.GetEditDialog($fileId)
$dialog.Execute()

 

as there is no specifi information which XAML file should be loaded, there is a fall back inside the GetEditDialog function that looks for the File.XAML. However, id you add few more lines, like this:

$vaultContext.ForceRefresh = $true
$fileId=$vaultContext.CurrentSelectionSet[0].Id
$dialog = $dsCommands.GetEditDialog($fileId)
$xamlFile = New-Object CreateObject.WPF.XamlFile "CreateFile", "C:\ProgramData\Autodesk\Vault 2014\Extensions\DataStandard\Vault\Configuration\File.xaml"
$dialog.XamlFile = $xamlFile
$dialog.Execute()

 can you see the difference? I fave added the line $xamlFile = .... and the $dialog.XamlFile = $xamlFile.

What happen is that you can create a XAML-Object out of the XAML file you like and then let the function use it.

 

however, if you look in to your XAML files, you will notice that the File.XAML is a Windows while the Datasheet.XAML is a UserControl. So, you cannot use directly the Datasheet.XAML as a dialog. But wha you can do, is create a EditFile.XML and configure that file they way it's more appropriate and then let your PS1 file point to you XAML as described above.

If you don't want to recdefine the complete XAML then you may copy&paste parts from the datasheet to your new edit XAML file. just double check your entries.

 

hope this helps

ciao

marco

 

coolOrange
www.coolorange.com
Message 3 of 7
mspace
in reply to: mspace

I had overlooked the difference in the type of XAML file, that was the key. You quick response is greatly appreciated.

A little copy/paste and some tweaks to the layout and it is working as needed.

Thanks again.

Mike S.
Message 4 of 7

Hi both

 

I have a similar issue.

 

Using the CAD set of folders (DataStandards\CAD\Configuration) I would like to fire a different XAML file when a dwg is selected, as our .dwg has different properties.

 

So currently the Inventor.xaml will fire for ipt and iam but I would like a separate xaml to fire when a dwg is requested. Is this possible?

 

Regards

Gareth

Message 5 of 7

Hi Gareth, yes, it's possibile to load different XAMLs for different file types also with the CAD integration. However i suggest to do another aproach. It's also possibile to have one XAML that contains the information for drawings, parts, assemblies, etc. an dynamically hide or show information at the right time.

So, the XAML file is one, but it looks different depending on which file type, or any other property, is set. For instance you could group those fields that are specific to a file type into a group box or a separate tab. Then you could show/hide such group box or tab depending on the filetype or other properties.

 

Here is a video we made alst year on VDS 2014:

http://www.screencast.com/users/coolOrange/folders/dsVault2014/media/e7487108-c654-4336-8fea-4c74f40...

 

The logic is still valid, so it might be a good starting point.

 

ciao

marco

 

coolOrange
www.coolorange.com
Message 6 of 7

Marco

 

Thanks for replying so quickly

 

I was just looking up 'Grouping' as your reply came through.

 

I will look at your videos and hopefully sort it.

 

Thanks again

 

GW

Message 7 of 7
Stemdriller
in reply to: Stemdriller

Hi Marco

 

OK I have just gone through the video and it is just what I am after, so thank you once again.

 

Your support is much appreciated.

 

And I owe you a few drinks

 

GW

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report