提取管道连接件 及系统类型,主要代码如下:
string message = "";
ConnectorSet connectors = pipe.ConnectorManager.Connectors;
foreach (Connector conn in connectors)
{
if (conn.IsConnected == true)
{
ConnectorSet connectorSet = conn.AllRefs;
ConnectorSetIterator iterator = connectorSet.ForwardIterator();
while (iterator.MoveNext())
{
Connector currentConnector = iterator.Current as Connector;
if (currentConnector != null)
{
if (currentConnector.ConnectorType == ConnectorType.End ||
currentConnector.ConnectorType == ConnectorType.Curve ||
currentConnector.ConnectorType == ConnectorType.Physical)
{
if (currentConnector.Owner.Name != pipe.Name)
{
string conName = currentConnector.Owner.Name;
Parameter systemParam = pipe.LookupParameter("系统类型");
string systemValue = systemParam.AsValueString();
message += conName + "," + systemValue;
}
}
}
}
}
}