Skip to content

Instantly share code, notes, and snippets.

@benkoshy
Created February 11, 2021 05:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benkoshy/9813b7784595b6614eefc3a44cb52b0c to your computer and use it in GitHub Desktop.
Save benkoshy/9813b7784595b6614eefc3a44cb52b0c to your computer and use it in GitHub Desktop.
    class Program
    {
        static void Main(string[] args)
        {
            Model model = new Model();
            if (model.GetConnectionStatus())
            {
                PolyBeam polyBeam = new PolyBeam(PolyBeam.PolyBeamTypeEnum.BEAM);                              
                ContourPoint startPoint = new ContourPoint(new Point(1000, 0, 0), null);

                // get the radial midpoint between the
                // start and end points

                double x = 1000 * Math.Cos(Math.PI / 4);
                double y = 1000 * Math.Sin(Math.PI / 4);                

                ContourPoint midPoint = new ContourPoint(new Point(x, y, 0), new Chamfer(0, 0, Chamfer.ChamferTypeEnum.CHAMFER_ARC_POINT));
                ContourPoint endPoint = new ContourPoint(new Point(0, 1000, 0), null);

                polyBeam.AddContourPoint(startPoint);
                polyBeam.AddContourPoint(midPoint);
                polyBeam.AddContourPoint(endPoint);

                polyBeam.Profile.ProfileString = "UB360*51";
                polyBeam.Insert();
            }

            model.CommitChanges();
        }        
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment