DFMergeAssemblies component

Contents

_images/icon22.png

DFMergeAssemblies component#

This component parse a series of DFAssemblies into a unique DFAssembly object.

Inputs:

i_new_name (str ,item)

The new name of the assembly to export.

i_assemblies (ghdoc ,list)

The assemblies to merge.

Outputs:

o_assembly

The create DFAssembly object representing the timber elements.

Code:

#! python3

import diffCheck
from diffCheck.df_geometries import DFBeam, DFAssembly

from ghpythonlib.componentbase import executingcomponent as component

import System

class DFMergeAssemblies(component):
    def RunScript(self,
                  i_new_name: str,
                  i_assemblies: System.Collections.Generic.IList[diffCheck.df_geometries.DFAssembly]
                  ) -> diffCheck.df_geometries.DFAssembly:

        beams = System.Collections.Generic.List[DFBeam]()
        for assembly in i_assemblies:
            for beam in assembly.beams:
                beams.Add(beam)

        o_assembly = DFAssembly(beams, i_new_name)

        return o_assembly