Data Standards Define Category in Inventor

Data Standards Define Category in Inventor

Anonymous
Not applicable
4,643 Views
21 Replies
Message 1 of 22

Data Standards Define Category in Inventor

Anonymous
Not applicable

Hi,

 

I'm in the process of trying to setup data standards but I am falling at the first hurdle from inventor.

 

When I select a category and check file in the file is not categorised in vault,looking at the file it isn't writing to a property that i can apply a rule against to categorise and data standards doesn't seem to apply the category i have selected on check-in.

 

How do i setup the mapping of the category drop down to a property? Or is there a better way of setting this up?

 

Thanks in advance for any help.

 

 

 

0 Likes
Accepted solutions (1)
4,644 Views
21 Replies
Replies (21)
Message 2 of 22

wangdu
Collaborator
Collaborator

Hi,

 

You can try this.

 

In the InitializeWindow function in the Default.ps1, hook to the SelectionChanged event of the Categories combobox.

 

$categories = $dsWindow.FindName("Categories")
$categories.add_SelectionChanged({
    param($sender,$args)
    $Prop["YourProperty"].Value = $sender.SelectedItem.Name
})

Now all that is left is to create a rule in the vault on the property called "YourProperty".

 

Hope it helps!

 

Wangdu

 

coolOrange

www.coolOrange.com

0 Likes
Message 3 of 22

Anonymous
Not applicable

Hi Wangdu,

 

I’m afraid I don’t know what you mean.

 

Without the code you gave me It presents me with a list of categories from vault but doesn’t put the file in a category on check in.

 

The line you have given me creates a blank list.

 

What I’m confused with is why ithis tool doesn’t “work out the box”?? The tool doesn’t categorise a file from inventor to vault without configuration?

 

Thanks

 

Stuart

0 Likes
Message 4 of 22

wangdu
Collaborator
Collaborator

Hi,

 

The category lists is just there for the sake of displaying the dynamic properties. Dynamic properties are those inventor properties that are mapped to vault properties. The category in the vault is not set because the file doesn't exist in the vault before the check-in.

 

Therefore, the above code that I posted will help to set a property "YourProperty" with the selected category and once the file is checked in, your rule will check the value of this property and set the category accordingly.

 

You can find help on Data Standard here

https://knowledge.autodesk.com/support/vault-products/learn-explore/caas/CloudHelp/cloudhelp/2016/EN...

 

Wangdu

 

0 Likes
Message 5 of 22

Anonymous
Not applicable

Hi Wangdu,

 

As i have said i tried the code but the category drop down goes blank after applying, I have attached my ps1 file you may have better luck?

 

I changed "yourproperty" to "Category " I assume this would mean it will utilise the inventor property Category? I then thought from there i could setup rules to organise files into vault?

 

I cant understand what the use of this tool would be if i did not categorise the file on check-in, it defeats the purpose of categories? The file would be in vault but not categorized?

 

Thanks

 

Stuart

 

 

0 Likes
Message 6 of 22

wangdu
Collaborator
Collaborator

Hi,

 

There is no property called "Category". You should declare it in the Inventor.cfg. I haven't looked at your ps1, but I believe after defining the Category property in the Inventor.cfg you are good to go.

 

Or maybe Category is a standard property, so perhaps you should use another name.

 

Wangdu

0 Likes
Message 7 of 22

Anonymous
Not applicable

Hi Wangdu,

 

Unfortunatly it is not working for me I am trying to copy the value from the category drop down I select to the inventor i-propety "Category".

 

I have pasted in the code you supplied but it removes all values from the category drop down and complelty removes the folder (bread crumb drop down)

 

I can see other people have asked this query on the forum but havent had an answer, it seems crazy that the add-in exists without the ability to auto assign to a category, i would be happy to pick up an inventor property to use for a vault rule but again I am suprised this isnt setup by default in data standards?

 

I have attached the files maybe this will help you with understanding the issue and how i have edited the code you have supplied.

 

Thanks

 

 

0 Likes
Message 8 of 22

wangdu
Collaborator
Collaborator

Hi,

 

From the code in the Default.ps1, I see you are missing the ".Value" when you are assigning the SelectedItem.

 

$Prop[Category].Value = $sender.SelectedItem.Name

Hope it is working now.

 

 

Wangdu

0 Likes
Message 9 of 22

wangdu
Collaborator
Collaborator

Hi,

 

Have you get it working?

 

I saw that the $dsWindow is also spelled incorrectly. Looks to me you are not using the updated code. Please use the corrected code.

 

 

Wangdu

0 Likes
Message 10 of 22

Anonymous
Not applicable

Hi Wangdu,

 

No im afraid it still doesnt work.

 

I also wanted to filter out some categroires to certain file types, but still I cant even get it to write to the inventor property category based on my selection from the category drop down.

 

Thanks

0 Likes
Message 11 of 22

Anonymous
Not applicable

Hello Wangdu,

 

I have the same Problem.

I have put your code into the default.ps1 then the Category List is empty.

What can i do ?

 

Best Regards

Gerd

0 Likes
Message 12 of 22

wangdu
Collaborator
Collaborator

Hi Gerd,

 

Can you post your cfg and the ps1 so I can give a look?

 

Wangdu

0 Likes
Message 13 of 22

wangdu
Collaborator
Collaborator

Hi Stuart,

 

I have it working on my machine. I don't know why it still doesn't work.

 

Wangdu

 

 

0 Likes
Message 14 of 22

Anonymous
Not applicable

Hi Wangdu,

Here are my Files. I will write the Category into the Field "Artikelnummer" in DS the Value is set but not in the I-Property

 

Greats Gerd

0 Likes
Message 15 of 22

Anonymous
Not applicable
No Idea ?
0 Likes
Message 16 of 22

wangdu
Collaborator
Collaborator

Hi,

 

You were right with the iProperty. It doesn't get saved.

 

What I found now working was setting the property in the OnPostCloseDialog function in the Default.ps1. So, the idea is when the dialog is closed, the above function gets called. Then we look up the selected category and assign it to the custom iProperty. E.g.

 

function OnPostCloseDialog
{
	$mWindowName = $dsWindow.Name
	switch($mWindowName)
	{
		"InventorWindow"
		{
			#rules applying for Inventor
                        $categories = $dsWindow.FindName("Categories")
                        $Prop["Test"].Value = $categories.SelectedItem.Name
		}
		"AutoCADWindow"
		{
			#rules applying for AutoCAD
		}
		default
		{
			#rules applying commonly
		}
	}
}

Make sure the "Test" property is defined in the Inventor.cfg.

 

In order for the vault to find out the category, you need to map the inventor custom property to a vault UDP. After that, create a rule that defines the file category depending on the vaule of the UDP.

 

Hope it works!

 

Wangdu

0 Likes
Message 17 of 22

Anonymous
Not applicable

Hi Wangdu,

 

Sorry it doesn´t work. Data Standard don´t save the Value in my I-Property.

 

I use Data Standard Update 3; Inventor 2016 SP1 R3 and Vault 2016 SP1

 

Regards Gerd

 

0 Likes
Message 18 of 22

wangdu
Collaborator
Collaborator

Hi,

 

You can check what is going wrong by writing to Data Standard Log window using $dsDiag.

 

$dsDiag.ShowLog  #shows the Log window
$test = "some value"
$dsDiag.Trace(">> $($test)") #writes to the log window

hope this will help to find the issues.

 

 

Wangdu

0 Likes
Message 19 of 22

Markus.Koechl
Autodesk
Autodesk
Accepted solution

Hi all,

unfortunately I found a hurdle investigating systematically our default configuration (as installed). We need to ensure that the event selectionchanged is not triggered again, as we close the dialog and the selection is reset to default values. 

You can achieve this e.g. implementing a condition like shown below:

function InitializeWindow {

	$dsWindow.Width = 600
	$dsWindow.Height = 400

	#region mkoe
	$Global:_PostClose = $false
	$dsWindow.FindName("Categories").add_SelectionChanged({
			param( $parameter)
			m_CategoryChanged
		})
	#endregion

	$mWindowName = $dsWindow.Name
	switch($mWindowName)
	{
		"InventorWindow"..........

I added the $_PostClose variable to be used as condition within m_CategoryChanged function:

#region mkoe
function m_CategoryChanged {
	IF ($Global:_PostClose -eq $false){
		$_mCat = $dsWindow.FindName("Categories").SelectedItem.Name
		$dsDiag.Trace("<changed Category is $_mCat >")
		$Prop["Category"].Value = $_mCat
	}
}
#endregion

Finally I added $_PostClose = $True to the OnPostCloseDialog function:

function OnPostCloseDialog {
 
$mWindowName = $dsWindow.Name

 $Global:_PostClose = $true

switch($mWindowName)
{
.....

Thanks bringing this up to our attention!

- Markus



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
Message 20 of 22

Anonymous
Not applicable

Hi Markus,

 

I have tried the suggested code but I have no category, no numbering scheme, no folder drop downs.

 

I have no idea where the supplied code fits in the .ps1. Obviously not where I have put it!

 

It would be easier if you just sent me the ps1 and cfg file for inventor with the modification applied to the default installation files.

 

I am truly amazed that the behaviour of this tool is completely different in inventor when compared to AutoCAD and vault. Out of the box it doesn't standardise anything from inventor.

 

 

Stuart

 

 

0 Likes