在一年的大部分时间里,我一直在断断续续地解决这个问题。正如标题所说,我希望从墙的一侧到开口的两侧(门洞),然后在墙的另一端(垂直和水平)终止。我也希望为墙上的所有家庭提供维度,但我已经能够使用 ScottWilson 的巫毒魔法助手类来实现这一点。在这里找到: http: //thebuildingcoder.typepad.com/blog/2016/04/stable-reference-string-magic-voodoo.html
foreach (ElementId ele in selSet) {
FamilyInstance fi = doc.GetElement(ele) as FamilyInstance;
Reference reference = ScottWilsonVoodooMagic.GetSpecialFamilyReference(fi,ScottWilsonVoodooMagic.SpecialReferenceType.CenterLR,doc);
refs.Append(reference);
pts[i] = ( fi.Location as LocationPoint ).Point;
i++;
}
XYZ offset = new XYZ(0,0,4);
Line line = Line.CreateBound( pts[0]+offset, pts[selSet.Count - 1]+offset );
using( Transaction t = new Transaction( doc ) )
{
t.Start( "dimension embeds" );
Dimension dim = doc.Create.NewDimension(doc.ActiveView, line, refs );
t.Commit();
}
问题在于确定对墙壁表面的适当稳定参考。我能够找到墙上的所有面孔,但这给了我 100 多个面孔进行分类。
如果有人可以帮助我,将不胜感激!
旁注:最接近的方法是通过我的面板投射光线追踪,然后使用参考相交法来确定参考。但我真的很难实现:http ://thebuildingcoder.typepad.com/blog/2015/12/retrieving-wall-openings-and-sorting-points.html