public void VisualizePoint(SpatialAnalysis.Geometry.UV pnt, double size, double elevation) { //unit conversion SpatialAnalysis.Geometry.UV p = pnt.Copy(); unitConversion.Transform(p); //revit drawing XYZ p1 = new XYZ(p.U - size / 2, p.V - size / 2, elevation); XYZ p2 = new XYZ(p.U + size / 2, p.V + size / 2, elevation); XYZ q1 = new XYZ(p.U + size / 2, p.V - size / 2, elevation); XYZ q2 = new XYZ(p.U - size / 2, p.V + size / 2, elevation); using (Transaction t = new Transaction(OSM_FOR_REVIT.RevitDocument, "Show Point")) { t.Start(); FailureHandlingOptions failOpt = t.GetFailureHandlingOptions(); failOpt.SetFailuresPreprocessor(new CurveDrawingWarningSwallower()); t.SetFailureHandlingOptions(failOpt); Plane pln = Plane.CreateByNormalAndOrigin(XYZ.BasisZ, new XYZ(0, 0, elevation)); SketchPlane skp = SketchPlane.Create(OSM_FOR_REVIT.RevitDocument, pln); Line l1 = Line.CreateBound(p1, p2); Line l2 = Line.CreateBound(q1, q2); OSM_FOR_REVIT.RevitDocument.Create.NewModelCurve(l1, skp); OSM_FOR_REVIT.RevitDocument.Create.NewModelCurve(l2, skp); t.Commit(); } p1 = null; p2 = null; q1 = null; q2 = null; }
/// <summary> /// Initializes a new instance of the <see cref="StateBase"/> class. /// </summary> /// <param name="location">The location.</param> /// <param name="direction">The direction.</param> /// <param name="velocityMagnitude">The velocity magnitude.</param> public StateBase(UV location, UV direction, double velocityMagnitude) { this.Direction = direction; this.Velocity = direction.Copy(); this.Velocity.Unitize(); this.Velocity *= velocityMagnitude; this.Location = location; }
/// <summary> /// Initializes a new instance of the <see cref="StateBase"/> class. /// </summary> /// <param name="location">The location.</param> /// <param name="direction">The direction.</param> public StateBase(UV location, UV direction) { this.Direction = direction; this.Velocity = direction.Copy(); this.Location = location; }