You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Revit中由FloorPlan创建的俯视SectionView镜像问题求助

问题:基于FloorPlan创建俯视SectionView时出现镜像问题

我尝试基于FloorPlan创建SectionView,视图方向设置为俯视(与FloorPlan一致),但生成的SectionView出现镜像问题。

以下是我的代码:

//uiapp is UIApplication, ass is input assembley, danglerad is input angle radian
FamilyInstance fibox = GetPlaceholderBoxFromAssembly(uiapp, ass);
double dw = bbox.Max.Subtract(bbox.Min).X;
double dd = bbox.Max.Subtract(bbox.Min).Y;
double dh = bbox.Max.Subtract(bbox.Min).Z;

snameprefix = "up";

max_pt = new XYZ(dw, dd, dh); 
min_pt = new XYZ(-dw, -dd, -dh);

bbox.Max = max_pt;
bbox.Min = min_pt;

trans = Autodesk.Revit.DB.Transform.CreateRotation(XYZ.BasisZ, danglerad);
trans.Origin = mid_pt;

try
{
    bbox.Transform = trans; 
}
catch { }           

using (Transaction tr = new Transaction(uiapp.ActiveUIDocument.Document, "CreateSecPlan"))
{
    tr.Start();
        viewsec = ViewSection.CreateSection(uiapp.ActiveUIDocument.Document, viewfamtypeid, bbox); 
        viewsec.Name += $"_{ass.Name}_{snameprefix}";
        viewsec.DisplayStyle = DisplayStyle.HLR;
        viewsec.DetailLevel = ViewDetailLevel.Fine;
        viewsec.ViewTemplateId = templid;
        viewsec.Scale = iscale;
        
        viewsec.get_Parameter(BuiltInParameter.SECTION_COARSER_SCALE_PULLDOWN_METRIC).Set(1);

        tr.Commit();                    
}

using (Transaction t3 = new Transaction(uiapp.ActiveUIDocument.Document, "MirrorView"))
{
    t3.Start();

    Plane pln = Plane.CreateByNormalAndOrigin(viewsec.ViewDirection, viewsec.Origin);
    ElementTransformUtils.MirrorElements(uiapp.ActiveUIDocument.Document, new List<ElementId> { viewsec.Id }, pln, false);
    t3.Commit();
}

我还尝试过使用ViewSection.CreateDetail以及镜像视图的CropBoxElement,但均无效,请问问题出在哪里?

内容的提问来源于stack exchange,提问作者homecoder

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 17:20:09