PDA

View Full Version : Copying coords into clipboard?



Matt
11-06-2003, 07:28 AM
Hi http://www.creactive-design.co.uk/gfx/bigsmile.gif

Is it possible to copy into the global clipboard coordinates (x,y,z) for a point?

I've checked through the LScript Reference PDF but the only command for copying - copies the geometry which isn't what I need.

Any ideas? http://www.creactive-design.co.uk/gfx/confused.gif

Cheers
Matt

faulknermano
11-10-2003, 08:40 AM
use pointinfo() to retrieve the point coordinates and use store(), globalstore() or the file object agent (ASCII text files) to store the information. after that, it is just simple matter of retrieving the data using recall(), globarecall(), or once again, the file object agent.

Matt
11-10-2003, 10:28 AM
Thanks faulknermano didn't think this was possible due to the lack of replies!

Thing is I can't make it work, here's a snippet of what I'm trying to store:

- - -

selmode(USER);
editbegin();
coords=center(boundingbox());
editend();

cx=number(coords.x);

globalstore("bbcentre", cx);

- - -

First I had an error saying 'Invalid Argument 1 type to globalstore()'.

But for some reason that seems to have gone (despite the fact that the script hasn't changed, VERY odd!!!!)

Even when the script runs with no errors it doesn't store the variable ('cx' in this case) in the global clipboard.

If I explain why I need this script . . .

When mirroring stuff I like to do it accurately using existing geometry in the model, a nice easy way it to select some geometry where the mirror is to take place, run the bounding box script (which I adapted from one of Carl Merrits) which finds the bounding box centre of whatever is selected (which works out to be the mirror centre too) copy the value from the axis I need and paste it into the Mirror axis in the numeric panel.

It would be nice to have the script copy the value automatically.

I'm thinking there isn't a command that does this now! :(

Matt

faulknermano
11-11-2003, 08:01 AM
regarding your globalstore() problem: i've had weird experiences myself which were remedied, sometimes, by deleting the entry in the registry that corresponds to the globalstore() in your script. in this case look for the "bbcentre" entry and delete it. then run the script again.

if that doesnt work, you still have the file object agent as an alternative. write out a text file to save your info. this is more reliable, of course:





...
f = File("c:/globalData.txt","w");
if(!f)
error("<br>Invalid file.");
f.writeln("Some global data.");

rf = File("c:/globalData.txt","r");
line = rf.read();

...

faulknermano
11-11-2003, 08:04 AM
Originally posted by Matt


If I explain why I need this script . . .

When mirroring stuff I like to do it accurately using existing geometry in the model, a nice easy way it to select some geometry where the mirror is to take place, run the bounding box script (which I adapted from one of Carl Merrits) which finds the bounding box centre of whatever is selected (which works out to be the mirror centre too) copy the value from the axis I need and paste it into the Mirror axis in the numeric panel.

It would be nice to have the script copy the value automatically.

I'm thinking there isn't a command that does this now! :(

Matt

i dont thin there is a command that will enable you to override the values of lightwave's inbuilt tools. however, it is fairly simply to create your own script that does the mirroring automatically. there is the mirror() cs command, just so you know. it's in the docs.