public static RevitType ToSAM(this ElementType elementType, ConvertSettings convertSettings) { if (elementType == null) { return(null); } RevitType result = convertSettings?.GetObject <RevitType>(elementType.Id); if (result != null) { return(result); } switch (elementType.Category.CategoryType) { case CategoryType.AnalyticalModel: case CategoryType.Model: result = new RevitType3D(elementType.Name); break; case CategoryType.Annotation: result = new RevitType2D(elementType.Name); break; } if (result != null) { result.UpdateParameterSets(elementType, ActiveSetting.Setting.GetValue <TypeMap>(Core.Revit.ActiveSetting.Name.ParameterMap)); convertSettings?.Add(elementType.Id, result); } return(result); }
public static RevitInstance3D ToSAM(this WallSweep wallSweep, ConvertSettings convertSettings) { if (wallSweep == null || !wallSweep.IsValidObject) { return(null); } RevitInstance3D result = convertSettings?.GetObject <RevitInstance3D>(wallSweep.Id); if (result != null) { return(result); } Document document = wallSweep.Document; if (document == null) { return(result); } ElementType elementType = document.GetElement(wallSweep.GetTypeId()) as ElementType; if (elementType == null) { return(null); } RevitType3D revitType3D = elementType.ToSAM(convertSettings) as RevitType3D; if (revitType3D == null) { return(null); } result = new RevitInstance3D(revitType3D, wallSweep.ToSAM_Geometries <Spatial.ISAMGeometry3D>()); if (result != null) { result.UpdateParameterSets(elementType, ActiveSetting.Setting.GetValue <TypeMap>(Core.Revit.ActiveSetting.Name.ParameterMap)); convertSettings?.Add(elementType.Id, result); } return(result); }
public RevitType3D(RevitType3D revitType3D) : base(revitType3D) { }