Skip to main content

components

Function components 

Source
pub fn components(xml: &[u8]) -> Vec<String>
Expand description

The files of the direct components of an assembly, from its component tree (swXmlContents/COMPINSTANCETREE), each once in the order of the tree:

<swFile id="6" swPath="Z:\…\box.SLDPRT"/>                      the files
<swModel id="5" swFileRef="6"/>                                 a model of a file
<swModel id="2" swFileRef="3">                                  the assembly itself
  <swReference swModelRef="5" swIsVirtualComponent="NO"/>       an instance
</swModel>

The assembly’s own models are those that no instance refers to; only their instances count (sub-assemblies list their own components). Virtual components live inside the assembly and have no file. Broken XML yields the components read up to the error.