Pro-E numeric codes cover most components, but parts downloaded as STEP
from online catalogs (rings, bushings, knobs...) get alphabetic Creo names
with no predictable shape. Add a second extraction path that tokenizes the
binary generically and validates candidates against the known codes in
cad_index.db, applying the same placement/occurrence rule used for bare
numeric codes. Numeric extraction is unchanged, so missing-from-index
reporting for renamed/moved Pro-E codes still works.
Also load all known prt/asm codes once per scan instead of one query per
candidate, in both RisolviAlberoComponenti and VerificaCompletezzaAssiemi.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Batch the DB lookup per file instead of per code in scripts/ExtractCreoStrings.cs:
files_ultima_versione is an unmaterialized view, so each query rescanned the whole
files table (~230ms) - batching cuts a multi-minute BFS to seconds.
- Widen the code regex to accept a revision letter and a "_..." suffix together
(e.g. "9284200366A_C01"), and purely numeric "_NNNN" suffixes (e.g. dimensional
variants like "2702220182_8188"), not just letter+digits.
- Require bare digit-only candidates to also appear inside a real
"Componente ID N (...)"/"Component id N (...)" placement, filtering out
incidental references to a containing assembly's own code.
- scripts/ExtractCreoStrings.cs now reports only the direct references of the given
.asm (one level, matching Creo's own tree for that file) instead of recursing into
sub-assemblies.
- Port the regex and placement-check refinements to the production
AssemblyComponentScanner.cs used by the app's "Trova componenti referenziati" and
"Verifica completezza" phases.
- Document the new false-positive categories (parent/container self-reference,
suppressed/removed components with residual placement, placement missing
suffix/bracket detail) in docs/formato-asm.md, generalized beyond the specific
assemblies used to find them.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
These appear in the .asm binary as a family-table instance name (e.g.
"R6--_-_U6592<UNI6592>"), not a separate file on disk - only the generic
"uni6592.prt" is actually indexed. Extract just the "<UNI...>" content
instead of the full instance name, in both the standalone script and the
production scanner, so standard hardware stops being silently dropped as
"not found in index".
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The standalone script already excluded internal saved-view IDs
(ModelView#<numero>) from the referenced-codes heuristic; the app's own
"Trova componenti referenziati" phase used the same regex without the fix.
Ports the lookbehind so both stay consistent, per docs/formato-asm.md.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Restructure Form1 into a sequential wizard (database -> import -> raw ->
recursive component resolution -> completeness/STEP report), fix
case-sensitivity bugs in codice/tipo_file lookups and a word-boundary gap
in the assembly scanner that missed _D100-style sub-assembly references,
and treat the distinta's general assembly as an ordinary CSV row (derived
from the DBP_<codice>_<timestamp> filename) instead of special-casing it
throughout. Also adds CadSearchGui.Tests (xUnit) covering the scanner,
filename parsing, and the case-insensitive DB lookup behavior.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>