Hello,
I am in charge of developping a PythonPart whose goal is to verify if the elements designed in a drawing file belongs to the right sub-part of the building (aka Batch) they pretend to be in.
For this, an attribute (Batch attribute) on each element is containing the Batch name, while Batches are designed in another drawing file as 3D objects.
The idea is to join each controlled element to its respective Batch using the Batch attribute value and to verify if the volume of the element is contained in the volume of the Batch.
At now, for doing this, I am using the following code (summarily...) based on using GetMinMaxBox function:
# Getting MinMaxBox of Batch to control towards elements
min_max_batch = AllplanBaseElements.GetMinMaxBox(self.batch_volumes, 0.0, True)
for element_to_control in elements:
...ele_list = AllplanElementAdapter.BaseElementAdapterList()
...ele_list.append(element_to_control)
...# Getting MinMaxBox of each individual element
...min_max_element = AllplanBaseElements.GetMinMaxBox(ele_list, 0.0, True)
...if not min_max_batch.IsContaining(min_max_element):
......logger.error(f"Element {comp_id} / {name} : Not contained inside {self.batch} 3D Volume")
This is operating but my concern is that while this is working on PythonParts (anchor plates, ...) this is not working on elements such as walls, slabs, beams.
You can see in attached files an exerpt of the model (in blue the Batch 3D volume in Animation and Wireframe mode) where the two walls are said 'not contained' while the two anchor plates are 'contained'.
Is there a particular restriction in using the GetMinMaxBox function, or is it simply not applicable to walls, slabs, etc.
In such a case, what would be the best way to make this control to any kind of element ?
Best regards.