Skip to content

Instantly share code, notes, and snippets.

@slydlake
Last active November 27, 2024 09:54
Show Gist options
  • Save slydlake/7e424452b15985187cd0f76c7bf00cef to your computer and use it in GitHub Desktop.
Save slydlake/7e424452b15985187cd0f76c7bf00cef to your computer and use it in GitHub Desktop.
[VDS change Properties by command VDS Copy] #VDS
function SetWindowTitle
{
$mWindowName = $dsWindow.Name
    switch($mWindowName)
  {
   "InventorFrameWindow"
   {
    $windowTitle = $UIString["LBL54"]
   }
   "InventorDesignAcceleratorWindow"
   {
    $windowTitle = $UIString["LBL50"]
   }
   "InventorPipingWindow"
   {
    $windowTitle = $UIString["LBL39"]
   }
   "InventorHarnessWindow"
   {
    $windowTitle = $UIString["LBL44"]
   }
   default #applies to InventorWindow and AutoCADWindow
   {
    if ($Prop["_CreateMode"].Value)
    {
     if ($Prop["_CopyMode"].Value)
     {
      $windowTitle = "$($UIString["LBL60"]) - $($Prop["_OriginalFileName"].Value)"
# CDN: Set Creationdate and Author, Designer by copy with VDS
$Prop["Creation Time"].Value = Get-Date -displayhint date
$Document.PropertySets.Item("Summary Information").Item("Author").Value = $VaultConnection.UserName
$Document.PropertySets.Item("Design Tracking Properties").Item("Designer").Value = $VaultConnection.UserName
# CDN end
     }
     elseif ($Prop["_SaveCopyAsMode"].Value)
     {
      $windowTitle = "$($UIString["LBL72"]) - $($Prop["_OriginalFileName"].Value)"
     }else
     {
      $windowTitle = "$($UIString["LBL24"]) - $($Prop["_OriginalFileName"].Value)"
     }
    }
    else
    {
     $windowTitle = "$($UIString["LBL25"]) - $($Prop["_FileName"].Value)"
    } 
   }
  }
  return $windowTitle
}
<?xml version="1.0" encoding="utf-8"?>
<Configuration>
<PathDefinition>{Workspace}\{Prop[Folder].Value}</PathDefinition>
<FileNameDefinition>{Prop[DocNumber].Value}</FileNameDefinition>
<PropertyDefinitions>
<PropertyDefinition PropertyName="DocNumber" DataType="Text" InitialValue="{PathAndFileNameHandler.FileName}" />
<PropertyDefinition PropertyName="Title" DataType="Text" InitialCopyValue="{Prop[Title].Value}" />
<PropertyDefinition PropertyName="Description" DataType="Text" />
<PropertyDefinition PropertyName="Designer" DataType="Text" />
<PropertyDefinition PropertyName="Author" DataType="Text" />
<PropertyDefinition PropertyName="Comments" DataType="Text" />
<PropertyDefinition PropertyName="Creation Time" DataType="Text" InitialCopyValue="{now}" />
<PropertyDefinition PropertyName="Folder" DataType="Text" InitialValue="." RequiresValue="true"/>
<PropertyDefinition PropertyName="Original" DataType="Text" InitialCopyValue="{PathAndFileNameHandler.OriginalFullFileName}" />
</PropertyDefinitions>
<!--Add INEST to the SupportedFileTypes if you want VDS to handle the .inest files-->
<SupportedFileTypes>IDW,IAM,IPT,IPN,DWG</SupportedFileTypes>
<ShowCheckInDialog>True</ShowCheckInDialog>
<SkipForProperties></SkipForProperties>
</Configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment