SEK 0.00
0

Parasolid in SOLIDWORKS: x_t vs x_b, Versions and Batch Export

Parasolid is the SOLIDWORKS geometry kernel. Learn x_t vs x_b, how to pick the output version, import tips and batch export with the API.
Parasolid in SOLIDWORKS: x_t vs x_b, Versions and Batch Export
Picture of Amen Jlili

Amen Jlili

Amen Jlili is the founder and technical director of Blue Byte Systems Inc., a software company in Vancouver, Canada, specializing in automating SOLIDWORKS and PDM.

Parasolid is the geometric modeling kernel that SOLIDWORKS is built on, so exporting a SOLIDWORKS part or assembly to Parasolid (.x_t or .x_b) hands the receiving system the same B-rep math SOLIDWORKS used to create it, with no translation into another kernel. In practice that makes Parasolid the cleanest neutral format between SOLIDWORKS and other Parasolid-based CAD and CAM systems. This guide covers the difference between .x_t and .x_b, how to pick the output version, what to expect on import, and how to batch export Parasolid files with a VBA macro or inside SOLIDWORKS PDM.

What Parasolid is and why SOLIDWORKS uses it

Parasolid is a commercial geometry kernel developed by Siemens Digital Industries Software and licensed to many CAD, CAM, CAE and visualization vendors. The kernel is the layer that actually computes solids: Boolean operations, fillets, shells, face and edge topology, tolerances. The feature tree, sketches and dimensions you see in SOLIDWORKS sit on top of it.

That distinction matters for data exchange. A Parasolid file contains the resulting bodies, not the feature history. When you export to Parasolid you are writing the kernel’s own data structures to disk. When you export to STEP or IGES, the exporter has to translate those bodies into a standard representation, and the importer on the other side has to translate them back into its own kernel. Every translation is a chance for tolerance mismatches, sliver faces, or surfaces that fail to knit into a solid.

If the receiving application also runs on Parasolid, a Parasolid file usually arrives as a valid solid with no repair needed. That is the main reason machine shops, CAM programmers and simulation teams often ask for .x_t files specifically.

SOLIDWORKS Parasolid formats: x_t vs x_b

SOLIDWORKS offers two Parasolid file types in File > Save As:

Format Extension Encoding Typical use
Parasolid text .x_t Plain text Default choice, widely requested, easy to inspect and diff
Parasolid binary .x_b Binary Smaller files, exact numeric storage, faster to read and write

Both hold the same kind of content. The practical differences:

  • Size. Binary files are typically noticeably smaller than the text equivalent, which helps with large assemblies or email size limits.
  • Precision. Text files store numbers as decimal text; binary stores them in their native form. For normal mechanical parts this rarely matters, but binary avoids any rounding from text conversion.
  • Transport. Text files can be damaged by tools that change line endings or character encoding (some FTP transfers in ASCII mode, some email gateways). Binary files must be transferred as binary.
  • Compatibility. Almost every Parasolid-based application reads both, but .x_t is the one people ask for by name. When in doubt, send .x_t.

Tip: if a recipient reports a corrupt .x_t, check how it was transferred before you blame the export. A changed line ending is a common cause.

Choosing the Parasolid output version

Parasolid files are versioned. A file written by a newer Parasolid release can contain data an older reader does not understand, so if your supplier is running an older CAM or CAD system, you may need to write an older Parasolid version.

In the Save As dialog, select a Parasolid file type and click Options. The export options for Parasolid let you choose the output version from a list. The default is the version that matches your SOLIDWORKS release. Pick an older version only when a specific recipient needs it. Downgrading for everyone gains nothing, and newer readers handle the current version without issue.

The same dialog also offers export settings such as the output coordinate system, which is useful when the receiving system expects the part positioned relative to a specific origin (a CAM setup, for example). Define a coordinate system in the model first, then select it at export time.

These options are stored as system settings, so once you change them they apply to every subsequent Parasolid export from that machine until you change them back. In the API, the Parasolid output version is exposed as a user preference (swParasolidOutputVersion in swUserPreferenceIntegerValue_e), which is how a macro can enforce a version before a batch run instead of relying on whatever the last user selected.

Parts vs assemblies

A part exports its solid and surface bodies. An assembly exports the bodies of its components into a single Parasolid file, positioned as they are in the assembly. The file does not carry SOLIDWORKS mates, configurations or feature history.

If the recipient needs one file per component, export the components individually. We have a ready macro for that: export assembly components as Parasolid.

Importing Parasolid files into SOLIDWORKS

To bring a Parasolid file into SOLIDWORKS, use File > Open and set the file type filter to Parasolid. SOLIDWORKS creates a new part (or an assembly, depending on the content and your import options) with the geometry as an imported body feature.

What you get:

  • A solid or surface body with no sketches or parametric features.
  • Usually no need for Import Diagnostics, because the geometry was created by the same kernel. If the sending system used looser tolerances, Import Diagnostics can still help.
  • Full ability to add new features on top of the imported body: cuts, holes, fillets, mates in an assembly.

If you need editable features, the FeatureWorks add-in can attempt to recognize features such as extrudes, holes and fillets on an imported body and rebuild them as SOLIDWORKS features. It works best on prismatic machined parts and less well on complex freeform geometry. For many workflows, simply modeling on top of the imported body is faster than feature recognition.

Parasolid vs STEP: when to use which

STEP is the right default when you do not know what the recipient runs, or when you need product structure and metadata in a vendor neutral, standards based format. Parasolid wins when the recipient is on a Parasolid-based system and wants the cleanest possible solids.

Situation Better choice
Recipient uses a Parasolid-based CAD or CAM system Parasolid .x_t
Unknown recipient system STEP AP214 or AP242
Need for long-term archiving based on an ISO standard STEP
Exchange between two SOLIDWORKS users Native files, or Parasolid if history must be stripped
Supplier reported bad surfaces or open solids from STEP Try Parasolid

Many teams simply send both. If you export STEP too, see our guides on exporting the active document as a STEP file and batch exporting configurations to STEP.

Batch export SOLIDWORKS files to Parasolid with the API

Saving one file at a time through the dialog is fine for occasional requests. For a full project, use the API. The export call is the same IModelDocExtension.SaveAs you use for any format: SOLIDWORKS picks the translator from the file extension, so passing a path ending in .x_t writes a Parasolid text file and .x_b writes binary. How to create an X_T file through the API is a question that comes up on CADOverflow too.

The macro below loops through every part and assembly in a folder, opens each one silently, saves a Parasolid text file next to it and closes it.

Option Explicit

Const SOURCE_FOLDER As String = "C:\Work\Export\"

Sub main()
    Dim swApp As SldWorks.SldWorks
    Set swApp = Application.SldWorks

    Dim fileName As String
    fileName = Dir(SOURCE_FOLDER & "*.sld*")

    Do While fileName <> ""
        Dim ext As String
        ext = LCase(Right(fileName, 6))
        If ext = "sldprt" Or ext = "sldasm" Then
            ExportOne swApp, SOURCE_FOLDER & fileName, IIf(ext = "sldprt", swDocPART, swDocASSEMBLY)
        End If
        fileName = Dir
    Loop
End Sub

Sub ExportOne(swApp As SldWorks.SldWorks, filePath As String, docType As Long)
    Dim swModel As SldWorks.ModelDoc2
    Dim errs As Long, warns As Long

    Set swModel = swApp.OpenDoc6(filePath, docType, swOpenDocOptions_Silent, "", errs, warns)
    If swModel Is Nothing Then
        Debug.Print "Failed to open: " & filePath & " (error " & errs & ")"
        Exit Sub
    End If

    Dim outPath As String
    outPath = Left(filePath, InStrRev(filePath, ".")) & "x_t"

    Dim ok As Boolean
    ok = swModel.Extension.SaveAs(outPath, swSaveAsCurrentVersion, _
        swSaveAsOptions_Silent, Nothing, errs, warns)

    Debug.Print IIf(ok, "Saved: ", "Failed: ") & outPath
    swApp.CloseDoc swModel.GetTitle
End Sub

A few practical notes from running this kind of job on real data:

  • Set the Parasolid version first. If your recipient needs an older version, set the swParasolidOutputVersion preference at the start of the macro, and restore the original value at the end so you do not surprise the next user.
  • Configurations. SaveAs exports the active configuration. To export every configuration, call ShowConfiguration2 for each name returned by GetConfigurationNames and save to a file name that includes the configuration. The STEP configuration macro linked above shows the pattern; only the extension changes.
  • Assemblies open with their components. Opening many large assemblies in a loop consumes memory. Close each document and consider restarting SOLIDWORKS between large batches.
  • Read-only and vaulted files. Opening a file from a local PDM cache is fine for export since you are not saving the source, but the output folder must be writable.

For more on macro structure, error handling and early binding, our macro library has ready examples you can adapt.

Batch Parasolid export inside SOLIDWORKS PDM

When the files live in SOLIDWORKS PDM, a desktop macro gets awkward: you need the latest version cached locally, you need to decide which version to export (latest or released), and you usually want the output checked back into the vault or written to a share for suppliers.

That is the job PDMPublisher was built for. It runs as a PDM task that exports drawings and models (PDF, DXF, STEP, IGES, Parasolid X_T and more) from a right click or automatically on a workflow transition, with file naming from data card variables and output either into the vault or to a network folder. If you want to test it on your own vault, there is a PDMPublisher trial.

Community discussions

FAQ

Does a Parasolid file keep the SOLIDWORKS feature tree?

No. Parasolid stores the final bodies (B-rep geometry and topology). Sketches, features, dimensions, mates and configurations are not included. The recipient gets a dumb solid.

Should I send x_t or x_b?

Send .x_t unless the recipient asks for binary or file size is a problem. It is the most widely requested Parasolid format and every Parasolid-based system reads it.

Why does my supplier say the Parasolid file is too new?

The file was written in a Parasolid version newer than their software supports. Open the Parasolid export options in Save As and choose an older output version, then export again.

Can I export Parasolid from a SOLIDWORKS macro without opening the Save As dialog?

Yes. Open the document with OpenDoc6 and call IModelDocExtension.SaveAs with an output path ending in .x_t or .x_b. SOLIDWORKS chooses the Parasolid translator from the extension.

Need help with this?

If you need Parasolid, STEP or PDF exports automated across a whole vault, or a custom export macro for your team, contact us. For export tasks inside SOLIDWORKS PDM, take a look at PDMPublisher.

Need this adapted to your workflow?

We build custom SOLIDWORKS macros, add-ins and PDM automation.

Picture of Amen Jlili

Amen Jlili

Amen Jlili is the founder and technical director of Blue Byte Systems Inc., a software company in Vancouver, Canada, specializing in automating SOLIDWORKS and PDM.

Leave a Comment

0
0
Your Cart
Your cart is emptyReturn to Shop