Skip to content

Commit

Permalink
bug(revit): [CNX-7509] revit wall by face doesnt work in revit 2022 (#…
Browse files Browse the repository at this point in the history
…3211)

uses old FaceWallToNative method for 2021&2022

Co-authored-by: Alan Rynne <alan@speckle.systems>
  • Loading branch information
clairekuang and AlanRynne authored Mar 12, 2024
1 parent ea47da6 commit fd99b48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,11 @@ public object ConvertToNativeObject(Base @object)
return ProfileWallToNative(o);

case BER.RevitFaceWall o:
#if REVIT2021 || REVIT2022
return FaceWallToNative(o);
#else
return FaceWallToNativeV2(o);
#endif

case BE.Wall o:
return WallToNative(o);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,15 @@ public ApplicationObject FaceWallToNativeV2(RevitFaceWall speckleWall)
}

List<string> notes = null;
var solid = BrepToNative(speckleWall.brep, out notes);
var faceReference = solid.Faces.get_Item(0);
var faceref = faceReference.Reference;
var freeform = CreateFreeformElementFamily(new List<Solid> { solid }, speckleWall.id, "Mass");
Solid solid = BrepToNative(speckleWall.brep, out notes);
DB.FamilyInstance freeform = CreateFreeformElementFamily(new List<Solid> { solid }, speckleWall.id, "Mass");
Doc.Regenerate();
faceref = GetFaceRef(freeform);
Reference faceref = GetFaceRef(freeform);

var revitWall = FaceWall.Create(Doc, wallType.Id, GetWallLocationLine(speckleWall.locationLine), faceref);
//Doc.Delete(freeform.Id);

SetInstanceParameters(revitWall, speckleWall);
appObj.Update(status: ApplicationObject.State.Created, createdId: revitWall.UniqueId, convertedItem: revitWall);
//appObj = SetHostedElements(speckleWall, revitWall, appObj);
}
catch (Exception ex) when (!ex.IsFatal())
{
Expand Down

0 comments on commit fd99b48

Please sign in to comment.