Skip to content

Commit

Permalink
clone solid
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Tammik committed May 15, 2015
1 parent a682a56 commit 78164ae
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion BuildingCoder/BuildingCoder/CmdExportSolidToSat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@ namespace BuildingCoder
[Transaction( TransactionMode.Manual )]
class CmdExportSolidToSat : IExternalCommand
{
#region Clone Solid Workaround before new Revit 2016 Solid.Clone API
static public Solid Clone( /*this*/ Solid solid )
{
if( solid == null )
{
return null;
}

// Better than unioning the solid with itself:
// use a small cube contained within the original
// solid instead, e.g. a 1x1x1 cube at the origin
// or something.

return BooleanOperationsUtils
.ExecuteBooleanOperation( solid, solid,
BooleanOperationsType.Union );
}
#endregion // Clone Solid Workaround

/// <summary>
/// Return the full path of the first file
/// found matching the given filename pattern
Expand Down Expand Up @@ -65,7 +84,7 @@ public Result Execute(

// Retrieve all floors from the model

var floors
var floors
= new FilteredElementCollector( doc )
.OfClass( typeof( Floor ) )
.ToElements()
Expand Down

0 comments on commit 78164ae

Please sign in to comment.