Help with EditorWindow class

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/03/2012 at 11:51, xxxxxxxx wrote:

Hey guys,
I'd like to try out the functions in this class. But I can't figure out the proper way to construct it.

Example from the docs:  x, y = win.Screen2Local()

That really doesn't help much. Since it doesn't say where "win" comes from. Or show how to instantiate the class. And the function doesn't even work substituting values for x&y.

This is my best guess where "win" comes from. But I can't figure out how to use any of the functions in it:

import c4d  
  
def main() :  
  
  win = c4d.gui.EditorWindow  
  win.Local2Screen(100,200) #Error: requires a c4d.gui.EditorWindow object

Appears to be wrong.
Can anybody offer some small example how the Local2Screen() function is supposed to be written?

-ScottA

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/03/2012 at 14:14, xxxxxxxx wrote:

Basedraw has a GetEditorWindow member.

http://www.thirdpartyplugins.com/python/modules/c4d/C4DAtom/GeListNode/BaseList2D/BaseView/BaseDraw/index.html#BaseDraw.GetEditorWindow

i don't think you can just create an instance of editorwindow like in your example.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/03/2012 at 14:17, xxxxxxxx wrote:

Hi Scott!

  1. You have missed the parantheses used to instantiate the class.

  2. Anyway, you cannot instantiate the c4d.gui.EditorWindow class. It must be obtained from a c4d.BaseDraw object or used in methods were it is given as a parameter (e.g. draw-functions).

  3. Screen2Local() and similiar methods do not accept arguments, but return a tuple of 2 values that define the offset, i.e. the values you have to add to the values you want to convert.

bd     = doc.GetActiveBaseDraw()
win    = bd.GetEditorWindow()
ox, oy = win.Local2Screen()
print 200+ox, 100+oy

Cheers,
-Niklas

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/03/2012 at 16:40, xxxxxxxx wrote:

Thanks Guys.:beer:

-ScottA