Skip to main content
Glama

place_ifc_object

Position IFC building model elements at specific coordinates with optional rotation to construct or modify architectural designs.

Instructions

Place an IFC object at a specified location with optional rotation. This tool allows you to create and position IFC elements in the model. The object is placed using the specified IFC type and positioned at the given coordinates with optional rotation around the Z axis. Args: type_name: Name of the IFC element type to place (must exist in the model) x: X-coordinate in model space y: Y-coordinate in model space z: Z-coordinate in model space rotation: Rotation angle in degrees around the Z axis (default: 0) Returns: A message with the result of the placement operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
type_nameYes
xYes
yYes
zYes
rotationNo
ctxNo

Implementation Reference

  • The main handler function for the 'place_ifc_object' MCP tool. It connects to Blender via socket, sends the placement parameters (type_name, location [x,y,z], rotation) using the 'place_ifc_object' command, and processes the response into a user-friendly message including the new object's Blender name and Global ID if successful.
    @mcp.tool() def place_ifc_object( type_name: str, x: float, y: float, z: float, rotation: float = 0.0, ctx: Context| None = None ) -> str: """ Place an IFC object at a specified location with optional rotation. This tool allows you to create and position IFC elements in the model. The object is placed using the specified IFC type and positioned at the given coordinates with optional rotation around the Z axis. Args: type_name: Name of the IFC element type to place (must exist in the model) x: X-coordinate in model space y: Y-coordinate in model space z: Z-coordinate in model space rotation: Rotation angle in degrees around the Z axis (default: 0) Returns: A message with the result of the placement operation """ try: # Get Blender connection blender = get_blender_connection() # Send command to place the object result = blender.send_command("place_ifc_object", { "type_name": type_name, "location": [x, y, z], "rotation": rotation }) # Check for errors if isinstance(result, dict) and "error" in result: return f"Error placing object: {result['error']}" # Format success message if isinstance(result, dict) and result.get("success"): return (f"Successfully placed '{type_name}' object at ({x}, {y}, {z}) " f"with {rotation}° rotation.\nObject name: {result.get('blender_name')}, " f"Global ID: {result.get('global_id')}") # Return the raw result as string if it's not a success or error dict return f"Placement result: {json.dumps(result, indent=2)}" except Exception as e: logger.error(f"Error placing IFC object: {str(e)}") return f"Error placing IFC object: {str(e)}"

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