27 mei 2013

QCad 3.1 on Intel Mac OS X

QCad3.png

Still using QCad to view and edit Autocad DXF files. Finally upgraded from the Qt3 version, QCad 2, to the 2012 QCad 3.1 beta which makes use of Qt4.

For an overview of all new features, see the QCad blog. New functionality I am happy with, though I do miss the old plain icons, in order of importance:

Compilation

Building QCad from the Github source is straightforward:

git clone git://github.com/qcad/qcad.git qcad
cd qcad
qmake
make
doxygen # optionally generate developer documentation

Qt4 was installed with Macports qt4-mac package:
# QMake version 2.01a
# Using Qt version 4.8.4 in /opt/local/lib

In addition, for the library browser to work, Macports package qt4-mac-sqlite3-plugin was installed.

Development

What I like best of the QCad makeover is the architecture, especially the ease with which (ECMA) scripts can be added.

An example testrun, e.g. to test your own scripts, with a dxf TestFile and the QCad scriptdebugger enabled:

export DYLD_LIBRARY_PATH="<yourPath>/qcad/release:$DYLD_LIBRARY_PATH";
cd qcad/release/QCad.app/Contents/MacOS
./QCAD \
-always-load-scripts \
-enable-script-debugger \
<pathToYourTestFile>

Run QCAD -help for a list of all command-line options.

The adventurous developer can find more info in Ribbonsoft's QCad forum.

Geplaatst op 27 mei 2013 22:05 | Comments (0)

07 februari 2009

QCad 2.0.5 on Intel Mac OS X

QCad.png

Looking for a program to view and edit .dxf files on the Mac I stumbled upon QCad from Ribbonsoft. This allows you to view and edit Autocad DXF files.

Compiling QCad

Although the QCad source is under GPL, only demo versions are availabale as binary. So, compiled QCad from source. Follows the list and some links I used to get QCad compiled under OS X 10.4.11 with gcc-4.0 (and using a MacPorts QT3 installation, present from previous MacPort installed sw)

### install the QT3 package with MacPorts.
### You are expected to be familiar with MacPorts
### and have it installed
$ ssh -l yourAdminUser localhost
## this is used to logon as admin from within an
## ordinary user terminal session
$ sudo port selfupdate
$ sudo port install qt3
...
### compile QCad
$ cd /opt/local
$ sudo mkdir qcad
$ sudo cp /Users/yourUserId/Desktop/QCad/qcad-2.0.5.0-1-community.src.tar.gz .
$ tar xfz qcad-2.0.5.0-1-community.src.tar.gz
$ rm qcad-2.0.5.0-1-community.src.tar.gz
### to prevent "qmacstyle_mac.h: No such file or directory" error,
### applied patch manually (as patch raised errors) by commenting
### out (with vi) in src/main.cpp:
//#ifdef __APPLE__
//#include
//#endif:
...
//#ifdef __APPLE__
// QApplication::setStyle(new QMacStyle());
//#endif
...
$ export QTDIR=/opt/local/lib/qt3 ## MacPorts QT3 location
$ export QMAKESPEC=/opt/local/lib/qt3/mkspecs/macx-g++
$ cd scripts
$ ./build_qcad.sh notrans


Running QCad

Doubleclik QCad.app or start from terminal window:

$ open /opt/local/qcad/qcad-2.0.5.0-1-community.src/qcad/QCad.app


Compile QCad under OS X 10.5.8

$ cd /opt/local/qcad/qcad-2.0.5.0-1-community.src/scripts/

$ sudo vi build_qcad.sh # set Qt vars in build script (setting environment vars didn't work for me)
export QTDIR=/opt/local/lib/qt3
export QMAKESPEC="/opt/local/lib/qt3/mkspecs/macx-g++"
export PATH=$QTDIR/bin:$PATH

$ sudo vi ../qcadlib/src/engine/rs_entity.cpp # edit or apply this Debian patch
- os << " layer address: " << (int)(e.layer) << " ";
+ os << " layer address: " << (long)(e.layer) << " ";

$ sudo vi ../qcadlib/src/engine/rs_layer.cpp # same
- << " address: " << (int)(&l)
+ << " address: " << (long)(&l)

$ sudo vi ../qcad/src/qc_applicationwindow.cpp # fix Help info (Qt assistant is in /opt/local/bin/qt3 which is part of the $PATH set)
- assistant = new QAssistantClient(RS_SYSTEM->getAppDir()+"/bin", this);
+ assistant = new QAssistantClient("", this);

$ sudo rm ../dxflib/src/*.o; # clean .app and all object files
$ sudo rm ../fparser/src/*.o;
$ sudo rm ../qcad/src/obj/*.o;
$ sudo rm ../qcadactions/src/obj/*.o;
$ sudo rm ../qcadcmd/src/obj/*.o;
$ sudo rm ../qcadguiqt/src/obj/*.o;
$ sudo rm ../qcadlib/src/obj/*.o;
$ sudo rm -R ../qcad/QCad.app;

$ sudo ./build_qcad.sh notrans # build QCad

Geplaatst op 07 februari 2009 17:28 | Comments (1)