Generates comments containing the content of references making IFC files easier to manually review.
#71= IFCDERIVEDUNIT((#68,#69,#70),.THERMALTRANSMITTANCEUNIT.,$);
#73= IFCDERIVEDUNITELEMENT(#43,3);
Becomes:
#71= IFCDERIVEDUNIT((#68,#69,#70),.THERMALTRANSMITTANCEUNIT.,$);
/*#68= IFCDERIVEDUNITELEMENT(#59,1);*/
/*#59= IFCSIUNIT(*,.MASSUNIT.,.KILO.,.GRAM.);*/
/*#69= IFCDERIVEDUNITELEMENT(#66,-1);*/
/*#66= IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.KELVIN.);*/
/*#70= IFCDERIVEDUNITELEMENT(#64,-3);*/
/*#64= IFCSIUNIT(*,.TIMEUNIT.,$,.SECOND.);*/
#73= IFCDERIVEDUNITELEMENT(#43,3);
/*#43= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);*/
Requires node installed.
npm install --global ifc-commenter
ifc-commenter example.ifcTo export out a commented file:
ifc-commenter example.ifc --output example_commented_.ifc
The file name(s) should not have any spaces.
- 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
_commentedsuffix.
@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
-
Save the Batch Script: Save this script with a
.batextension, for example,ifc-commenter-script.bat. -
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, typeregedit, and press Enter). -
Navigate to
HKEY_CLASSES_ROOT\*\shell. -
Right-click on
shell, selectNew -> Key, and name it something likeIFC Commenter. -
Right-click on the new key (
IFC Commenter), selectNew -> Key, and name itcommand. -
Set the value of the
(Default)entry in thecommandkey to the path of your batch script with%1as 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.