Grasshopper

algorithmic modeling for Rhino

How to add viewpoint in Rhino by mouse click and some other question

In rhinopython not grasshopper python
I have some problem use the Rhino.Display.DisplayPipeline.DrawPoint or the Rhino.Input.custom. I don't know how to use these classes.
I just want add some dynamic display point by mouse clicks.
My simple code following but failed:
import rhinoscriptsyntax as rs
import Rhino
import System.Drawing

while 1:
pt = Rhino.Input.Custom.GetPoint()
pt.Get()
c = pt.Point()
print (c)
print(type(c))
Rhino.Display.DisplayPipeline.DrawPoint(c,System.Drawing.Color.Blue)

Someother problems:
1. How to Capture mouse events
2. can somebody explain the 'gp.DynamicDraw += GetPointDynamicDrawFunc' means.
How did the '+=' works to hook on the function.

Views: 544

Replies to This Discussion

You might to post this over on the new McNeel Discourse forum as well (under the Rhino Developer or Scripting category). Also, for drawing fairly basic geometry I've found David's CustomDisplay class is rather easy to implement instead of tapping into the DisplayPipeline. Hope that helps..

THX, I have clear the dynamic display but It depends on the mouse movement , could I display any points or lines not with dynamic display? Any ways to capture mouse events or keyboard? Like play a game. It is not the model, just the display?

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service