├── .npmignore ├── .gitignore ├── .github └── workflows │ └── test.yml ├── README.md ├── LICENSE.txt ├── lib ├── cli.ts └── comment.ts ├── package.json ├── test ├── comment-spec.ts └── examples │ ├── simple.ifc │ └── simple.expected.ifc └── tsconfig.json /.npmignore: -------------------------------------------------------------------------------- 1 | .github 2 | test 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | **/.DS_Store 3 | dist 4 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: npm test 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v1 12 | - name: Setup Node.js for use with actions 13 | uses: actions/setup-node@v1.1.0 14 | - name: Run npm install 15 | run: npm install --dev 16 | - name: Run npm test 17 | run: npm test 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IFC Commenter 2 | 3 | Generates comments containing the content of references making IFC files easier to manually review. 4 | 5 | ## Example 6 | 7 | ```ifc 8 | #71= IFCDERIVEDUNIT((#68,#69,#70),.THERMALTRANSMITTANCEUNIT.,$); 9 | #73= IFCDERIVEDUNITELEMENT(#43,3); 10 | ``` 11 | 12 | **Becomes**: 13 | 14 | ```ifc 15 | #71= IFCDERIVEDUNIT((#68,#69,#70),.THERMALTRANSMITTANCEUNIT.,$); 16 | /*#68= IFCDERIVEDUNITELEMENT(#59,1);*/ 17 | /*#59= IFCSIUNIT(*,.MASSUNIT.,.KILO.,.GRAM.);*/ 18 | /*#69= IFCDERIVEDUNITELEMENT(#66,-1);*/ 19 | /*#66= IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.KELVIN.);*/ 20 | /*#70= IFCDERIVEDUNITELEMENT(#64,-3);*/ 21 | /*#64= IFCSIUNIT(*,.TIMEUNIT.,$,.SECOND.);*/ 22 | #73= IFCDERIVEDUNITELEMENT(#43,3); 23 | /*#43= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);*/ 24 | ``` 25 | 26 | ## Installation 27 | 28 | Requires [node](https://nodejs.org) installed. 29 | 30 | ```sh 31 | npm install --global ifc-commenter 32 | 33 | ifc-commenter example.ifc 34 | ``` -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lib/cli.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import comment from './comment' 3 | import fs = require('fs') 4 | import yargs = require('yargs') 5 | 6 | const argv = yargs.argv 7 | 8 | const usage = () => { 9 | const message = [ 10 | 'Usage: ifc-commenter [options] filename', 11 | ' --indent indent to use between nested generated comments', 12 | ' --output write the output to a file rather than stdout' 13 | ].join('\n') 14 | 15 | console.error(message) 16 | } 17 | 18 | if (argv._.length !== 1) { 19 | usage() 20 | process.exit(1) 21 | } 22 | 23 | const filename = argv._[0] 24 | 25 | const readFile: () => string = () => { 26 | try { 27 | return fs.readFileSync(filename, 'utf8') 28 | } catch (err) { 29 | console.error(err) 30 | process.exit(1) 31 | } 32 | } 33 | 34 | const content = readFile() 35 | const indent = argv.indent as string || comment.defaultIndent 36 | const result = comment(content, indent) 37 | const outputFilename = argv.output as string 38 | 39 | if (outputFilename) { 40 | try { fs.writeFileSync(outputFilename, result) } catch (err) { 41 | console.error(err) 42 | process.exit(1) 43 | } 44 | } else { 45 | process.stdout.write(result) 46 | } 47 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ifc-commenter", 3 | "version": "1.0.2", 4 | "description": "Mark up IFC files", 5 | "main": "index.js", 6 | "scripts": { 7 | "lint": "standardx **/*.ts", 8 | "unit-test": "mocha -r ts-node/register 'test/**/*-spec.ts'", 9 | "test": "npm run lint && npm run compile && npm run unit-test", 10 | "format": "standardx --fix **/*.ts", 11 | "compile": "tsc -p .", 12 | "prepublish": "npm run compile" 13 | }, 14 | "bin": "./dist/lib/cli.js", 15 | "keywords": [ 16 | "ifc" 17 | ], 18 | "author": "David Padbury ", 19 | "license": "MIT", 20 | "devDependencies": { 21 | "@types/chai": "^4.2.7", 22 | "@types/diff": "^4.0.2", 23 | "@types/mocha": "^5.2.7", 24 | "@types/node": "^13.1.4", 25 | "@types/yargs": "^13.0.4", 26 | "@typescript-eslint/eslint-plugin": "^2.14.0", 27 | "@typescript-eslint/parser": "^2.14.0", 28 | "chai": "^4.2.0", 29 | "chalk": "^3.0.0", 30 | "diff": "^4.0.1", 31 | "mocha": "^6.2.2", 32 | "standardx": "^5.0.0", 33 | "ts-node": "^8.5.4", 34 | "typescript": "^3.7.4" 35 | }, 36 | "dependencies": { 37 | "detect-newline": "^3.1.0", 38 | "yargs": "^15.1.0" 39 | }, 40 | "eslintConfig": { 41 | "rules": { 42 | "no-unused-vars": "off", 43 | "@typescript-eslint/no-unused-vars": "error" 44 | } 45 | }, 46 | "standardx": { 47 | "parser": "@typescript-eslint/parser", 48 | "plugins": [ 49 | "@typescript-eslint/eslint-plugin" 50 | ], 51 | "env": [ 52 | "mocha" 53 | ] 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /test/comment-spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai' 2 | import comment from '../lib/comment' 3 | import { fail } from 'assert' 4 | import fs = require('fs') 5 | import path = require('path') 6 | import jsdiff = require('diff') 7 | import chalk = require('chalk') 8 | 9 | describe('comment', () => { 10 | describe('examples', () => { 11 | testExample('simple') 12 | 13 | function testExample (name: string) { 14 | it(`should produce expected output for ${name}.ifc`, () => { 15 | const input = readExample(`${name}.ifc`) 16 | const expected = readExample(`${name}.expected.ifc`) 17 | const output = comment(input) 18 | 19 | const diff = jsdiff.diffWords(expected, output) 20 | const differences = diff.filter(part => part.added || part.removed) 21 | 22 | if (differences.length > 0) { 23 | // print diff 24 | diff.forEach(part => { 25 | const color = part.added ? chalk.green : part.removed ? chalk.red : chalk.gray 26 | 27 | process.stderr.write(color(part.value)) 28 | }) 29 | 30 | fail('output produced was different to expected') 31 | } 32 | }) 33 | } 34 | }) 35 | 36 | it('should create a comment hierarchy', () => { 37 | const result = comment([ 38 | '#1 first line', 39 | '#2 second line #1' 40 | ].join('\n')) 41 | 42 | expect(result).to.be.eql([ 43 | '#1 first line', 44 | '#2 second line #1', 45 | ' /*#1 first line*/' 46 | ].join('\n')) 47 | }) 48 | 49 | it('should not match a line that does not start with an id', () => { 50 | const input = [ 51 | 'this is not an instruction #1 #2', 52 | '#2 another' 53 | ].join('\n') 54 | const result = comment(input) 55 | expect(result).to.be.eql(input) 56 | }) 57 | }) 58 | 59 | function readExample (filename: string) { 60 | return fs.readFileSync(path.join(__dirname, 'examples', filename), 'utf8') 61 | } 62 | -------------------------------------------------------------------------------- /test/examples/simple.ifc: -------------------------------------------------------------------------------- 1 | ISO-10303-21; 2 | HEADER; 3 | 4 | /****************************************************************************************** 5 | * STEP Physical File produced by: The EXPRESS Data Manager Version 5.02.0100.07 : 28 Aug 2013 6 | ******************************************************************************************/ 7 | FILE_DESCRIPTION(('ViewDefinition [CoordinationView_V2.0]'),'2;1'); 8 | FILE_NAME('Project Number','2020-01-03T11:54:50',(''),(''),'The EXPRESS Data Manager Version 5.02.0100.07 : 28 Aug 2013','20191031_1115(x64) - Exporter 20.1.0.1 - Alternate UI 20.1.0.1',''); 9 | FILE_SCHEMA(('IFC2X3')); 10 | ENDSEC; 11 | 12 | DATA; 13 | #1= IFCORGANIZATION($,'Autodesk Revit 2020 (ENU)',$,$,$); 14 | #5= IFCAPPLICATION(#1,'2020','Autodesk Revit 2020 (ENU)','Revit'); 15 | #6= IFCCARTESIANPOINT((0.,0.,0.)); 16 | #10= IFCCARTESIANPOINT((0.,0.)); 17 | #12= IFCDIRECTION((1.,0.,0.)); 18 | #14= IFCDIRECTION((-1.,0.,0.)); 19 | #16= IFCDIRECTION((0.,1.,0.)); 20 | #18= IFCDIRECTION((0.,-1.,0.)); 21 | #20= IFCDIRECTION((0.,0.,1.)); 22 | #22= IFCDIRECTION((0.,0.,-1.)); 23 | #24= IFCDIRECTION((1.,0.)); 24 | #26= IFCDIRECTION((-1.,0.)); 25 | #28= IFCDIRECTION((0.,1.)); 26 | #30= IFCDIRECTION((0.,-1.)); 27 | #32= IFCAXIS2PLACEMENT3D(#6,$,$); 28 | #33= IFCLOCALPLACEMENT(#154,#32); 29 | #38= IFCORGANIZATION($,'','',$,$); 30 | #39= IFCPERSONANDORGANIZATION(#36,#38,$); 31 | #42= IFCOWNERHISTORY(#39,#5,$,.NOCHANGE.,$,$,$,1578074068); 32 | #43= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.); 33 | #44= IFCDIMENSIONALEXPONENTS(1,0,0,0,0,0,0); 34 | #45= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.3048),#43); 35 | #46= IFCCONVERSIONBASEDUNIT(#44,.LENGTHUNIT.,'FOOT',#45); 36 | #47= IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.); 37 | #48= IFCDIMENSIONALEXPONENTS(2,0,0,0,0,0,0); 38 | #49= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.09290304),#47); 39 | #50= IFCCONVERSIONBASEDUNIT(#48,.AREAUNIT.,'SQUARE FOOT',#49); 40 | #51= IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.); 41 | #52= IFCDIMENSIONALEXPONENTS(3,0,0,0,0,0,0); 42 | #53= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.028316846592),#51); 43 | #54= IFCCONVERSIONBASEDUNIT(#52,.VOLUMEUNIT.,'CUBIC FOOT',#53); 44 | #55= IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.); 45 | #56= IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0); 46 | #57= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.0174532925199433),#55); 47 | #58= IFCCONVERSIONBASEDUNIT(#56,.PLANEANGLEUNIT.,'DEGREE',#57); 48 | #59= IFCSIUNIT(*,.MASSUNIT.,.KILO.,.GRAM.); 49 | #60= IFCDERIVEDUNITELEMENT(#59,1); 50 | #61= IFCDERIVEDUNITELEMENT(#43,-3); 51 | #62= IFCDERIVEDUNIT((#60,#61),.MASSDENSITYUNIT.,$); 52 | #64= IFCSIUNIT(*,.TIMEUNIT.,$,.SECOND.); 53 | #65= IFCSIUNIT(*,.FREQUENCYUNIT.,$,.HERTZ.); 54 | #66= IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.KELVIN.); 55 | #67= IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.DEGREE_CELSIUS.); 56 | #68= IFCDERIVEDUNITELEMENT(#59,1); 57 | #69= IFCDERIVEDUNITELEMENT(#66,-1); 58 | #70= IFCDERIVEDUNITELEMENT(#64,-3); 59 | #71= IFCDERIVEDUNIT((#68,#69,#70),.THERMALTRANSMITTANCEUNIT.,$); 60 | #73= IFCDERIVEDUNITELEMENT(#43,3); 61 | #74= IFCDERIVEDUNITELEMENT(#64,-1); 62 | #75= IFCDERIVEDUNIT((#73,#74),.VOLUMETRICFLOWRATEUNIT.,$); 63 | 64 | ENDSEC; 65 | 66 | END-ISO-10303-21; -------------------------------------------------------------------------------- /lib/comment.ts: -------------------------------------------------------------------------------- 1 | import detectNewLine = require('detect-newline') 2 | 3 | // pattern for extracting instruction ids 4 | const referencePattern = /#(\d+)/g 5 | 6 | const defaultIndent = ' ' 7 | comment.defaultIndent = defaultIndent 8 | 9 | /** 10 | * Append the IFS content supplied in `input` with comments of the instructions being referenced. 11 | * As there can be forward references we go over the input twice. 12 | * On the first we collect the id of the line (if specified), and all other instructions it references. 13 | * On the second we print each line and if it references any instructions, print their respective lines as comments. 14 | * If these comments reference other instructions we print as well with an additional indent. 15 | */ 16 | export default function comment (input: string, indent: string = defaultIndent): string { 17 | // in an attempt to support files created on windows try to guess at what the newline character of the content is 18 | // if none is found a unix newline will be assumed 19 | const newLine = detectNewLine.graceful(input) 20 | // split into individual lines (for the time being we assume instructions are not split between lines) 21 | const lines = input.split(newLine) 22 | // sparse array indexed by line number containing the instruction id that line contains 23 | const lineIds: Array = [] 24 | // sparse array indexed by id containing the line number of that instruction 25 | const idLines: Array = [] 26 | // map from instruction id to an array of instruction ids that the instruction referenced 27 | const references: Map> = new Map>() 28 | 29 | let output: string = '' 30 | 31 | // add a line to the output 32 | // prepend a new line if there has been prior output 33 | const appendLine = (() => { 34 | let first = true 35 | return (line: string) => { 36 | if (!first) output += newLine + line 37 | else { 38 | output = line 39 | first = false 40 | } 41 | } 42 | })() 43 | 44 | // first parse to index identifiers and references 45 | lines.forEach((text, index) => { 46 | // extract all ids from the line in the form #123 47 | const result = parseLine(text) 48 | 49 | if (!result) return 50 | 51 | lineIds[index] = result.id 52 | idLines[result.id] = index 53 | references.set(result.id, result.references) 54 | }) 55 | 56 | // second parse to build the output 57 | lines.forEach((line, index) => { 58 | // always just output the line as is 59 | appendLine(line) 60 | 61 | // if it's got a id, print the lines it references 62 | const id = lineIds[index] 63 | if (id) { 64 | printReferences(id) 65 | } 66 | }) 67 | 68 | /** 69 | * Print comments for the instructions this instruction references. 70 | * Depth indicates how much to indent the comments as we also print references 71 | * of references in a hierarchy. 72 | */ 73 | function printReferences (id: number, depth = 0) { 74 | // for each reference of this instruction 75 | (references.get(id) || []).forEach(ref => { 76 | // lookup the line text of the instruction 77 | const refLine = lines[idLines[ref]] 78 | 79 | if (!refLine) return 80 | 81 | // generate the indent 82 | let comment = '' 83 | for (let i = 0; i <= depth; i++) { 84 | comment += indent 85 | } 86 | // generate the comment 87 | comment = comment + `/*${refLine}*/` 88 | 89 | appendLine(comment) 90 | 91 | // do this recursively to build a hierarchy 92 | printReferences(ref, depth + 1) 93 | }) 94 | } 95 | 96 | return output 97 | } 98 | 99 | /** 100 | * Parse all instruction ids from line. 101 | */ 102 | function parseLine (line: string) { 103 | let id = null 104 | const references = [] 105 | 106 | let match = null 107 | while ((match = referencePattern.exec(line))) { 108 | if (id === null) { 109 | // if we're looking for an id for the line but don't find it on the first character 110 | // ignore parsing the entire line 111 | if (match.index !== 0) continue 112 | id = parseInt(match[1], 10) 113 | } else { 114 | references.push(parseInt(match[1], 10)) 115 | } 116 | } 117 | 118 | return id !== null ? { id, references } : null 119 | } 120 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Basic Options */ 4 | "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ 5 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ 6 | // "lib": [], /* Specify library files to be included in the compilation. */ 7 | // "allowJs": true, /* Allow javascript files to be compiled. */ 8 | // "checkJs": true, /* Report errors in .js files. */ 9 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 10 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 11 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 12 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 13 | // "outFile": "./", /* Concatenate and emit output to single file. */ 14 | "outDir": "./dist", /* Redirect output structure to the directory. */ 15 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 16 | // "composite": true, /* Enable project compilation */ 17 | // "removeComments": true, /* Do not emit comments to output. */ 18 | // "noEmit": true, /* Do not emit outputs. */ 19 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 20 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 21 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 22 | 23 | /* Strict Type-Checking Options */ 24 | "strict": true, /* Enable all strict type-checking options. */ 25 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 26 | // "strictNullChecks": true, /* Enable strict null checks. */ 27 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 28 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 29 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 30 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 31 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 32 | 33 | /* Additional Checks */ 34 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 35 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 36 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 37 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 38 | 39 | /* Module Resolution Options */ 40 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 41 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 42 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 43 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 44 | // "typeRoots": [], /* List of folders to include type definitions from. */ 45 | // "types": [], /* Type declaration files to be included in compilation. */ 46 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 47 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 48 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 49 | 50 | /* Source Map Options */ 51 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 52 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 53 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 54 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 55 | 56 | /* Experimental Options */ 57 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 58 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /test/examples/simple.expected.ifc: -------------------------------------------------------------------------------- 1 | ISO-10303-21; 2 | HEADER; 3 | 4 | /****************************************************************************************** 5 | * STEP Physical File produced by: The EXPRESS Data Manager Version 5.02.0100.07 : 28 Aug 2013 6 | ******************************************************************************************/ 7 | FILE_DESCRIPTION(('ViewDefinition [CoordinationView_V2.0]'),'2;1'); 8 | FILE_NAME('Project Number','2020-01-03T11:54:50',(''),(''),'The EXPRESS Data Manager Version 5.02.0100.07 : 28 Aug 2013','20191031_1115(x64) - Exporter 20.1.0.1 - Alternate UI 20.1.0.1',''); 9 | FILE_SCHEMA(('IFC2X3')); 10 | ENDSEC; 11 | 12 | DATA; 13 | #1= IFCORGANIZATION($,'Autodesk Revit 2020 (ENU)',$,$,$); 14 | #5= IFCAPPLICATION(#1,'2020','Autodesk Revit 2020 (ENU)','Revit'); 15 | /*#1= IFCORGANIZATION($,'Autodesk Revit 2020 (ENU)',$,$,$);*/ 16 | #6= IFCCARTESIANPOINT((0.,0.,0.)); 17 | #10= IFCCARTESIANPOINT((0.,0.)); 18 | #12= IFCDIRECTION((1.,0.,0.)); 19 | #14= IFCDIRECTION((-1.,0.,0.)); 20 | #16= IFCDIRECTION((0.,1.,0.)); 21 | #18= IFCDIRECTION((0.,-1.,0.)); 22 | #20= IFCDIRECTION((0.,0.,1.)); 23 | #22= IFCDIRECTION((0.,0.,-1.)); 24 | #24= IFCDIRECTION((1.,0.)); 25 | #26= IFCDIRECTION((-1.,0.)); 26 | #28= IFCDIRECTION((0.,1.)); 27 | #30= IFCDIRECTION((0.,-1.)); 28 | #32= IFCAXIS2PLACEMENT3D(#6,$,$); 29 | /*#6= IFCCARTESIANPOINT((0.,0.,0.));*/ 30 | #33= IFCLOCALPLACEMENT(#154,#32); 31 | /*#32= IFCAXIS2PLACEMENT3D(#6,$,$);*/ 32 | /*#6= IFCCARTESIANPOINT((0.,0.,0.));*/ 33 | #38= IFCORGANIZATION($,'','',$,$); 34 | #39= IFCPERSONANDORGANIZATION(#36,#38,$); 35 | /*#38= IFCORGANIZATION($,'','',$,$);*/ 36 | #42= IFCOWNERHISTORY(#39,#5,$,.NOCHANGE.,$,$,$,1578074068); 37 | /*#39= IFCPERSONANDORGANIZATION(#36,#38,$);*/ 38 | /*#38= IFCORGANIZATION($,'','',$,$);*/ 39 | /*#5= IFCAPPLICATION(#1,'2020','Autodesk Revit 2020 (ENU)','Revit');*/ 40 | /*#1= IFCORGANIZATION($,'Autodesk Revit 2020 (ENU)',$,$,$);*/ 41 | #43= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.); 42 | #44= IFCDIMENSIONALEXPONENTS(1,0,0,0,0,0,0); 43 | #45= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.3048),#43); 44 | /*#43= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);*/ 45 | #46= IFCCONVERSIONBASEDUNIT(#44,.LENGTHUNIT.,'FOOT',#45); 46 | /*#44= IFCDIMENSIONALEXPONENTS(1,0,0,0,0,0,0);*/ 47 | /*#45= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.3048),#43);*/ 48 | /*#43= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);*/ 49 | #47= IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.); 50 | #48= IFCDIMENSIONALEXPONENTS(2,0,0,0,0,0,0); 51 | #49= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.09290304),#47); 52 | /*#47= IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);*/ 53 | #50= IFCCONVERSIONBASEDUNIT(#48,.AREAUNIT.,'SQUARE FOOT',#49); 54 | /*#48= IFCDIMENSIONALEXPONENTS(2,0,0,0,0,0,0);*/ 55 | /*#49= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.09290304),#47);*/ 56 | /*#47= IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);*/ 57 | #51= IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.); 58 | #52= IFCDIMENSIONALEXPONENTS(3,0,0,0,0,0,0); 59 | #53= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.028316846592),#51); 60 | /*#51= IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);*/ 61 | #54= IFCCONVERSIONBASEDUNIT(#52,.VOLUMEUNIT.,'CUBIC FOOT',#53); 62 | /*#52= IFCDIMENSIONALEXPONENTS(3,0,0,0,0,0,0);*/ 63 | /*#53= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.028316846592),#51);*/ 64 | /*#51= IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);*/ 65 | #55= IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.); 66 | #56= IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0); 67 | #57= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.0174532925199433),#55); 68 | /*#55= IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);*/ 69 | #58= IFCCONVERSIONBASEDUNIT(#56,.PLANEANGLEUNIT.,'DEGREE',#57); 70 | /*#56= IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0);*/ 71 | /*#57= IFCMEASUREWITHUNIT(IFCRATIOMEASURE(0.0174532925199433),#55);*/ 72 | /*#55= IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);*/ 73 | #59= IFCSIUNIT(*,.MASSUNIT.,.KILO.,.GRAM.); 74 | #60= IFCDERIVEDUNITELEMENT(#59,1); 75 | /*#59= IFCSIUNIT(*,.MASSUNIT.,.KILO.,.GRAM.);*/ 76 | #61= IFCDERIVEDUNITELEMENT(#43,-3); 77 | /*#43= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);*/ 78 | #62= IFCDERIVEDUNIT((#60,#61),.MASSDENSITYUNIT.,$); 79 | /*#60= IFCDERIVEDUNITELEMENT(#59,1);*/ 80 | /*#59= IFCSIUNIT(*,.MASSUNIT.,.KILO.,.GRAM.);*/ 81 | /*#61= IFCDERIVEDUNITELEMENT(#43,-3);*/ 82 | /*#43= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);*/ 83 | #64= IFCSIUNIT(*,.TIMEUNIT.,$,.SECOND.); 84 | #65= IFCSIUNIT(*,.FREQUENCYUNIT.,$,.HERTZ.); 85 | #66= IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.KELVIN.); 86 | #67= IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.DEGREE_CELSIUS.); 87 | #68= IFCDERIVEDUNITELEMENT(#59,1); 88 | /*#59= IFCSIUNIT(*,.MASSUNIT.,.KILO.,.GRAM.);*/ 89 | #69= IFCDERIVEDUNITELEMENT(#66,-1); 90 | /*#66= IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.KELVIN.);*/ 91 | #70= IFCDERIVEDUNITELEMENT(#64,-3); 92 | /*#64= IFCSIUNIT(*,.TIMEUNIT.,$,.SECOND.);*/ 93 | #71= IFCDERIVEDUNIT((#68,#69,#70),.THERMALTRANSMITTANCEUNIT.,$); 94 | /*#68= IFCDERIVEDUNITELEMENT(#59,1);*/ 95 | /*#59= IFCSIUNIT(*,.MASSUNIT.,.KILO.,.GRAM.);*/ 96 | /*#69= IFCDERIVEDUNITELEMENT(#66,-1);*/ 97 | /*#66= IFCSIUNIT(*,.THERMODYNAMICTEMPERATUREUNIT.,$,.KELVIN.);*/ 98 | /*#70= IFCDERIVEDUNITELEMENT(#64,-3);*/ 99 | /*#64= IFCSIUNIT(*,.TIMEUNIT.,$,.SECOND.);*/ 100 | #73= IFCDERIVEDUNITELEMENT(#43,3); 101 | /*#43= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);*/ 102 | #74= IFCDERIVEDUNITELEMENT(#64,-1); 103 | /*#64= IFCSIUNIT(*,.TIMEUNIT.,$,.SECOND.);*/ 104 | #75= IFCDERIVEDUNIT((#73,#74),.VOLUMETRICFLOWRATEUNIT.,$); 105 | /*#73= IFCDERIVEDUNITELEMENT(#43,3);*/ 106 | /*#43= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);*/ 107 | /*#74= IFCDERIVEDUNITELEMENT(#64,-1);*/ 108 | /*#64= IFCSIUNIT(*,.TIMEUNIT.,$,.SECOND.);*/ 109 | 110 | ENDSEC; 111 | 112 | END-ISO-10303-21; --------------------------------------------------------------------------------