我有一堆坡道,我想知道它们的起点和终点(如果有多个起点/终点,我想知道它们如何连接)。
我目前得到这些作为
List<TransitionPoint> ret = new List<TransitionPoint>();
FilteredElementCollector collector = new FilteredElementCollector(doc);
ICollection<Element> ramps = collector.OfCategory(BuiltInCategory.OST_Ramps).ToElements();
foreach (var ramp in ramps)
{
//what goes here?
}
这些斜坡包含以下属性:
Type Comments
Ramp Max Slope (1/x)
Category
URL
Design Option
Type Name
Ramp Material
Function
Manufacturer
Family Name
Model
Keynote
Type Image
Text Size
Shape
Text Font
Maximum Incline Length
Assembly Description
Assembly Code
Type Mark
Category
Thickness
Cost
Description
现在,如果这些楼梯我会使用 ICollectionstairs = collector.OfCategory(BuiltInCategory.OST_Stairs).OfClass(typeof(Stairs)).ToElements();
然后我可以将对象投射到楼梯中,但是似乎没有一个类模拟楼梯可以让我解决Stairs.GetStairsRuns().
有人知道如何获得类似 RampRun 的东西或以其他方式找到坡道的起点和终点吗?
我也尝试过以下解决方案,但也不起作用
public static void MapRunsToRamps(Document doc)
{
var rule = ParameterFilterRuleFactory.CreateNotEqualsRule(new ElementId(BuiltInParameter.HOST_ID_PARAM), "null", true);
ElementParameterFilter filter = new ElementParameterFilter(rule);
FilteredElementCollector collector = new FilteredElementCollector(doc);
List<Element> rampsRuns = collector.WherePasses(filter).ToElements().ToList<Element>();
foreach (Element e in rampsRuns)
{
var hostpara = e.get_Parameter(BuiltInParameter.HOST_ID_PARAM);
if (hostpara != null)
{
var host = doc.GetElement(new ElementId(hostpara.AsInteger()));
if (host.Category.Equals(BuiltInCategory.OST_Ramps))
{
//breakpoint that is never activated
}
}
}
}
这会发现大量物体,但没有一个以斜坡作为宿主。
Here is an example of a ramp and the location I'm trying to find marked with red arrows.
this https://forums.autodesk.com/t5/revit-api/how-do-we-get-the-x-y-z-corords-for-stairs-ramps/td-p/2575349 https://forums.autodesk.com/t5/revit-api/how-do-we-get-the-x-y-z-cordinates-for-stairs-ramps/td-p/2575349建议我们可以使用位置曲线,有什么方法可以做到这一点吗?
编辑:
似乎确实有一些草图,我们可以根据这些草图找到坡道,问题是我是否有一个草图说
var rampCategoryfilter = new ElementCategoryFilter(BuiltInCategory.OST_StairsSketchRunLines);
var rampsRuns = new FilteredElementCollector(doc).WherePasses(rampCategoryfilter);
那么我确实可以获得位置,但我没有的是它也属于的坡道,知道如何找到它吗?