Docking points

The docking points of the PythonPart can be used to connect Allplan objects with these points. One usage are the associative dimension lines.

Depending on the dynamic state of the PythonPart elements, the docking points are created in the following ways:

Static PythonPart

These type of a PythonPart has the following rules:

  • the geometry element count and order is static

  • the point count and order inside the geometry elements is static

If these rules are met, the docking points are generated automatically from the geometry elements of the PythonPart.

PythonPart with dynamic element count and static elements

These type of a PythonPart has the following rules:

  • the geometry element count and order is dynamic

  • the point count and order inside the geometry elements is static

To make the docking points unique, a docking point key must be assigned to each geometry element of the PythonPart. This must be implemented in the py file of the PythonPart and can be done as follows:

polyhed_ele  = AllplanBasisElements.ModelElement3D(com_prop, polyhed)

polyhed_ele.SetDockingPointsKey("Polyhed")

The docking point keys should be assigned in such a the way that the elements, whose points can be used for meaningful dimension lines, are always get the same key.

In the following example, a PythonPart is created with a dynamic count of polyhedron. The docking point keys are created from the left and right.

../../_images/DockingPointsKey1.png

When the number of polyhedron is changed, the keys from the left and right are the same and remain for the adjustment of the associative dimension lines.

../../_images/DockingPointsKey2.png

Dynamic PythonPart

These type of a PythonPart has dynamic elements in case of point count and order. To create these dynamic docking points, the function

def create_docking_points(build_ele       : BuildingElement,
                          doc             : AllplanElementAdapter.DocumentAdapter,
                          placement_matrix: AllplanGeo.Matrix3D) -> Tuple[List[Tuple[str, AllplanGeo.Point3D]],
                                                                          List[Tuple[str, AllplanGeo.Point3D]],
                                                                          List[Tuple[str, AllplanGeo.Point3D]]]:
   """
   Creation of the docking points

   Args:
      build_ele:        building element.
      doc:              input document
      placement_matrix: placement matrix

   Returns:
      created docking points as tuple with the point lists for the 2D, 3D and 2D3D view
   """

   ...

must be implemented in the py file of the PythonPart. These function must be used only for creating the docking points of the dynamic elements. For the creation of the docking points of the other elements, only the docking point key must be set.

The following example shows a PythonPart element with possible recesses a the left an right side. The docking point keys are represented by a unique name of the element and the point index, as shown in the figure. The number of docking points is reduced to the docking points that are still present in the case where a recess is missing.

../../_images/DockingPoints1.png

This allows to adjust the dimension lines in case of a missing recess like

../../_images/DockingPoints2.png

Example

An example of creating docking points is implemented in the following files

…\etc\Examples\PythonParts\BasisExamples\General\DockingPoints.pyp
…\etc\PythonPartsExampleScripts\BasisExamples\General\DockingPoints.py

To use the docking points, the following steps can be performed:

  • start Allplan and create a DockingPoints PythonPart

  • create associative dimension lines by using the docking points from the PythonPart

  • modify the created PythonPart by

  • modify size

  • modify element count

  • disable recess

  • after the modification, the associative dimension lines are adjusted