Support Forum

[Frage] [PythonParts] Script Object PythonPart and preview [Gelöst]

Schlagworte:
  • Pythonpart
  • ScriptObject
  • Preview

Hi,

I'm looking at preview inside scriptobject.

In my case, I'm using

PointInteractor
to place an object (wich works) and I'd like to have a preview following the mouse.

How can I do that and there is an example ?

Best
Christophe

Lösung anzeigen Lösung verbergen

Hi Christophe,

when you construct the PointInteractor, you can add a preview function, that will be called everytime the mouse is moved. For example, in the SlabOpening.py:167 the PointInteractor is created with the preview function "draw_opening_preview" which is defined in line 191. Note, that the function cannot take any arguments. It will only be called when the mouse is moved, so it only has to draw something. The current point should be taken from the result class (see line 195).

Best,
Bart

Hi Christophe,

when you construct the PointInteractor, you can add a preview function, that will be called everytime the mouse is moved. For example, in the SlabOpening.py:167 the PointInteractor is created with the preview function "draw_opening_preview" which is defined in line 191. Note, that the function cannot take any arguments. It will only be called when the mouse is moved, so it only has to draw something. The current point should be taken from the result class (see line 195).

Best,
Bart