Skip to content

Commit

Permalink
EditFilledRegion: use MoveElements instead of MoveElement
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Tammik committed Sep 4, 2015
1 parent 9b423a5 commit a7b5af8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
17 changes: 9 additions & 8 deletions BuildingCoder/BuildingCoder/CmdFilledRegionCoords.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace BuildingCoder
[Transaction( TransactionMode.ReadOnly )]
class CmdFilledRegionCoords : IExternalCommand
{
#region EditFilledRegion
/// <summary>
/// Edit filled region by moving it back and forth
/// to make its boundary lines reappear after
Expand All @@ -30,23 +31,23 @@ class CmdFilledRegionCoords : IExternalCommand
/// </summary>
public void EditFilledRegion( Document doc )
{
FilteredElementCollector fillRegions
ICollection<ElementId> fillRegionIds
= new FilteredElementCollector( doc )
.OfClass( typeof( FilledRegion ) );
.OfClass( typeof( FilledRegion ) )
.ToElementIds();

using( Transaction tx = new Transaction( doc ) )
{
tx.Start( "Move all Filled Regions" );

foreach( FilledRegion filledRegion in fillRegions )
{
XYZ v = XYZ.BasisX;
ElementTransformUtils.MoveElement( doc, filledRegion.Id, v );
ElementTransformUtils.MoveElement( doc, filledRegion.Id, -v );
}
XYZ v = XYZ.BasisX;
ElementTransformUtils.MoveElements( doc, fillRegionIds, v );
ElementTransformUtils.MoveElements( doc, fillRegionIds, -v );

tx.Commit();
}
}
#endregion // EditFilledRegion

List<XYZ> GetBoundaryCorners( FilledRegion region )
{
Expand Down
5 changes: 3 additions & 2 deletions BuildingCoder/BuildingCoder/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
// 2015-08-18 2016.0.120.9 eliminated obsolete API calls to ElementTransformUtils.MirrorElements by adding bool mirrorCopies argument
// 2015-09-04 2016.0.120.10 added original EditFilledRegion to show code improvements
// 2015-09-04 2016.0.120.11 in EditFilledRegion: foreach iter, using tx, single tx, XYZ static member
// 2015-09-04 2016.0.120.12 in EditFilledRegion: use MoveElements instead of MoveElement
//
[assembly: AssemblyVersion( "2016.0.120.10" )]
[assembly: AssemblyFileVersion( "2016.0.120.10" )]
[assembly: AssemblyVersion( "2016.0.120.12" )]
[assembly: AssemblyFileVersion( "2016.0.120.12" )]

0 comments on commit a7b5af8

Please sign in to comment.