How to set-up a Parasolid environment to use the TranslateToPkParts sample on Windows

This guide describes all the required steps to quickly use Parasolid within HOOPS Exchange by setting-up the TranslateToPkParts sample available with every package:

  1. First of all, download any HOOPS Exchange Windows package on our developer zone.
  2. Replace the “include\hoops_license.h” license file by one you can generate here.
  3. Copy the 2 .dll files (pskernel.dll and pskernel_net.dll) from your Parasolid installation and replace the existing ones located in the “bin\win64” of your HOOPS Exchange folder.
  4. Open the Exchange .sln project in Visual Studio, select the x64 platform and set the TranslateToPkParts sample as the default project to launch.
  5. Edit the project debug properties by putting the path corresponding to your “base\schema” folder installation of Parasolid in the “Environment” field. Notice that you mustn’t use any quote (for example “P_SCHEMA=D:\Documents\Parasolid\x64_win_release_31_0_228\base\schema”).
  6. Go to the property manager, unroll the TranslateToPkParts project, then select the “Debug | x64” mode and double click on “PARASOLID”. In the “User Macros” section, fill both the 2 fields “PARASOLID_INSTALL _DIR” and “PARASOLID_INSTALL_DIR_64” with the path to your Parasolid root installation folder (for example “D:\Documents\Parasolid\x64_win_release_31_0_228”).
  7. Finally get back to the Solution Explorer and set the desired Command Arguments under the Debugging section. The first parameter is the input file, the second one is the output Parasolid (ie the .xmt_txt, but you don’t need to specify the extension) and the third is the filepath used to generate the log.
    The next optional arguments are the different Parasolid options (healing, sew, sewexchange, merge and simplify) you can perform during the process, by default they’re all deactivated.
    Here’s a template of command arguments you can copy & paste: “\path_to_your_file\input.stp” “path_to_folder\output” “another_path\log.txt” -healing 0 -sew 0 -sewexchange 0 -merge 0 -simplify 0

During step 3, copying the psbodyshop.dll as well may also be required if simplify or merge operations need to be performed.

Hello, I wanted to follow up this article with a more explicit instructions and a few screen shots that might help out. Let’s get started:

Open <Your_HE_Location>\HOOPS_Exchange_Publish_2023_Win_VS2019\HOOPS_Exchange_Publish_\samples\exchange.sln using Visual Studio.

Then navigate and open the TranslateToPkParts projectd. You will see a single, TranslateToPkParts.cpp file. Go ahead and open that. At the top of the file, you’ll see this message:

In order to compile, you need to:

  1. On Windows
    - Set up the PARASOLID_INSTALL_DIR and PARASOLID_INSTALL_DIR_64 environment variables to your Parasolid folder using the property sheet PARASOLID with the “User macros” field;
    - Save the property sheet.
    - Then you can build it.

The project already has a properties file setup for you. To view it go to View → Other Windows → Property Manager.

Then on the right of the screen in the Property Manager pane, open the TranslateToPkParts project:

image

Open the configuration you want to run and double click the PARASOLID sheet and then select User Macros on the left. You should see this:

Set the path to your Parasolid directory:

You should be able to successfully build the project now (in this case, I am only building x64, so I won’t be able to build a mix platform project or x32 project):

In order to run the project, we need to do a few things starting with setting up an environment variable that points to our P_SCHEMA. We have a place holder in the project already. You can set it by going back to the solution explorer, right clicking on the TranslatToPkParts project and selecting Properties. From there you should select Debugging on the left and under the Environment row, you’ll see a place holder for the env var:

Set this to the location of the Parasolid schema folder:

You can now set Command line arguments in the same Debugging section under “Command Arguments”. The last thing you need to do is either set up your path to append the location of the PSKERNEL.dll or copy the .dll to your Working Directory, which you can see specified in the “Working Directory” row in the Debugging section where you setup your P_SCHEMA and command line arguments. I will copy the .dll to the working directory.

You can now run the TranslateToPkParts project: