Skip to content

Commit a0f484a

Browse files
author
Wawan Solihin
committed
Fixed runtime issue due to incorrect IfcXML schema file path
1 parent 30e099f commit a0f484a

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Source/Revit.IFC.Common/Utility/IfcSchemaEntityTree.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,23 +145,23 @@ public static IDictionary<string, IfcSchemaEntityNode> GetEntityDictFor(string s
145145
if (string.IsNullOrEmpty(loadedIfcSchemaVersion) || !loadedIfcSchemaVersion.Equals(schemaFile, StringComparison.InvariantCultureIgnoreCase))
146146
{
147147
// Process IFCXml schema here, then search for IfcProduct and build TreeView beginning from that node. Allow checks for the tree nodes. Grey out (and Italic) the abstract entity
148-
schemaFile = Path.Combine(DirectoryUtil.RevitProgramPath, "EDM\\" + schemaFile);
149-
FileInfo schemaFileInfo = new FileInfo(schemaFile);
148+
string schemaFilePath = Path.Combine(DirectoryUtil.RevitProgramPath, "EDM\\" + schemaFile);
149+
FileInfo schemaFileInfo = new FileInfo(schemaFilePath);
150150
#if IFC_OPENSOURCE
151151
if (!schemaFileInfo.Exists)
152152
{
153153
// For the open source code, if the schema file is not found, search also from the IfcExporter install folder
154-
string schemaLoc = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetCallingAssembly().Location);
155-
schemaFile = Path.Combine(schemaLoc, schemaFile);
156-
schemaFileInfo = new FileInfo(schemaFile);
154+
string schemaLoc = Path.GetDirectoryName(System.Reflection.Assembly.GetCallingAssembly().Location);
155+
schemaFilePath = Path.Combine(schemaLoc, schemaFile);
156+
schemaFileInfo = new FileInfo(schemaFilePath);
157157
}
158158
#endif
159159
if (schemaFileInfo.Exists)
160160
{
161-
bool newLoad = ProcessIFCXMLSchema.ProcessIFCSchema(schemaFileInfo);
162-
if (newLoad)
163-
loadedIfcSchemaVersion = Path.GetFileName(schemaFile);
164-
}
161+
bool newLoad = ProcessIFCXMLSchema.ProcessIFCSchema(schemaFileInfo);
162+
if (newLoad)
163+
loadedIfcSchemaVersion = Path.GetFileName(schemaFile);
164+
}
165165
}
166166

167167
return EntityDict;

Source/Revit.IFC.Export/Exporter/Exporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ private string LocateSchemaFile(string schemaFileName)
986986
string filePath = null;
987987
#if IFC_OPENSOURCE
988988
// Find the alternate schema file from the open source install folder
989-
filePath = Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetCallingAssembly().Location), schemaFileName);
989+
filePath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), schemaFileName);
990990
if (!File.Exists(filePath))
991991
#endif
992992
{

Source/Revit.IFC.Export/Exporter/IFCEntityAndPsetList.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class IFCEntityAndPsetListRawFromJson
9898
/// </summary>
9999
public IFCCertifiedEntitiesAndPSets()
100100
{
101-
string fileLoc = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetCallingAssembly().Location);
101+
string fileLoc = Path.GetDirectoryName(System.Reflection.Assembly.GetCallingAssembly().Location);
102102
string filePath = Path.Combine(fileLoc, "IFCCertifiedEntitiesAndPSets.json");
103103

104104
if (File.Exists(filePath))

0 commit comments

Comments
 (0)