本文整理汇总了C#中Wall.get_Geometry方法的典型用法代码示例。如果您正苦于以下问题:C# Wall.get_Geometry方法的具体用法?C# Wall.get_Geometry怎么用?C# Wall.get_Geometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wall
的用法示例。
在下文中一共展示了Wall.get_Geometry方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessWall
private string ProcessWall( Wall wall )
{
string msg = string.Format(
"Wall <{0} {1}>:",
wall.Name, wall.Id.IntegerValue );
Debug.WriteLine( msg );
Options o = wall.Document.Application.Create.NewGeometryOptions();
GeometryElement ge = wall.get_Geometry( o );
//GeometryObjectArray objs = ge.Objects; // 2012
IEnumerable<GeometryObject> objs = ge; // 2013
// face normals and origins:
Dictionary<XYZ, List<XYZ>> naos
= new Dictionary<XYZ, List<XYZ>>();
foreach( GeometryObject obj in objs )
{
Solid solid = obj as Solid;
if( null != solid )
{
getFaceNaos( naos, solid );
}
}
return msg
+ getDimensions( naos )
+ "\n";
}
示例2: GetWallFace
/// <summary>
/// The method is used to get the wall face along the specified parameters
/// </summary>
/// <param name="wall">the wall</param>
/// <param name="view">the options view</param>
/// <param name="ExtOrInt">if true indicate that get exterior wall face, else false get the interior wall face</param>
/// <returns>the face</returns>
public static Face GetWallFace(Wall wall, View view, bool ExtOrInt)
{
FaceArray faces = null;
Face face = null;
Options options = new Options();
options.ComputeReferences = true;
options.View = view;
if (wall != null)
{
GeometryObjectArray geoArr = wall.get_Geometry(options).Objects;
foreach (GeometryObject geoObj in geoArr)
{
if (geoObj is Solid)
{
Solid s = geoObj as Solid;
faces = s.Faces;
}
}
}
if (ExtOrInt)
face = GetExteriorFace(faces);
else
face = GetInteriorFace(faces);
return face;
}
示例3: list_wall_geom
void list_wall_geom( Wall w, Application app )
{
string s = "";
CurtainGrid cgrid = w.CurtainGrid;
Options options
= app.Create.NewGeometryOptions();
options.ComputeReferences = true;
options.IncludeNonVisibleObjects = true;
GeometryElement geomElem
= w.get_Geometry( options );
foreach( GeometryObject obj in geomElem )
{
Visibility vis = obj.Visibility;
string visString = vis.ToString();
Arc arc = obj as Arc;
Line line = obj as Line;
Solid solid = obj as Solid;
if( arc != null )
{
double length = arc.ApproximateLength;
s += "Length (arc) (" + visString + "): "
+ length + "\n";
}
if( line != null )
{
double length = line.ApproximateLength;
s += "Length (line) (" + visString + "): "
+ length + "\n";
}
if( solid != null )
{
int faceCount = solid.Faces.Size;
s += "Faces: " + faceCount + "\n";
foreach( Face face in solid.Faces )
{
s += "Face area (" + visString + "): "
+ face.Area + "\n";
}
}
if( line == null && solid == null && arc == null )
{
s += "<Other>\n";
}
}
TaskDialog.Show( "revit", s );
}
示例4: GetWallOpeningPlanarFaces
/// <summary>
/// Retrieve all planar faces belonging to the
/// specified opening in the given wall.
/// </summary>
static List<PlanarFace> GetWallOpeningPlanarFaces(
Wall wall,
ElementId openingId)
{
List<PlanarFace> faceList = new List<PlanarFace>();
List<Solid> solidList = new List<Solid>();
Options geomOptions = wall.Document.Application.Create.NewGeometryOptions();
if( geomOptions != null )
{
//geomOptions.ComputeReferences = true; // expensive, avoid if not needed
//geomOptions.DetailLevel = ViewDetailLevel.Fine;
//geomOptions.IncludeNonVisibleObjects = false;
GeometryElement geoElem = wall.get_Geometry( geomOptions );
if( geoElem != null )
{
foreach( GeometryObject geomObj in geoElem )
{
if( geomObj is Solid )
{
solidList.Add( geomObj as Solid );
}
}
}
}
foreach( Solid solid in solidList )
{
foreach( Face face in solid.Faces )
{
if( face is PlanarFace )
{
if( wall.GetGeneratingElementIds( face )
.Any( x => x == openingId ) )
{
faceList.Add( face as PlanarFace );
}
}
}
}
return faceList;
}
示例5: ProfileOpenings
private static void ProfileOpenings(Wall wall,
double minOpeningValue, UIDocument uiDoc)
{
double wallOpeningArea = 0.0;
double wallTotalOpeningArea = 0.0;
// Get the geometry
GeometryElement geo = wall.get_Geometry(new Options());
foreach (GeometryObject geoObj in geo.Objects)
{
// Get the solid (expected for walls)
Solid solid = geoObj as Solid;
if (solid != null)
{
// Get the faces
foreach (Face solidFace in solid.Faces)
{
// Get the front face
XYZ faceNormal = solidFace.ComputeNormal(new UV());
if (faceNormal.IsAlmostEqualTo(wall.Orientation))
{
// Get the loop (external ou internal)
foreach (EdgeArray ea in solidFace.EdgeLoops)
{
List<XYZ> loop;
XYZ loopNormal;
double loopArea;
ComputerGeometryLoops(ea, out loop,
out loopNormal, out loopArea);
// Skip the outermost loop
//
// The outemost loop is equals or greater
// than the face
if (IsLoopValid(/*minOpeningValue,*/ solidFace,
faceNormal, loopNormal, loopArea))
{
if (IsLoopOpen(wall, loop, loopNormal))
{
if (loopArea < minOpeningValue)
wallOpeningArea += loopArea;
else
wallTotalOpeningArea += loopArea;
}
}
}
}
}
}
}
AddWallArea(wall.Id, wallOpeningArea, wallTotalOpeningArea);
}