Rs.AddLeader -- needs more than two points


#1

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

AddLeader

Parameters
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)


Leader Question -- not what i expect from different perspectives
(NARUTO) #2

Need three points or more


#3

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 …


#4

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
pts=[]
pts.append(Rhino.Geometry.Point3d(0,0,0))
pts.append(Rhino.Geometry.Point3d(1,1,0))
rs.AddLeader(pts,text="Test")

–Mitch


#5

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

import rhinoscriptsyntax as rs
import Rhino
pts=[]
pt1= Rhino.Geometry.Point3d(0,0,0)
pt2= Rhino.Geometry.Point3d(1,1,0)
pt3= Rhino.Geometry.Point3d(1,1,0)
pts.extend([pt1,pt2,pt3])
rs.AddLeader(pts,text="Test")

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?


#6

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

http://mcneel.myjetbrains.com/youtrack/issue/RH-27419

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

–Mitch


#7

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.


(Steve Baer) #8

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.