Vault Datastandard $DSParam empty?

Vault Datastandard $DSParam empty?

b.graaf
Advocate Advocate
303 Views
1 Reply
Message 1 of 2

Vault Datastandard $DSParam empty?

b.graaf
Advocate
Advocate

I have learned, that if you click on the "OK" button in a DataStandard dialog, that the OnPostCloseDialog function will be executed.

Depending if you are saving or editing a DataStandard part, hitting the "OK" button, should also give the $DSParam the value "Create" or Ëdit".

 

Depending on this value, the OnPostCloseDialog can generate a new/first filename, or not (if you already have saved the file).

 

The next peace of code shows the OnPostCloseDialog part.

If it is an Inventor file, then the code looks if the $DSParam has the value "Create" and only than, it will generate a new filenumber.

If it is not (you are editting an already saved file) no new number has to be generated.

 

function OnPostCloseDialog
{
    $mWindowName = $dsWindow.Name
        switch($mWindowName)
        {
            "InventorWindow"
            {
                if ($DSParam -eq "Create")
                {
                    #CODE for generating partnumber
                }
            }
        }
}

The strange thing is, that my DataStandard will never go in the partn muber generating code. For some reason, the $DSParam seems to get no value at all.

Is this something I have to create somewhere else in the code myself, or should this parameter get the value by a hardcoded peace of code?

 

Oh, the "OK" button is binded:

 

<Button Name="btnok" 
		Command="{Binding CloseWindowCommand, ElementName=InventorWindow}" 
		Grid.Column="1" Margin="0,5,0,5" Width="80" 
		HorizontalAlignment="Right" VerticalAlignment="Center" 
		ToolTipService.ShowOnDisabled="True" 
		ToolTip="{Binding UIString[LBL35]}" 
		Content="{Binding UIString[BTN1]}" 
		IsEnabled="{Binding Properties.IsValid}"></Button>
0 Likes
304 Views
1 Reply
Reply (1)
Message 2 of 2

wangdu
Collaborator
Collaborator

Hi,

 

Which version are you running? 2017 DS for Inventor seems to have no value. I don't think you can create and set the parameters.

 

But you can use instead $Prop["_CreateMode"].Value or $Prop["_EditMode"].Value or others inside the OnPostCloseDialog to differentiate between the creation or saving mode. Can you try that and see if it helps?

 

Thanks,

 

Wangdu

 

coolOrange

www.coolOrange.com

0 Likes