<< Click to Display Table of Contents >> Project Rules |
|
WireCAD 9 allows you to define project specific rules.
There are four contexts in which rules will be evaluated. Rules are contained in the Project Rules grid.
Rules can be enabled/disabled by use of the Project>Settings[Project Rules] Enable Project Rules setting.
A Rule consists of:
1.The Expression to evaluate.
2.The Context in which to evaluate the expression.
3.The ExecutionOrder. If multiple rules are defined to evaluate within the same Context they will be evaluated in the ExecutionOrder order.
4.A Description of the rule.
1.AssignCableNoAssignBeforeEdit - executed during a new Cable Number Assignment or existing Cable Number Edit before the dialog is shown.
2.AssignCableNoAssignAfterEdit - as above but after the user has clicked Save on the dialog or if Verbose Cable No Assignment = false then during the Cable save process.
3.AssignSysNameAssignBeforeEdit - executed during a new SysName Assignment or existing SysName Edit before the dialog is shown.
4.AssignSysNameAssidnAfterEdit - as above but after the user has clicked Save on the dialog or if Verbose SysName Assignment = false then during the SysName save process.
Let's assume that you have the following requirements:
1.SDI SignalType where the Length > 100 should use a different CableType than the default defined in the Project Signal Types Default Cable Type grid.
2.We want to modify the connector type from BNC to KINGS 2065-10-9 if the CableType is 1694
For requirement number 1 we will create a new rule as follows:
•Context - AssignCableNoAssignAfterEdit. We use this so that we can get the Length from the user.
•Expression - (SignalType = 'SDI' && Length >=100) then set CableType = '1694'
•Description - My First Rule. Change cable type for SDI if over 100. This is descriptive text for you and your team. It can be whatever.
•ExecutionOrder - 0. Rules execute in the order specified. Any Rule with the ExecutionOrder < 0 will not execute.
For requirement number 2 we will create two rules as follows:
•Context - AssignCableNoAssignBeforeEdit. We use this so we can see our changes in the edit dialog.
•Expression - (SRCConn = 'BNC' && CableType = '1694') then set SRCConn = 'KINGS 2065-10-9'
•Description - BNC to Kings
•ExecutionOrder - 0. Rules execute in the order specified. Any Rule with the ExecutionOrder < 0 will not execute.
•Context - AssignCableNoAssignBeforeEdit. We use this so we can see our changes in the edit dialog.
•Expression - (DestConn = 'BNC' && CableType = '1694') then set DestConn = 'KINGS 2065-10-9'
•Description - BNC to Kings
•ExecutionOrder - 1. Rules execute in the order specified. Any Rule with the ExecutionOrder < 0 will not execute.