本文整理汇总了C#中Autodesk.ToList方法的典型用法代码示例。如果您正苦于以下问题:C# Autodesk.ToList方法的具体用法?C# Autodesk.ToList怎么用?C# Autodesk.ToList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autodesk
的用法示例。
在下文中一共展示了Autodesk.ToList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ByOutlineTypeAndLevel
/// <summary>
/// Create a Revit Floor given it's curve outline and Level
/// </summary>
/// <param name="outline"></param>
/// <param name="level"></param>
/// <returns>The floor</returns>
public static Floor ByOutlineTypeAndLevel( Autodesk.DesignScript.Geometry.Curve[] outline, FloorType floorType, Level level)
{
if (outline == null)
{
throw new ArgumentNullException("outline");
}
if (floorType == null)
{
throw new ArgumentNullException("floorType");
}
if ( level == null )
{
throw new ArgumentNullException("level");
}
if (outline.Count() < 3)
{
throw new Exception("Outline must have at least 3 edges to enclose an area.");
}
var ca = new CurveArray();
outline.ToList().ForEach(x => ca.Append(x.ToRevitType()));
return new Floor(ca, floorType.InternalFloorType, level.InternalLevel );
}
示例2: ByViewFacePointsAndValues
/// <summary>
/// Show a colored Face Analysis Display in the Revit view.
/// </summary>
/// <param name="view">The view into which you want to draw the analysis results.</param>
/// <param name="sampleLocations">The locations at which you want to create analysis values.</param>
/// <param name="samples">The analysis values at the given locations.</param>
/// <param name="name">An optional analysis results name to show on the results legend.</param>
/// <param name="description">An optional analysis results description to show on the results legend.</param>
/// <param name="unitType">An optional Unit type to provide conversions in the analysis results.</param>
/// <returns>A FaceAnalysisDisplay object.</returns>
public static FaceAnalysisDisplay ByViewFacePointsAndValues(
View view, Surface surface,
Autodesk.DesignScript.Geometry.UV[] sampleLocations, double[] samples, string name = "", string description = "", Type unitType = null)
{
if (view == null)
{
throw new ArgumentNullException("view");
}
if (surface == null)
{
throw new ArgumentNullException("surface");
}
if (sampleLocations == null)
{
throw new ArgumentNullException("sampleUvPoints");
}
if (samples == null)
{
throw new ArgumentNullException("samples");
}
if (sampleLocations.Length != samples.Length)
{
throw new Exception("The number of sample points and number of samples must be the same");
}
if (string.IsNullOrEmpty(name))
{
name = Resource1.AnalysisResultsDefaultName;
}
if (string.IsNullOrEmpty(description))
{
description = Resource1.AnalysisResultsDefaultDescription;
}
var data = SurfaceAnalysisData.BySurfacePointsAndResults(surface, sampleLocations.ToList(), new List<string> { "Dynamo Data" }, new List<IList<double>>{samples});
return new FaceAnalysisDisplay(view.InternalView, new ISurfaceAnalysisData<Autodesk.DesignScript.Geometry.UV, double>[] { data }, name, description, unitType);
}