MoI discussion forum
MoI discussion forum

Full Version: Can "presets" for selecting objects be implemented?

Show messages:  1-19  20-23

From: Michael Gibson
27 Mar   [#20] In reply to [#19]
Hi Frederick, I've attached an example here.

- Michael

Attachments:
Example.zip


From: fcwilt
27 Mar   [#21] In reply to [#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:
ExportParts.zip


From: Michael Gibson
27 Mar   [#22] In reply to [#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
From: fcwilt
28 Mar   [#23] In reply to [#22]
Hi Michael,

That seems simple enough.

I will give it a try shortly.

Thanks.

Frederick

Show messages:  1-19  20-23