diff --git a/src/bcf/bcf/v2/topic.py b/src/bcf/bcf/v2/topic.py index 82f09c54a4..9617cb41bf 100644 --- a/src/bcf/bcf/v2/topic.py +++ b/src/bcf/bcf/v2/topic.py @@ -268,7 +268,7 @@ class TopicHandler: return outfile - def add_viewpoint(self, element: entity_instance) -> None: + def add_viewpoint(self, element: entity_instance) -> VisualizationInfoHandler: """Add a viewpoint pointed at the placement of an IFC element to the topic. Args: @@ -278,7 +278,9 @@ class TopicHandler: self.add_visinfo_handler(new_viewpoint) return new_viewpoint - def add_viewpoint_from_point_and_guids(self, position: NDArray[np.float64], *guids: str) -> None: + def add_viewpoint_from_point_and_guids( + self, position: NDArray[np.float64], *guids: str + ) -> VisualizationInfoHandler: """Add a viewpoint pointing at an XYZ point in space Args: diff --git a/src/bcf/bcf/v3/topic.py b/src/bcf/bcf/v3/topic.py index 44109a21db..47a37330b5 100644 --- a/src/bcf/bcf/v3/topic.py +++ b/src/bcf/bcf/v3/topic.py @@ -165,7 +165,7 @@ class TopicHandler: if self.bim_snippet: destination_zip.writestr(f"{self.topic.guid}/{ref_filename}", self.bim_snippet) - def add_viewpoint(self, element: entity_instance) -> None: + def add_viewpoint(self, element: entity_instance) -> VisualizationInfoHandler: """ Add a viewpoint tergeting an IFC element to the topic. @@ -174,8 +174,11 @@ class TopicHandler: """ new_viewpoint = VisualizationInfoHandler.create_new(element, self._xml_handler) self.add_visinfo_handler(new_viewpoint) + return new_viewpoint - def add_viewpoint_from_point_and_guids(self, position: NDArray[np.float64], *guids: str) -> None: + def add_viewpoint_from_point_and_guids( + self, position: NDArray[np.float64], *guids: str + ) -> VisualizationInfoHandler: """ Add a viewpoint tergeting an IFC element to the topic. @@ -186,6 +189,7 @@ class TopicHandler: position, *guids, xml_handler=self._xml_handler ) self.add_visinfo_handler(vi_handler) + return vi_handler def add_visinfo_handler(self, new_viewpoint: VisualizationInfoHandler) -> None: self.viewpoints[new_viewpoint.guid + ".bcfv"] = new_viewpoint