Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 6023

Cannot access MouseCallBackEventArgs in GHPython

$
0
0

@jpullutasigiza wrote:

Hello - I cannot access the MouseCallbackEventArgs in GHPython but in RhinoPython it works perfectly fine. Any suggestions?

from Rhino.UI import *
import scriptcontext as sc
import Rhino.RhinoDoc as rhdoc

class MyMouseCallback(MouseCallback):
  def OnMouseDown(self, e):
    print "active viewport: {0}".format(e.View.ActiveViewport.Name)
    ghenv.Component.ExpireSolution(True)
    self.Enabled = False
 
 
sc.doc = rhdoc.ActiveDoc
m_mc = MyMouseCallback()
m_mc.Enabled = True

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6023

Trending Articles