Scripting the Trim command -- programmatically select objects to keep or remove?
All  1-2  3-9

Previous
Next
 From:  mike (MVERHULST)
11415.3 In reply to 11415.2 
cool,

but i did dismiss the alert and the gui is still blocked. its like it is asking for me to select a section of the line to remove with the mouse. But how do i programmatically select line segments to keep or remove?
  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:  pressure (PEER)
11415.4 In reply to 11415.3 
Hi Mike,

When I run your code on Windows in the latest v5 beta it works just fine. The GUI is responsive after I click through the alert.

Re:
> its like it is asking for me to select a section of the line to remove with the mouse.

Setting input 2 with an empty objectList like you're doing means that all fragments will be kept.

Re:
> But how do i programmatically select line segments to keep or remove?

What's kept and removed is determined by the contents of the objectList passed to input 2 and whether the factory is running in "keep" mode or "remove" mode.

- 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:  mike (MVERHULST)
11415.5 In reply to 11415.4 
can you test it in v4? i wonder if i am doing something wrong? see the image? i cant click on the circle, but i can click ui buttons and/or either of the 2 line segments

EDITED: 29 May 2024 by MVERHULST

Image Attachments:
Size: 109.9 KB, Downloaded: 42 times, Dimensions: 1039x776px
  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:  pressure (PEER)
11415.6 In reply to 11415.5 
Hi Mike,

I can click on the circle fine in v4 and in v5.

Is the code that you posted the entirety of your script, or is there other code too? Is there anything going on in the companion .htm file?

It sounds like selection lock is getting set on the circle. That's the typical reason for not being able to click on something.

- 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:  mike (MVERHULST)
11415.7 In reply to 11415.6 
interesting

that is the whole script i dont have a html file

i am running it with this command

"C:\Program Files\MoI 4.0\MoI.exe" C:\Users\Administrator\Desktop\trimtest.js
  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:  mike (MVERHULST)
11415.8 In reply to 11415.7 
excellent,

thanks for your help :)

i needed to add

var objects = gd.getObjects();
objects.unlockSelection();
  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:  Michael Gibson
11415.9 In reply to 11415.8 
Hi Mike, clearing selection lock is something that normally happens when a command ends.

When you run a startup script it's not using the "command" mechanism and so you'll have to do some things manually like that.

- 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
 

Reply to All Reply to All

 

 
 
Show messages: All  1-2  3-9