Using a Digitizing Tablet

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
meimaddin
Registered Member
Posts: 2
Joined: Tue Mar 14, 2023 10:28 pm

Using a Digitizing Tablet

Post by meimaddin » Tue Mar 14, 2023 11:23 pm

Hello,
i would like using a Digitizing Tablet to enter points or lines with absolute coordinates to a qcad drawing. I already have generated a C-program getting the coordinates of the digitizing mouse when a button of the mouse is pressed. What is the best way to enter these coordinates to a drawing. Could i do that with a plugin to QCAD, calling a routine in the QCAD-Api for entering a point or line to the drawing, or should i create a script for every event and executing this for every point or line? Or could i use a separate program started by a ECMA-script returning the coordinates with a special protocol?

I think, this plays no matter, but my OS is Windows10 and QCAD Version is 3.26.4.0 Arch x86_64.

Thanks in advance - meimaddin

CVH
Premier Member
Posts: 3416
Joined: Wed Sep 27, 2017 4:17 pm

Re: Using a Digitizing Tablet

Post by CVH » Wed Mar 15, 2023 8:29 am

meimaddin wrote:
Tue Mar 14, 2023 11:23 pm
i would like using a Digitizing Tablet to enter points or lines with absolute coordinates to a qcad drawing.
Normally when a Digitizing Tablet works on your OS then it would interact with QCAD just the same as a mouse.
All depends ... With customizable button areas you probably need to configure it to send QCAD shortcut keys.

There is some success reported with what is called "SendKeys", look it up in the forum. :wink:

Two hits from the forum:
https://www.qcad.org/rsforum/viewtopic. ... let#p38426
https://www.qcad.org/rsforum/viewtopic. ... let#p29826

Regards,
CVH
Last edited by CVH on Wed Mar 15, 2023 9:46 am, edited 1 time in total.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Using a Digitizing Tablet

Post by andrew » Wed Mar 15, 2023 8:56 am

There are various ways to interact with QCAD.

The easiest way would be copy / paste, i.e. output a text file of coordinates with your application and copying that to the clipboard or copying coordinates to the clipboard directly from your application.
You can then simply paste this list of coordinates into the QCAD command line while the appropriate tool is running (points, lines, polylines, etc.)

Another way is to import a coordinate text file into QCAD using a script similar to this script that imports points from a list of coordinates:
https://github.com/qcad/qcad/blob/maste ... tPoints.js

If you need direct visualization while tracing, you'd have to create a more direct communication channel to QCAD. You could for example start your application from a QCAD script using QProcess and listen to the stdout output of your application to retrieve coordinates. Example for QProcess:
https://github.com/qcad/qcad/blob/maste ... Process.js

This would have to be modified to not wait for the process to finish and read stdout line by line.

meimaddin
Registered Member
Posts: 2
Joined: Tue Mar 14, 2023 10:28 pm

Re: Using a Digitizing Tablet

Post by meimaddin » Tue Mar 21, 2023 10:31 pm

Thank you CVH and andrew. I will try using ExProcess.js since this seems to give the result i imagine. I will keep you informed whether i succeed!

Best regards - mymaddin

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”