mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +00:00
tool.Ifc - add some doc-strings
This commit is contained in:
@@ -258,6 +258,7 @@ class Ifc(bonsai.core.tool.Ifc):
|
||||
|
||||
@classmethod
|
||||
def resolve_uri(cls, uri: str) -> str:
|
||||
"""Get absolute path based on the active IFC file."""
|
||||
if os.path.isabs(uri):
|
||||
return uri
|
||||
ifc_path = cls.get_path()
|
||||
@@ -267,6 +268,10 @@ class Ifc(bonsai.core.tool.Ifc):
|
||||
|
||||
@classmethod
|
||||
def get_uri(cls, uri: str | Path, use_relative_path: bool = False) -> str:
|
||||
"""Get path relative to the active IFC file, if `use_relative_path` is `True`.
|
||||
|
||||
If `use_relative_path` is `False` - get absolute filepath from uri.
|
||||
"""
|
||||
if not use_relative_path:
|
||||
return Path(uri).absolute().resolve().as_posix()
|
||||
uri = Path(uri)
|
||||
|
||||
Reference in New Issue
Block a user