I need to select a point I created in vb script through the centroid function and both get its coordinates to print to a text file and find a distance between it and another point without using the command line in Rhino.
Using ‘Rhino.LastObject’ worked for selecting a surface and finding its area but for some reason keeps telling me it’s in the wrong format using points. Any help would be much appreciated. This involves converting the ObjectID to a usable format.
I am only guessing since I don’t see your script code, but if you are getting a point object via LastObject, you
need to get it’s coordinates via this method:
Thank you for the quick response! I did try using ‘PointCoordinates’ and my code is shown below:
Rhino.command("-_AreaCentroid _SelName fp_surf _Enter")
str_fp_centroid = Rhino.LastObject
arr_fp_cent = Rhino.PointCoordinates(str_fp_centroid)
I’m using ‘Print’ just to check if it is doing what I want; however, I get the error that this must be an array, which I thought it was by using ‘PointCoordinates.’ It also will not write to a file.
Thank you for your help, I have figured it out. Using Rhino.LastObject does not work well with using Rhino commands. I used Rhino.MeshAreaCentroid to find the point combined with PointCoordinates and it is working now.