IfcStore.Create() throws "The path is not in a valid format." exception
Hi XBim team.
On one of the computers I am getting "The path is not in a valid format." exception during IFC generation. Code line which throws this exception is following:
using (var ifcStore = IfcStore.Create(filePath, IFCParts4x3.GetCredentials(), XbimSchemaVersion.Ifc4x3))
I have looked into the XBim library and it ends in the following constructor:
/// <summary> /// Constructor used to create a new persistent model with specified path /// </summary> /// <param name="filepath"></param> /// <param name="ifcVersion"></param> /// <param name="editorDetails"></param> protected IfcStore(string filepath, XbimSchemaVersion ifcVersion, XbimEditorCredentials editorDetails) : this() { var model = ModelProvider.Create(ifcVersion, filepath); AssignModel(model, editorDetails, ifcVersion); }
Any idea how to solve/overcome this ussue?
Thanks for your work.
Best,
Ondřej
Are you using the Toolkit in environment other than Windows?
@martin1cerny no, it is in windows environment.
What is the value of filePath?
It is not fixed. It depends on the user and his/her input. Generally, it is valid folder somewhere on the PC (e.g. desktop or save folder, user folder or project folder). I have also tried this overload for IfcStore.Create but with same error:
using (var ifcStore = IfcStore.Create(IFCParts4x3.GetCredentials(), XbimSchemaVersion.Ifc4x3, XbimStoreType.InMemoryModel))
Can we see a stack trace / error message? This is really simple code so it's hard to see where it's going wrong. I've added a test case to demo this working. My guess is some kind of missing dependency/environmental issue.
Your best bet is to share a full reproduction we can take a look at - including the project file.
That would be a problem. It happens at one of my customers machine. On the others it does work... So on my. If I put my code into a try except statement, it raises error message as mentioned above. Is there another possibility to gain more info?
Sorry there's really not a lot to go on if that's the case. Can you maybe get some logs from the customer machine - with stack traces? If you can log the exception it would be helpful.
Without that, the error message "The path is not in a valid format." is not one I recognise from xbim Toolkit or .net so I can't make any suggestions.