Skip to content

Usage Guide

PowerShell Numbering


Minute Controller allows a post-process PowerShell script to execute upon each file created in the set. This can be particularly useful for returning custom tailored properties to the created file that can only be created through the means of a custom script.

With the PowerShell script, it's possible to:

  • Return the assigned file name from the generated file and copy it into a Vault Property (UDP).
  • Return details of the targget folder that the Numbering was executed on.
  • Traverse the file directory path and extract particular folder/sub-folder name that can then be applied to the created files Vault Properties.

PowerShell wsObject

Returned properties of the wsObject include;

  • NewFileName: The file name applied to the generated drawing based off of the schema.
  • properties: The properties assigned to the last generated drawing that were applied during the file set configuration through the Drawing Register application.
  • vFolder: The properties returned from the target folder where the file set has been created.
  • ExistingFile: Boolean indicating if the file was existing prior.
  • ToRegister: Boolean indicating if the Register Drawing check-box was enabled
  • SelectedSchema: The active schema used for the drawing generation.

Sample PowerShell Script

Sample PowerShell Script for use with Numbering.

ps1
# $wsObject - Variable contains the file object last generated by the Drawing Register. 

try{
 $fileNameWithoutExtension = [System.IO.Path]::GetFileNameWithoutExtension($wsObject.NewFileName)
 $wsObject.properties["Drawing No."] = $fileNameWithoutExtension
}
catch{
}

Tentech 2024