Sublime Forum

Optimizing Sublime Text 4 for Large ASCII STEP (ISO 10303-21) & DXF CAD Files

#1

When debugging broken B-Rep geometry exports or header version mismatches in industrial CAD pipelines, opening 150 MB–400 MB ASCII STEP (ISO-10303-21, .stp / .step) or DXF files in standard IDEs usually freezes the main thread. Sublime Text 4 handles these files remarkably well once symbol indexing and syntax heuristics are tuned for dense entity tables.

Here is the production configuration we use for inspecting large CAD text exports and AutoLISP (.lsp) scripts without UI stalls:

1. Prevent Symbol Indexer Thrashing on STEP Entity IDs

An ASCII STEP file contains millions of cross-referenced lines like #482910 = CARTESIAN_POINT('',(12.450,0.000,-4.125));. If Sublime’s indexer attempts to parse these into symbol tables, background worker CPU usage spikes to 100%.

Add these exclusions to Preferences.sublime-settings:

{
    "index_exclude_patterns": [
        "*.stp",
        "*.step",
        "*.igs",
        "*.iges",
        "*.dxf",
        "*.ifc",
        "*.dwl",
        "*.dwl2"
    ],
    "syntax_detection_size_limit": 26214400,
    "word_wrap": false
}

2. Fast Regex Navigation for Corrupt B-Rep Faces

When a CAD kernel reports a non-manifold shell or failed sewing operation on a specific entity ID (e.g., #10492), you can trace the full parent-child chain (ADVANCED_FACE → FACE_OUTER_BOUND → EDGE_LOOP → ORIENTED_EDGE) using Sublime’s incremental regex find (Ctrl+F with .* enabled):

  • Find all references to an entity ID: #10492\b
  • Locate header schema & tolerance declarations: ^FILE_SCHEMA|^UNCERTAINTY_MEASURE_WITH_UNIT

3. Lightweight .sublime-build for STEP Tolerance & Header Verification

You can attach a fast Python pre-flight check (Tools -> Build System -> New Build System...) to verify unit scaling (MILLI, INCH) and global uncertainty tolerances before importing the file into heavy MCAD kernels:

{
    "cmd": ["python3", "-u", "-c", "import sys, re; txt=open(sys.argv[1], errors='ignore').read(65536); print('Schema:', re.findall(r'FILE_SCHEMA\s*\(\((.*?)\)\)', txt)); print('Uncertainty:', re.findall(r'UNCERTAINTY_MEASURE_WITH_UNIT\s*\((.*?)\)', txt))", "$file"],
    "selector": "text.plain"
}

For cross-checking ISO 286 shaft/hole limits and chordal tessellation tolerances alongside raw STEP headers, we also keep an open browser reference at CADGuide.tools Engineering Tolerance Calculator.

If anyone else here uses ST4 for OpenSCAD, AutoLISP, or STEP/G-code inspection, sharing your .sublime-syntax rules for ISO-10303-21 would be very welcome!

0 Likes