list_ifc_entities
Extract and filter IFC entities by type from Blender models, optionally limiting results to selected objects, and output as JSON for streamlined analysis.
Instructions
List IFC entities of a specific type. Can be filtered to only include objects
currently selected in the Blender UI.
Args:
entity_type: Type of IFC entity to list (e.g., "IfcWall")
limit: Maximum number of entities to return
selected_only: If True, only return information about selected objects
Returns:
A JSON-formatted string listing the specified entities
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity_type | No | ||
| limit | No | ||
| selected_only | No |
Implementation Reference
- tools.py:301-327 (handler)The MCP tool handler implementation for 'list_ifc_entities'. This function registers the tool using @mcp.tool(), defines the input parameters (entity_type, limit, selected_only), connects to Blender via get_blender_connection(), sends the 'list_ifc_entities' command with parameters, and returns the JSON-formatted result or error message.@mcp.tool() def list_ifc_entities(entity_type: str | None = None, limit: int = 50, selected_only: bool = False) -> str: """ List IFC entities of a specific type. Can be filtered to only include objects currently selected in the Blender UI. Args: entity_type: Type of IFC entity to list (e.g., "IfcWall") limit: Maximum number of entities to return selected_only: If True, only return information about selected objects Returns: A JSON-formatted string listing the specified entities """ try: blender = get_blender_connection() result = blender.send_command("list_ifc_entities", { "entity_type": entity_type, "limit": limit, "selected_only": selected_only }) # Return the formatted JSON of the results return json.dumps(result, indent=2) except Exception as e: logger.error(f"Error listing IFC entities: {str(e)}") return f"Error listing IFC entities: {str(e)}"