0

我正在尝试使用 Revit API 为缩略图导出 3d Revit 模型族图像。我尝试打开模型边缘,使它们显示为较暗的线条,并且我尝试打开抗锯齿以使线条平滑。我意识到打开阴影可能是没有希望的,因为这个选项在家庭文档中不可用。
我已经用尽了所有图像导出选项属性。下面的代码具有导出图像选项和到目前为止我已设法设置的枚举 Revit API 属性。

    if (view3D != null)
            {
                views.Add(view3D.Id);
                var graphicDisplayOptions = view3D.get_Parameter(BuiltInParameter.MODEL_GRAPHICS_STYLE);
                // Settings for shaded with edges
                graphicDisplayOptions.Set(3);

                var detailLevelOptions = view3D.get_Parameter(BuiltInParameter.VIEW_DETAIL_LEVEL);
                //Settings for view detail, 3 = fine, 2=med, 1=coarse
                detailLevelOptions.Set(3);

            }
        }
        catch (Autodesk.Revit.Exceptions.InvalidOperationException)
        {

        }

        var ieo = new ImageExportOptions
        {
            //Export image file configuration settings
            FilePath = ImageFamModelFileName,
            FitDirection = FitDirectionType.Horizontal,
            HLRandWFViewsFileType = ImageFileType.BMP,
            ShadowViewsFileType = ImageFileType.BMP,
            ImageResolution = ImageResolution.DPI_600,
            ShouldCreateWebSite = false
        };
4

1 回答 1

0

这篇博文中有一个家庭文档和视图的测试用例,请看一下。下面是其中的一部分。

#if !VERSION2014
    var direction = new XYZ(-1, 1, -1);
    var view3D = doc.IsFamilyDocument
      ? doc.FamilyCreate.NewView3D(direction)
      : doc.Create.NewView3D(direction);
#else
    var collector = new FilteredElementCollector(
      doc );

    var viewFamilyType = collector
      .OfClass( typeof( ViewFamilyType ) )
      .OfType<ViewFamilyType>()
      .FirstOrDefault( x =>
        x.ViewFamily == ViewFamily.ThreeDimensional );

    var view3D = ( viewFamilyType != null )
      ? View3D.CreateIsometric( doc, viewFamilyType.Id )
      : null;

#endif // VERSION2014
于 2015-08-12T13:58:03.277 回答