Autodesk Forge Viewer is not rendering SVF derived from IFC - autodesk-forge

IFC model has been uploaded and translated to SVF.
the problem is reproduced on https://autodesk-forge.github.io/forge-tutorial-postman/display_svf.html. The viewer is rendering forge logo indefinitely. The console shows an error:
"TypeError: undefined is not an object (evaluating 't.children.length')"
We are experiencing this since Tuesday, 26 Oct, 2022 06:45 AM (GMT).
This is the body of the Translate Job Post API:
{
"input": {
"urn": "{{t4_ossEncodedSourceFileURN}}"
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"2d", "3d"
],
"advanced": {
"conversionMethod": "modern",
"buildingStoreys": "show",
"spaces": "show",
"openingElements" : "show"
}
}
]
}
}
The same model is successfully presented when translated to SVF2.
We tested this executing multiple scenarios using multiple models.
Using postman collections, both versions with signedcookies and without show the same behavior.
In our system , we are translating models to SVF and downloading derivatives to serve those from our own servers. The same behavior is noticed there. We are using forge-server-utils version 8.3.4 for download
Also, vscode-forge-tools Visual Studio Code extension shows the same behavior.
Models translated before the date indicated above are rendered correctly.
Kindly asking for help, this has a big impact on our service.

Related

Autodesk Construction Cloud API unavailable endpoints

Our team is working with Autodesk Construction Cloud and it's Docs module quite heavily. Because of that we're trying to develop some internal tools which would automate some work that they do, mostly around copying files.
In ACC Docs you can easily copy files from one folder to another. From our investigation it looks like the ACC internally uses an endpoint like this to copy the files:
https://developer.api.autodesk.com/dm/v3/projects/{{projectId}}/documents:copy?targetFolder={{targetFolder}}
By using the authentication token from ACC requests (obtained from the browser), we can easily use this call from Postman or even an AWS Lambda function. But when we're using the auth tokens obtained from 3-legged auth process as described in the documentation, the same API call fails.
Is it even possible right now to obtain an auth token which works with that endpoint for copying ACC Docs files? Or is this not available right now as this API is still not really "public"?
Happy New Year!
Those APIs are internal APIs. Please do not try to use them. even if it may work, you would use it on your own risk..
Regarding with copy files files from one folder to the other, you can use the public API. After you get the version urn of the original file, call the endpoint below with the parameter
POST https://developer.api.autodesk.com/data/v1/projects/{PROJECT_ID}/items?copyFrom=urn%3Aadsk.wipprod%3Afs.file%3Avf.rH_L4XJsTmeiYA4ixCVNAA%3Fversion%3D1
with the payload, in which specify the target folder.
{
"jsonapi": {
"version": "1.0"
},
"data": {
"type": "items",
"relationships": {
"tip":{
"data":{
"type":"versions",
"id":"1"
}
},
"parent": {
"data": {
"type": "folders",
"id": "urn:adsk.wipprod:fs.folder:co.0xaYa2rVTJuFiz7rxLCOQQ"
//!<<< The folder we want to put this file
}
}
}
},
"included":[
{
"type":"versions",
"id":"1",
"attributes":{
"name":"rac_basic_sample_project.rvt" //!<<< Version name
}
}
]
}

Downloading a Model Derivative from BIM 360

I have a file hosted on BIM 360 with different versions. I retrieved the latest version's URN, translated to Base64 URL safe, and posted a model derivative job to translate to IFC. This URN does not have padding, but it does contain an underscore where the / character used to be. If I check the manifest of the version, it shows the derivative URN:
{
"urn": <source_urn>,
"derivatives":[
...
{
"children": [{
"urn": "urn:adsk.viewing:fs.file<source_urn>/output/Resource/IFC/rme_advanced_sample_project.ifc",
"role":"ifc","mime":"application/vnd.autodesk.cad",
"guid":<guid>,
"type":"resource","status":"success"
}],
"progress":"complete",
"outputType":"ifc",
"status":"success"
}],
"hasThumbnail":"true",
"progress":"complete",
"type":"manifest",
"region":"US",
"version":"1.0",
"status":"success"
}
If I try to download the model using <source_urn> and
urn:adsk.viewing:fs.file<source_urn>/output/Resource/IFC/rme_advanced_sample_project.ifc (I converted it into a URI safe format using encodeURIComponent), I get the following error:
{
statusCode: 400,
statusMessage: 'Bad Request',
statusBody: { diagnostic: 'The requested derivative urn is invalid.' }
}

Room object in Revit files

I followed the instruction in the link below to extract Room objects from Revit models:
https://forge.autodesk.com/blog/new-rvt-svf-model-derivative-parameter-generates-additional-content-including-rooms-and-spaces
I made the changes as instructed and tested the sample Revit file (rac_basic_sample_project.rvt). But, still I don't see the rooms or the viewables (phases). Below is fhe request I post. Am I missing anything?
{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YzQ4ZDUxNDNhMDRiNDAxNmI3ODYxY2NlMzQ2ZDkyNjdfZmFjaWxpdHlfOTUvZWIyYzMzNDgtNDAxYS00ZjQ3LTgwM2EtMjM1OGYwYmI0YjY2LnJ2dA"
},
"output": {
"destination": {
"region": "us"
},
"formats": [
{
"type": "svf",
"views": [
"3d"
],
"advanced": {
"generateMasterViews": true
}
}
]
}
}
I just tested the feature and I can see the room data:
The JSON payload seems ok, so try checking the following things:
Make sure you use the x-ads-force header (explained in the blog post you linked to); if you had already processed your Revit model before, triggering a new Model Derivative job would not do anything unless you force the translation
Try using another design (and from a newer version of Revit if possible); in my screenshot I'm using one of the official samples for Revit 2020, although I remember being able to get the room data from older samples as well
The room data is only available in certain "viewables" so make sure you're looking at the right one; for my sample project, for example, the room data is not available in the "{3D}" viewable but it is available in the "Working Drawings" viewable

Define IFC Mvd on posting translation job

On translation of RVT file to SVF, I also want to post a job to translate and download an IFC file. Opening that IFC file after translation, it seems to use CV1 - Coordination View 1, which is a very old Model View Definition (hardly in use anymore and only for IFC2x3). If I export same RVT file in Revit 2016 with newest IFC exporter downloaded, choosing CV1 as an option, the file size of the IFC file translated from Revit is half the size of that from Forge. Is there a way to specify which MVD to use for the IFC translation using Model Derivative API, as it is in Revit (CV2, COBIE, IFC4 RV/DTV)? Since it seems that Forge uses the Revit IFC exporter, I would anticipate this be an option, but so far I have not succeeded finding it.
2019 Update
Just got informed, the issue REVIT-125299 has been resolved according to our engineering team. So, please try to submit the job body like below, use IFCExportOption instead, then you will obtain an IFC exported with the specified export setting. Cheer!
{
"input": {
"urn": "{{base64URN}}"
},
"output": {
"formats": [
{
"type": "IFC",
"views": [
"2d",
"3d"
],
"advanced": { //!<<< export options start
"IFCExportOption": "IFC4 Design Transfer View"
} //!<<< export options end
}
]
}
}
The old
After checking with our engineering team, Forge MD has supported to set IFC export options up like in Revit. For example,
{
"input": {
"urn": "{{base64URN}}",
"compressedUrn": false,
"rootFilename": "{{Filename}}"
},
"output": {
"formats": [
{
"type": "IFC",
"views": [
"2d",
"3d"
],
"advanced": { //!<<< export options start
"exportSettingName": "IFC4 Design Transfer View"
} //!<<< export options end
}
]
}
}
IFC exporter will try to seek for the saved export settings in your uploaded RVT based on the exportSettingName. If there is no matched setting, it will use IFC2X3 by default as I experience.
But there is a issue related to this feature, the output might not matched with the export settings, it has been logged as request id REVIT-125299 in our internal case system to make our team to allocate time to investigate. Apologies for any inconvenience caused.
However, you can sent the request id to forge.help#autodesk.com in the future to track updates. Thank you~
P.S. The above code sample might be changed in the future, please follow with the official documents: https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST/

export whole Neo4j database / cypher result to GraphJSON

I´ve already had a look at different post like this and this but nothing seems to be answered 100%.
My current problem is, that I want to visualyze - and ideally - analyze my Neo4j-Graph with a library (or software/tool).
The database-server is running on a remote (virtual) server and it seems that there is no chance to export the database to a format where I can work on with.
I´ve tried exporting the graph in a .graphml-file to import this file in Gephi, but Gephi doesn´t find the properties. Gephi-streaming with apoc-procedures and the graph-streaming plugin also does not work, because it´s a remote server (also with the tool mentioned here).
Now I´m currently testing around with Alchemy.js... So far, so good. But as it seems there´s no way to export the graph/query to the GraphJson-format?
Is there really no "easy" way to export the data?
Thanks for your help in advance!
This is how I would proceed
Run this query from the post you mentioned in the Neo4j Browser or in any bolt driver:
MATCH (a)-[r]->(b)
WITH collect(
{
source: id(a),
target: id(b),
caption: type(r)
}
) AS edges
RETURN edges
Now that you have loaded the data, you can simply download it as JSON using download button.(if you are using bolt driver ignore)
Either you manually downloaded JSON from Neo4j Browser or you are using bolt driver, you will end up with something like this.
{
"columns": [
"edges"
],
"data": [
{
"row": [
[
{
"source": 31288,
"target": 152,
"caption": "HAS_PAYMENT_METHOD"
}
]
],
"meta": [
null
],
"graph": {
"nodes": [
],
"relationships": [
]
}
}
]
Now all you have to is to filter out data.row results and you are done. Probably using bolt driver is the better choice as you have to clean up data anyway and it doesnt run into issues with returning a lots of data to the browser(it might crash).
Update: added python version
from neo4j.v1 import GraphDatabase
driver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "neo4j"))
session = driver.session()
result = session.run("MATCH (a)-[r]->(b) WITH collect({source: id(a),target: id(b),caption: type(r)}) AS edges RETURN edges")
for record in result:
print(record["edges"])
Hope this helps