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

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

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.

Autodesk Forge viewer: Directly load a SVF?

As the official documentation states, you can upload a source file to OSS and translate it, once in your bucket, to a SVF with the Model Derivative API.
But is it possible to skip the translation step, directly uploading a SVF project (for example, one of these: https://forge-rcdb.autodesk.io/gallery) and loading into the web viewer?
I haven't been able neither to do it nor find any documentation yet.
Yes, that is possible. Instead of loading the Model Derivative service "manifest" using the Autodesk.Viewing.Document.load method, and then loading a specific "viewable" from the manifest using the Viewer3D#loadDocumentNode method, you can just call the viewer's loadModel method and provide an actual URL to your SVF file.
Note however that the Forge Viewer assets (JavaScript, CSS files, icons, etc.) should still be coming from the Autodesk domain. In other words, we do not officially support running the application offline. If you need to support workflows where your users could be temporarily disconnected from the internet, please refer to https://forge.autodesk.com/blog/disconnected-workflows.

Exporting ifc file from revit file in Forge using specific settings

Looking up online I only found a way to export a Revit file to IFC using the settings inside the Revit File already.
Is there a way to export an ifc file from a Revit model using a specific settings (not the settings inside the Revit model)?
(For example, exporting to IFC4 with 1st level boundaries)
Inside a Revit file there is an option to export settings and then load them.
Is there a way to use this settings file automatically on a different Revit file that does not contain this settings?
I assume the export you refer to is built in to the Forge translation system, cf. Supported Translation Formats.
In that case, I do not believe that you can modify the standard settings.
However, you could achieve what you want using the Forge Design Automation API for Revit instead.
In that case, you could implement a .NET Revit add-in that applies the required settings and launches the export.
That add-in can then be re-packaged for use in the Design Automation API framework, for real-time online web access.
Here is an example add-in IfcSpaceZoneBoundaries that I created to retrieve IFC spaces and zones and their boundaries.
For more info, please refer to Design Automation API for Revit or DA4R.

Autodesk Forge reading from text file

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.