Check if file path exists and if it's an IFC file. If `filepath` is not provided, will use filepath property from the current operator.
(self, filepath: Optional[str] = None)
| 69 | use_relative_path: bool |
| 70 | |
| 71 | def is_existing_ifc_file(self, filepath: Optional[str] = None) -> bool: |
| 72 | """Check if file path exists and if it's an IFC file. |
| 73 | |
| 74 | If `filepath` is not provided, will use filepath property from the current operator. |
| 75 | """ |
| 76 | if filepath is None: |
| 77 | path = self.get_filepath_abs() |
| 78 | else: |
| 79 | path = Path(filepath) |
| 80 | return path.exists() and path.is_file() and "ifc" in path.suffix.lower() |
| 81 | |
| 82 | def get_filepath_abs(self) -> Path: |
| 83 | # self.filepath filled by fileselect_add is absolute |
no test coverage detected