mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 11:24:19 +00:00
typing
This commit is contained in:
@@ -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 Optional
|
||||
|
||||
|
||||
def add_layer(file, Name=None) -> None:
|
||||
def add_layer(file: ifcopenshell.file, Name: Optional[str] = None) -> ifcopenshell.entity_instance:
|
||||
"""Adds a new layer
|
||||
|
||||
An IFC layer is like a CAD layer. Portions of an object's geometry
|
||||
@@ -41,6 +43,4 @@ def add_layer(file, Name=None) -> None:
|
||||
|
||||
ifcopenshell.api.run("layer.add_layer", model, Name="AI-WALL-FULL-DIMS-N")
|
||||
"""
|
||||
settings = {"Name": Name or "Unnamed"}
|
||||
|
||||
return file.create_entity("IfcPresentationLayerAssignment", Name=settings["Name"])
|
||||
return file.create_entity("IfcPresentationLayerAssignment", Name=Name)
|
||||
|
||||
Reference in New Issue
Block a user