Skip to content

Commit

Permalink
Fix(Revit) : analytical stick and surface fixes (#2922)
Browse files Browse the repository at this point in the history
fixes for analytical members

Co-authored-by: Connor Ivy <[email protected]>
  • Loading branch information
connorivy and Connor Ivy authored Sep 14, 2023
1 parent 56c005e commit 0592ce3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Structure;
using Autodesk.Revit.DB.Structure.StructuralSections;
using ConverterRevitShared.Extensions;
using Objects.BuiltElements;
using Objects.BuiltElements.Revit;
using Objects.Structural.Geometry;
using Objects.Structural.Materials;
Expand Down Expand Up @@ -74,7 +76,11 @@ public ApplicationObject AnalyticalStickToNative(Element1D speckleStick)
if (isExactMatch)
{
//update type
analyticalMember.SectionTypeId = familySymbol.Id;
if (familySymbol.Category.EqualsBuiltInCategory(BuiltInCategory.OST_StructuralColumns)
|| familySymbol.Category.EqualsBuiltInCategory(BuiltInCategory.OST_StructuralFraming))
{
analyticalMember.SectionTypeId = familySymbol.Id;
}
isUpdate = true;
revitMember = analyticalMember;

Expand All @@ -93,7 +99,11 @@ public ApplicationObject AnalyticalStickToNative(Element1D speckleStick)
{
revitMember = AnalyticalMember.Create(Doc, baseLine);
//set type
revitMember.SectionTypeId = familySymbol.Id;
if (familySymbol.Category.EqualsBuiltInCategory(BuiltInCategory.OST_StructuralColumns)
|| familySymbol.Category.EqualsBuiltInCategory(BuiltInCategory.OST_StructuralFraming))
{
revitMember.SectionTypeId = familySymbol.Id;
}
}

// set or update analytical properties
Expand Down Expand Up @@ -141,25 +151,26 @@ private ApplicationObject CreatePhysicalMember(Element1D speckleStick)
return appObj;

case ElementType1D.Brace:
RevitBrace revitBrace = new RevitBrace();
revitBrace.type = propertyName;
revitBrace.baseLine = speckleStick.baseLine;
Brace speckleBrace = new();
SetElementType(speckleBrace, propertyName);
speckleBrace.baseLine = speckleStick.baseLine;
speckleBrace.units = speckleStick.units;
#if REVIT2020 || REVIT2021 || REVIT2022
revitBrace.applicationId = speckleStick.applicationId;
speckleBrace.applicationId = speckleStick.applicationId;
#endif
appObj = BraceToNative(revitBrace);
appObj = BraceToNative(speckleBrace);

return appObj;

case ElementType1D.Column:
RevitColumn revitColumn = new RevitColumn();
revitColumn.type = propertyName;
revitColumn.baseLine = speckleStick.baseLine;
revitColumn.units = speckleStick.units;
Column speckleColumn = new();
SetElementType(speckleColumn, propertyName);
speckleColumn.baseLine = speckleStick.baseLine;
speckleColumn.units = speckleStick.units;
#if REVIT2020 || REVIT2021 || REVIT2022
revitColumn.applicationId = speckleStick.applicationId;
speckleColumn.applicationId = speckleStick.applicationId;
#endif
appObj = ColumnToNative(revitColumn);
appObj = ColumnToNative(speckleColumn);

return appObj;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,12 @@ private ApplicationObject CreatePhysicalMember(Element2D speckleElement)
default:
var polycurve = PolycurveFromTopology(speckleElement.topology);
var level = LevelFromPoint(PointToNative(speckleElement.topology[0].basePoint));
var revitFloor = new RevitFloor(speckleElement.property.name, speckleElement.property.name, polycurve, level, true);
var speckleFloor = new BuiltElements.Floor(polycurve);
SetElementType(speckleFloor, speckleElement.property.name);
#if REVIT2020 || REVIT2021 || REVIT2022
revitFloor.applicationId = speckleElement.applicationId;
speckleFloor.applicationId = speckleElement.applicationId;
#endif
return FloorToNative(revitFloor);
return FloorToNative(speckleFloor);
}
}

Expand Down

0 comments on commit 0592ce3

Please sign in to comment.