What I am trying to do is basicaly this:
- create a live link between Sverchok and QCad.
This could be easy to do with a watchdog, that can be activated somehow with a checkbox.
Here is an example of reading a dxf file opened in QCad and creating 3D geometry in Blender.
Next - I will showcase the reverse.
https://www.youtube.com/watch?v=UBH8zfMW7o0
Question:
- on windows 11, it is possible to do with a javascript script to call somehow the revert function with a trigger outside qcad?
QCAD Python Visual scripring with Sverchok and Blender
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.
-
- Junior Member
- Posts: 10
- Joined: Mon Dec 09, 2024 10:58 am
- andrew
- Site Admin
- Posts: 8779
- Joined: Fri Mar 30, 2007 6:07 am
Re: QCAD Python Visual scripring with Sverchok and Blender
If QCAD is running, you can load additional files or run a script by launching it again with the appropriate parameters:
For example, to trigger the revert menu, you can launch:
A more sophisticated solution would involve QFileSystemWatcher.
For example, to trigger the revert menu, you can launch:
Code: Select all
qcad.exe -exec scripts/Pro/File/RevertFile/RevertFile.js
-
- Junior Member
- Posts: 10
- Joined: Mon Dec 09, 2024 10:58 am
Re: QCAD Python Visual scripring with Sverchok and Blender
Thank you!
I will use the simple aproach!
I will come back with feedback if/how I've solved it.
I will use the simple aproach!
I will come back with feedback if/how I've solved it.
-
- Junior Member
- Posts: 10
- Joined: Mon Dec 09, 2024 10:58 am
Re: QCAD Python Visual scripring with Sverchok and Blender
Thank you for the tip! This code does the trick for me in python.
I've realised I don't need a live update.
But I can use a watchdog to do it if I would find it more conveninent.
import subprocess
# Set up the paths
qcad_path = "C:\\Users\.......\\Downloads\\qcad-3.31.2-pro-win64\\qcad-3.31.2-pro-win64\\qcad.exe" # Path to the exe
dxf_file = "model_export.dxf"
# The Revert comamnd
command = [qcad_path, "-exec", "scripts/Pro/File/RevertFile/RevertFile.js"]
# Run the comand
subprocess.run(command)
print("The DXF file has been reset in QCAD.")
I've realised I don't need a live update.
But I can use a watchdog to do it if I would find it more conveninent.
import subprocess
# Set up the paths
qcad_path = "C:\\Users\.......\\Downloads\\qcad-3.31.2-pro-win64\\qcad-3.31.2-pro-win64\\qcad.exe" # Path to the exe
dxf_file = "model_export.dxf"
# The Revert comamnd
command = [qcad_path, "-exec", "scripts/Pro/File/RevertFile/RevertFile.js"]
# Run the comand
subprocess.run(command)
print("The DXF file has been reset in QCAD.")