Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INQ: Help Needed Configuring IfcTemplate and Mapping Table for Import Process #826

Open
Florian-Schaefer-TinLine opened this issue Nov 29, 2024 · 0 comments
Labels
inquiry An information request from end user that is not an Enhancement Request or Problem Report

Comments

@Florian-Schaefer-TinLine
Copy link

Florian-Schaefer-TinLine commented Nov 29, 2024

Inquiry description

I’m trying to configure the IfcTemplate and the Mapping table for the IFC import from code in my Revit Addin. Below is my current implementation for linking an IFC file. Using the Importer.

Could you please provide guidance or examples on how to properly configure the IfcTemplate and Mapping table for the IFC import? Any sample configurations or references to relevant documentation would be highly appreciated.

public bool CreateIfcLink(Document doc, string ifcPath)
{
       bool rc = false;

        IDictionary<string, string> options
            = new Dictionary<string, string>();

        options["Action"] = "Link"; 
        options["Intent"] = "Reference"; 

        Importer importer = Importer.CreateImporter(
            doc, ifcPath, options);


        try
        {
            importer.ReferenceIFC(doc, ifcPath);
            rc = true;
        }
        catch (Exception ex)
        {
            _logService.LogError(ex.Message);
            if (null != Importer.TheLog)
                Importer.TheLog.LogError(
                    -1, ex.Message, false);
        }
        finally
        {
            if (null != Importer.TheLog)
                Importer.TheLog.Close();
            if (null != IFCImportFile.TheFile)
                IFCImportFile.TheFile.Close();
        }

        return rc;
}

Revit Version

2024.0.x

IFC for Revit Addon Version

24.x.x

Windows Version

11 22H2

@Florian-Schaefer-TinLine Florian-Schaefer-TinLine added the inquiry An information request from end user that is not an Enhancement Request or Problem Report label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inquiry An information request from end user that is not an Enhancement Request or Problem Report
Projects
None yet
Development

No branches or pull requests

1 participant