PointPicker and history script/API questions
All  1-4  5-10

Previous
Next
 From:  Larry Fahnoe (FAHNOE)
10917.5 In reply to 10917.4 
Got it, thanks Michael.

> The tricky part is it is up to the snap function to determine which snap point is targeted using the screen coordinates of the mouse.
> The hit testing functions for helping with that are not currently exposed to script, nor is the screen coordinates. I'll see about adding those in.

Yes, with only limited testing of the SnapFunc above, the corner points don't end up being "sensitive" enough: the clicks don't reliably trigger the intended corner.

No worries, I'll go back to using pointpicker.restrictToObject( rect).

--Larry

EDITED: 15 Dec 2022 by FAHNOE

  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
10917.6 In reply to 10917.1 
Hi Larry,

re:
> Oddly after the script exits, an undo will expose the rotated edge in its original position.

I'm not reproducing that over here.

When I run 2dopening and pick some points I get a result like this:


And when I then do an undo, I get this:


- 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
Next
 From:  Larry Fahnoe (FAHNOE)
10917.7 In reply to 10917.6 
Hi Michael,

Yes, that's the intended behavior. Please click on the Door checkbox to expose the unexpected undo behavior.

BTW, the purpose of the script is to add simple 2D window and door symbols to an architectural floorplan, so the typical use would be on a model like the attached.

--Larry

EDITED: 26 Dec 2022 by FAHNOE

  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:  Larry Fahnoe (FAHNOE)
10917.8 In reply to 10917.7 
With continued development of this script the unexpected undo behavior went away, though I'm still not clear on its cause nor just what cleared it up. A minor mystery, most likely due to a lack of understanding on my part.

--Larry
  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
10917.9 In reply to 10917.8 
Hi Larry,

re:
> A minor mystery, most likely due to a lack of understanding on my part.

I think there's a bug somewhere in the automatic undo generation system when some intermediate objects are both created and deleted within the same command.

If you run into it again you might try using factory.calculate() instead of factory.commit(), like:

var object_list_result = factory.calculate();

The difference is that factory.calculate() creates "loose objects", meaning the objects have not been added into the geometry database automatically. If you're then using that geometry for internal construction and it's not supposed to be shown by itself to the user you don't need to have it added into the geometry database.

- 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:  Larry Fahnoe (FAHNOE)
10917.10 In reply to 10917.9 
Thanks Michael, will keep that in mind.

--Larry
  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

 

 
 
Show messages: All  1-4  5-10