Rs.AddLeader -- needs more than two points

not sure if the help is wrong or rs.AddLeader isn’t working properly but:


points- Required. A list of 3-D points. The array must contain at least two points.

then the example:

import rhinoscriptsyntax as rs
points = rs.GetPoints(True, False, "Select leader points")
if points: rs.AddLeader( points )

this only works (for me) if i click more than two points.

any ideas?
(for now, i’m just adding the end point to the array twice… seems ok i guess)

Need three points or more

well yeah, it seems that way…

just that all the various docs say 2 or more plus the _Leader command in rhino only needs two …

Seems to work with two points here… Make sure the two points make sense if you don’t specify a view…

import rhinoscriptsyntax as rs
import Rhino


hmm… weird.
your script doesn’t work for me… if i do this to it:

import rhinoscriptsyntax as rs
import Rhino
pt1= Rhino.Geometry.Point3d(0,0,0)
pt2= Rhino.Geometry.Point3d(1,1,0)
pt3= Rhino.Geometry.Point3d(1,1,0)

it does work

is there anything you can think of (like a setting?) that may be interfering?
doesn’t seem like it would be a mac thing but maybe?

It works here under Windows with both Python as well as Vb. It’s possible that the version of rhinoscriptsyntax installed on Mac is older than the one on Windows, maybe a bug was fixed in between. I don’t have my Mac with me today to test…

Yes, that is probably it… It’s actually me that reported the bug here

@stevebaer I don’t know how often rhinoscriptsyntax is updated on Mac…


it’s not a huge deal though i am working on something which has a few of these in there… shouldn’t be too bad to change once i figure out the AddLeader oddity… (it’s not bad because the duplicate point isn’t being place in the model… still only two points there)

but if you remember, can you test this out when you get back to a mac?

edit- just saw your edit.
seems likely it’s a mac thing then… the service updates are usually a month or two behind and maybe even more with python.

The Mac build may be a little behind at the moment. This should resolve itself soon though since I’ve got some python/Mac work coming up right after I finish my current project.