Not able to get InterSection point between Wall and Column.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
public XYZ FindLocPoint(Element ele1, Element ele2, Document doc)
{
LocationCurve locCurve = ele1.Location as LocationCurve;
Line curve1 = null;
if (locCurve != null)
{
curve1 = locCurve.Curve as Line;
}
else if (locCurve == null)
{
BoundingBoxXYZ bbox = ele1.get_BoundingBox(doc.ActiveView);
XYZ cp = bbox.Min.Add(bbox.Max).Divide(2.0);
XYZ p1 = new XYZ(cp.X, cp.Y, bbox.Min.Z);
XYZ p2 = new XYZ(cp.X, cp.Y, bbox.Max.Z);
curve1 = Line.CreateBound(p1, p2);
}
LocationCurve locCurve2 = ele2.Location as LocationCurve;
Line curve2 = null;
if (locCurve2 != null)
{
curve2 = locCurve2.Curve as Line;
}
else if (locCurve2 == null)
{
BoundingBoxXYZ bbox = ele2.get_BoundingBox(doc.ActiveView);
XYZ cp = bbox.Min.Add(bbox.Max).Divide(2.0);
XYZ p1 = new XYZ(cp.X, cp.Y, bbox.Min.Z);
XYZ p2 = new XYZ(cp.X, cp.Y, bbox.Max.Z);
curve2 = Line.CreateBound(p1, p2);
}
IntersectionResultArray intersectionResultArray = null;
XYZ point = null;
curve2.Intersect(curve1, out intersectionResultArray);
foreach (IntersectionResult intersectionResult in intersectionResultArray)
{
point = intersectionResult.XYZPoint;
}
return point;
}
@Mohamed_Arshad