GenerativeComponents Help

PointByOriginDistanceAngleZTranslation

The following transaction example shows how to declare a function. Starting with the keywords 'global redeclare' and following with the desired function, a global function is made meaning it can be accessed at anytime by simply calling the function name and specifying the arguments. After the transaction successfully runs, you can follow the following steps to see if the function 'PointByOriginDistanceAngleZTranslation' was successfully created:
  1. Select (Show Functions ) to access the functions.
  2. In the Functions dialog use the scroll bar to search for the created function 'PointByOriginDistanceAngleZTranslation'. The listed functions should be alphabetically sorted.
  3. Once found, click on the function and you can view the function that was previously declared in the transaction.
transaction 1 modelChange 'Define PointByOriginDistanceAngleZTranslation'
{
    script
    {
        global redeclare Point PointByOriginDistanceAngleZTranslation(CoordinateSystem cs,  Point originPt, double radius, double theta, double zTranslation)
        {
            DAngle phi; 
            phi.Degrees = theta; 
            DPoint3d cylindricalPD3d;  
            cylindricalPD3d = DPoint3d.FromCylindricalOffset(ref originPt.DPoint3d, radius, phi, zTranslation);
            Point pt = new Point ();
            pt.FromDPoint3d(cs, cylindricalPD3d); 
            return pt; 
        }
    }
}