Context:
Users can customize the schematics applications using EKL. One example of such customization is creating accelerators for repetitive tasks that require many user inputs.
- In this context, this function will provide the capability to create a symbol on a diagram from EKL
- The object must be already there in the system (Log Reference tree)
- The new EKL function “PlaceSchSymbolFromInstance”
Rule working mode : "All Occurence Objects Navigation"
Code:
// Rule purpose:
// For each time you selected the Equipment and a View, A symbol has been placed.
// Eqt1.1 is placed with the default symbol at the position 0, 0.
// Eqt1.2 is placed with SymbRef2 at the position 50, 70.
// ThisObject -> LogicalOccurence
let eqtRef(EnsLogicalEquipment)
let eqtInst(EnsLogicalEquipmentInst)
set eqtRef = ThisObject.Reference
set eqtInst = ThisObject.Instance
let pathOfInst(List)
pathOfInst.SetItem(eqtInst, 1)
let XPos(real)
set XPos = 0
let YPos(real)
set YPos = 0
let symbolName(string)
if(NULL <> eqtRef and NULL <> eqtInst)
{
let eqtName(string)
set eqtName = eqtInst.Name
if(eqtName == "Eqt1.2")
{
set XPos = 50
set YPos = 70
set symbolName = "SymbRef2"
}
let viewInst(DIFViewInstance)
let sheet(DifSheet)
GetSchActiveSheetAndView(sheet, viewInst)
PlaceSchSymbolFromInstance(pathOfInst, viewInst, XPos, YPos, symbolName)
}