straight snap in a script

Next
 From:  pressure (PEER)
11255.1 
Is there a way to create a straight snap at a specific angle in a script? I tried using pointpicker.addStraightSnapAngle(angle, label) but that adds snaps at zero degrees and at every multiple of the angle that's less than 360.

What I need to do is more like adding a straight snap at just 90 degrees without additional snaps being added at 0, 180, and 270.

Doing pointpicker.disableStraightSnapAngle(0); won't work for me because I still want the straight snaps that originate outside my script to be active. Like for 0 degrees, I want there to be a straight snap labeled "x"

- Peer
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11255.2 In reply to 11255.1 
Hi Peer,

re:
> Is there a way to create a straight snap at a specific angle in a script?

Just with pointpicker.addStraightSnapAngle() as you mention.


> What I need to do is more like adding a straight snap at just 90 degrees without
> additional snaps being added at 0, 180, and 270.

Doing pointpicker.disableStraightSnapAngle( 0 ), pointpicker.disableStraightSnapAngle( 180 ), and pointpicker.disableStraightSnapAngle( 270 ) is the only way set up to do that.

Maybe instead of using straight snap you could set up a custom snapping function. That would be by calling pointpicker.addSnapFunc( YourFunc ); the function you pass will get the pointpicker object passed to it and if you want a snap to be triggered you call pointpicker.setSnapFuncPoint( point, 'label' );

Something like this:

function SnapFunc( pointpicker )
{
   Look at pointpicker.pt or pointpicker.screenpt
   and if you want it to snap somewhere do pointpicker.setSnapFuncPoint( point, 'label' );
}

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  pressure (PEER)
11255.3 In reply to 11255.2 
Thanks Michael for responding so quickly! I'll give the custom snap function route a try.

- Peer
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All