Add Point() and scriptcontext


#1

Hi there,

I have found a link how to add new point to the document and just wondering why do we need to use scripcontext.doc because rs.AddPoint(point3d) is already in the script. Can you please give me a short explanation ?

  # creates a point where the mouse is clicked
  # using the RhinoScript syntax
  point3d = rs.GetPoint("Click for point")
  if point3d == None: return Result.Nothing
  rs.AddPoint(point3d)
  doc.Objects.AddPoint(point3d)

#2

In this case they do the same thing - so you don’t need them both.


#3

Thanks, that was my guess.