Being busy with Dynamo there is so much you can spend time on learning. I haven’t taken the time to look into functions in Dynamo. Which I regret now, I could have saved myself a lot of time. Tonight I thought let’s look into this as I found myself repeating something in Dynamo a lot. I often need to get a vector from a curve’s start to endpoint. There are curves being created in dynamo that are straight and for which this function may work. This function of course could create havoc for any none straight curves. These straight curves typically come from PolyCurves, edges from flat surfaces and isolines from flat surfaces.
So after reading the dynamo primer for 1 minute.7-4_functionsA bit of node to code and typing.
- Are the original nodes
- Is the function I defined at Number 3 in a Code Block
- The actual code
In other words this is embarrassingly simple…
/*This is a function for getting a vector from:
a curve start to endpoint*/
point1 = Curve.StartPoint(curve1);
point2 = Curve.EndPoint(curve1);
vector1 = Vector.ByTwoPoints(point1, point2);