EBDN - Community - Question & Answers

  Thursday, 30 September 2021
  1 Replies
  774 Visits
0
Votes
Undo
Hi Team,

i'm using below method to get the device Pins X,Y coordinates which is working fine but I want get the Device pin Designation along with X,Y coordinates which i'm not getting ..Please help me on the same.

public static bool GetSymbolInformation(this Sheet sheet, string symbolId,
out SymbolInfo info, out Collection<PinData> Pins)
{
if (string.IsNullOrEmpty(symbolId))
throw new ArgumentNullException("symbolId";);

IList<ExecuteSheetOperationRecordData> op = new List<ExecuteSheetOperationRecordData>();
op.Add(new ExecuteSheetOperationRecordData()
{ Qualifier = (int)ExecuteSheetOperationModes.OpExecSheetGetSymbol, Value = 0 });
op.Add(new ExecuteSheetOperationRecordData()
{ Qualifier = (int)ExecuteSheetOperationModes.ArgExecSheetRef2Symbol, Value = symbolId });
op.Add(new ExecuteSheetOperationRecordData()
{ Qualifier = (int)ExecuteSheetOperationModes.ArgExecSheetFctSel, Value = 0 });
op.Add(new ExecuteSheetOperationRecordData()
{ Qualifier = (int)ExecuteSheetOperationModes.ArgExecSheetRetVal, Value = null });
op.Add(new ExecuteSheetOperationRecordData()
{ Qualifier = (int)ExecuteSheetOperationModes.ArgExecSheetRetVal, Value = null });
op.Add(new ExecuteSheetOperationRecordData()
{ Qualifier = (int)ExecuteSheetOperationModes.ArgExecSheetRetVal, Value = null });
op.Add(new ExecuteSheetOperationRecordData()
{ Qualifier = (int)ExecuteSheetOperationModes.ArgExecSheetRetVal, Value = null });
op.Add(new ExecuteSheetOperationRecordData()
{ Qualifier = (int)ExecuteSheetOperationModes.ArgExecSheetRetVal, Value = null });
op.Add(new ExecuteSheetOperationRecordData()
{ Qualifier = (int)ExecuteSheetOperationModes.ArgExecSheetRetVal, Value = null });
op.Add(new ExecuteSheetOperationRecordData()
{ Qualifier = (int)ExecuteSheetOperationModes.ArgExecSheetRetVal, Value = null });
op.Add(new ExecuteSheetOperationRecordData()
{ Qualifier = (int)ExecuteSheetOperationModes.ArgExecSheetRetVal, Value = null });


sheet.ExecuteSheetOperation(ref op);

if (op[3].Value == null || op[4].Value == null) //TODO check all values for null
{
//System.Diagnostics.Debug.Assert(false);
SimpleLog.addLogMessage("Failed to retrieve Symbol Information for " + symbolId, sheet.FullName, MessageType.Error);
info = new SymbolInfo();
Pins = new Collection<PinData>();
return false;
}
info = new SymbolInfo((double)op[3].Value, (double)op[4].Value, (double)op[5].Value, (double)op[6].Value, ((double)op[9].Value) != 0.0, ((double)op[10].Value) != 0.0);
int NumberofPins = Convert.ToInt32(op[7].Value);
Pins = new Collection<PinData>();
ExecuteSheetOperationRecordData[] RawPins = (ExecuteSheetOperationRecordData[])op[8].Value; //TODO check upper bound
for (int i = 0; i < NumberofPins; i++)
{
int orient = Convert.ToInt32(RawPins[5 * i + 3].Value);
int typ = Convert.ToInt32(RawPins[5 * i + 4].Value);
Pins.Add(new PinData((string)RawPins[5 * i].Value, new SheetPosition((double)RawPins[5 * i + 1].Value, (double)RawPins[5 * i + 2].Value),
(PinOrientation)orient, (ObjectType)typ));
}
return true;
}

Thanks,
Ramesh