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
Using a Digitizing Tablet
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Re: Using a Digitizing Tablet
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.
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.
Re: Using a Digitizing Tablet
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.
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.
Re: Using a Digitizing Tablet
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
Best regards - mymaddin