Wrong direction of detection of walls using api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
//Checking for SouthWest Facing Walls & Windows
bool isSouthWestFacing = IsSouthWestFacing(exteriorDirection);
if (isSouthWestFacing)
{
SouthWest_Wall_Lst.Add(WE);
inserts_0 = (WE as HostObject).FindInserts(true, true, true, true);
ParaSouthWestWall = WE.LookupParameter("SouthWest");
using (Transaction trans = new Transaction(doc, "ETTV_1"))
{
trans.Start();
ParaSouthWestWall.Set(1);
foreach (ElementId emtid in inserts_0)
{
Element emt = doc.GetElement(emtid);
emt.LookupParameter("SouthWest").Set(1);
}
trans.Commit();
}
}
//Checking for SouthWest Facing Direction
bool IsSouthWestFacing(XYZ direction)
{
double angleToWest = direction.AngleTo(-XYZ.BasisX);
double angleToSouth = direction.AngleTo(-XYZ.BasisY);
return ((Math.Abs(angleToWest) > Math.PI / 😎 & (Math.Abs(angleToWest) < (Math.PI * 3 / 8))) &
((Math.Abs(angleToSouth) > Math.PI / 😎 & (Math.Abs(angleToSouth) < (Math.PI * 3 / 8)));
}
As you can see both walls are opposite side of building but it registers as same direction. Any information that you need please request.