I am trying to enable RSnapOnEntity and RSnapDistanceExtension so both occur at the same when a user is using our script to drop an item on the document.
I can setSnap so it snaps to the entity but have not been able to also enable RSnapDistanceExtension.
I have the following code in our script
Code: Select all
this.getDocumentInterface().setSnap(new RSnapOnEntity());
var guiAction = RGuiAction.getByScriptFile("scripts/Snap/SnapDistance/SnapDistance.js");
if (!isNull(guiAction)) {
guiAction.slotTrigger();
}
this.getDocumentInterface().setSnapRestriction(new RSnapDistanceExtension());
Code: Select all
this.getDocumentInterface().setSnapRestriction(new RSnapDistanceExtension());
Code: Select all
ReferenceError: Can't find variable: RSnapDistanceExtension
Hope you can help.
Thanks,
Andrew.