I would like to create a beam profile and assign it to a curve using script. I know start point and end point.
You may use below snippet which should work in Discovery as well now.
import SpaceClaim.Api.V19.Geometry.CircleProfile as CircularProfile
profile = CircularProfile(planeXY, rad_sld, PointUV.Origin, 0)
doc = DocumentHelper.GetActiveDocument()
beamProfile = Part.CreateBeamProfile(doc, name, profile)
# Create beams related points
start = Point.Create(pt_x, pt_y, pt_z1)
end = Point.Create(pt_x, pt_y, pt_z2)
lineSegment = CurveSegment.Create(start, end)
line = DesignCurve.Create(part, lineSegment)
beam = Beam.Create(beamProfile, line)
I would recommend to use CoreAPI method rather than Scripting API for creating Beam from a profile.