diff --git a/README.md b/README.md
index 10d03630a1..059869ee62 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,21 @@
IfcOpenShell
============
-Open source (LGPL) software library for working with the IFC ([IFC2x3 TC1] and [IFC4]) file format.
-
-[http://ifcopenshell.org](http://ifcopenshell.org)
-[http://academy.ifcopenshell.org](http://academy.ifcopenshell.org)
+IfcOpenShell is an open source ([LGPL]) software library for working with the Industry Foundation Classes ([IFC])
+file format. Currently supported IFC releases are [IFC2x3 TC1] and [IFC4].
+For more information, see
+* [http://ifcopenshell.org](http://ifcopenshell.org)
+* [http://academy.ifcopenshell.org](http://academy.ifcopenshell.org)
Prerequisites
-=============
-* Git, CMake (2.6 or newer), Visual Studio 2008 or newer with C++ toolset (Windows), or GCC (*nix, Clang untested).
-
+-------------
+* Git
+* CMake (2.6 or newer)
+* Windows: Visual Studio 2008 or newer with C++ toolset, MinGW not supported currently
+* *nix: GCC 4.7 or newer, or Clang (any version should work, but not tested)
Dependencies
-============
+-------------
* [Boost](http://www.boost.org/)
* Open Cascade - *optional*, but required for building IfcGeom
([official](http://www.opencascade.org/getocc/download/loadocc/) or [community edition](https://github.com/tpaviot/oce))
@@ -21,17 +24,15 @@ Dependencies
For handling code pages and Unicode in the parser
* [OpenCOLLADA](https://github.com/khronosGroup/OpenCOLLADA/) - *optional*
For IfcConvert to be able to write tessellated Collada (.dae) files
-* [SWIG](http://www.swig.org/), [Python](https://www.python.org/) libraries - *optional*
+* [SWIG](http://www.swig.org/) and [Python](https://www.python.org/) - *optional*
For building the IfcOpenShell Python interface and the Blender add-on
-* 3ds Max SDK - *optional*
- For building the 3ds Max plug-in
-
-
-Compiling on Windows
-====================
-Users are advised to build IfcOpenShell using the CMake file provided in
-the cmake/ folder.
+* [3ds Max SDK](http://www.autodesk.com/products/3ds-max/free-trial) - *optional*
+ For building the 3ds Max plug-in.
+ All recent versions of 3ds Max (2014 and newer) are 64-bit only, so a 64-bit installation is assumed.
+Building IfcOpenShell
+---------------------
+### Compiling on Windows
The preferred way to fetch and build this project's dependencies is to use the build scripts
in win/ folder. **See [win/readme.md] for more information**. Instructions in a nutshell
(**assuming Visual Studio 2015 x64 environment variables set**):
@@ -54,16 +55,9 @@ Alternatively, one can use the utility batch files to build and install the proj
> build-ifcopenshell.cmd
> install-ifcopenshell.cmd
-Alternatively, the old Visual Studio solution and project files requiring manual work can
-be found from the win/sln folder.
-
-
-Compiling on *nix
-=================
-Users are advised to build IfcOpenShell using the CMake file provided in
-the cmake/ folder. There might be an Open CASCADE package in your operating
-system's software repository. If not, you will need to compile Open
-CASCADE yourself. See http://opencascade.org.
+### Compiling on *nix
+There might be an Open CASCADE package in your operating system's software repository. If not, you will need to compile
+Open CASCADE yourself. See http://opencascade.org.
For building the IfcPython wrapper, SWIG and Python development are
required.
@@ -95,7 +89,7 @@ To build IfcOpenShell please take the following steps:
If all worked out correctly you can now use IfcOpenShell. See the examples below.
Usage examples
-==============
+--------------
**Invoking IfcConvert from the command line**
@@ -165,6 +159,8 @@ Usage examples
>>> # Writing IFC-SPF files to disk:
>>> f.write("out.ifc")
-[win/readme.md]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/win/readme.md "win/readme.md"
+[LGPL]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/COPYING "LGPL"
+[IFC]: http://www.buildingsmart-tech.org/specifications/ifc-overview "IFC"
[IFC2x3 TC1]: http://www.buildingsmart-tech.org/specifications/ifc-releases/ifc2x3-tc1-release "IFC2x3 TC1"
-[IFC4]: http://www.buildingsmart-tech.org/specifications/ifc-releases/ifc4-release "IFC4"
\ No newline at end of file
+[IFC4]: http://www.buildingsmart-tech.org/specifications/ifc-releases/ifc4-release "IFC4"
+[win/readme.md]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/win/readme.md "win/readme.md"
\ No newline at end of file
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index de84ce173e..9e91417382 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -29,6 +29,7 @@ OPTION(USE_IFC4 "Use IFC 4 instead of IFC 2x3 (full rebuild recommended when swi
OPTION(BUILD_IFCPYTHON "Build IfcPython." ON)
OPTION(BUILD_EXAMPLES "Build example applications." ON)
OPTION(USE_VLD "Use Visual Leak Detector for debugging memory leaks, MSVC-only." OFF)
+OPTION(BUILD_IFCMAX "Build IfcMax, a 3ds Max plug-in, Windows-only." OFF)
# TODO QtViewer is deprecated ATM as it uses the 0.4 API
# OPTION(BUILD_QTVIEWER "Build IfcOpenShell Qt GUI Viewer (requires Qt 4 framework)." OFF)
@@ -48,6 +49,9 @@ UNIFY_ENVVARS_AND_CACHE(OPENCOLLADA_INCLUDE_DIR)
UNIFY_ENVVARS_AND_CACHE(OPENCOLLADA_LIBRARY_DIR)
UNIFY_ENVVARS_AND_CACHE(PCRE_LIBRARY_DIR)
UNIFY_ENVVARS_AND_CACHE(PYTHON_EXECUTABLE)
+IF(WIN32)
+ UNIFY_ENVVARS_AND_CACHE(THREEDS_MAX_SDK_HOME)
+ENDIF()
# Find Boost
IF(MSVC)
@@ -239,6 +243,11 @@ if(ENABLE_BUILD_OPTIMIZATIONS)
endif()
IF(MSVC)
+ # Enable solution folders (free VS versions prior to 2012 don't support solution folders)
+ if (MSVC_VERSION GREATER 1600)
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+ endif()
+
IF(USE_VLD)
ADD_DEFINITIONS(-DUSE_VLD)
ENDIF()
@@ -419,6 +428,10 @@ IF(BUILD_EXAMPLES)
ADD_SUBDIRECTORY(../src/examples examples)
ENDIF()
+IF(BUILD_IFCMAX)
+ ADD_SUBDIRECTORY(../src/ifcmax ifcmax)
+ENDIF()
+
# CMake installation targets
INSTALL(FILES ${IFCPARSE_H_FILES} DESTINATION include/ifcparse)
INSTALL(FILES ${IFCGEOM_H_FILES} DESTINATION include/ifcgeom)
diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt
index 0f0da6a525..8805d40e8c 100644
--- a/src/examples/CMakeLists.txt
+++ b/src/examples/CMakeLists.txt
@@ -19,6 +19,8 @@
ADD_EXECUTABLE(IfcParseExamples IfcParseExamples.cpp)
TARGET_LINK_LIBRARIES(IfcParseExamples IfcParse)
+set_target_properties(IfcParseExamples PROPERTIES FOLDER Examples)
ADD_EXECUTABLE(IfcOpenHouse IfcOpenHouse.cpp)
TARGET_LINK_LIBRARIES(IfcOpenHouse IfcParse IfcGeom ${OPENCASCADE_LIBRARIES})
+set_target_properties(IfcOpenHouse PROPERTIES FOLDER Examples)
diff --git a/src/ifcmax/CMakeLists.txt b/src/ifcmax/CMakeLists.txt
new file mode 100644
index 0000000000..923532b073
--- /dev/null
+++ b/src/ifcmax/CMakeLists.txt
@@ -0,0 +1,39 @@
+################################################################################
+# #
+# This file is part of IfcOpenShell. #
+# #
+# IfcOpenShell is free software: you can redistribute it and/or modify #
+# it under the terms of the Lesser GNU General Public License as published by #
+# the Free Software Foundation, either version 3.0 of the License, or #
+# (at your option) any later version. #
+# #
+# IfcOpenShell is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# Lesser GNU General Public License for more details. #
+# #
+# You should have received a copy of the Lesser GNU General Public License #
+# along with this program. If not, see . #
+# #
+################################################################################
+
+INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${OCC_INCLUDE_DIR} ${OPENCOLLADA_INCLUDE_DIRS} ${ICU_INCLUDE_DIR}
+ ${Boost_INCLUDE_DIRS} ${THREEDS_MAX_SDK_HOME}/include
+)
+
+# All recent versions of 3ds Max (2014 and newer) are 64-bit only so assume lib/x64 directory
+LINK_DIRECTORIES(${LINK_DIRECTORIES} ${IfcOpenShell_BINARY_DIR} ${OCC_LIBRARY_DIR} ${OPENCOLLADA_LIBRARY_DIR}
+ ${ICU_LIBRARY_DIR} ${Boost_LIBRARY_DIRS} ${THREEDS_MAX_SDK_HOME}/lib/x64/Release
+)
+
+ADD_LIBRARY(IfcMax SHARED IfcMax.h IfcMax.cpp)
+
+TARGET_LINK_LIBRARIES(IfcMax IfcParse IfcGeom Comctl32.lib zlibdll.lib bmm.lib core.lib CustDlg.lib edmodel.lib expr.lib
+ flt.lib geom.lib gfx.lib gup.lib imageViewers.lib ManipSys.lib maxnet.lib Maxscrpt.lib
+ maxutil.lib MenuMan.lib menus.lib mesh.lib MNMath.lib Paramblk2.lib particle.lib Poly.lib RenderUtil.lib
+ tessint.lib viewfile.lib ${OPENCASCADE_LIBRARIES}
+)
+
+SET_TARGET_PROPERTIES(IfcMax PROPERTIES SUFFIX ".dli")
+
+INSTALL(TARGETS IfcMax RUNTIME DESTINATION bin)
diff --git a/src/ifcmax/IfcMax.cpp b/src/ifcmax/IfcMax.cpp
index dde5cc8547..46bf0f39f8 100644
--- a/src/ifcmax/IfcMax.cpp
+++ b/src/ifcmax/IfcMax.cpp
@@ -20,49 +20,54 @@
#include