mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
typing
This commit is contained in:
@@ -17,9 +17,12 @@
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ifcopenshell.util.unit
|
||||
from typing import Optional
|
||||
|
||||
|
||||
def add_arbitrary_profile(file, profile=None, name=None) -> None:
|
||||
def add_arbitrary_profile(
|
||||
file: ifcopenshell.file, profile: list[tuple[float, float]], name: Optional[str] = None
|
||||
) -> ifcopenshell.entity_instance:
|
||||
"""Adds a new arbitrary polyline-based profile
|
||||
|
||||
The profile is represented as a polyline defined by a list of
|
||||
@@ -30,7 +33,7 @@ def add_arbitrary_profile(file, profile=None, name=None) -> None:
|
||||
identical.
|
||||
|
||||
:param profile: A list of coordinates
|
||||
:type profile: list[list[float]]
|
||||
:type profile: list[tuple[float, float]]
|
||||
:param name: If the profile is semantically significant (i.e. to be
|
||||
managed and reused by the user) then it must be named. Otherwise,
|
||||
this may be left as none.
|
||||
|
||||
+9
-3
@@ -17,9 +17,15 @@
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ifcopenshell.util.unit
|
||||
from typing import Optional
|
||||
|
||||
|
||||
def add_arbitrary_profile_with_voids(file, outer_profile=None, inner_profiles=None, name=None) -> None:
|
||||
def add_arbitrary_profile_with_voids(
|
||||
file: ifcopenshell.file,
|
||||
outer_profile: list[tuple[float, float]],
|
||||
inner_profiles: list[list[tuple[float, float]]],
|
||||
name: Optional[str] = None,
|
||||
) -> ifcopenshell.entity_instance:
|
||||
"""Adds a new arbitrary polyline-based profile with voids
|
||||
|
||||
The outer profile is represented as a polyline defined by a list of
|
||||
@@ -35,9 +41,9 @@ def add_arbitrary_profile_with_voids(file, outer_profile=None, inner_profiles=No
|
||||
provided in SI meters.
|
||||
|
||||
:param outer_profile: A list of coordinates
|
||||
:type profile: list[float]
|
||||
:type profile: list[tuple[float, float]]
|
||||
:param inner_profiles: A list of polylines
|
||||
:type profile: list[list[float]]
|
||||
:type profile: list[list[tuple[float, float]]]
|
||||
:param name: If the profile is semantically significant (i.e. to be
|
||||
managed and reused by the user) then it must be named. Otherwise,
|
||||
this may be left as none.
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
import ifcopenshell
|
||||
|
||||
|
||||
def add_parameterized_profile(file, ifc_class=None) -> None:
|
||||
def add_parameterized_profile(file: ifcopenshell.file, ifc_class: str) -> ifcopenshell.entity_instance:
|
||||
"""Adds a new parameterised profile
|
||||
|
||||
IFC offers parameterised profiles for common standardised hot roll
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
import ifcopenshell
|
||||
from typing import Any
|
||||
|
||||
|
||||
def edit_profile(file, profile=None, attributes=None) -> None:
|
||||
def edit_profile(file: ifcopenshell.file, profile: ifcopenshell.entity_instance, attributes: dict[str, Any]) -> None:
|
||||
"""Edits the attributes of an IfcProfileDef
|
||||
|
||||
For more information about the attributes and data types of an
|
||||
@@ -26,7 +28,7 @@ def edit_profile(file, profile=None, attributes=None) -> None:
|
||||
:param profile: The IfcProfileDef entity you want to edit
|
||||
:type profile: ifcopenshell.entity_instance
|
||||
:param attributes: a dictionary of attribute names and values.
|
||||
:type attributes: dict, optional
|
||||
:type attributes: dict
|
||||
:return: None
|
||||
:rtype: None
|
||||
|
||||
@@ -41,7 +43,7 @@ def edit_profile(file, profile=None, attributes=None) -> None:
|
||||
ifcopenshell.api.run("profile.edit_profile", model,
|
||||
profile=circle, attributes={"ProfileName": "1000mm Dia"})
|
||||
"""
|
||||
settings = {"profile": profile, "attributes": attributes or {}}
|
||||
settings = {"profile": profile, "attributes": attributes}
|
||||
|
||||
for name, value in settings["attributes"].items():
|
||||
setattr(settings["profile"], name, value)
|
||||
|
||||
@@ -20,7 +20,7 @@ import ifcopenshell
|
||||
import ifcopenshell.util.element
|
||||
|
||||
|
||||
def remove_profile(file, profile=None) -> None:
|
||||
def remove_profile(file: ifcopenshell.file, profile: ifcopenshell.entity_instance) -> None:
|
||||
"""Removes a profile
|
||||
|
||||
:param profile: The IfcProfileDef to remove.
|
||||
|
||||
Reference in New Issue
Block a user