Show messages:
1-20
21-22
From: Michael Gibson
Hi stefano, so the user data is primarily intended to be a way for scripts to store data on either the document or on individual objects.
The script can use a unique name for the "key" part to avoid having some other script trying to store data in the same spot.
Scripts can access document user text by using these functions:
moi.geometryDatabase.setUserText( key, value );
var text = moi.geometryDatabase.getUserText( key ); // returns undefined if no user text is there.
var list = moi.geometryDatabase.getAllUserText();
moi.geometryDatabase.removeUserText( key );
moi.geometryDatabase.clearAllUserText();
Document user text is stored inside .3dm files.
The user can see and add or modify document user text values in the UI under File > Notes > “Document user text”.
User text can also be set on individual objects. The UI for setting these is under Details… > Object user text.
The object level user text has the same functions that are on the document:
obj.setUserText( key, value );
var text = obj.getUserText( key );
var list = obj.getAllUserText();
obj.removeUserText( key );
obj.clearAllUserText();
MoI itself does not currently make use of any user text value, it’s there for scripts to use if the script wants to store some data on particular objects or for the document.
You wrote:
> Maybe this is only for storing scripts or could any values be assigned under key/value
>
> Example <...>
Sure, you can set these values on the user text. They will only be very useful though if you have set up a script that will access those values and do something with them.
re:
> Export this to csv - you’d have a list of 3 columns
Do you mean you want something like column A quantity, column B object name, column C cost/sqm ?
It is possible for a script to write to a text file. Some info here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=9665.2
- Michael
From: stefano (LIGHTWAVE)
hi Michael - this MOI3D Notes V5 and the future looks very powerful!
Especially the object detail side of things...
I will work out a few more concise examples of how I might
use object data values - need some paint to dry 1st...
Stefano
Show messages:
1-20
21-22