{"id":28254927,"url":"https://github.com/phi-ag/rvt","last_synced_at":"2026-03-03T07:45:33.775Z","repository":{"id":290609177,"uuid":"974973277","full_name":"phi-ag/rvt","owner":"phi-ag","description":"Parse Revit file format","archived":false,"fork":false,"pushed_at":"2025-06-14T00:30:37.000Z","size":170,"stargazers_count":2,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T01:28:55.910Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phi-ag.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-29T15:27:13.000Z","updated_at":"2025-06-07T01:15:27.000Z","dependencies_parsed_at":"2025-05-17T22:26:29.321Z","dependency_job_id":"45ab56c1-d8ca-4689-aeb8-efe3726f69af","html_url":"https://github.com/phi-ag/rvt","commit_stats":null,"previous_names":["phi-ag/rvt"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/phi-ag/rvt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phi-ag%2Frvt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phi-ag%2Frvt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phi-ag%2Frvt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phi-ag%2Frvt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phi-ag","download_url":"https://codeload.github.com/phi-ag/rvt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phi-ag%2Frvt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259746084,"owners_count":22905210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-19T20:16:28.772Z","updated_at":"2026-03-03T07:45:28.739Z","avatar_url":"https://github.com/phi-ag.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @phi-ag/rvt\n\n[![Version](https://img.shields.io/npm/v/%40phi-ag%2Frvt?style=for-the-badge\u0026color=blue)](https://www.npmjs.com/package/@phi-ag/rvt)\n[![Coverage](https://img.shields.io/codecov/c/github/phi-ag/rvt?style=for-the-badge)](https://app.codecov.io/github/phi-ag/rvt)\n[![Downloads](https://img.shields.io/npm/d18m/%40phi-ag%2Frvt?style=for-the-badge)](https://www.npmjs.com/package/@phi-ag/rvt)\n[![Size](https://img.shields.io/npm/unpacked-size/%40phi-ag%2Frvt?style=for-the-badge\u0026label=size\u0026color=lightgray)](https://www.npmjs.com/package/@phi-ag/rvt)\n\nParse Revit file format\n\n## Usage\n\n    pnpm add @phi-ag/rvt\n\n### Examples\n\nNode.js / Bun\n\n```ts\nimport { basicFileInfo, thumbnail } from \"@phi-ag/rvt\";\nimport { openPath } from \"@phi-ag/rvt/node\";\n\nconst file = await openPath(\"family.rfa\");\nconst info = await basicFileInfo(file);\nconst image = await thumbnail(file);\n\nconsole.log(info);\n```\n\nDeno\n\n```ts\nimport { basicFileInfo, thumbnail } from \"@phi-ag/rvt\";\nimport { openPath } from \"@phi-ag/rvt/deno\";\n\nusing file = await openPath(\"family.rfa\");\nconst info = await basicFileInfo(file.data);\nconst image = await thumbnail(file.data);\n\nconsole.log(info);\n```\n\nBrowser\n\n```ts\nimport { basicFileInfo, openFile, thumbnail } from \"@phi-ag/rvt\";\n\n// Get a file handle from \u003cinput type=\"file\" accept=\".rfa,.rvt\" /\u003e\n// see https://developer.mozilla.org/en-US/docs/Web/API/File_API/Using_files_from_web_applications\nconst selectedFile = document.getElementById(\"input\").files[0];\n\nconst file = await openFile(selectedFile);\nconst info = await basicFileInfo(file);\nconst image = await thumbnail(file);\n\nconsole.log(info);\n```\n\nIf you don't want to throw errors, use `tryOpenPath`, `tryOpenFile`, `tryBasicFileInfo` and `tryThumbnail`\n\n```ts\ntryOpenPath(\"valid.rvt\");\n// =\u003e { ok: true; data: ... }\n\ntryOpenPath(\"invalid.rvt\");\n// =\u003e { ok: false; error: \"Error message\" }\n\ntryBasicFileInfo(validFile);\n// =\u003e { ok: true; data: { version, build, ... } }\n\ntryBasicFileInfo(invalidFile);\n// =\u003e { ok: false; error: \"Error message\" }\n```\n\n## Development\n\nInstall [fnm](https://github.com/Schniz/fnm?tab=readme-ov-file#installation) or [nvm](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating) ([nvm-windows](https://github.com/coreybutler/nvm-windows?tab=readme-ov-file#installation--upgrades))\n\nInstall `Node.js`\n\n    fnm use\n\nInstall `pnpm`\n\n    corepack enable\n    corepack prepare --activate\n\nInstall packages\n\n    pnpm i\n\nWatch\n\n    pnpm dev\n\nTest\n\n    pnpm test\n\n## Reverse Engineering\n\nThe code in this repository was created through [clean-room reverse engineering](https://en.wikipedia.org/wiki/Clean-room_design).\n\n### Tools\n\n- [7zip](https://github.com/ip7z/7zip)\n- [binwalk](https://github.com/ReFirmLabs/binwalk)\n- Hex editor (eg. [ImHex](https://github.com/WerWolv/ImHex))\n\n### Example\n\n1. Pick a file you want to inspect. I'm using [racbasicsamplefamily-2026.rfa](examples/racbasicsamplefamily-2026.rfa) for this example.\n2. Extract the [Compound File Binary Format](https://en.wikipedia.org/wiki/Compound_File_Binary_Format) using `7z`.\n\n```\n7z x racbasicsamplefamily-2026.rfa\n\n.\n├── BasicFileInfo\n├── Contents\n├── Formats\n│   └── Latest\n├── Global\n│   ├── ContentDocuments\n│   ├── DocumentIncrementTable\n│   ├── ElemTable\n│   ├── History\n│   ├── Latest\n│   └── PartitionTable\n├── PartAtom\n├── Partitions\n│   └── 69\n├── RevitPreview4.0\n└── TransmissionData\n```\n\n3. Recursively analyze and extract data using `binwalk`.\n\n```\nbinwalk -Me Global/ElemTable\n\nextractions/\n├── ElemTable -\u003e /home/peter/rdp/family-2026/Global/ElemTable\n└── ElemTable.extracted\n    └── 8\n        └── decompressed.bin\n```\n\n4. Use a hex editor to inspect the data.\n\n```\nimhex extractions/ElemTable.extracted/8/decompressed.bin\n```\n\n5. Start to guess what the data could represent.\n\n```\nHex View 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n\n00000000 C9 05 C8 07 00 00 00 00 00 00 00 00 00 00 00 00 ................\n```\n\nAfter looking at a couple of files I'm thinking:\n\n- The first byte could indicate the file version, seems to be consistent for a given Revit version.\n- The second byte seems to be always `05`.\n- Interpreting the next 4 bytes `C8 07 00 00` as little-endian `int32` is `1992`.\n  - I believe this is the total amount of entries in this file.\n  - It seems strange that they are using `int32` for this value as they moved to `int64` element ids, see [64-Bit Element Ids, Maybe?](https://thebuildingcoder.typepad.com/blog/2022/11/64-bit-element-ids-maybe.html)\n- After the initial 6 bytes the file can be processed in 40 byte chunks (everything little-endian):\n  - Id: `int64`\n  - Unknown (1): `int32`\n  - Unknown (2): `int32`\n  - Unknown (3): `int32`\n  - Id (2): `int64` (seems to be always identical to the first id)\n  - Unknown (4): `int64`\n  - Unknown (5): `int32`\n\nThis is as far as I got for `ElemTable`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphi-ag%2Frvt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphi-ag%2Frvt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphi-ag%2Frvt/lists"}