> For the complete documentation index, see [llms.txt](https://technical.geometrygym.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://technical.geometrygym.com/rhino-grasshopper/ifc/ifc-grasshopper/create-via-code.md).

# Create via Code

## Starting a Model

## Assigning Beams

{% tabs %}
{% tab title="Python" %}

```python
import clr
import sys

clr.AddReferenceToFileAndPath(r"C:\Program Files\Geometry Gym\Rhino7\ggRhinoIFC.dll")

import GeometryGym.Ifc as gg 

from System.Collections.Generic import List
from System import Guid
from Rhino.Geometry import Transform
from Rhino.Geometry import Point3d
from Rhino.Geometry import Vector3d
from Rhino.Geometry import Line
from Rhino.Geometry import Plane

ipe = "IPE300"
db = gg.DatabaseIfc(True,gg.ModelView.Ifc2x3Coordination) 

building = gg.IfcBuilding(db,"PythonBuilding")
project = gg.IfcProject(building,"PythonProject", gg.IfcUnitAssignment.Length.Millimetre)
s355 = gg.IfcMaterial(db,"S355JR") 
s355.Category = "STEEL"
profile = gg.IfcIShapeProfileDef(db,ipe,150,300,7.1,10.7)
profile.FilletRadius = 15
#ifcBeamTypeID = GuidEncoder.Encode(Guid("{FA07940E-19FC-417a-B7F1-09A0CCF39B74}")) 
#Can create a unique identifier if you wish else leave blank

materialProfile = gg.IfcMaterialProfile(ipe,s355,profile)

materialProfileUsage = gg.IfcMaterialProfileSetUsage(materialProfile)

#beamType = gg.IfcBeamType(ipe,mp,gg.IfcBeamTypeEnum.BEAM)
#ln = Line(Point3d(0,0,0),Point3d(1000,0,0)) 
#clipPlanes = List[Plane]()

#beam = gg.IfcBeamStandardCase(building,bt,ln,Vector3d.YAxis, gg.IfcCardinalPointReference.MID,clipPlanes)

axisPlacement = gg.IfcAxis2Placement3D(gg.IfcCartesianPoint(db,0,0,0),gg.IfcDirection(db,1,0,0),gg.IfcDirection(db,0,1,0))

beam = gg.IfcBeamStandardCase(building,materialProfileUsage,axisPlacement,1000)

a = db.ToString(gg.FormatIfcSerialization.STEP)
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://technical.geometrygym.com/rhino-grasshopper/ifc/ifc-grasshopper/create-via-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
