Skip to content

Commit

Permalink
eliminated and replaced non-static Creator.CreateModelLine taking XYZ…
Browse files Browse the repository at this point in the history
… start and end point by static overload taking Document as well
  • Loading branch information
Jeremy Tammik committed Apr 10, 2015
1 parent a4d07fe commit 8644555
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 29 deletions.
6 changes: 4 additions & 2 deletions BuildingCoder/BuildingCoder/CmdRotatedBeamLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ LocationCurve curve
p = p - v;
q = q + v;

Creator creator = new Creator( doc );
creator.CreateModelLine( p, q );
//Creator creator = new Creator( doc );
//creator.CreateModelLine( p, q );

Creator.CreateModelLine( doc, p, q );
}
return Result.Succeeded;
}
Expand Down
12 changes: 6 additions & 6 deletions BuildingCoder/BuildingCoder/CmdWallLayers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Result Execute(
//int i; // 2011
int n;
double halfThickness, layerOffset;
Creator creator = new Creator( doc );
//Creator creator = new Creator( doc );
XYZ lcstart, lcend, v, w, p, q;

using( Transaction tx = new Transaction( doc ) )
Expand Down Expand Up @@ -83,16 +83,16 @@ LocationCurve curve

p = lcstart - 2 * v;
q = lcend + 2 * v;
creator.CreateModelLine( p, q );
Creator.CreateModelLine( doc, p, q );

q = p + halfThickness * w;
creator.CreateModelLine( p, q );
Creator.CreateModelLine( doc, p, q );

// Exterior edge

p = lcstart - v + halfThickness * w;
q = lcend + v + halfThickness * w;
creator.CreateModelLine( p, q );
Creator.CreateModelLine( doc, p, q );

//CompoundStructure structure = wall.WallType.CompoundStructure; // 2011
CompoundStructure structure = wall.WallType.GetCompoundStructure(); // 2012
Expand Down Expand Up @@ -126,7 +126,7 @@ LocationCurve curve

p = lcstart - v - halfThickness * w;
q = lcend + v - halfThickness * w;
creator.CreateModelLine( p, q );
Creator.CreateModelLine( doc, p, q );
}
else
{
Expand All @@ -147,7 +147,7 @@ LocationCurve curve

p = lcstart - v + layerOffset * w;
q = lcend + v + layerOffset * w;
creator.CreateModelLine( p, q );
Creator.CreateModelLine( doc, p, q );
}
}
tx.Commit();
Expand Down
38 changes: 19 additions & 19 deletions BuildingCoder/BuildingCoder/Creator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,22 +198,22 @@ SketchPlane NewSketchPlanePassLine(
return SketchPlane.Create( _doc, plane ); // 2014
}

public void CreateModelLine( XYZ p, XYZ q )
{
if( p.IsAlmostEqualTo( q ) )
{
throw new ArgumentException(
"Expected two different points." );
}
Line line = Line.CreateBound( p, q );
if( null == line )
{
throw new Exception(
"Geometry line creation failed." );
}
_credoc.NewModelCurve( line,
NewSketchPlanePassLine( line ) );
}
//public void CreateModelLine( XYZ p, XYZ q )
//{
// if( p.IsAlmostEqualTo( q ) )
// {
// throw new ArgumentException(
// "Expected two different points." );
// }
// Line line = Line.CreateBound( p, q );
// if( null == line )
// {
// throw new Exception(
// "Geometry line creation failed." );
// }
// _credoc.NewModelCurve( line,
// NewSketchPlanePassLine( line ) );
//}

/// <summary>
/// Return a new sketch plane containing the given curve.
Expand Down Expand Up @@ -334,11 +334,11 @@ public void DrawPolygon(
}
else
{
CreateModelLine( p, q );
CreateModelLine( _doc, p, q );
}
q = p;
}
CreateModelLine( q, p1 );
CreateModelLine( _doc, q, p1 );
}

public void DrawPolygons(
Expand Down Expand Up @@ -382,7 +382,7 @@ public void DrawFaceTriangleNormals( Face f )
Util.PointString( p ),
Util.PointString( normal ) );

CreateModelLine( p, p + normal );
CreateModelLine( _doc, p, p + normal );
}
}
}
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 @@ -87,6 +87,7 @@
// 2015-03-25 2015.0.120.4 integrated Alexander Ignatovich ai CmdWallProfile - first attempt.cs
// 2015-03-25 2015.0.120.5 integrated Alexander Ignatovich ai CmdWallProfile - second attempt.cs
// 2015-03-25 2015.0.120.6 integrated Alexander Ignatovich ai CmdWallProfile - final.cs
// 2015-03-25 2015.0.120.7 eliminated and replaced non-static Creator.CreateModelLine taking XYZ start and end point by static overload taking Document as well
//
[assembly: AssemblyVersion( "2015.0.120.6" )]
[assembly: AssemblyFileVersion( "2015.0.120.6" )]
[assembly: AssemblyVersion( "2015.0.120.7" )]
[assembly: AssemblyFileVersion( "2015.0.120.7" )]

0 comments on commit 8644555

Please sign in to comment.