Autodesk Forge reading from text file - autodesk-forge

I was just wondering if there is a way to push a text file to Autodesk forge. I've completed a few examples of pushing 3D models to the forge viewer but was wondering if there was a way to push an average text file and for it to be displayed through Forge?
Just an idea of mine, would love to hear of the possibilities!

The Data Management APIs will let you upload any content you want, but the Model Derivative APIs are meant to be used with CAD file formats (and a few additional formats like PDF). You can see all the available translations here: https://forge.autodesk.com/en/docs/model-derivative/v2/developers_guide/supported-translations. General text files are not supported.

Related

Forge viewer - Download pdf derivative via API

Can I download a pdf from a derivative via API?
It's not clear to me what exactly you're asking for. Below are a couple of answers to what I think your question could be:
You have uploaded a PDF file to the Model Derivative service, and you would like to download the results of the conversion?
While you can download the derivatives of 3D models, I'm afraid it is not possible for PDFs. When processing PDFs, the Model Derivative service converts them to image pyramids to enable Google Maps-like experience where zooming in on different parts of the PDF will load in higher resolution images of the area.
However, if your goal is to be able to load a PDF into the viewer without the Model Derivative service, note that this is also possible: https://aps.autodesk.com/blog/dwf-and-pdf-support-forge-viewer
You have uploaded a design (e.g., a Revit design) to the Model Derivative service, and you would like to download the PDF output that the service generated?
If you're interested in converting Revit designs to PDFs, I would suggest that you generate the PDFs using the Design Automation for Revit as this service is better suited for these types of tasks.

Questions about Autodesk Forge Viewer API

I couldn't find Forge Viewer API demo site and don't know what it looks like. I appreciate it if you have some experience using it and answer questions below.
Can you put markup comments on 3D models easily?
When you update comments, are they automatically saved right after you click some update button?
Can you delete 3D model data easily?
Is it mandatory to upload 3D model data to the Autodesk cloud server when you use the Forge Viewer? I don't want to put design data outside of my service but want to see 3D model on a browser.
You can upload any model and check with Viewer through viewer.autodesk.com
We have a few options for markups on documents. this blog might be helpful. You can also take advantage of sprites and textgeometry for labeling your models
Depending on the method you'll need to implement an algorithm to save, store and load your markups.
The data you see with Viewer is the SVF(2) generated by a translation from a source file. To modify the source file, you'll need to run a Design Automation job.
You need to upload your models to a bucket in order to trigger a translation, generating an SVF(2) that can be rendered with Viewer (refer here).
Formats like gltf, pdf, and dwf can be loaded without the need for translations.

Why Layer detection isn't possible in Autodesk forge Api for PDF files?

I want to import PDF file in Model derivative API and work with different layers. But it is not detecting layers in PDF models as it does in DWG files. Layer manager option is not visible. What to do?
In cases where the Model Derivative service isn't extracting enough information from your input files, you have a couple of options:
if your input file is a AutoCAD, Revit, Inventor, or 3ds Max file, consider extracting the additional information using the Design Automation service
if your input file is a PDF, consider:
viewing the PDF directly in the viewer (see this blog post for more details)
using a 3rd party library (e.g., pdf.js) to extract the additional info yourself

How to have forge viewer to display elements with low level details?

On revit, in 3D view, I have some plumbing pipes with low/medium level of details, so they are just shown as a wire:
If I want to see them nicely, I move up level of detail and I see a nice pipe:
For some files, I cannot edit the original with Revit before sending to forge for conversion. I would like to know how can we see this pipe in forge viewer, even with low level of details?
For info, forge viewer has the element present in model hierarchy.
Thank you,
If I understand it correctly, you upload a "low details" Revit model (with plumbing pipes visualized as wires) to Forge, and in the Forge Viewer you would like to switch back to "full details"?
I'm afraid that is not possible. When converting the Revit model into a Forge Viewer format, all the original geometry is tessellated into triangle meshes, so there's no way to switch between levels of detail after that.
I have been looking at this, and noticed that if i upload the revit model to forge the pipework comes out as singleline, fittings in high detail.
in a similar way to opening a revit file in navisworks directly without converting to a NWC first.
so you can get around it by uploading a NWC file to forge. This doesn't solve the issue, as id prefer to upload the revit file directly.

How to use autodesk viewer api to view .dxf files on my website?

I have around 200 .dxf files on my server. I would like to integrate the autodesk-forge viewer so that people coming to my website can view the drawings? I do not see any example as such online which can help me in that? Do you guys have any examples which can assist me in this?
I do not want to upload the files on the cloud and use the embed link rather I just want to use the viewer api and pass my .dxf files from my server to view those on my website.
Any help will be highly appreciated?
I am afraid this is not possible, the Autodesk Forge Viewer requires you to upload the file on the Autodesk storage and use the Model Derivative API to prepare your DXF files to be viewed in the Viewer. You do not need to keep the DXF on the Autodesk storage after the process, but this is a required step.
If you follow this tutorial, you will be able to see you DXF files onlines. All resources are protected, but if you want to delete the seed file (aka the DXF file), you need to call this endpoint at the end of the tutorial steps.