本文整理汇总了C#中IGH_DataAccess.FetchList方法的典型用法代码示例。如果您正苦于以下问题:C# IGH_DataAccess.FetchList方法的具体用法?C# IGH_DataAccess.FetchList怎么用?C# IGH_DataAccess.FetchList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGH_DataAccess
的用法示例。
在下文中一共展示了IGH_DataAccess.FetchList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SolveInstance
/// <summary>
/// This is the method that actually does the work.
/// </summary>
/// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
protected override void SolveInstance(IGH_DataAccess DA)
{
// SET ALL INPUT PARAMETERS
List<Curve> A = DA.FetchList<Curve>("A");
List<Curve> B = DA.FetchList<Curve>("B");
try {
ClipType type = (ClipType)DA.Fetch<int>("BooleanType");
Plane pln = DA.Fetch<Plane>("Plane");
double tolerance = DA.Fetch<double>("Tolerance");
// Convert the curves to polylines
// This is a crude way of doing this.
// Should we add some parameters for this perhaps?
IEnumerable<Polyline> APl = Polyline3D.ConvertCurvesToPolyline(A);
IEnumerable<Polyline> BPl = Polyline3D.ConvertCurvesToPolyline(B);
// If we don't have a plane, let's try to create a plane from the first curve.
if (pln.Equals(default(Plane)) || !pln.IsValid) {
pln = APl.First().FitPlane();
}
List<Polyline> result = new List<Polyline>();
// do the boolean operation
result = Polyline3D.Boolean(type, APl, BPl, pln, tolerance, EvenOdd);
// OUTPUT LOGIC
DA.SetDataList("Result", result);
} catch (Exception e) {
this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, e.Message + ": " + e.StackTrace.ToString());
}
}
示例2: SolveInstance
/// <summary>
/// This is the method that actually does the work.
/// </summary>
/// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
protected override void SolveInstance(IGH_DataAccess DA)
{
// SET ALL INPUT PARAMETERS
List<Curve> curves = DA.FetchList<Curve>("Polylines");
double dist = DA.Fetch<double>("Distance");
Plane pln = DA.Fetch<Plane>("Plane");
double tolerance = DA.Fetch<double>("Tolerance");
List<Polyline3D.OpenFilletType> openType = DA.FetchList<int>("OpenFillet").Cast<Polyline3D.OpenFilletType>().ToList();
if (openType == null || openType.Count == 0) {
openType = new List<Polyline3D.OpenFilletType> { Polyline3D.OpenFilletType.Square };
}
double miter = DA.Fetch<double> ("Miter");
List<Polyline3D.ClosedFilletType> closedType = DA.FetchList<int>("ClosedFillet").Cast<Polyline3D.ClosedFilletType>().ToList();
IEnumerable<Polyline> polylines = Polyline3D.ConvertCurvesToPolyline(curves);
if (pln.Equals(default(Plane)))
{
pln = polylines.First().FitPlane();
}
// set default fillet type.
if (closedType == null || closedType.Count == 0) {
closedType = new List<Polyline3D.ClosedFilletType> { Polyline3D.ClosedFilletType.Square };
}
if (curves.Count == 0) {
return;
}
List<List<Polyline>> outside;
List<List<Polyline>> holes;
Polyline3D.Offset(polylines, openType, closedType, pln, tolerance, new List<double> { dist }, miter, 0.25, out outside, out holes);
// OUTPUT LOGIC
DA.SetDataList("Contour", outside.First());
DA.SetDataList("Holes", holes.First());
}