PDA

View Full Version : LScript silly question



HelioAraujo
02-25-2009, 07:12 AM
Howdy folks,

I searched for the manuals, here in the forum and in the "LScript Index" site before posting this question. I would like to flatten the layers via lscript. Is is possible to invoke the "Flatten Layers" command in the "View" tab?

Thanks in advance.

Regards,
Helio

evenflcw
02-25-2009, 08:21 AM
Bring all layers to foreground. Cut. Bring first layer only to foreground. Paste.

or

cmdseq("Flatten");

Check lwext*.cfg for the correct name to invoke with cmdseq() and meshedit().

HelioAraujo
02-25-2009, 09:06 AM
Hi Dan,

I had tried cmdseq("Flatten Layers") ... and it didn't work ...

Thanks for the hint :thumbsup:

Regards,
Helio

HelioAraujo
02-25-2009, 09:28 AM
Using the cmdseq("Flatten"); resulted in a popup window requiring user action, so I tried the other method and it worked. Here's the code:

selmode(USER);
// Flatten layers.
qtLayers = lyrdata();
lyrsetfg(qtLayers);
cut();
lyrsetfg(1);
paste();

Thanks again to Dan.

Regards,
Helio

dpont
02-25-2009, 09:32 AM
In Command Exe,

cmdseq flattenlayers

Or in Lscript,

CommandInput("cmdseq flattenlayers");

You can find all available commands in a txt file
with 'Save Cmd List' in Modeler.

Denis.

HelioAraujo
02-25-2009, 10:42 AM
Hi Denis,

Thanks for the info!

I tried the following:

main
{
selmode(USER);
CommandInput("cmdseq layerbrowser");
}


and got a popup window telling me:

Plugin missing
No plugin of type CommandSequence found with name layerbrowser.
Would you like to load if from disk?

Now I'm trying to find a way to list the layers by name.

Regards,
Helio

*********************************************
The answer to my question is in this thread:
http://www.newtek.com/forums/showthread.php?t=70954&highlight=layer
*********************************************

dpont
02-25-2009, 11:13 AM
Should be a single command,
layerbrowser
not a command sequence but even
if if it is listed, it seems that it is
not implemented (like a few others).

Denis.

HelioAraujo
02-25-2009, 05:39 PM
I ended up doing one myself. With some searches on the forums I was able to find what I needed. Now I have a command on modeler/utilities tab for choosing a layer based on its name. The initial need was a lscript that would break up an object according to the polygon's surface names, separate the polygon into smaller pieces and place each new object ona separate layer. There's a script like that in the lscript user manual, all I had to do was change it to suit my needs (e.g. naming the layer according to the surface assigned to the geometry). I did this to make my life easier when working on Maxwell Render in a scene made in LW.

If someone is interested in the scripts, I'll gladly post them here.

Regards,
Helio