Listing model files in BIM360 through data management API - autodesk-forge

I have a need to display models stored in BIM360 in the Forge Viewer. For this reason I'd like to list all models that are contained in a project.
I was looking at fetching them using the search API. Is this a reasonable way to do it? I guess the only way to identify model files is to use attributes.fileType in the filter? And then look at the relationships.derivatives data. Or is there some other way to search for models?

Unfortunately, your request is not supported by the Search API currently. With my experience, extracting relationships.derivatives out is the only way manually from the API responses that contain this attribute e.g.
GET projects/:project_id/folders/:folder_id/contents
GET projects/:project_id/items/:item_id/tip
GET projects/:project_id/items/:item_id/versions

Related

Get Discipline of View [Autodesk Model Derivative API]

I'm trying to get the Discipline Property of a Revit Model uploaded to BIM 360. I was able to get the list of views by GET
https://developer.api.autodesk.com/modelderivative/v2/designdata/URL_SAFE_URN_OF_SOURCE_FILE/metadata
However there is no data on Discipline. Where and how can I get it?
I'm not familiar with "Discipline Properties" in Revit but I can comment on the Forge side of things:
The GET :urn/metadata endpoint simply returns a list of "viewables" that were extracted from the source design file. In case of Revit, these are typically 3D views or 2D sheets. I'm not aware of any other types of viewables that could be extracted by the Model Derivative service.
If the "discipline property" is a property available on some of the Revit elements, you might want to take a look at the GET :urn/metadata/:guid/properties endpoint. This one returns a JSON with properties of objects in one of the extracted viewables. Note that those properties are also accessible from Forge Viewer using its APIs.
In general, the Model Derivative service is trying to extract the "right" amount of information, making sure that the viewer gets all the important data for visualization and analysis, but also making sure that the size of the converted output stays in bounds. If there is some specific information in Revit designs that you need that is not extracted automatically, you can consider using the Design Automation service to process your Revit models in the cloud and extract all the information with your custom Revit plugin.

How do I show the issue ids corresponding to all the issues in a file?

I am trying to show the issue ids corresponding to all the issues that are present in a drawing file. Currently, the issue ids are shown only when the issue is clicked. Is there a way to achieve the same using Forge development?
Yes, you can list issue IDs attached to a specific document using Forge APIs like so:
Use Data Management APIs to find the URN of a specific version of your document
the URN should start with something like urn:adsk.wipprod:dm.lineage:
Use BIM360 APIs to list all issues available in your BIM360 project, and if needed, filter them based on their target_urn property with the URN you found in the previous step

Can model derivative get all the information from BIM?

I'm very new to forge and revit. I've been trying to see if I can get all the information from Revit / BIM file programmatically. I know I might be able to get it with DB link or excel, but export to excel seems an extract steps.
Then I found out Forge, I was assuming Model Derivative APIs will did the job for you, basically upload the files to bucket and click on the models to select object, let's say a floor, I should be able to make API calls with all the information about that floor. However, when I play around with Forge, it seems like not every information is in the properties. Is that correct? Or I just didn't implement it correctly?
Thanks for your answer.
It is possible to get all the information regarding properties of any/all object(s).
First you need to get the URN of the version of the file, get the metadata from this API:
https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET/
Use the next 2 APIs in the above link to get properties of any/all object(s).
In case you don't know how to get URN:
The way you get URN is from forge Data Management Api, you can list Hubs > Projects > Folders > Items > Versions.
This tutorial guides you on the steps.

Import Data From Google API to Parse

I am trying to import all restaurant data (within a certain location) from Google Places API to a Parse class. What is the best approach?
The types of data I need are: name, opening_hours (array), price, geometry (location), etc.
Do I need to download all the Google Places data first and then import it into Parse or can this be done all at once?
Parse supports "REST" API, should I be using REST or import through json/csv?
How do I go about "retrieving" the Google data? (trying to wrap my head around the concept)
Google API -https://developers.google.com/places/documentation/details
Parse Import API -https://www.parse.com/docs/data#data-import
Parse REST API -https://parse.com/docs/rest
Sorry for the newbie questions. I've never migrated data using API before.
I would advise against storing the data in a Parse class. The Google Places API is there for the ever-changing data that is out there on restaurants. If you import it into Parse, you would have to constantly update it. The Google Places API is fantastic and easy to use. Currently I use it in my AngularJS application for an autocomplete text input. I also use the Google Geocoding API in my Cloud Code with a Parse.Cloud.HttpRequest. Both work great but I would never want to import the API data and make it static...
I think a better option is like #jsetting32 commented about. Query the API for the events in the area, then save the one the user selects in a ParseObject. You can pick and choose the data you want to save and even give it start and end dates so users can look at past events.

How to retrieve family from graph API?

I know how to retrieve family from Facebook using fql. But I can't find how to do so using the much more convenient graph API. Is there a way or is fql the only way to find relationships?
Via graph API it will be:
https://graph.facebook.com/UID/family
which requires user_relationships/friends_relationships extended permissions