Skip to main content

instance_counts

Function instance_counts 

Source
pub fn instance_counts(
    path: &Path,
    format: &str,
) -> Option<HashMap<String, u32>>
Expand description

How often an assembly places each component file – keyed by the lower case, normalised file name – where its format tells:

  • NX (nx-part): the placed components (NAME.prt), hidden layers left out as in the preview (nxasm::kind_of);
  • SOLIDWORKS 2015+ assemblies: the instances of the component tree without swExcludeFromBOM (swpart::file_component_counts; a file with only excluded instances counts 0);
  • STEP assemblies with external references: the assembly occurrences of each external file (stepbom::external_instance_counts);
  • Inventor assemblies: the occurrences of each referenced file from the file descriptor table without the suppressed ones (invasm::file_occurrence_counts; only suppressed ones count 0).

None for every other format and for files without component data. Blocking (reads the file).