Need help that MoI meets Z88

 From:  Michael Gibson
7323.3 In reply to 7323.2 
Hi Hamish,


> for each line object in the geometry database, do:

There isn't any convenient way set up for a script to know if a curve is a line or a general bendy curve. But you can get a list of all curves in the geometry database by doing:
var curves = moi.geometryDatabase.getObjects().getCurves();


> get length;

The length of a curve can be retrieved using curve.getLength();


> get xyz of start

The start point can be retrieved using var pt = curve.getStartPt();


> get xyz of end

var pt = curve.getEndPt();


> Sort data? By what criteria??
> Export to text file.

A script can write to a text file using moi.filesystem.openFileStream(), check out the updated version of SavePointFile for an example: http://kyticka.webzdarma.cz/3d/moi/#SavePointFile


Currently it can be pretty difficult to write these kinds of scripts, it has not been a priority area for MoI as of yet and so there aren't things like tutorials and documentation and things like that. At some point in the future that will probably change but for now it can be pretty difficult to make stuff like what you are describing.

- Michael