70001430 Piority to ortho point than the osnap point

Article 70001430
Type Wish
Product WebJS
Version 7016
Date Added 10/26/2018
Fixed 8.8001.0.2 (10/29/2018)
Submitted by Brendan Fry

Summary

I would like to have a property to change the priority from osnap point to the ortho point. So when i have enabled both the ortho mode and osnaps and move an entity to place it in the ortho direction point and not be placed in the osnap point of another entity.

Solution

In version 8001.0.2 a new event vdFIlterActionPoint on vdcanvas object was added.
Example:

Suppose that we want to get the projection of selected osnap over the Ortho Line, instead of getting the Osnap point.

With following code inside the vdcanvas.vdFIlterActionPoint event :
When Action with ReferencePoint is active and the Action OrthoMode is on and Osnap is selected
then change the final point to be the projection of Osnap to the Line between ReferencePoint and OrthoPoint


vdcanvas.vdFIlterActionPoint = function (args) {
if (args.Action.ReferencePoint && args.Action.OrthoPoint && args.Action.OsnapPoint) { //transform the osnap from view to world cs var osnapworld = args.Action.vdrawOwner().ViewToWorld(args.Action.OsnapPoint); //get the perpendicular from osnap point to the line between ReferencePoint and OrthoPoint args.SelectedPoint = vdgeo.projectionPointOnLine(args.Action.OsnapPoint, args.Action.ReferencePoint, args.Action.OrthoPoint); } }

Also new properties was added to vdcanvas.ActiveAction()
vdcanvas.ActiveAction().OrthoPoint
Returns a point in World Coordinate System parallel to x or y axis relative to ReferencePoint and when the OrthoMode is on
If OrthoMode is off then the null is return

Send comments on this topic.