Getting Started with SNAP > Chapter 1 Introduction
Getting Started with NX SNAP — Overview
Structural note: unlike the standard HTML/iframe topic pages used elsewhere
in the NX 2212 doc set, this book (gs_snap) renders as a PDF inside a
pdfjs iframe (117 pages), not id="xhtml" HTML. The getElementById('xhtml')
technique does not apply. To extract text: the PDF viewer is PDF.js; its
iframe has id="pdfjs", and contentWindow.PDFViewerApplication is reachable
(same-origin) with .pdfDocument.getPage(n).then(p=>p.getTextContent())
returning per-page text — much faster than scrolling/screenshotting 117 pages.
Concatenating too much extracted text into one string occasionally trips the
browser tool's exfiltration guard ([BLOCKED: Cookie/query string data] or
[BLOCKED: Base64 encoded data]) even on innocuous content — read pages
individually/in small slices rather than joining the whole document into one
big string.
What is NX SNAP?
SNAP = Simple NX Application Programming. It's a .NET-based API for customizing/extending NX, positioned as a modern, easy-to-learn alternative to GRIP (unmaintained for years, dated) and NX Open/Knowledge Fusion (powerful but complex, steep learning curve). SNAP is explicitly aimed at "average NX users" who aren't professional programmers, with the design goal of being learnable quickly. It's "just a .NET library" — can be called from any .NET language (VB.NET, C#), though the guide's examples use VB.
Because SNAP is a thin, approachable layer, when it can't do something the guide explicitly tells users to drop down to NX Open ("plug the gaps") — the guide's chapter 16 covers how NX Open works for exactly this reason.
Guide structure (17 chapters, 117 pages)
- Introduction — what SNAP is, purpose, other docs, examples
- Using the NX Journal Editor — system requirements (.NET Framework), typographic conventions, SNAP vs MiniSNAP licensing
- Basics/getting a program running (chapter numbering continues through syntax fundamentals — variables, data types)
- Logical values & operators, arrays, other collections, strings, enumerations, "Nothing", decision statements, looping
- (syntax chapters continue) 6–9. Feature Functions (through ch. ~10) — brief descriptions of SNAP functions with usage examples; explicitly NOT exhaustive — "we only describe a small subset of the available functions," full detail lives in the SNAP Reference Guide or Visual Studio's Object Browser/IntelliSense
- More Feature Functions
- Assemblies — "the obligatory car example," trees/roots/leaves, components vs. prototypes, cycling through descendants, indented listings, recursive traversals 12–14. (dialog/UI-building chapters, callback mechanics) 15 (numbered ~14 in TOC, "Chapter 15" per running header at that point): Using Block UI Styler with SNAP — overall process, template code, callback details, precedence of values, getting more info
- Selecting NX Objects — selection dialogs,
SelectObjectblocks - How NX Open works (bridges to NX Open when SNAP isn't enough)
- Troubleshooting — using the NX log file, "Invalid Attempt to Load Library," "No Public Members; Inaccessible Due to Protection Level," Visual Studio templates missing, .dlx file not found, "Failed to Load Image"
Related documents referenced
- SNAP Reference Guide — the definitive/complete function reference (this Getting Started guide is intentionally a subset/tutorial)
- "SNAP and NX Open for GRIP Enthusiasts" — maps GRIP functions to
SNAP/NX Open equivalents, for users with GRIP background (this is book
gs_snap_for_gripin this same product doc set) - Visual Studio Object Browser / IntelliSense — used in practice instead of the Reference Guide once you know the API shape
Practical notes captured
- SNAP requires .NET Framework (version noted in ch. 2 "System Requirement").
- Two licensing tiers mentioned: SNAP and MiniSNAP (ch. 2 covers licensing differences — not yet extracted in detail here).
- Programs are written/run via the NX Journal Editor.
- Troubleshooting chapter suggests common real-world failure modes are DLL loading/protection-level (accessibility) issues and missing VS templates — i.e., typical .NET assembly deployment problems, not SNAP-language issues.
Source: https://docs.sw.siemens.com/en-US/doc/209349590/PL20220512394070742.gs_snap · retrieved Tue Jul 07 2026 00:00:00 GMT+0000 (Coordinated Universal Time)