uligerhardt
Posts: 2
Joined: 20 Jan 2015, 12:46

Hello all!

I'm trying to show *.stp files which apparently needs MeshBuilder.dll. But I can't make that work. Even the CAD3D demo throws a TsgCommonBrepImageError exception 'MeshBuilder.dll Cannot be loaded!'.
How can I make that work?

Best regards
Uli

support
Posts: 2832
Joined: 30 Mar 2005, 11:36
Contact:

Hello Uli,

CAD VCL requires MeshBuilder.dll and Open Cascade DLLs to load 3D file formats (STEP, IGES, etc.). These libraries come with CAD VCL and located in the following folders:

\Delphi\ExternalLib\OpenCascade\win32\vc9\bin\ - libraries for x32 platform,
\Delphi\ExternalLib\OpenCascade\win64\vc9\bin\ - libraries for x64 platform.

You may just copy the .dll files from one of these folders to the folder with the executable file (e.g. CAD3D.exe) or, if you want them to be located at some other path, call an sgFunction.InitDefMeshBuilderDllPath() method to define the MeshBuilder.dll path on the application startup. In the CAD3D demo project this path is defined as follows:

Code: Select all

``InitDefMeshBuilderDllPath(ExtractFilePath(Application.ExeName), 'Demos\3D\Bin\');``
Mikhail

uligerhardt
Posts: 2
Joined: 20 Jan 2015, 12:46

Thanks Mikhail,
I got it to work using

Code: Select all

`` cnstMeshBuilderDllPath := TPath.Combine(ExtractFilePath(Application.ExeName), 'DLLS\');``
instead of InitDefMeshBuilderDllPath. Am I missing something if I do this direct assignment?

Yesterday I only had copied MeshBuilder.dll instead of all the DLLs, so LoadLibrary failed despite MeshBuilder.dll was found.

support
Posts: 2832
Joined: 30 Mar 2005, 11:36
Contact:

Uli,

The InitDefMeshBuilderDllPath() method actually does the same, but also takes into account the conditional compilation symbol SG_CPUX64 which denotes the target platform (x64 or x32):

Code: Select all

``````{\$IFDEF SG_CPUX64}