Я пишу приложение, чтобы найти положение ссылок Revit в проекте. Я использую locationPoint, но он дает ноль. Т
FilteredElementCollector collector = new FilteredElementCollector(myDoc);//
collector.OfClass(typeof(Instance)).OfCategory(BuiltInCategory.OST_RvtLinks);
foreach (Element elLink in collector)
{
Instance ins = elLink as Instance;
RevitLinkType linkType = myDoc.GetElement(ins.GetTypeId()) as RevitLinkType;
LocationPoint pn = linkType.Location as LocationPoint;
TaskDialog.Show("rvt", "Name " + linkType.Name);
if (null != pn)
{
TaskDialog.Show("rvt", "location " + pn.Point.X + " " + pn.Point.Y + " " + pn.Point.Z);
}
}
Я ожидаю найти x, y, z связанного файла Revit
Посмотрите на Строительный кодер обсуждение Определение расположения связанного элемента в главном документе:
RevitLinkInstance
is derived from theInstance
class, the base class for all instance objects. It provides the methodsGetTransform
, to retrieve the transform of the instance, andGetTotalTransform
that includes the true north transform as well.