Skip to main content

placements

Function placements 

Source
pub fn placements(xml: &[u8]) -> Option<Vec<Component>>
Expand description

The parts of an assembly with their placements, from its component tree (swXmlContents/COMPINSTANCETREE), sub-assemblies resolved:

<swFile id="6" swDocType="PART" swPath="…\Topf.SLDPRT"/>
<swModel id="5" swFileRef="6"/>                                  a file in one configuration
<swModel id="2" swFileRef="3">                                   an assembly in one configuration
  <swReference swModelRef="5" swSuppressed="NO" swHidden="NO"
               swTransform="r00 r01 r02 0 r10 r11 r12 0 r20 r21 r22 0 tx ty tz 1"/>
</swModel>
<swConfiguration swModelRef="2" swMostRecentConfiguration="YES"/>

A point of a component lands at p · R + t (t in metres; the components carry millimetres). The top model is the configuration that was active when the file was saved; a sub-assembly’s model lists its own instances, placed relative to it. Suppressed, hidden and virtual instances (the latter have no file of their own) are left out, with everything below them. Each component is named by the file name of its swPath (the author’s path, so it is found by name). None when the XML has no assembly model.