本文整理汇总了C#中Autodesk.Select方法的典型用法代码示例。如果您正苦于以下问题:C# Autodesk.Select方法的具体用法?C# Autodesk.Select怎么用?C# Autodesk.Select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autodesk
的用法示例。
在下文中一共展示了Autodesk.Select方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Robustify
/// <summary>
/// This method contains workarounds for increasing the robustness of input geometry
/// </summary>
/// <param name="geometry"></param>
/// <param name="translation"></param>
private static void Robustify(ref Autodesk.DesignScript.Geometry.Geometry[] geometry,
ref Autodesk.DesignScript.Geometry.Vector translation)
{
// translate all geom to centroid of bbox, then translate back
var bb = Autodesk.DesignScript.Geometry.BoundingBox.ByGeometry(geometry);
// get center of bbox
var trans = ((bb.MinPoint.ToXyz() + bb.MaxPoint.ToXyz())/2).ToVector().Reverse();
// translate all geom so that it is centered by bb
geometry = geometry.Select(x => x.Translate(trans)).ToArray();
// so that we can move it all back
translation = trans.Reverse();
}
示例2: ByCurvesAndDivisions
public static DividedPath ByCurvesAndDivisions(Autodesk.DesignScript.Geometry.Curve[] curve, int divisions)
{
if (curve == null)
{
throw new ArgumentNullException("curve");
}
if (divisions < 2)
{
throw new Exception("The number of divisions must be greater than 2!");
}
if (curve.Any(x => x == null))
{
throw new ArgumentNullException(String.Format("curves[{0}]", Array.FindIndex(curve, x => x == null)));
}
return new DividedPath(curve.Select(x => ElementCurveReference.TryGetCurveReference(x)).ToArray(), divisions);
}
示例3: ByParametersOnFace
/// <summary>
/// Create an adaptive component by uv points on a face.
/// </summary>
/// <param name="uvs">An array of UV pairs</param>
/// <param name="surface">The surface on which to place the AdaptiveComponent</param>
/// <param name="familySymbol"></param>
/// <returns></returns>
public static AdaptiveComponent ByParametersOnFace( Autodesk.DesignScript.Geometry.UV[] uvs, Surface surface, FamilySymbol familySymbol)
{
if (uvs == null)
{
throw new ArgumentNullException("uvs");
}
if (surface == null)
{
throw new ArgumentNullException("surface");
}
if (familySymbol == null)
{
throw new ArgumentNullException("familySymbol");
}
return new AdaptiveComponent(uvs.Select(x => new []{x.U,x.V}).ToArray(), ElementFaceReference.TryGetFaceReference(surface), familySymbol);
}
示例4: ByGeometries
/// <summary>
/// Import a collection of Geometry (Solid, Curve, Surface, etc) into Revit as an ImportInstance. This variant is much faster than
/// ImportInstance.ByGeometry as it uses a batch method.
/// </summary>
/// <param name="geometries">A collection of Geometry</param>
/// <returns></returns>
public static ImportInstance ByGeometries(Autodesk.DesignScript.Geometry.Geometry[] geometries)
{
if (geometries == null)
{
throw new ArgumentNullException("geometries");
}
// transform geometry from dynamo unit system (m) to revit (ft)
geometries = geometries.Select(x => x.InHostUnits()).ToArray();
var translation = Vector.ByCoordinates(0, 0, 0);
Robustify(ref geometries, ref translation);
// Export to temporary file
var fn = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".sat";
var exported_fn = Autodesk.DesignScript.Geometry.Geometry.ExportToSAT(geometries, fn);
return new ImportInstance(exported_fn, translation.ToXyz());
}