PDA

View Full Version : Is it possible to call Extend Selection from lscript



Meta_Nerd
09-17-2004, 09:52 PM
I have an lscript that needs to call Expand Selection.
I tried to find any plugins to use so I could call cmdseq();....NO LUCK.

I am new to modeler scripts. Layout at least has a nice command history so you can figure it out.

Please help,

I wrote my own, but it is very slow. How much slower are plugins than lscripts.
Maybe I will have to write my own plug. Hmmmmm...

Ahhhhh.

Chris Reid

Dodgy
09-18-2004, 07:42 AM
I wanted the same thing a while back but couldn't find a command for this either. iIdon't think it exists...

faulknermano
09-18-2004, 08:03 AM
expand/contract selection is available as a user command. you could try experimenting calling a user command as a plugin but i doubt it would work.

faulknermano
12-01-2014, 04:49 PM
:)

Ten years after.... (http://youtu.be/_m7Q_rGLS_Q)



select_expand
{
selmode(USER);
pc = editbegin();
storedpoints = nil;
for(i=1;i<=pc;i++)
{
polylist = points[i].polygon();
// go thruogh polygon getting other points
for(j=1;j<=polylist.size();j++)
{
poly = polylist[j];
// store all points in poly except points[i]
for(k=1;k<=poly.pointCount;k++)
{
abort = false;
thispoint = poly.points[k];
// go through all points[] and make sure that it is not included here
for(m=1;m<=pc;m++)
if(thispoint == points[m])
abort = true;
if(abort == false)
{
if(storedpoints.contains(thispoint) == false)
storedpoints[storedpoints.size()+1] = thispoint;
}
}

}
polylist = nil;
}
editend();

selpoint(SET,POINTID,storedpoints);
}

iain_r
12-02-2014, 01:48 PM
Tried these with points and polygons, not sure if this is what you were looking for, tested in 9.6.

Contract


@version 2.8
@warnings
@script modeler
@name "SelectContract"

main
{
selmode(USER);
cmdseq("Select Contract");
}

Extend


@version 2.8
@warnings
@script modeler
@name "SelectExpand"

main
{
selmode(USER);
cmdseq("Select Expand");
}

Regards

Iain

faulknermano
12-02-2014, 01:57 PM
Hahaha! LScript hates me now.

*I actually thought I tried that method, but I must have instead used CommandInput("Select Expand") in Modeler and it did nothing. But I really thought I tried cmdseq()!

Ah well, the function I did was stupidly slow. :)

Thanks Iain.

iain_r
12-03-2014, 01:07 PM
No problem, I had to check out how to use cmdseq myself then find the commands in the extension config file. Amazing what's in there, might try some of the other commands and see what happens.

Regards

Iain

Dodgy
12-03-2014, 10:54 PM
Wow, this is an old thread. I knew I'd been using the cmdseq command for a while, so I knew it was available now LOL