3b6623e51a
* feat: add send rebars as solid toggle * feat: rebar `displayValue` default of centrelines * feat: sending rebars as solid poc - need to refactor to avoid duplicate code - is this the best way? what if user view isn't fine? * refactor: extract common code and code comments * refactor: reduce code duplication in DisplayValueExtractor with record * refactor: wording volumetric not solid
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using Speckle.Converters.Common;
|
|
using Speckle.Converters.RevitShared.Helpers;
|
|
using Speckle.InterfaceGenerator;
|
|
using Speckle.Sdk.Common;
|
|
|
|
namespace Speckle.Converters.RevitShared.Settings;
|
|
|
|
[GenerateAutoInterface]
|
|
public class RevitConversionSettingsFactory(
|
|
RevitContext revitContext,
|
|
IHostToSpeckleUnitConverter<DB.ForgeTypeId> unitConverter
|
|
) : IRevitConversionSettingsFactory
|
|
{
|
|
public RevitConversionSettings Create(
|
|
DetailLevelType detailLevelType,
|
|
DB.Transform? referencePointTransform,
|
|
bool sendEmptyOrNullParams,
|
|
bool sendLinkedModels,
|
|
bool sendRebarsAsVolumetric,
|
|
double tolerance = 0.0164042 // 5mm in ft
|
|
)
|
|
{
|
|
var document = revitContext.UIApplication.NotNull().ActiveUIDocument.Document;
|
|
return new(
|
|
document,
|
|
detailLevelType,
|
|
referencePointTransform,
|
|
unitConverter.ConvertOrThrow(document.GetUnits().GetFormatOptions(DB.SpecTypeId.Length).GetUnitTypeId()),
|
|
sendEmptyOrNullParams,
|
|
sendLinkedModels,
|
|
sendRebarsAsVolumetric,
|
|
tolerance
|
|
);
|
|
}
|
|
}
|