Custom Material Problem in Forge with Revit 2017 - autodesk-forge

I followed the instructions in the blog post on custom materials in forge and got it to work with Revit 2019.
However, with Revit 2017 (I had to update it first to get the "Publish Settings" in the Collaboration tab), the completely same approach did not work and the translation failed with the following manifest message:
{
"type":"manifest",
"hasThumbnail":"false",
"status":"failed",
"progress":"complete",
"region":"US",
"urn":"dXJuOmFkc2sub2JqZWN0...",
"version":"1.0",
"derivatives":[
{
"name":"001_010_020_Gras_dicht_bump.jpg",
"hasThumbnail":"false",
"status":"failed",
"progress":"complete",
"messages":[
{
"type":"error",
"code":"Revit-UnsupportedFileType",
"message":"<message>The file is not a Revit file or is not a supported version.</message>"
},
{
"type":"error",
"message":"Possibly recoverable warning exit code from extractor: -536870935",
"code":"TranslationWorker-RecoverableInternalFailure"
}
],
"outputType":"svf"
}
]
}
The translation seems to fail because Forge does not know what to do with the image. When first trying with Revit 2019 I got the same error, but managed to resolve it by specifying a realistic 3d view for the Set in the Publish Settings. This seems to tell Forge it needs the images for creating the textures.
But for some reason, this wont work with 2017, although I make the exact same call, and have the exact same settings.. am I missing something, or doing something wrong? Is Revit 2017 handling its Publish Settings differently, or are custom textures not supported in Forge for Revit 2017 files?
I am thankful for any hint or help in this case.

Related

Extension Autodesk Forge: My IFC 4 model can not connect to my extension

I uploaded my IFC version 4 to Autodesk forge and then added my extension, unfortunately, my control panel can not work and connect to my model.
Also, I had this problem with the Revit model but solved it with a solution from Mr. Petr Broz.
Please check this (Extension Autodesk Forge: My control panel doesn't connect to the Revit model after adding my own extension to the package).
unfortunately, the solution for the Revit model doesn't work for the IFC4 model.
Would you please Guide me on how I can solve it?
I cannot see the full extension code from the thread you pointed out, but this problem should not be related to IFC4.
From your code snippet, I can see that there is a great possibility that thesetTransformation function would be called before the geometries are loaded completely. Before completely loaded geometries, fragment info like transform matrix, bounding box, and so on would not be completed. Therefore, I would advise you to setTransformation function after Autodesk.Viewing.GEOMETRY_LOADED_EVENT is triggered to avoid this problem.
if(model.isLoadDone() ) {
viewer.addEventListner(
`Autodesk.Viewing.GEOMETRY_LOADED_EVENT`,
() => {
this.setTransformation();
}, { once: true }); //!<<< run this even handler once
} else {
this.setTransformation();
}
Or call the async function viewer.waitForLoadDone() before calling setTransformation function to ensure geometries are loaded completely.
await viewer.waitForLoadDone();
this.setTransformation();

2D viewables from Revit 2022 models do not work in the Forge Viewer

We have a Forge Viewer (GuiViewer3D, v. 7) implementation in our Nuxt app, using a few extensions (MarkupsCore, Measure, FullScreen) and custom docking panels such as a list of viewables to select from. Ever since we upgraded from Revit version 2021 to 2022, we haven't been able to display the 2D viewables from our svf files in the viewer. When we select any 2D viewable, the viewer freezes in this state:
With a few warnings thrown in the console:
Deprecated API usage: No “GlobalWorkerOptions.workerSrc” specified.
and
Warning: getOperatorList - ignoring errors during "GetOperatorList: page 0" task: "r: Cannot read properties of undefined (reading 'X')"
of which the former lead to this stackoverflow post, to which Augusto Goncalves suggested we tried uploading our revit file in your online viewer at https://viewer.autodesk.com/designviews. This works, and so we tried to create a new Nuxt app with a simple Forge Viewer implementation following the v. 7 example guide. This also works.
What we did next was to re-implement the v. 7 viewer in our production app by following the official documentation once again, thus removing any customization and leaving out everything else than the bare minimum. With this v. 7 viewer, running in a node environment on either node version 10.0 or 14.9, the bug persists, ruling out the possibility of any custom code being the cause.
Upon further debugging of scripts (loaded in via Autodesk) such as pdf.js, CompGeom.min.js, PDFLoader.js, path2d.js etc., we’ve gotten to a point where this message appears, and this is where our current trail ends:
TypeError: Cannot read properties of undefined (reading 'X') at c.strokeClipperContour (https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/extensions/CompGeom/CompGeom.min.js:17:173979) at https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/extensions/CompGeom/CompGeom.min.js:17:177686 at https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/extensions/CompGeom/CompGeom.min.js:17:177811 at Array.map (<anonymous>) at c.fill (https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/extensions/CompGeom/CompGeom.min.js:17:177413) at t.value https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/extensions/CompGeom/CompGeom.min.js:17:16067) at t.value (https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/extensions/CompGeom/CompGeom.min.js:17:9554) at e.beginDrawing (https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/extensions/PDF/PDF.min.js:39:211570) at t.value (https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/extensions/PDF/PDF.min.js:39:185323) at ttps://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/extensions/PDF/PDF.min.js:39:158419
We cannot effectively debug these minified scripts, and are hoping you can provide some insight as to what might be causing this issue.

How to load otg from Bim360?

I would like to to read my bim360 models which is in otg format in my Forgeviewer (version 7.3). The projects have been converted using the https://otg-bim.herokuapp.com/ app.
Is there any guidelines of how to make my Forge viewer read otg format from Bim360? I found this guideline (https://github.com/wallabyway/OTG-client-sample/blob/552c78b1fe8e1177f6694fd947a17fd189a8505b/public/js/ForgeViewer.js#L26-L29), however it uses Autodesk.Viewing.ViewingApplication which I find in version 2 of the Forge API, but not in version 7.3.
You can use this version of the ForgeViewer.js to work with latest versions of the viewer. https://github.com/jaimerosales/OTG-client-sample/blob/master/public/js/ForgeViewer.js
It seems that it is the same svn. Fault was that options requires autorization, even though I am allready autorized through bim360 login. Providing the access token there, uncomment useCookie and useCrentials and it works.
const options = {
env: 'FluentProduction',
api: 'fluent',
//useCookie: false,
//useCredentials: false,
accessToken: "add access token even though you are allready authorized in in bim360"
};
So far, I have seen a significant improvement loading using otg :-).
The latest version of svf2 works fine when using buckets instead of bim360. I have not vertified it with bim360. Example code which was helpfull for me was this npm package. https://www.npmjs.com/package/ng2-adsk-forge-viewer

Autodesk Forge Design automation - Revit IO: unable to upload application package to design automation app

I am trying to explore design automation for Revit by exploring the code at https://github.com/Autodesk-Forge/design.automation-nodejs-revit.window.family.create.
When I run the application, I get an error message
"Failed to create the family:( "
and the following log -
jstree.min.js:5 [Deprecation] document.registerElement is deprecated
and will be removed in M73, around March 2019. Please use
window.customElements.define instead. See
https://www.chromestatus.com/features/4642138092470272 for more
details. (anonymous) # jstree.min.js:5 ForgeTree.js:348 Uncaught
TypeError: Cannot read property 'className' of undefined
at refreshTypeList (ForgeTree.js:348)
at HTMLSpanElement.spanRemove.onclick (ForgeTree.js:339)
Also while following the instruction in the provided code, most of the links give in README.md for Postman collection (https://github.com/Developer-Autodesk/design-automation-for-revit/blob/master/Docs/AppBundle.md ) was in-accessible to me.
The error you mentioned is on the browser side and it's related to the jsTree, which needs updating due to a browser change. We're fixing it on our samples.
About the overall error, it probably due to a missing setup on the sample. As a suggestion, I would suggest a basic tutorial for Design Automation. Back to the error, you probably need to check the reports.txt to see what happened during the Workitem execution.
We're also fixing a few broken links on the documentation, sorry about that. Are you looking for anything specific?
Update
Design Automation requires code:all scope.

Autodesk Forge BIM 360 API - Activating Service Types

We have been using the Forge API to automatically set up projects in BIM 360, but seem unable to find a way to automatically activate a Service (Field, Glue, etc.).
Intuitively, I would have thought that the "service_types" attribute would be the way to do this, but the services are not activating.
1) What does the "service_types" attribute actually do?
2) If possible, how do we activate a project Service using the Forge API (Most specifically Field)?
Thank you kindly,
Re. #1
Your understanding of service_type is correct.
Re. #2
Could you try below after you create a project?
https://developer.autodesk.com/en/docs/bim360/v1/reference/http/projects-project_id-users-POST/
e.g., with the body like this:
{
"role": "project_admin",
"service_type": "field",
"company_id": "77e4444e-5dad-46a2-ad29-555cc00452a0",
"email": "my.name#autodesk.com"
}
I verified that having service_type in project creation itself does not have effect. And the documentation is a little confusing. But if you use the above method, it works. Note that you need to have Field license with you account.
There is also a tutorial page:
https://developer.autodesk.com/en/docs/bim360/v1/tutorials/activate-service/