Message 1 of 10
Get curve from Reference Plane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I would like to get the curve from a selected Reference Plane, but it isn't working. Could anyone help?
My code:
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
Document doc = uidoc.Document;
Reference reference=pickGridsExtent(uidoc);
var refPlane = doc.GetElement(reference.ElementId) as ReferencePlane;
Curve refCurve = refPlane.Curve;
return Result.Succeeded;
}
Code from pickGridsExtent(uidoc):
public Reference pickGridsExtent(UIDocument uidoc)
{
ISelectionFilter selFilter = new SelectionFilter.SelFilterRefPlane(); //Selection Filter of Reference Planes
Reference reference = uidoc.Selection.PickObject(ObjectType.Element, selFilter);
return reference;
}