Open alilouchka opened 6 years ago
I ran into the same type of error while trying to execute the example_BIMServer.html demo.
While debugging in dev tools, it looks like the BimServerClient and the BimServerApiPromise constructors lie in the default attribute of the module returned by the promise. so to make it work my lines 53 and 54 became :
bimserverapi.BimServerClient = BimServerClient.default;
bimserverapi.BimServerApiPromise = BimServerApiPromise.default;
And the model appears. I didn't investigate much further and it seems that there are some other errors on click events. So this solution i give seems to be a workaround that may be incorrect.
Guess everything is not OK but hope this helps.
Versions: Bimserver 1.5.92 Bimsurfer git clone from revision 33b2877
Thank you bdamay, it's working !! but i have some problems: Its not showing the object details when i select it. I have an other question, how can I test it in chrome 62 and other browsers?
Thank you : )
Glad to know it shows you a model.
As I said i don't think my solution is the right one because according to documentation BimServerClient.BimServerClient should be a constructor. (same for BimServerApiPromise.BimServerApiPromise).
Sure @rubendel or another guru can help on this matter better than me.
BimSurfer demo doesn't work in Chrome 62 due to Ecma6 script syntax used for importing libraries. So you get a syntax error in Chrome62. (Other browsers i don't know)
I finally got a bit deeper in the comprehension of what is bugging the demo.
First:
Bimsurfer is obviously waiting for a roid in the querystring that is not provided by index.html. So i added the parameter in the link on line 61 of index.html, it becomes:
a.setAttribute("href", "docs/example_BIMServer.html?address=" + encodeURIComponent(address) + "&token=" + client.token + "&poid=" + project.oid+"&roid="+project.lastRevisionId);
It works with projects without subproject. I actually didn't manage to get the right revision id for subproject yet. I think that it's not that important in a purpose of a demo on object selection .
Second:
While looking for metadata it fails because on line 196 of MetaDataRenderer.js, The script seems to expect data in a variable models[oid[0]].model.objects but fails. I found something in apiModel attribute. So i modified the line 196 with.
var o = models[oid[0]].apiModel.objects[oid[1]];
I'm not that sure it is that correct but with these 2 steps i got the demo working without console errors.
If for some reason i was answering the wrong way, please note i'm pretty new on the platform. I'm ready to hear any advised comment.
I hope this helps. (Anyway, it helped me understand better how all this is behaving... thanks the demo :-))
Hi bdamay, Thanks for your answers . I am new too to the plateform , I'm trying to do my own demo to test the bimsurfer but i'm getting some errors when i load the librairies:
I am trying to test a client wab app using BimServerClient api.
Everything is Ok when i load the librairies like in the demo:
I got in the console :
But when i try to load them locally from :
or from my local host :
I get the unexpected token error and BimServerClient is not defined :
Can you help me please !?
Thanks
Your script tag needs type="module".
Thank you rubendel for your answer. I got less errors now :
I think it doesn't find the file geometry.js or maybe it's beacause of an other issue ?
Thanks for your answer
Your BimServerClient is still not defined.
You might try to import it with
import BimServerClient from js/bimserverclient.js
Thabks bdamay for your answer, i did all of this but it stills not working :
Result:
Any solution please ? : )
Thanks
Did you try
<script type="module">
import BimServerClient from 'PATH_TO_JS/bimserverclient.js'; ...
?
It worked for me
I'm getting this error in chrome 64 when i try to connect BimSurfer to BIMServer.
Any solutions please ??
Thanks !