You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-27Lines changed: 26 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,3 @@
1
-
2
1
# Autodesk View & Data API - Getting Started Tutorial
3
2
4
3
@@ -11,38 +10,38 @@ This conceptual documentation is designed to let you quickly start exploring and
11
10
12
11
## What do you need for your project?
13
12
14
-
The View & Data web service consists of two APIs. The first API is a REST API which allows you to upload and translate 2D/3D models into a lightweight format that can be downloaded and displayed by the Second API – a client-side JavaScript API that allows you to embedand customize/automate an interactive 2D/3D model viewer on your web page.
13
+
The View & Data web service consists of two APIs. The first API is a REST API which allows you to upload and translate 2D/3D models into a light-weight format that can be downloaded and displayed by the Second API – a client-side JavaScript API that allows you to embed, customize and automate an interactive 2D/3D model viewer on your web page.
15
14
16
-
Depending on your needs you may prefer to write a server or a desktop application to consume the REST API. Your choice will be mainly based on how many files you need to translate, and the frequency:
15
+
Depending on your needs, you may prefer to write a server or a desktop application to consume the REST API. Your choice will be mainly based on how many files you need to translate, and the frequency:
17
16
18
-
1- If you need to translate only one (or very few) of your own models to be viewed by other people, then you may prefer to use a desktop application to do this, or one of our demo pages.
17
+
- If you need to translate only one (or very few) of your own models to be viewed by other people, then you may prefer to use a desktop application to do this, or one of our demo pages.
19
18
20
-
2- If you need to translate multiple models in a batch process or allow other users to upload their own files, then a web server implementation will be needed.
19
+
- If you need to translate multiple models in a batch process or allow other users to upload their own files, then a web server implementation will be needed.
21
20
22
21
## Obtaining an API Key
23
22
24
-
All View & Data API applications must access the service using an API key. Using an API key enables you to monitor your application's API usage, and ensures that Autodesk can contact you about your application if necessary. Because these keys are used to authenticate your access to the API, this also protects your data from being accessed without your permission.
23
+
All View & Data API applications accesses the service using an API key. The API key enables you to monitor your application's API usage, and ensures that Autodesk can contact you about your application if necessary. Because these keys are used to authenticate your access to the API, this also protects your data from being accessed without your permission.
25
24
26
25
To create your API key:
27
26
28
-
* Visit the [Autodesk Developers Page](https://developer.autodesk.com/api/view-and-data-api/) and Sign In with your Autodesk Account (or click the Sign Up link to create an account for free if you don't already have one).
27
+
* Visit the [Autodesk Developers Page](https://developer.autodesk.com/api/view-and-data-api/) and sign in with your Autodesk Account, or click the Sign Up link to create an account for free if you don't already have one.
29
28
30
29
* Click the 'Create an App' link.
31
30
32
31

33
-
34
-
* Select the 'API' you want to generate a key for. For this tutorial, select the 'View and Data API'.
32
+
33
+
* Select the API you want to generate a key for. For this tutorial, select the 'View and Data API'.
35
34
36
35

37
-
38
-
* Complete the form, and submit your request by pushing the 'Create App' button. Your application should now appear in your application lists. (Note: The 'Redirect URL' field is a required field, but you don't have to provide a real URL if you don't have one - just add something like 'http://www.mysite.com').
39
-
36
+
37
+
* Complete the form and submit your request by pushing the 'Create App' button. Your application will appear in your application list. (Note: The 'Redirect URL' field is a required field, but you don't have to provide a real URL if you don't have one - just add something like 'http://www.mysite.com').
38
+
40
39

41
-
42
-
* Click on the App you just created to access your Consumer Key and Secret. You can review your App and API keys whenever you like by clicking on the 'My Apps' link after signing in.
40
+
41
+
* Click on the newly created App to access your Consumer Key and Secret. You can review your App and API keys whenever you like by clicking on the 'My Apps' link after signing in.
43
42
44
43

45
-
44
+
46
45
By default, a key can be used on any site / application. However, we strongly recommend that you restrict the use of your key to domains that you administer, to prevent use on unauthorized sites. We also recommend you create a new App (API key) for every new application (rather than reusing the same key in multiple applications).
47
46
48
47
@@ -53,7 +52,7 @@ Now you have your API key, the next step is to upload and translate a model so i
53
52
54
53
### Upload a model on the Autodesk View & Data server
55
54
56
-
Upload one of your models to your account and get its URN using the following [web page](http://models.autodesk.io).
55
+
Upload one of your models to your account and get its URN using the following [web page](http://models.autodesk.io).
57
56
58
57
Alternately, you can also use one of the desktop solutions below if you prefer:
59
58
@@ -65,16 +64,16 @@ If you prefer using cURL or another programming languages, there are more sample
65
64
66
65
There are some 3D model samples available in this [GitHub tutorial repository](https://github.com/Developer-Autodesk/tutorial-getting.started-view.and.data) (in the 'Sample files' folder) if you don't have your own. You can clone or download the repository to access them.
67
66
68
-
Note that, if you do not have git installed already, you can get it from here: [Windows](https://windows.github.com/), [Mac OSX](https://mac.github.com/), and [Linux](http://git-scm.com/download/linux). And get additional setup instructions [here](https://help.github.com/articles/set-up-git).
67
+
Note that, if you do not have git installed already, you can get it from here: [Windows](https://windows.github.com/), [Mac OSX](https://mac.github.com/), and [Linux](http://git-scm.com/download/linux). And get additional setup instructions [here](https://help.github.com/articles/set-up-git).
69
68
70
69
If you have GitHub client ([GitHub for Windows](https://windows.github.com/) or [GitHub for Mac](https://mac.github.com/)) installed, you can clone the tutorial [repository](https://github.com/Developer-Autodesk/tutorial-getting.started-view.and.data) from github.com. Go to [https://github.com/Developer-Autodesk/tutorial-getting.started-view.and.data](https://github.com/Developer-Autodesk/tutorial-getting.started-view.and.data) and clone the source code by click the "Clone in Desktop" button.
71
70
72
71

73
-
72
+
74
73
If you prefer command line, using following command.
This command creates the *tutorial-getting.started-view.and.data* directory in your current directory. In this directory, you can find the sample files and finished files in following steps.
79
78
80
79
If you wish to not install git, you can download a zip file of the sample model files and finished code snippets instead from [here](https://github.com/Developer-Autodesk/tutorial-getting.started-view.and.data/archive/master.zip), or download the zip file by clicking "Download ZIP" and extract to a folder, which contains the sample files and finished files in following steps.
@@ -166,7 +165,7 @@ Copy the URN which you generated prior installing the server in file /www/index.
166
165
```
167
166
var defaultUrn = '<replace with your encoded urn>';
168
167
```
169
-
Run the server from the Node.js console, by running the following command:
168
+
Run the server from the Node.js console, by running the following command:
170
169
```
171
170
node server.js
172
171
```
@@ -265,7 +264,7 @@ Create a file named "Viewing.Extension.Workshop.js" (for example), and save it i
265
264
You can also checkout the changes of this step from github by running following command if you have git installed:
266
265
267
266
git checkout workshop-viewer-customization-step1
268
-
267
+
269
268
### Step 2 – Reference the extension script
270
269
271
270
Reference the extension file in your index.html by adding the following script element to the header (change the path if you installed the file anywhere other than the www subfolder):
@@ -371,12 +370,12 @@ Start by adding a handler for the SELECTION_CHANGED event to the Extension (i.e.
371
370
}
372
371
</b>
373
372
</pre>
374
-
373
+
375
374
376
375
You can also checkout the changes of this step from github by running following command if you have git installed:
377
376
378
-
git checkout workshop-viewer-customization-step5
379
-
377
+
git checkout workshop-viewer-customization-step5
378
+
380
379
Every element in the displayed model has a unique ID called a dbId. The code you've just written simply stores the dbId of the first element in the list of elements that the user selected. (Usually, the user will only select a single element, but more complete code would handle multiple selected elements).
381
380
382
381
You can test your code now, if you like. Put a breakpoint in the event handler to check its being called when you select an element. You can use Developer Tool of Chrome or similar tools in other modern browsers to do debugging like setting breaking point, watch variable values, etc. (Hint: You select a model element by clicking it with you mouse; elements are highlighted in blue when selected).
@@ -430,7 +429,7 @@ Add some code to initialize an empty panel in the body of your extension:
430
429
431
430
_self.load = function () {
432
431
</pre>
433
-
432
+
434
433
Instantiate the panel in your load method, uninitialize it in unload. Edit _self.load and _self.unload as follows
435
434
<pre>
436
435
@@ -567,7 +566,7 @@ Add following methods to handle the animation immediately below the end of the _
567
566
pos.x, pos.y, pos.z);
568
567
var rAxis = new THREE.Vector3(
569
568
axis.x, axis.y, axis.z);
570
-
569
+
571
570
var matrix = new THREE.Matrix4().makeRotationAxis(
0 commit comments