Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to grab Edge references from a Face reference (I thought about selecting the edge to begin with, but I didn't want the user to accidentally select the wrong edge), and I figured out how to get Curves but not the reference. Trying to grab the reference from those Curves returns null. I found this post which was really helpful, but getting that edge reference to pass in is where I'm getting stuck. Any ideas would be greatly appreciated.
Here's the chunk of code I'm working with:
Reference sel1 = uidoc.Selection.PickObject(ObjectType.Face);
Reference sel2 = uidoc.Selection.PickObject(ObjectType.Face);
PlanarFace face1 = (doc.GetElement(sel1) as FamilyInstance).GetGeometryObjectFromReference(sel1) as PlanarFace;
PlanarFace face2 = (doc.GetElement(sel2) as FamilyInstance).GetGeometryObjectFromReference(sel2) as PlanarFace;
List<CurveLoop> list1 = face1.GetEdgesAsCurveLoops().ToList();
List<CurveLoop> list2 = face2.GetEdgesAsCurveLoops().ToList();
List<Curve> curves1 = new List<Curve>();
List<Curve> curves2 = new List<Curve>();
foreach (Curve c in list1[0])
{
curves1.Add(c);
}
foreach (Curve c in list2[0])
{
curves2.Add(c);
}
curves1.Sort(SortLines);
curves2.Sort(SortLines);
XYZ point = FindIntersection(curves1[0], curves2[0]); //Where would these edges intersect?
Edge edge1 = GetEdge(curves1[0].Reference, doc); //Use the symbol edge reference to return the instance edge reference
Edge edge2 = GetEdge(curves2[0].Reference, doc);*I know the point and edge variables are a bit mixed up, I'm still just trying to figure out the references.
Solved! Go to Solution.