public static void getDuctPoint(ExternalCommandData commandData)
{
UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
Document doc = uidoc.Document;
string dbg = "";
FilteredElementCollector allDuct
= new FilteredElementCollector(doc)
.OfClass(typeof(Duct));
int nDucts = 0;
int nCurves = 0;
foreach (Duct aDuct in allDuct)
{
++nDucts;
LocationCurve lc = aDuct.Location as LocationCurve;
if(null == lc) dbg= "No Duct!";
if (null != lc)
{
++nCurves;
Curve c = lc.Curve;
dbg+=string.Format("Duct {0} from {1} to {2}",
aDuct.Id.IntegerValue,
c.GetEndPoint(0).ToString(),
c.GetEndPoint(1).ToString());
}
}
TaskDialog.Show("??", dbg);
//return Result.Succeeded;
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น