Working on a script that uses the same structure of the base course, im trying to add a 3D Polyline to the object im creating. The Polyline is not used in other parts of the script, i just need a parametric polyline as an output, so i can turn it to a line fixture in allplan
This is how geometry is created:
def calculate_geometry(self) -> AllplanGeometry.Polyhedron3D:
return AllplanGeometry.Polyhedron3D.CreateCuboid(AllplanGeometry.AxisPlacement3D(),self.length,self.width,self.height)
def calculate_geometry_2(self):
self.pluviale_points = [AllplanGeometry.Point3D(0, 0, 0),AllplanGeometry.Point3D(1000, 1000, -1000),AllplanGeometry.Point3D(0, 0, 0)]
polyline = AllplanGeometry.Polyline3D(self.pluviale_points)
props = AllplanBaseElements.CommonProperties()
props.Color = 6
props.Layer = 1
props.Visible = True
return AllplanBasisElements.ModelElement3D(props, polyline)
def create_as_pythonpart(self, build_ele: BuildingElement) -> CreateElementResult:
"""Create the reinforced beam as a PythonPart with handles and attributes
ReturnsythonPart with handles and attributes """
model_ele_list = ModelEleList()
model_ele_list.append_geometry_3d([self.geometry_2])
model_ele_list.append_geometry_3d(self.geometry)
pyp_util = PythonPartUtil()
pyp_util.add_pythonpart_view_2d3d(model_ele_list)
pyp_util.add_attribute_list(self.attributes)
pyp_util.add_reinforcement_elements(self.reinforcement.all_reinforcement_elements)
python_part_elements = pyp_util.create_pythonpart(build_ele)
return CreateElementResult(elements = python_part_elements,
handles = self.handle_list)
At the moment my script runs but the polyline is completely ignored; before that i was able to get the polyline visible but only in the preview before placing the element, but i dont know how to got back even to that result.