CreateMode & EditMode

CreateMode & EditMode

Anonymous
Not applicable
750 Views
3 Replies
Message 1 of 4

CreateMode & EditMode

Anonymous
Not applicable

I am building up my DS process and my ps/XAML files are configured using tabs

 

DWG Props and Parts Properties, depending on which extension is selected eg ipt, iam or dwg then the relevant tabs are shown and hidden, which works fine when creating, saves ok and i can check in to Vault.

 

But when I come to edit such a file when the XAML fires all the tabs are visible. I am guessing it is something to do with the CreateMode and EditMode, my ps1 file currently only exhibits 'CreateMode'. So do I need to add 'EditMode' to the PS file in someway. PS1 file listed below

Can't really find much info about these two modes and how they work.

 

Any guidance would be appreciated

 

Thanks

 

GW

 

 

function InitializeWindow
{
       $dSWindow.Width = 600
       $dSWindow.Height = 400
      
#region create mode properties
       if($Prop["_CreateMode"].Value)
       {
       #}


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

#region file type settings
              if($Prop["_FileExt"].Value -eq "ipt" )
              {
                     $dSWindow.findName("PartsTab").Visibility = $visible
                     $dSWindow.findName("DWGTab").Visibility = $collapsed
                     $dSWindow.findName("BuilderTab").Visibility = $collapsed
                     $dSWindow.findName("PartsTab").IsSelected = "True"
                     $dSWindow.findName("cmbMat").IsEnabled = "True"
              }
              elseif ($Prop["_FileExt"].Value -eq "iam" )
              {
                     $dSWindow.findName("PartsTab").Visibility = $visible
                     $dSWindow.findName("DWGTab").Visibility = $collapsed
                     $dSWindow.findName("BuilderTab").Visibility = $collapsed
                     $dSWindow.findName("PartsTab").IsSelected = "True"
                     $dSWindow.findName("cmbMat").Visibility = $hidden
                     $dSWindow.findName("lblMaterial").Visibility = $hidden

 

0 Likes
751 Views
3 Replies
Replies (3)
Message 2 of 4

marco.mirandola
Advocate
Advocate

Hi, i think you already described the solution. in you PS1 you set the visibility for the tabs only if the dialog appears in create mode. So, i't obvious that all the tabs do appear every time after the creation (edit mode). if you like to have the same behavior while creating and editing, and just differentiate by file type, or other properties, then just remove the first if($Prop["_CreateMode"].Value)

 

is this what you were looking for?

 

ciao

marco

 

coolOrange
www.coolorange.com
0 Likes
Message 3 of 4

Anonymous
Not applicable

Sorry Marco

 

Only just seen your reply.

 

Yes I do want the same behaviour, so I just need to remove the first ($Prop["_CreateMode"].Value?

 

The tabs work fine

 

Thanks for responding

 

GW

0 Likes
Message 4 of 4

marco.mirandola
Advocate
Advocate
Hi, in your code you have a switch between IPT and IAM, which is fine. In that switch you set some controls to visible and other to collapsed/hidden. A few lines above, you check wether you are in CreateMode or not and execute the following code just in case you are in CreateMode.
So, yes, if you like to have your code always running, then it has to be "outside" the CreateMode test. So, either remove such lines, or move your switch part out from the CreateMode action area.

ciao
marco
coolOrange
www.coolorange.com
0 Likes