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
| Name | Required | Description | Default |
|---|---|---|---|
| type_name | Yes | ||
| x | Yes | ||
| y | Yes | ||
| z | Yes | ||
| rotation | No | ||
| ctx | No |
Implementation Reference
- tools.py:474-527 (handler)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)}"