本文整理汇总了C#中Dynamo.Models.NodeMigrationData.RemoveFirstConnector方法的典型用法代码示例。如果您正苦于以下问题:C# NodeMigrationData.RemoveFirstConnector方法的具体用法?C# NodeMigrationData.RemoveFirstConnector怎么用?C# NodeMigrationData.RemoveFirstConnector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dynamo.Models.NodeMigrationData
的用法示例。
在下文中一共展示了NodeMigrationData.RemoveFirstConnector方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Migrate_0630_to_0700
public static NodeMigrationData Migrate_0630_to_0700(NodeMigrationData data)
{
NodeMigrationData migratedData = new NodeMigrationData(data.Document);
XmlElement oldNode = data.MigratedNodes.ElementAt(0);
string oldNodeId = MigrationManager.GetGuidFromXmlElement(oldNode);
//create the node itself
XmlElement newNode = MigrationManager.CreateFunctionNodeFrom(oldNode);
MigrationManager.SetFunctionSignature(newNode, "ProtoGeometry.dll",
"Surface.ByLoft",
"[email protected][]");
migratedData.AppendNode(newNode);
string newNodeId = MigrationManager.GetGuidFromXmlElement(newNode);
PortId oldInPort0 = new PortId(oldNodeId, 0, PortType.INPUT);
data.RemoveFirstConnector(oldInPort0);
PortId oldInPort1 = new PortId(oldNodeId, 1, PortType.INPUT);
XmlElement connector1 = data.FindFirstConnector(oldInPort1);
PortId newInPort0 = new PortId(newNodeId, 0, PortType.INPUT);
data.ReconnectToPort(connector1, newInPort0);
PortId oldInPort2 = new PortId(oldNodeId, 2, PortType.INPUT);
data.RemoveFirstConnector(oldInPort2);
return migratedData;
}
示例2: Migrate_0630_to_0700
public static NodeMigrationData Migrate_0630_to_0700(NodeMigrationData data)
{
NodeMigrationData migratedData = new NodeMigrationData(data.Document);
XmlElement oldNode = data.MigratedNodes.ElementAt(0);
string oldNodeId = MigrationManager.GetGuidFromXmlElement(oldNode);
//create the node itself
XmlElement dsRevitNode = MigrationManager.CreateFunctionNodeFrom(oldNode);
MigrationManager.SetFunctionSignature(dsRevitNode, "RevitNodes.dll",
"FaceAnalysisDisplay.ByViewFacePointsAndValues",
"[email protected],FaceReference,double[][],double[]");
migratedData.AppendNode(dsRevitNode);
string dsRevitNodeId = MigrationManager.GetGuidFromXmlElement(dsRevitNode);
XmlElement documentNode = MigrationManager.CreateFunctionNode(
data.Document, oldNode, 0, "RevitNodes.dll",
"Document.Current", "Document.Current");
migratedData.AppendNode(documentNode);
XmlElement activeViewNode = MigrationManager.CreateFunctionNode(
data.Document, oldNode, 1, "RevitNodes.dll",
"Document.ActiveView", "Document.ActiveView");
migratedData.AppendNode(activeViewNode);
//create and reconnect the connecters
PortId oldInPort0 = new PortId(oldNodeId, 0, PortType.Input);
XmlElement connector0 = data.FindFirstConnector(oldInPort0);
PortId oldInPort1 = new PortId(oldNodeId, 1, PortType.Input);
XmlElement connector1 = data.FindFirstConnector(oldInPort1);
PortId oldInPort2 = new PortId(oldNodeId, 2, PortType.Input);
PortId oldInPort3 = new PortId(oldNodeId, 3, PortType.Input);
XmlElement connector3 = data.FindFirstConnector(oldInPort3);
PortId newInPort1 = new PortId(dsRevitNodeId, 1, PortType.Input);
PortId newInPort2 = new PortId(dsRevitNodeId, 2, PortType.Input);
PortId newInPort3 = new PortId(dsRevitNodeId, 3, PortType.Input);
data.ReconnectToPort(connector0, newInPort3);
data.ReconnectToPort(connector1, newInPort2);
data.ReconnectToPort(connector3, newInPort1);
data.RemoveFirstConnector(oldInPort2);
data.CreateConnector(documentNode, 0, activeViewNode, 0);
data.CreateConnector(activeViewNode, 0, dsRevitNode, 0);
return migratedData;
}
示例3: Migrate_0630_to_0700
//.........这里部分代码省略.........
"[email protected]" +
"string,SketchPlane,double,double,double,ModelTextType");
migratedData.AppendNode(dsModelText);
string dsModelTextId = MigrationManager.GetGuidFromXmlElement(dsModelText);
// Create a "Plane.ByOriginNormal" that takes a "Point" (origin) and
// a "Vector" (normal). This new node will convert both the "position"
// and "normal" to a "Plane".
XmlElement plane = MigrationManager.CreateFunctionNode(
data.Document, oldNode, 0, "ProtoGeometry.dll", "Plane.ByOriginNormal",
"[email protected],Vector");
migratedData.AppendNode(plane);
string planeId = MigrationManager.GetGuidFromXmlElement(plane);
// Create a "SketchPlane.ByPlane" node which converts a "Plane"
// into a "SketchPlane".
XmlElement dsSketchPlane = MigrationManager.CreateFunctionNode(
data.Document, oldNode, 1, "RevitNodes.dll",
"SketchPlane.ByPlane", "[email protected]");
migratedData.AppendNode(dsSketchPlane);
string dsSketchPlaneId = MigrationManager.GetGuidFromXmlElement(dsSketchPlane);
// Create a "ModelTextType.ByName" node that converts a "string"
// into "ModelTextType" node.
XmlElement dsModelTextType = MigrationManager.CreateFunctionNode(
data.Document, oldNode, 2, "RevitNodes.dll",
"ModelTextType.ByName", "[email protected]");
migratedData.AppendNode(dsModelTextType);
string dsModelTextTypeId = MigrationManager.GetGuidFromXmlElement(dsModelTextType);
//append asVector Node
XmlElement pointAsVector0 = MigrationManager.CreateFunctionNode(
data.Document, oldNode, 3, "ProtoGeometry.dll",
"Point.AsVector", "Point.AsVector");
migratedData.AppendNode(pointAsVector0);
string pointAsVector0Id = MigrationManager.GetGuidFromXmlElement(pointAsVector0);
//append number Node
XmlElement numberNode = MigrationManager.CreateCodeBlockNodeModelNode(
data.Document, oldNode, 4, "0;");
migratedData.AppendNode(numberNode);
#endregion
#region Move Connectors Onto the New Nodes
// Move connector for "text" over to the new node.
PortId oldInPort = new PortId(oldNodeId, 0, PortType.INPUT);
PortId newInPort = new PortId(dsModelTextId, 0, PortType.INPUT);
XmlElement connector = data.FindFirstConnector(oldInPort);
data.ReconnectToPort(connector, newInPort);
// Move connector for "position" over to "Plane" node.
oldInPort = new PortId(oldNodeId, 1, PortType.INPUT);
newInPort = new PortId(planeId, 0, PortType.INPUT);
connector = data.FindFirstConnector(oldInPort);
data.ReconnectToPort(connector, newInPort);
// Move connector for "normal" over to "Plane" node.
oldInPort = new PortId(oldNodeId, 2, PortType.INPUT);
newInPort = new PortId(pointAsVector0Id, 0, PortType.INPUT);
connector = data.FindFirstConnector(oldInPort);
data.ReconnectToPort(connector, newInPort);
data.CreateConnector(pointAsVector0, 0, plane, 1);
// Connect from "Plane" to "SketchPlane".
data.CreateConnector(plane, 0, dsSketchPlane, 0);
// Connect from "SketchPlane" to the new node.
data.CreateConnector(dsSketchPlane, 0, dsModelText, 1);
oldInPort = new PortId(oldNodeId, 3, PortType.INPUT);
data.RemoveFirstConnector(oldInPort);
// Move connector for "depth" over to the new node.
oldInPort = new PortId(oldNodeId, 4, PortType.INPUT);
newInPort = new PortId(dsModelTextId, 4, PortType.INPUT);
connector = data.FindFirstConnector(oldInPort);
data.ReconnectToPort(connector, newInPort);
// Move connector for "text type name" over to "ModelTextType" node.
oldInPort = new PortId(oldNodeId, 5, PortType.INPUT);
newInPort = new PortId(dsModelTextTypeId, 0, PortType.INPUT);
connector = data.FindFirstConnector(oldInPort);
data.ReconnectToPort(connector, newInPort);
// Connect from "ModelTextType" to the new node.
data.CreateConnector(dsModelTextType, 0, dsModelText, 5);
data.CreateConnector(numberNode, 0, dsModelText, 2);
data.CreateConnector(numberNode, 0, dsModelText, 3);
#endregion
return migratedData;
}