15.01.2025 - 08:31
*
Hello,
I'm creating a Standard PythonPart that generates a PythonPartGroup "parent" with several PythonParts "child" in it. The creation works fine, however, I need to create each "child" in a different specific DrawingFile while keeping them inside the PytonPartGroup. Is that possible, and if so, how can I achieve it?
The code used for the PythonPartGroup looks as follows:
def create_element(build_ele, doc): #.... child1 = ChildPythonPart(random.random() * 3600, build_ele.ProfBalconera.value, build_ele.dadesTDInclinades.value[0].Altura, build_ele.dadesTDInclinades.value[0].Llargada, build_ele.BarraGruix.value, build_ele.IsUseGlobalProp.value, build_ele.FounColor.value, 40098) child2 = ChildPythonPart(random.random() * 3600, build_ele.ProfBalconera.value, build_ele.dadesTDInclinades.value[1].Altura, build_ele.dadesTDInclinades.value[1].Llargada, build_ele.BarraGruix.value, build_ele.IsUseGlobalProp.value, build_ele.FounColor.value, 40098) group_elems.append(PythonPart ("ChildPythonPart1", parameter_list = child1.get_params_list(), hash_value = child1.hash(), python_file = child1.filename(), views = table_views_incl, matrix = vectorI1, common_props = common_propsIncl, attribute_list = table_attr_list_incl)) group_elems.append(PythonPart ("ChildPythonPart2", parameter_list = child2.get_params_list(), hash_value = child2.hash(), python_file = child2.filename(), views = table_views_incl, matrix = vectorI1, common_props = common_propsIncl, attribute_list = table_attr_list_incl)) parent = PythonPartGroup (build_ele.NomTD.value, build_ele.get_params_list(), build_ele.get_hash(), build_ele.pyp_file_name, group_elems) model_elem_list = parent.create() model_elem_list_preview = parent_preview.create() return CreateElementResult(elements= model_elem_list, handles= handle_list, preview_elements= model_elem_list_preview)