Skip to content

Commit 56c9004

Browse files
authored
Merge branch 'develop' into 3110-template-handling
2 parents 38fe936 + d36f8ff commit 56c9004

File tree

11 files changed

+1090
-471
lines changed

11 files changed

+1090
-471
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135

136136
- name: Sign files with Trusted Signing (DLLs and EXEs)
137137
if: (github.repository == env.MainRepo)
138-
uses: azure/trusted-signing-action@v1.0.0
138+
uses: azure/trusted-signing-action@v1.1.0
139139
with:
140140
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
141141
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
@@ -157,7 +157,7 @@ jobs:
157157
158158
- name: Sign files with Trusted Signing (installers)
159159
if: (github.repository == env.MainRepo)
160-
uses: azure/trusted-signing-action@v1.0.0
160+
uses: azure/trusted-signing-action@v1.1.0
161161
with:
162162
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
163163
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
@@ -174,7 +174,7 @@ jobs:
174174
timestamp-digest: SHA256
175175

176176
- name: Upload Installers
177-
uses: actions/upload-artifact@v6
177+
uses: actions/upload-artifact@v7
178178
with:
179179
name: pyrevit-installers
180180
path: |

Pipfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ verify_ssl = true
55

66
[dev-packages]
77
mypy = "*"
8-
pylint = "==4.0.4"
8+
pylint = "==4.0.5"
99

1010
[packages]
1111
docopt = "*"
1212
requests = "*"
1313
pygount = "*"
1414
pyyaml = ">=5.4"
1515
black = "*"
16-
setuptools = "==80.10.2"
16+
setuptools = "==82.0.0"
1717
mkdocs = "*"
1818
mkdocstrings = "*"
1919
mkdocstrings-python = "*"

Pipfile.lock

Lines changed: 238 additions & 322 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"IFCVersion": 21,
3+
"ExchangeRequirement": 3,
4+
"IFCFileType": 0,
5+
"ActivePhaseId": -1,
6+
"SpaceBoundaries": 0,
7+
"SplitWallsAndColumns": false,
8+
"IncludeSteelElements": true,
9+
"ProjectAddress": {
10+
"UpdateProjectInformation": false,
11+
"AssignAddressToSite": false,
12+
"AssignAddressToBuilding": true
13+
},
14+
"Export2DElements": false,
15+
"ExportLinkedFiles": 0,
16+
"VisibleElementsOfCurrentView": false,
17+
"ExportRoomsInView": false,
18+
"ExportInternalRevitPropertySets": false,
19+
"ExportIFCCommonPropertySets": true,
20+
"ExportBaseQuantities": false,
21+
"ExportMaterialPsets": false,
22+
"ExportSchedulesAsPsets": false,
23+
"ExportSpecificSchedules": false,
24+
"ExportUserDefinedPsets": false,
25+
"ExportUserDefinedParameterMapping": false,
26+
"ExportUserDefinedParameterMappingFileName": "",
27+
"ClassificationSettings": {
28+
"ClassificationName": null,
29+
"ClassificationEdition": null,
30+
"ClassificationSource": null,
31+
"ClassificationEditionDate": "\/Date(-62135596800000)\/",
32+
"ClassificationLocation": null,
33+
"ClassificationFieldName": null
34+
},
35+
"TessellationLevelOfDetail": 0.5,
36+
"ExportPartsAsBuildingElements": false,
37+
"ExportSolidModelRep": false,
38+
"UseActiveViewGeometry": false,
39+
"UseFamilyAndTypeNameForReference": false,
40+
"Use2DRoomBoundaryForVolume": false,
41+
"IncludeSiteElevation": false,
42+
"StoreIFCGUID": false,
43+
"ExportBoundingBox": false,
44+
"UseOnlyTriangulation": false,
45+
"UseTypeNameOnlyForIfcType": false,
46+
"UseVisibleRevitNameAsEntityName": false,
47+
"SelectedSite": "Default Site",
48+
"SitePlacement": 0,
49+
"GeoRefCRSName": "",
50+
"GeoRefCRSDesc": "",
51+
"GeoRefEPSGCode": "",
52+
"GeoRefGeodeticDatum": "",
53+
"GeoRefMapUnit": "",
54+
"ExcludeFilter": "",
55+
"COBieCompanyInfo": "",
56+
"COBieProjectInfo": "",
57+
"Name": "IFC Configuration_sample"
58+
}
743 Bytes
Loading
600 Bytes
Loading
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
IFC Export Demo
4+
---------------
5+
Demonstrates ifc_export.py from the pyRevit developer tab.
6+
Run from within an open Revit document.
7+
"""
8+
9+
import os
10+
from pyrevit import forms, script, revit, EXEC_PARAMS
11+
from pyrevit.interop.ifc import IFCExporter
12+
13+
output = script.get_output()
14+
doc = revit.doc
15+
16+
# ---------------------------------------------------------------------------
17+
# Pick an output folder
18+
# ---------------------------------------------------------------------------
19+
folder = forms.pick_folder(title="Select IFC output folder")
20+
if not folder:
21+
script.exit()
22+
23+
filename = "{}.ifc".format(doc.Title)
24+
25+
# ---------------------------------------------------------------------------
26+
# Optionally load a config file - skip to use defaults
27+
# ---------------------------------------------------------------------------
28+
use_config = forms.alert(
29+
"Load a Revit IFC configuration JSON file?\n\n"
30+
"Click Yes to browse, No to use built-in defaults.",
31+
yes=True,
32+
no=True,
33+
)
34+
35+
config_path = None
36+
if use_config:
37+
config_path = forms.pick_file(
38+
file_ext="json",
39+
init_dir=EXEC_PARAMS.command_path,
40+
title="Select IFC Configuration JSON",
41+
)
42+
43+
# ---------------------------------------------------------------------------
44+
# Runtime overrides - edit these to test specific options
45+
# ---------------------------------------------------------------------------
46+
overrides = {
47+
"SplitWallsAndColumns": False,
48+
"ExportIFCCommonPropertySets": True,
49+
"ExportBaseQuantities": False,
50+
"TessellationLevelOfDetail": 0.5, # comma bug handled automatically
51+
"VisibleElementsOfCurrentView": False,
52+
"SitePlacement": 0, # 0=SharedCoordinates
53+
}
54+
55+
# ---------------------------------------------------------------------------
56+
# Preview what options will be applied
57+
# ---------------------------------------------------------------------------
58+
output.print_md("## IFC Export Demo")
59+
output.print_md("**Document:** `{}`".format(doc.Title))
60+
output.print_md("**Output:** `{}`".format(os.path.join(folder, filename)))
61+
if config_path:
62+
output.print_md("**Config:** `{}`".format(config_path))
63+
else:
64+
output.print_md("**Config:** defaults only")
65+
66+
output.print_md("**Runtime overrides:**")
67+
for k, v in sorted(overrides.items()):
68+
output.print_md("- `{}` = `{}`".format(k, v))
69+
70+
# ---------------------------------------------------------------------------
71+
# Run the export
72+
# ---------------------------------------------------------------------------
73+
exporter = IFCExporter(doc)
74+
75+
try:
76+
# IFC Exports have to happen in a Transaction. To avoid changes it can also be rolled back afterwards.
77+
with revit.Transaction("IFC Export"):
78+
success = exporter.export(
79+
folder=folder,
80+
filename=filename,
81+
config_path=config_path,
82+
overrides=overrides,
83+
)
84+
if success:
85+
output.print_md("---\n**Export complete.**")
86+
forms.alert(
87+
"IFC exported successfully.\n\n{}".format(os.path.join(folder, filename)),
88+
title="Done",
89+
)
90+
else:
91+
output.print_md("---\n**Export returned False — check Revit journal.**")
92+
forms.alert(
93+
"Export returned False.\nCheck the Revit journal file for details.",
94+
title="Export failed",
95+
warn_icon=True,
96+
)
97+
98+
except Exception as ex:
99+
output.print_md("---\n**Error:** `{}`".format(str(ex)))
100+
forms.alert("Export error:\n\n{}".format(str(ex)), title="Error", warn_icon=True)
101+
raise

extensions/pyRevitDevTools.extension/pyRevitDev.tab/Developer Examples.panel/bundle.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ layout:
1111
- Inspect IExporter
1212
- DirectContext3D
1313
- Settings Window
14-
- Modeless
14+
- Modeless
15+
- ExportIFC

0 commit comments

Comments
 (0)