Skip to content

Commit

Permalink
implemented CmdFlatten
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Tammik committed Nov 16, 2015
1 parent 4967291 commit 0144515
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions BuildingCoder/BuildingCoder/CmdFlatten.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private Result Flatten1( Document myDoc, ElementId viewId )
}
#endregion // Using ExportAsDirectShape class

private Result Flatten2(
Result Flatten2(
Document doc,
ElementId viewId )
{
Expand All @@ -137,15 +137,25 @@ FilteredElementCollector col
{
foreach( Element e in col )
{
GeometryElement gelt = e.get_Geometry( geometryOptions );
GeometryElement gelt = e.get_Geometry(
geometryOptions );

if( null != gelt )
{
string appDataGUID = e.Id.ToString();

DirectShape ds = DirectShape.CreateElement(
doc, e.Category.Id, _direct_shape_appGUID,
appDataGUID );
// Currently create direct shape
// replacement element in the original
// document – no API to properly transfer
// graphic styles to a new document.
// A possible enhancement: make a copy
// of the current project and operate
// on the copy.

DirectShape ds
= DirectShape.CreateElement( doc,
e.Category.Id, _direct_shape_appGUID,
appDataGUID );

try
{
Expand Down

0 comments on commit 0144515

Please sign in to comment.