Elephant Repository

 From:  Michael Gibson
9476.326 In reply to 9476.325 
Hi Brian, yes dimensions can be created by a script.

There are 8 new factories for that: dimhorizontal, dimvertical, dimaligned, dimradius, dimangle, leader, annotationtext, arrow3d.

dimhorizontal, dimvertical, and dimaligned all create a linear dimension object, and they all have 3 inputs:
0: Frame - base plane for dimension with origin at first point
1: Point - end point
2: Point - location point

dimradius has 4 inputs:
0: Object - arc or circle curve
1: String - type of radial dimension, either "Radius" or "Diameter"
2: Point - arrow point on curve
3: Point - text point

dimangle has 4 inputs:
0: Frame - center of angle
1: Point - start point
2: Point - end point
3: Point - location point

leader has 2 fixed inputs:
0: Frame - plane with origin at arrow point
1: String - text
2+ : Point inputs added

annotationtext:
0: Base frame
1: Text

arrow3d - creates a leader with 2 points with the "rotate arrow towards viewer" property set on it, this is for James to use in the node editor for a vector direction display. It automatically creates a plane for the leader given 2 points.
0: start point
1: end point

Here's an example using arrow3d:

code:
	var startpt = moi.vectorMath.createPoint(5,5,5);
	var endpt = moi.vectorMath.createPoint(10,10,10);
	var f = moi.command.createFactory( 'arrow3d' );
	f.setInput( 0, startpt );
	f.setInput( 1, endpt );
	var arrow = f.calculate().item(0);
	moi.geometryDatabase.addObject( arrow );
	f.cancel();


- Michael