IFC-commenter

Some peeps might like this utility.
https://github.com/OpeningDesign/ifc-commenter
It comments out an IFC like the following, so you can dissect it.
Helps me understand IFC structure, and troubleshoot IFC files.

brunopostleCoenCadGirubruno_perdigao

Comments

  • edited June 2024

    With the help of chatgpt. The following Windows shell script allows you to right-click on an .ifc, and convert it to a commented .ifc file.

    1. Create a Batch Script: First, create a batch script that will take a file as input, run your command, and output the result with the _commented suffix.
        @echo off
        setlocal
    
        rem Get the input file path
        set "inputFile=%~1"
    
        rem Get the directory and filename without extension
        set "directory=%~dp1"
        set "filename=%~n1"
    
        rem Set the output file path
        set "outputFile=%directory%%filename%_commented.ifc"
    
        rem Run the command
        ifc-commenter "%inputFile%" --output "%outputFile%"
    
        endlocal
    
    1. Save the Batch Script: Save this script with a .bat extension, for example, ifc-commenter-script.bat.

    2. Add the Script to the Context Menu: To add this script to the right-click context menu, you need to add an entry to the Windows Registry.

      • Open the Registry Editor (press Win + R, type regedit, and press Enter).
      • Navigate to HKEY_CLASSES_ROOT\*\shell.
      • Right-click on shell, select New -> Key, and name it something like IFC Commenter.
      • Right-click on the new key (IFC Commenter), select New -> Key, and name it command.
      • Set the value of the (Default) entry in the command key to the path of your batch script with %1 as an argument. For example:

        "C:\path\to\your\script\ifc-commenter-script.bat" "%1"

    After these steps, when you right-click on an .ifc file, you should see an option called IFC Commenter in the context menu. Selecting this option will run the batch script, which in turn will run your command and generate the output file with the _commented suffix.

    MassimocarlopavAce
Sign In or Register to comment.