Batch Mode Whitespace Calculation using the Command Line
- Last UpdatedJan 27, 2023
- 3 minute read
Note:
AVEVA E3D Whitespace Optimizer operates using a cost charging mechanism. Refer to AVEVA E3D Whitespace Optimizer Cost Charging Mechanism Description for further information.
As noted in Run Whitespace Calculation using the Command Line, it is imperative that the .NET library is first imported (in each new Draw session) using the commands:
import 'Aveva.Pdms.SDInteraction.UI'
using namespace 'Aveva.Pdms.SDInteraction.UI.Whitespace.PML'
!ws = object WSManager()
This will then enable the use of the following commands.
The associated style and element rule set values can be copied to member elements using the command line:
!ws.CascadeExisting()
Executes cascading in the hierarchy branch rooted at the current element. The cascaded references are: Wgstrf, Wostrf, Wsersf. The references must be set on the current element before calling the method.
!ws.CascadeExisting(hierarchyElement)
Executes cascading in the hierarchy branch rooted at the specified hierarchy element. The cascaded references are: Wgstrf, Wostrf, Wsersf. The references must be set on the hierarchy element before calling the method. For example:
!ws.CascadeExisting('/MYDEPT')
!ws.ApplyRules()
If the current element is a picture owner, the rule set is copied from the Wsersf attribute and applied to the member element annotations.
!ws.ApplyRules(picOwner)
The rule set is copied from the Wsersf attribute of the specified picture owner and applied to the member element annotations. For example:
!ws.ApplyRules('/MYSHEE')
!ws.ApplyRules(picOwner, ruleSet)
The specified rule set is applied to the member element annotations of the specified picture owner. The specified rule set does not need to be the rule set referenced by the picture owner. For example:
!ws.ApplyRules('/MYSHEE', '/MYRULESET')
!ws.RunAndWrite(picOwners, wsrelb, timeout)
The whitespace calculation is performed for a collection of picture owners. A new batch run result (WSBART) is created under the specified result library (WSRELB). Then, for each picture owner in the collection, the engine stops after the specified amount of time. The result (the new annotation positions) is written to the picture owner, and a new picture owner result (WSPORT) is created under the WSBART. For example:
!myPicOwners = ARRAY()
!myPicOwners[0] = '/MY-SHEET-1'
!myPicOwners[1] = '/MY-SHEET-2'
...
!ws.RunAndWrite(!myPicOwners, '/MYWSRELB', 300)
Note:
Save work is executed at the beginning of the batch run, this is required to execute
retracting of sheets to their original states.
!ws.RunAndWrite(picOwners, wsrelb, timeout, mpLimit)
The whitespace calculation is performed for a collection of picture owners. A new batch run result (WSBART) is created under the specified result library (WSRELB). Then, for each picture owner in the collection, the engine continues computing until the first result improvement with the MP value at or below the specified limit is produced. If this does not happen, the whitespace calculation stops after the specified amount of time. The result (the new annotation positions) is written to the picture owner, and a new picture owner result (WSPORT) is created under the WSBART. For example:
!myPicOwners = ARRAY()
!myPicOwners[0] = '/MY-SHEET-1'
!myPicOwners[1] = '/MY-SHEET-2'
...
!ws.RunAndWrite(!myPicOwners, '/MYWSRELB', 300, 20)
Note:
Save work is executed at the beginning of the batch run, this is required to execute
retracting of sheets to their original states.
!ws.RunAndWrite(picOwners, wsrelb, timeout, mpLimit, wsbartName,
wsbartDescription, autoAcceptResultsGood, autoAcceptResultsAverage,
autoAcceptResultsBad)
The whitespace calculation is performed for a collection of picture owners. A new batch run result (WSBART) with specified name and description is created under the specified result library (WSRELB). Then, for each picture owner in the collection, the engine continues computing until the first result improvement with the MP value at or below the specified limit is produced. If this does not happen, the whitespace calculation stops after the specified amount of time. The result (the new annotation positions) is written to the picture owner, and a new picture owner result (WSPORT) is created under the WSBART. The state of given WSPORT is then set to 'Accepted' if its result tier matches the result tier(s) selected to be auto-accepted. For example:
!myPicOwners = ARRAY()
!myPicOwners[0] = '/MY-SHEET-1'
!myPicOwners[1] = '/MY-SHEET-2'
...
!ws.RunAndWrite(!myPicOwners, '/MYWSRELB', 300, 20, '/MYWSBARTNAME', 'MYWSBARTDESCRIPTION', True, True, False)
Note:
Save work is executed at the beginning of the batch run, this is required to execute
retracting of sheets to their original states.