How would I go about defining a North vector in Human UI.?
I don’t have Rhino geometry to select and would like to simply click start and end of the vector to get a direction…
Also how do I select a location/point without a point to select…?
How I would do this (off the top of head, not at my machine).
Use a HumanUI button as an input to a GHpython component. In the component you will have about 4 lines of code.
I’d use either the GetPoints or GetLine User input methods in RhinoScriptSyntax to prompt the user to click two points and return these to the python component output.
If you need more info than that reply this thread and I’ll mock it up when I’m back in my office.
My problem is that the architectural models I receive rarely have North in the Y direction and the North direction matters a lot when I run HB simulations
@Kiteboadeshapers approach sounds like the way to go…
I understand and was just trying to get my head around how to use Human UI as a friendly front end to a large grasshopper script using HB and LB to run sun simulations. The Human UI aspect is a separate issue and I didn’t think to include it…
Here is a screenshot that shows how I’m using Human + Human UI to refresh a ‘data dam’ and I’d like to do the same when setting the vector and a points, but as Human UI’s ‘Rhino Pick button’ requires a ‘physical’ point to select and has no tool for vectors…and so I’m stumped.
import rhinoscriptsyntax as rs
if Get_Points:
point1 = rs.GetPoint("select first point", None, None, True)
point2 = rs.GetPoint("select second point", None, None, True)
A = point1
B = point2
the last ‘True’ in the rs.GetPoint keeps the selection to only the current CP plane - that I believe matches your requirements. Check the Rhino Script Syntax docs if you want to amend.
@kiteboardshaper Thankyou!
I can see that I need to learn Python and the RhinoScript…this is such a nice an direct solution.
PS have you tried Synapse to make cross-platform UIs?..there is not a lot of guidance around, but it would be nice to make a UI that also works on a mac.
My Kite Design plugin www.karorocad.com was first developed with HumanUI, but I was very keen to get it to work cross platform.
I did try Synapse, but like ETO that it is based on I found the learning curve too steep to make any real progress.
What I ended up doing was developing my own HumanUI replacement based on Webview:
This has been my production code UI since the start of the year, has needed some tweaks to work in R8 but I’m pretty happy where it is now at.
I’ve been toying with the idea of compiling the UI as a GH plug-in to offer as an alternative to HumanUI. UI+, Synapse etc, but time is a factor here. Watch this space as the winter (development time) progresses in Cape Town.
Hi @kiteboardshaper , thank you for all your help.
I’ve been trying to implement your solutions, but have run into a strange problem
When I hit the button in the Human UI window to select the two points it works just fine (if I set the input to ‘List access’ and type hint to ‘ghdoc object’, I get an ‘undefined’ if I don’t) , but the action repeats so I have to select the set of points twice.
Thanks! Yours is the best script I have found for the problem thus far. I think Human UI is great but being unable to set geometry like you can with the grasshopper player or grasshopper parameters is severally lacking.
Thanks! For posterity, here’s my version so that you can see the points being created as you produce them and create as many points as you need.
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
if not sc.sticky.has_key(“point1”):
sc.sticky[“point1”] = “0,0,0”
sc.sticky[“point2”] = “0,50,0”
if Get_Points:
Rhino.RhinoApp.SetFocusToMainWindow()
get_point1 = rs.GetPoints(True,False,“Set First Point”,“Set Next Point”,2)
sc.sticky[“point1”] = get_point1