Grasshopper

algorithmic modeling for Rhino

Hi,

Is there a similar rhinoscriptsyntax function AddPoint in RhinoCommon?

I would like to use rs.AddPoint Python similar command in RhinoCommon using C#.

What would be a workaround?

Best,

Tomas

Views: 1072

Replies to This Discussion

You can look up the source code of rhinoscriptsyntax on Github (edit: direct link) or on your system. Should be on your hard drive here-ish:

C:\Users\YOURUSERNAME\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript

rs.AddPoint() is in the geometry.py namespace.

using C#:

if there's a List of type Point3d named tomas ... then for a given Point3d p simply do:

tomas,Add(p); (if p is a List: tomas.AddRange(p);)

if tomas is a Tree:

tomas.Add(p, new GH_Path(path_name)); (if p is List: tomas.AddRange(p, new GH_Path(path_name));)

if you have to add p1, p2, p3 "at once":

tomas.AddRange(new Point3d[3]{p1,p2,p3});

if you have to order tomas pts VS their distance to a point named focus:

tomas = tomas.OrderBy(x => x.DistanceTo(focus)).ToList();

etc etc

I have no idea about P things.

PS: You mean that Tomas needs this C#?

Attachments:

The equivalent in RhinoCommon would be AddPoint().

If you are doing this from a GH C# component, you already have a reference to the active doc as RhinoDocument.  So, you could do this:

RhinoDocument.Objects.AddPoint(new Point3d(0,0,0));

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service