Getting started with Webtools and OpenBIM

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
vanuan
Posts: 539
Joined: Wed Oct 24, 2018 9:49 pm

Getting started with Webtools and OpenBIM

Post by vanuan »

Has anybody been able to start Webtools and OpenBIM?

Here my adventure:

I've started bimserver in server mode in docker (this was a pain on its own). Created a project in it. Don't know whether I should create ifc3something or ifc4. Apparently ifc3something works better.
Next I've tried to save something. Turns out that I need ifcopenshell. After figuring out what it was, unpacked it into my freecad mod directory in home.
Next I've been hit by buiding part issue
Next thing I noticed it throws a stack trace when saving. Something like KeyError: 'result' in here:

WebTools/BIMServer.py

Line 337 in c1a2561

if resp.json()["response"]["result"]:

After fixing KeyError it started fail silently with "File upload failed", so not much help

After printing response I saw the error was something like "Checkin in progress, topicId: 35". Still don't know what it is. Checkin is some kind of locking mechanism so that nobody can upload new revisions while another is in progress. But BIMserver can't detect that checkin has failed. And I can't find any information on how to abort it or configure checkin timeout. And why checkin has failed?

Besides that it can't get a list of revisions. Something to do with "'ascii' codec can't decode byte ...".

Are any of those issues known? What's working? Is there any tutorial? Maybe it's just version incompatibility between WebTools and OpenBIM? I'm using latest of both.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Getting started with Webtools and OpenBIM

Post by yorik »

By openBIM, you mean the bimserver, right? Otherwise, please explain what it is :D

There is quite some time I didn't use the BimServer connection of FreeCAD, it might very well be a bit obsoleted :? and probably not fully working with python3 (the ascii/utf8/decoding issues are usually a symptom).

I'll try to give it a look this weekend...
User avatar
hlg
Posts: 39
Joined: Fri Jul 12, 2019 10:11 am

Re: Getting started with Webtools and OpenBIM

Post by hlg »

I have tested BIMserver connection yesterday and noticed a couple of issues which I have fixed (will submit a PR once finished). Among others, the BIMserver API for downloads has changed a while ago:
All the download* methods have been removed and replaced by one method called "download". (Source: BIMserver issue)
I have updated the JSON request accordingly, but the question is: Should webtools support pre-1.5 versions of BIMserver and keep alternative calls? @vanuan, which BIMserver version are you using?
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Getting started with Webtools and OpenBIM

Post by yorik »

Thanks for the update @hlg! Looking forward to it.
Since BIMServer is really made to be easy to upgrade, my opinion would be that we can drop support for earlier versions...
User avatar
hlg
Posts: 39
Joined: Fri Jul 12, 2019 10:11 am

Re: Getting started with Webtools and OpenBIM

Post by hlg »

PR is here: https://github.com/yorikvanhavre/WebTools/pull/6

I have encountered the following issues and possible improvements:

1. Currently, there seems to be no way to reload project and revision lists without reconnecting.
A reload button for the project list and reload of revisions upon change of project in the drop-down would come in handy.
Whenever a project is uploaded/exported from FreeCAD to BIMserver, revision list should be updated without explicite update trigger.

2. Feature suggestion: Use project name (with special char replacement) as default tempfile name suggestion. Change needs to be here: BIMServer.py:320 QtGui.QFileDialog.getSaveFileName directory parameter (3rd)

3. I noticed that the active document may be changed - or even worse, closed - while the BIMserver task panel is open. Thus the initial population of the root element for BIMserver upload may be obsolete by the time upload is executed. It would be better to populate or at least update the selection options at the time of export only. That would also allow the following: It should be possible to open the BIMserver task panel without a document open, since download/import from BIMserver would create a new document anyway.

4. Somewhat related to 3. but not an issue of Webtools: In IFC export (Arch module) in some places FreeCAD.ActiveDocument is used which may not be the same document as the hosting document of the feature(s) in exportlist parameter. This might result in errors or inconsistent export.

Shall I create issues in Github for these points?
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Getting started with Webtools and OpenBIM

Post by yorik »

These are all valid issues indeed.
It doesn't harm creating issues indeed, so they don't fall off the radar...
Post Reply