Modal operator to: (A) Create surface (B) create vertex on surface Would like to find some tutorial and documents for blender 290
about python vectors, raycast and modal.
i am doing my best trying to create this tool,
right now i can only create new object, add them some vertex and edges but i am really far from using a modal and snap the coordinates on the surface..
i would like to change quite often the &quot;Target plane shape&quot;,
So i plan to have the event of the keyboard change from mode A to mode B
But i also worried about the existing shortcut , they fight with the modal?
Surface_target A  ( we can change this with every drawing A)
Sequence_Edges B  ( the edge you drawn remain there)

Thank you for your time
EDIT:
To &quot;Draw&quot; using the mouse, require the use of a modal to get the events of the mouse, and read the position and the clicks.
Making a modal and a tool is harder than i thought.
I posted a working basis to use a UITool and a modal to get and update the mouse events .
https://blenderartists.org/t/event-leftmouse-pressed-disturbed-by-tool-selection/1270882
Once understand the behaviour you can add some of the function of the template like,
Ray cast modal, to get the 3D location of the mouse .
This was really complex for me, its a bit messy but i share it anyway.
Hope will help someonelse XD
Its just a script, you paste it in you script and run.
A tool and a panel will appear in your 3Dview, follow instruction for play .
https://mega.nz/file/wz4VCaaJ#7TxFvZqyeQZOFy7syu56As5RionvmfhYuTs0JvhZ8h8