Can "presets" for selecting objects be implemented?
 1-19  20-23

Previous
Next
 From:  Michael Gibson
11689.20 In reply to 11689.19 
Hi Frederick, I've attached an example here.

- Michael
Attachments:

  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:  fcwilt
11689.21 In reply to 11689.20 
Hi Michael,

Thank you.

Going back a post or two to where you mentioned this:

-The object picker will only target preselected objects if the selection happened before the command started.

-Since you want to automatically select stuff instead of having the user pick them you probably don't want to use the object picker there at all.

-Instead of calling GetObjects() you could call moi.geometryDatabase.getSelectedObjects(); and to wait at the prompt you could call WaitForDialogDone() instead of GetObjects().

I could not get it to work.

See attached.

Thanks.

Frederick
Attachments:

  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
11689.22 In reply to 11689.21 
Hi Frederick, almost - so what I meant was get rid of all the objectpicker stuff and you can get the selected objects by the return value of moi.geometryDatabase.getSelectedObjects(), like:

var objs = moi.geometryDatabase.getSelectedObjects();

And now that it's selecting objects by name there won't be any unnamed objects selected so I think you can skip the deselectUnnamedParts part as well.

So maybe just this (untested):

function ExportByPrefix() {
mgd.deselectAll();
mgd.selectNamed(pfix);

WaitForDialogDone();

DoExportParts( mgd.getSelectedObjects() );
}


re:
// what are these 4 lines below supposed to do

Those were updating the prompt (the top line in the command options area) by hiding one line of text and showing the next one.

- 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:  fcwilt
11689.23 In reply to 11689.22 
Hi Michael,

That seems simple enough.

I will give it a try shortly.

Thanks.

Frederick
  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:  1-19  20-23