Static geometry¶
Static geometry elements can be created with the PythonPart SelectGeometryForPythonPart, located in the folder Examples\ToolsAndStartExamples. With this PythonPart it’s possible to select geometry objects in the Allplan and convert the data of the geometry objects to a string. The created string is directly copied to the clipboard and can be pasted in the py file of the PythonPart.
The created string looks as follows:
geo_ele_strings = ["Line3D(0,0,0,1164.1666666666661,740.83333333333212,0)",
"Spline3D(IsPeriodic(0)StartVector(0,0,0)EndVector(0,0,0)Count(3)Points((1640.4166666667,-343.9583333333,0)(3386.6666666667,687.9166666667,0)(3386.6666666667,237.9166666667,0)))",
"Arc3D(CenterPoint(6901.875,211.6666666667,0)XDirection(1,0,0)ZAxis(0,0,1)MinorRadius(610)MajorRadius(610)DeltaAngle(3.3757121965560901)StartAngle(5.100741141965468)EndAngle(2.1932680313419723)IsCounterClockwise(1))",
"Polyline3D(Count(6)Points((8542.2294364012,-51.5205635988,0)(9385.7765294033,-630.4801981396,0)(10197.0702497985,-7.1276046683,0)(9854.9302508599,957.0851196132,0)(8832.1823822099,929.6487621329,0)(8542.2294364012,-51.5205635988,0)))",
"Polyline3D(Count(5)Points((4101.0416666667,-79.375,0)(5027.351550021,846.9348833544,0)(5609.4348833544,264.851550021,0)(4683.125,-661.4583333333,0)(4101.0416666667,-79.375,0)))"]
geo_elements = [StringToValueConverter.get_value("$geometryobject", geo_ele_string) for geo_ele_string in geo_ele_strings]
By using the StringToValueConverter, the geometry elements will be created from the string and can be used for further operations. The complete use of a static geometry is show in the example
…\etc\Examples\PythonParts\GeometryExamples\ExtrudeIncludedDrawingGeometry.pyp…\etc\PythonPartsExampleScripts\GeometryExamples\ExtrudeIncludedDrawingGeometry.py