BuildingCoder.CmdFaceWall.MakeLine C# (CSharp) Method

MakeLine() static private method

static private MakeLine ( Document doc, XYZ p, XYZ q ) : ModelCurve
doc Document
p XYZ
q XYZ
return ModelCurve
        static ModelCurve MakeLine(
            Document doc,
            XYZ p,
            XYZ q)
        {
            // Create plane by the points

              Line line = Line.CreateBound( p, q );
              XYZ norm = p.CrossProduct( q );
              if( norm.GetLength() == 0 ) { norm = XYZ.BasisZ; }

              //Plane plane = new Plane( norm, q ); // 2016

              Plane plane = Plane.CreateByNormalAndOrigin( norm, q ); // 2017

              SketchPlane skplane = SketchPlane.Create(
            doc, plane );

              // Create line

              return doc.FamilyCreate.NewModelCurve(
            line, skplane );
        }

Same methods

CmdFaceWall::MakeLine ( UIApplication app, XYZ ptA, XYZ ptB, Document doc ) : ModelCurve