Skip to main content
Glama

georeference_ifc_model

Assign geographic coordinates to IFC building models by creating or updating coordinate reference systems and map conversions for accurate location positioning.

Instructions

Georeferences the IFC currently opened in Bonsai/BlenderBIM by creating or updating IfcProjectedCRS and IfcMapConversion. Optionally updates IfcSite and writes the file to disk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
crs_modeYes
epsgNo
crs_nameNo
geodetic_datumNo
map_projectionNo
map_zoneNo
eastingsNo
northingsNo
orthogonal_heightNo
scaleNo
x_axis_abscissaNo
x_axis_ordinateNo
true_north_azimuth_degNo
context_filterNoModel
context_indexNo
site_ref_latitudeNo
site_ref_longitudeNo
site_ref_elevationNo
site_ref_latitude_ddNo
site_ref_longitude_ddNo
overwriteNo
dry_runNo
write_pathNo

Implementation Reference

  • The handler function for the 'georeference_ifc_model' tool. It collects georeferencing parameters, filters out None values, and forwards them as a command to the Blender addon via the socket connection for actual IFC model georeferencing.
    def georeference_ifc_model(
        crs_mode: str,
        epsg: int = None,
        crs_name: str = None,
        geodetic_datum: str = None,
        map_projection: str = None,
        map_zone: str = None,
        eastings: float = None,
        northings: float = None,
        orthogonal_height: float = 0.0,
        scale: float = 1.0,
        x_axis_abscissa: float = None,
        x_axis_ordinate: float = None,
        true_north_azimuth_deg: float = None,
        context_filter: str = "Model",
        context_index: int = None,
        site_ref_latitude: list = None,      # [deg, min, sec, millionth]
        site_ref_longitude: list = None,     # [deg, min, sec, millionth]
        site_ref_elevation: float = None,
        site_ref_latitude_dd: float = None,  # Decimal degrees (optional)
        site_ref_longitude_dd: float = None, # Decimal degrees (optional)
        overwrite: bool = False,
        dry_run: bool = False,
        write_path: str = None,
    ) -> str:
        """
        Georeferences the IFC currently opened in Bonsai/BlenderBIM by creating or 
        updating IfcProjectedCRS and IfcMapConversion. Optionally updates IfcSite 
        and writes the file to disk.
        """
        import json
        blender = get_blender_connection()
    
        # Build params excluding None values to keep the payload clean
        params = {
            "crs_mode": crs_mode,
            "epsg": epsg,
            "crs_name": crs_name,
            "geodetic_datum": geodetic_datum,
            "map_projection": map_projection,
            "map_zone": map_zone,
            "eastings": eastings,
            "northings": northings,
            "orthogonal_height": orthogonal_height,
            "scale": scale,
            "x_axis_abscissa": x_axis_abscissa,
            "x_axis_ordinate": x_axis_ordinate,
            "true_north_azimuth_deg": true_north_azimuth_deg,
            "context_filter": context_filter,
            "context_index": context_index,
            "site_ref_latitude": site_ref_latitude,
            "site_ref_longitude": site_ref_longitude,
            "site_ref_elevation": site_ref_elevation,
            "site_ref_latitude_dd": site_ref_latitude_dd,
            "site_ref_longitude_dd": site_ref_longitude_dd,
            "overwrite": overwrite,
            "dry_run": dry_run,
            "write_path": write_path,
        }
        params = {k: v for k, v in params.items() if v is not None}
    
        try:
            result = blender.send_command("georeference_ifc_model", params)
            return json.dumps(result, ensure_ascii=False, indent=2)
        except Exception as e:
            logger.exception("georeference_ifc_model error")
            return json.dumps(
                {"success": False, "error": "Could not georeference the model.", "details": str(e)},
                ensure_ascii=False,
                indent=2,
            )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/JotaDeRodriguez/Bonsai_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server