Hi Andrew, just purchased the Pro version and I can't find the scripts dwg2svg.js, dwg2bmp.js or dwg2pdf.js. The bash script dwg2bmp is referencing it but there is no /scripts/Pro directory in there. Why are there pointers to no .js files but the converter still runs?
Thanks!
Dave
dwg2svg script file location
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
-
- Newbie Member
- Posts: 4
- Joined: Wed Feb 04, 2015 12:39 am
Re: dwg2svg script file location
Everything in scripts/Pro is compiled into the qcadproscripts plugin located in the plugins folder as resource. These resources can be accessed by QCAD like regular files.
Perhaps, you could explain what you are intending to do, so I can help more effectively.
Perhaps, you could explain what you are intending to do, so I can help more effectively.
-
- Newbie Member
- Posts: 4
- Joined: Wed Feb 04, 2015 12:39 am
Re: dwg2svg script file location
Yes, thanks for the reply Andrew. I'm getting an error when I try to run dwg2bmp from any directory except qcad-3.7.7-pro-linux-x86_32. The error is: Warning: Autostart script not found at: "/home/dave/opt/qcad-3.7.7-pro-linux-x86_32/scripts/Pro/Tools/Dwg2Bmp/Dwg2Bmp.js :/home/dave/opt/qcad-3.7.7-pro-linux-x86_32/scripts/Pro/Tools/Dwg2Bmp/Dwg2Bmp.js"
This caused me to look at the dwg2bmp script and see what it is doing. In dwg2bmp, there is this reference: -autostart "$DIR/scripts/Pro/Tools/Dwg2Bmp/Dwg2Bmp.js
This raised the question as to why there is no Pro/Tools directory in qcad-3.7.7-pro-linux-x86_32. So, how is dwg2bmp running if this Pro/Tools doesn't exist nor does Dwg2Bmp.js file exist? Just trying to understand what is going on.
Thanks!
Dave
This caused me to look at the dwg2bmp script and see what it is doing. In dwg2bmp, there is this reference: -autostart "$DIR/scripts/Pro/Tools/Dwg2Bmp/Dwg2Bmp.js
This raised the question as to why there is no Pro/Tools directory in qcad-3.7.7-pro-linux-x86_32. So, how is dwg2bmp running if this Pro/Tools doesn't exist nor does Dwg2Bmp.js file exist? Just trying to understand what is going on.
Thanks!
Dave
Re: dwg2svg script file location
There is indeed an error in the dwg2bmp bash script. The $DIR variable should NOT be prepended to the script path, i.e.:
The other command line scripts look fine.
Code: Select all
"$binary" -no-dock-icon -no-gui -allow-multiple-instances -autostart "scripts/Pro/Tools/Dwg2Bmp/Dwg2Bmp.js" "$0" "$@"
-
- Newbie Member
- Posts: 4
- Joined: Wed Feb 04, 2015 12:39 am
Re: dwg2svg script file location
Andrew, that may be an issue as well, but what I'm not understanding is why there is no scripts/Pro/ directory, why it doesn't even exist. Is there some magic going on where these scripts are compiled into a plugin and bash somehow knows to look into an object file if the path to the "real" .js file is invalid or doesn't exist?
The root of the issue here is that I'd like to build on what you guys have done with the dwg2bmp.js script and if it's in a library, I can't even see it. Is there a way I can get access to this script so I can see what is going on in there?
Dave
The root of the issue here is that I'd like to build on what you guys have done with the dwg2bmp.js script and if it's in a library, I can't even see it. Is there a way I can get access to this script so I can see what is going on in there?
Dave
Re: dwg2svg script file location
Yes, this script is compiled into a plugin. There is no file in your file system with that name.buildyouridea wrote:Is there some magic going on where these scripts are compiled into a plugin and bash somehow knows to look into an object file if the path to the "real" .js file is invalid or doesn't exist?
Note that bash has nothing to do with this. The script file location is handed over by bash to the QCAD executable as a command line argument.
The dwg2bmp command line tool as well as the other dwg2... command line tools are part of QCAD Professional and not part of the open source QCAD Community Edition. If you are interested in command line tools in general, you might want to have a look at the merge tool which is open source:buildyouridea wrote:The root of the issue here is that I'd like to build on what you guys have done with the dwg2bmp.js script and if it's in a library, I can't even see it. Is there a way I can get access to this script so I can see what is going on in there?
https://github.com/qcad/qcad/blob/maste ... rawings.js
-
- Newbie Member
- Posts: 4
- Joined: Wed Feb 04, 2015 12:39 am
Re: dwg2svg script file location
Thanks for the explanation Andrew. I actually did just purchase the Pro version but it sounds like you are saying that these scripts are not even visible in the purchased version correct?
Can you point me in the right direction for developing my own dwg2bmp.js or dwg2jpg.js script? Like maybe a high level explanation as to what libs are used and how this works?
Dave
Can you point me in the right direction for developing my own dwg2bmp.js or dwg2jpg.js script? Like maybe a high level explanation as to what libs are used and how this works?
Dave
Re: dwg2svg script file location
For an example of creating a command line tool, have a look at the merge tool (scripts/Tools/MergeDrawings/MergeDrawings.js).
This would be the gist of creating a bitmap from a drawing file:
This would be the gist of creating a bitmap from a drawing file:
var doc = new RDocument(new RMemoryStorage(), new RSpatialIndexNavel()); var di = new RDocumentInterface(doc); var scene = new RGraphicsSceneQt(di); di.importFile("myfile.dxf"); var view = new RGraphicsViewImage(); view.setScene(scene, false); view.resizeImage(800, 600); view.autoZoom(10, true); scene.regenerate(); var buffer = view.getBuffer(); scene.unregisterView(view); var iw = new QImageWriter(fileName); iw.write(buffer);