PDA

View Full Version : Selecting New Points Created . . .



Matt
10-07-2003, 05:33 AM
Hi guys!

I'm a complete lscript newbie, I modified Carl Merritt's script PivotBB.ls to add a point using the bounding box selection rather than moving the pivot.

addpoint(center(boundingbox()));

However I'm at a loss as to how I select the new point created!

I've found the command in the (rather poor) lscript docs, which seems to be:

selpoint();

I can't even get the selpoint(CLEAR); to clear any points that might have been used in the original selection so that the new point isn't added to that selection!

Help!

:)

Cheers
Matt

Matt
10-07-2003, 06:22 AM
Sorted it! Found an example in 'radial_select.ls'

For anyone who wants it (!) here it is in full . . .


@version 2.2
@warnings
@script modeler

main
{
// Get user selection
selmode(USER);

// Edit mesh mode
editbegin();
// The magic line! Add a point in the bounding box of the selection, grabbing the details as you go!
pointcreated=addpoint(coords=center(boundingbox()) );
// dunno why the ); is on a new line, in shouldn't be!
// Leave edit mesh mode
editend();
// Clear any existing point selection
selpoint(CLEAR);
// Select newly created point
selpoint(SET,POINTID,pointcreated);
}

NanoGator
04-06-2005, 04:01 PM
Good god you saved my *** with this.

Note to Newtek: POST SAMPLE CODE IN THE MANUAL. It's really frustrating having to Google around for LScript samples solely because the selpoly description doesn't come with a sample. ****, that's an hour of my life I'd like to have back.

NanoGator
04-06-2005, 04:06 PM
Sorry about the outburst. I let myself get a little too frustrated. :(

Matt
04-06-2005, 06:01 PM
No worries! Glad it helped! :)