PDA

View Full Version : Modeler Layer script - impossible?



wiffzack
05-11-2003, 11:33 AM
hello,

i wan´t to write a script wich is called SelectLayerBySelection:

If more layers are selected, and i select a point (or poly), the
script should deselect all layers without selected points. :)
Everbody understand that?.

However, i thought this would be an easy "2-line-script", but now i think its impossible.

The problems:
If i use setlyrfg() i loose the users selection. I can't even loop thruogh all Layers and check if points are selected...

And that seems the only way to realize this. Or is there something like "isPointAlreadyHere( <vector> );".

The "automatic" point and poly-arrays are a problem too. I couldn't store the selected points before looping through the layers ( and set one layer to foreground )

The main reasoin for the script was Bandsaw and other tools, They dont work if mor layers are selected... I dont like to name my layers :)

Could somebody helb me?

thx & greetings

wiffzack
05-11-2003, 12:55 PM
Ok, ive got it :). I have notice that the Mesh() function is available in modeler.

So it is a "2 line script" :)

if somebody is interested:



main
{
selmode(USER);
pc = editbegin();
if(pc <= 0) {
pt = polygons[1];
}else{
pt = points[1];
}
editend();
obj = Mesh();
lyrsetfg( obj.layer( pt ) );
}