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: 

CreateMode & EditMode

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
295 Views, 3 Replies

CreateMode & EditMode

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

 

Tags (1)
3 REPLIES 3
Message 2 of 4
marco.mirandola
in reply to: Anonymous

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
Message 3 of 4
Anonymous
in reply to: marco.mirandola

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

Message 4 of 4
marco.mirandola
in reply to: Anonymous

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

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

Post to forums  

Autodesk Design & Make Report