PTC Creo & Windchill
Note: Users must procure and maintain valid licenses to integrate this commercial DE tool with the Istari Digital platform. Please contact your local IT administrator for assistance.
Supported Functions:
Getting Started
The Creo and Windchill integration provides support for PTC Creo parametric 10.0.X.X and PTC Windchill 12.1, allowing users to extract data from PTC Creo CAD and modify models. It also allows users to connect to a PTC Windchill instance to retrieve CAD files for Creo Automation.
Methods to Link to Istari Digital Platform
Upload: Yes - Creo Models
Link: Yes - Windchill based Models
Files Supported
The istari Digital Platform can extract from the following file types:
.prt
.asm
(Note: Assemblies need to be in a .zip
folder with all dependent files included to be properly extracted)
Note: These files can also be pulled from Windchill server with the windchill_extract
function.
Example Files
Version Compatibility
This software was tested with PTC Creo Parametric 10.0 and PTC Windchill 12.1 on a Windows Server 2019 machine. It is intended to run in a Windows environment.
Function Coverage and Outputs
The PTC Creo software can produce a number of artifacts extracted from the Creo CAD models. The table below describes each output artifact and its type.
Foundation Functions
Link to Foundation Function Documentation
Route | Coverage | Artifact Content Example |
---|---|---|
Function: @istari:extract: | Yes | |
- Extract model 6 side model views - PNG | ||
- Extract model isometric view - PNG | ||
- Extract user defined parameters - JSON | ||
- Extract mass properties and bounding box - JSON | ||
- Extract bill of materials (Products) - JSON | ||
- Extract material properties assigned - JSON | ||
Function: @istari:windchill_extract: | Yes | |
- Extractions same information as above. | ||
Function: @istari:update_parameters: | Yes | |
- Updates a set of parameters with user-specified values | ||
Function: @istari:windchill_update_parameters: | Yes | |
- Updates parameters in Windchill-managed CAD files through checkout/checkin workflow |
Multi Functions
Link to Multi Function Documentation
Route | Coverage |
---|---|
Function: @istari:batch_execute | Yes |
Function: @istari:variable_sweep | Coming Soon |
Tips and tricks for model extraction and Reuse
This section will guide users through creating a Creo model for optimal interaction with the provided software (SDK/platform).
1. User Defined Parameters: These are essential for extracting key values out of the Creo file. This will allow upstream and downstream digital threading of the Creo file. Refer to Creo instructions or your company's best practices for best methods to create these.
2. Material Properties: Ensure the correct material is defined in the Creo models
Detailed SDK Reference
Prerequisite: Install Istari Digital SDK and initialize Istari Digital Client per instructions here
Step 1: Upload and Extract the File(s)
Upload the file as a model
model = client.add_model(
path="example.prt",
description="Creo example Model",
display_name="Creo Model Name",
)
print(f"Uploaded base model with ID {model.id}")
Extract once you have the model ID
extraction_job = client.add_job(
model_id = model.id,
function = "@istari:extract",
tool_name = "ptc_creo_parametric",
tool_version = "10.0.0.0",
operating_system = "Windows 10",
)
print(f"Extraction started for model ID {model.id}, job ID: {extraction_job.id}")
Please choose appropriate tool_name, tool_version, and operating_system for your installation of this software.
Above is an example of how to call the function
Step 2: Check the Job Status
extraction_job.poll_job()
Step 3: Retrieve Results
Example
for artifact in model.artifacts:
output_file_path = f"c:\\extracts\\{artifact.name}"
if artifact.extension in ["txt", "csv", "md", "json", "html"]:
with open(output_file_path, "w") as f:
f.write(artifact.read_text())
else:
with open(output_file_path, "wb") as f:
f.write(artifact.read_bytes())
Step 4: Update Parameters
The following example demonstrates how to update parameters in a Creo model:
from time import sleep
import istari
from istari.openapi_client import JobStatusName
# Upload the Creo model
creo_model = client.add_model("path/to/your/model.zip")
print(f"Creo file uploaded as model {creo_model.id}")
# Create update job
update_job = client.add_job(
model_id=creo_model.id,
function="@istari:update_parameters",
tool_name="ptc_creo_parametric",
tool_version="10.0.0.0",
operating_system="Windows 10",
parameters={
"parameters": {
"9PRT0103\\DESCRIPTION": "Updated Description",
}
}
)
print(f"Created update job {update_job.id}")
print(f" > Model ID: {update_job.model.id}")
print(f" > Function: {update_job.function.name}")
print(f" > Tool Name: {update_job.function.tool_name}")
# Monitor job status
update_job.poll_job()
# List updated artifacts
for artifact in creo_model.artifacts:
print(f" * {artifact.id} {artifact.name}")
Extract a File from Windchill using (windchill_extract
) function
The @istari:windchill_extract
function allows you to extract a CAD file directly from a PTC Windchill instance by providing basic authentication credentials and specifying the windchill model link.
Function Overview
- Function Name:
@istari:windchill_extract
- Tool Name:
ptc_creo_parametric
- Supported Versions:
10.0.0.0
- Supported OS:
Windows 10 / 11
,Windows Server 2019 / 2022
1: Create the Input Files
You will need two files to run this function:
- A credentials file: A JSON file containing your Windchill username and password.
- A metadata file: A file with the extension
.istari_windchill_metadata
that specifies the part number to download.
Example Credentials File (windchill_secret.json
)
{
"username": "your-windchill-username",
"password": "your-windchill-password"
}
Example Metadata File (input.istari_windchill_metadata
)
{
"oid": "VR:wt.epm.EPMDocument:132353" // This is just example only
}
How to Extract the oid from a Windchill Link
When working with Windchill, you may deal with URLs that look like this from the model details page.
Example Windchill URL:
https://company_domain/Windchill/app/...&oid=VR%3Awt.epm.EPMDocument%3A120615
Copy the value of the oid
parameter and URL-decode it. In the example above:
- Encoded:
VR%3Awt.epm.EPMDocument%3A120615
- Decoded:
VR:wt.epm.EPMDocument:120615
Use the decoded string as the part_number
in your metadata.
You can skip this extraction step entirely by using the Istari Digital web UI. Simply add the file from the UI platform, copy the model_id
shown there, and pass it directly to the job as an identifier. This avoids manual URL decoding and speeds up your workflow.
2: Example of how to use the windchill_extract
function with the Istari Digital SDK:
The following script demonstrates the complete workflow:
step 1: Securely add your Windchill credentials.
function_auth_secret = client.add_function_auth_secret(
path="path/to/your/windchill_secret.json",
function_auth_type=FunctionAuthType.BASIC,
)
windchill_auth_source = NewSource(
revision_id=function_auth_secret.revision.id,
relationship_identifier="windchill_auth",
)
step 2: Upload the .istari_windchill_metadata
file as a model.
model = client.add_model(
path="path/to/your/input.istari_windchill_metadata",
display_name="Windchill Download Request",
)
step :3 Submit the windchill_extract
job, linking the auth secret as a source.
windchill_job = client.add_job(
model_id=model.id,
function="@istari:windchill_extract",
tool_name="ptc_creo_parametric",
tool_version="10.0.0.0",
operating_system="Windows 10",
sources=[windchill_auth_source],
)
Update Parameters in Windchill Files using (windchill_update_parameters
) function
The @istari:windchill_update_parameters
function allows you to update parameters in CAD files directly from a PTC Windchill instance by providing basic authentication credentials, specifying the windchill model link, and defining the parameters to update.
Function Overview
- Function Name:
@istari:windchill_update_parameters
- Tool Name:
ptc_creo_parametric
- Supported Versions:
10.0.0.0
- Supported OS:
Windows 10 / 11
,Windows Server 2019 / 2022
5.1: Example Usage
windchill_update_job = client.add_job(
model_id=model.id,
function="@istari:windchill_update_parameters",
tool_name="ptc_creo_parametric",
tool_version="10.0.0.0",
operating_system="Windows 10",
sources=[windchill_auth_source],
parameters={
"parameters": {
"DESCRIPTION": "Updated Description",
"MATERIAL": "Aluminum 6061",
"THICKNESS": "2.5"
}
}
)
Workflow Description
The windchill_update_parameters
function implements a complete checkout/checkin workflow:
- Authentication: Connects to Windchill using provided credentials
- File Retrieval: Downloads the specified model from Windchill
- Checkout: Checks out the file (and all component parts for assemblies)
- Parameter Updates: Applies the specified parameter changes
- Checkin: Checks the modified file back into Windchill
- Export: Provides the updated model as output
Note: This function only checks in files that have been modified, automatically skipping unchanged files to maintain workspace efficiency.
Setup for Administrators
Ensure that PTC Creo parametric 10.0.0.0 is installed on a Virtual Machine (VM) with Istari Digital Agent and appropriate Istari Digital Software. Verify that the installation is up to date with the latest patches and updates from PTC.
Required Environment Variables
The following environment variables must be set to ensure that the Creo module can interact with the PTC Creo Parametric environment correctly:
-
PRO_DIRECTORY: Set this variable to the path of the common files in your PTC Creo installation. This is necessary for the module to locate essential Creo resources.
- Example:
C:\Program Files\PTC\Creo 10.0.0.0\Common Files\
- Example:
-
PRO_COMM_MSG_EXE: Set this variable to the path of the
pro_comm_msg.exe
executable. This executable is required for communication between the Creo application and the module.- Example:
C:\Program Files\PTC\Creo 10.0.0.0\Common Files\x86e_win64\obj\pro_comm_msg.exe
- Example:
-
PATH: Add the path to the platform library folder to the Windows PATH environment variable. This ensures that the necessary libraries are accessible to the module.
- Example: Add
C:\Program Files\PTC\Creo 10.0.0.0\Common Files\x86e_win64\lib\
to your PATH variable.
- Example: Add
Setting Environment Variables
To set these environment variables on Windows:
- Open the Control Panel.
- Navigate to System and Security > System.
- Click on Advanced system settings.
- In the System Properties window, click on Environment Variables.
- Under System variables, click New to add
PRO_DIRECTORY
andPRO_COMM_MSG_EXE
. - Select the Path variable and click Edit to add the library path.
By correctly setting these environment variables, you ensure that the Creo module can fully leverage the capabilities of the PTC Creo Parametric environment.
Module Configuration (Version 3.0.0+)
Starting with creo-module 3.0.0 and istari-agent 9.8.0+, the old configuration variables (creo_path
, render_tool_path
, convert_tool_path
, windchill_pdm_link
, windchill_workspace
) are deprecated. While they remain supported for backward compatibility, we strongly encourage using the new standardized configuration variables and the centralized istari_digital_agent_module_configurations
approach for module configuration.
Centralized Configuration (Recommended)
The Istari Agent is configured via the file istari_digital_config.yaml
. The Agent expects the file to be located at:
%LOCALAPPDATA%\istari_digital\
on Windows~/.config/istari_digital/
on RHEL/Ubuntu
Configure the Creo module using the istari_digital_agent_module_configurations
section. The agent will pass this centralized configuration to the module:
agent:
istari_digital_agent_module_configurations:
"@istari:ptc_creo_parametric":
"ptc_creo_parametric_executable_path": "/path/to/creo/parametric.exe"
"ptc_creo_parametric_renderer_executable_path": "/path/to/render/tool"
"ptc_creo_parametric_converter_executable_path": "/path/to/convert/tool"
"ptc_creo_parametric_windchill_pdm_link": "https://your-windchill-server" # optional
"ptc_creo_parametric_windchill_workspace": "/path/to/workspace" # optional
Legacy Configuration (module_config.json)
For backward compatibility, you can still use the legacy module_config.json
file located at {istari_agent_dir}\istari_modules\ptc_creo_parametric\app\resources\module_config.json
:
{
"ptc_creo_parametric_executable_path": "C:/Program Files/PTC/Creo 10.0.0.0/Common Files/x86e_win64/bin/parametric.exe",
"ptc_creo_parametric_renderer_executable_path": "/path/to/render/tool",
"ptc_creo_parametric_converter_executable_path": "/path/to/convert/tool",
"ptc_creo_parametric_windchill_pdm_link": "https://your-windchill-server",
"ptc_creo_parametric_windchill_workspace": "/path/to/workspace"
}
Configuration Parameters
ptc_creo_parametric_executable_path
: Path to the Creo Parametric executableptc_creo_parametric_renderer_executable_path
: Path to the rendering tool for generating model viewsptc_creo_parametric_converter_executable_path
: Path to the conversion tool for file format conversionptc_creo_parametric_windchill_pdm_link
: (Optional) URL to your Windchill PDM serverptc_creo_parametric_windchill_workspace
: (Optional) Path to the Windchill workspace directory
External Dependencies
In addition to the core functionality provided by the Creo module, the module relies on two external utility tools to enhance its capabilities:
-
Universal CAD Converter: This tool is used to convert STL files generated by Creo into the OBJ format, which is essential for 3D mesh representation.
-
Blender Render Tool: This tool is utilized to render various views of the model, such as top, left, right, and iso views, providing comprehensive visual representations. (Note: This tool requires a properly installed GPU driver with OpenGL support)
Both of these tools should be packaged alongside the Creo module to ensure seamless integration and functionality.
Troubleshooting
- For general Agent and Software Troubleshooting Click Here
- Missing Artifacts:
- 2.1 parameters.json: Check source file, are there user defined parameters defined in the file? If not, refer to the software's manual for defining appropriate parameters.
- 2.2 material.json: Check source file, is material properly defined? If not, refer to the software's manual for defining appropriate material assignment.
- 2.3 missing png views: Check the GOU Driver installed on the module machine, it requires an OpenGL supported driver.