A Custom Element for Autodesk's LMV, also officially known as the View and Data API
<lmv-viewer url="https://lmv.rocks/data/engineraw/0.svf"></lmv-viewer>
See demo at http://nopjia.github.io/lmv-viewer/
See more samples and information for LMV at http://lmv.rocks/
Install the component using Bower:
$ bower install lmv-viewer
Or download as ZIP.
-
Import polyfill:
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
-
Import firefly.js
<script src="http://autodeskviewer.com/viewers-dev/latest/firefly.js"></script>
And optionally import extensions
<script src="http://autodeskviewer.com/viewers-dev/latest/firefly-extensions.js"></script>
-
Import <lmv-viewer> element:
<link rel="import" href="bower_components/lmv-viewer/lmv-viewer.html">
-
Load a file
<lmv-viewer url="https://lmv.rocks/data/engineraw/0.svf"></lmv-viewer>
Or load URN with your access token from Autodesk server
<lmv-viewer url="urn:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bm9wL0FyYm9yUHJlc3MuZHdm" token="7twj3okWPRkbBMtpfUSN5hZkcAkv"></lmv-viewer>
Attribute | Options | Description |
---|---|---|
url |
string | URL of document or model to load |
token |
string | (Optional) Access token required to load URL from Autodesk servers |
env |
string | (Optional) Server environment, defaults to "AutodeskProduction" |
Property | Description |
---|---|
viewer |
The Viewer3D instance. Use this to access the LMV Viewing API. |
doc |
The loaded document, if exists. See Autodesk.Viewing.Document (TODO: Link?) |
Try it yourself by pasting this into a blank HTML file
<!DOCTYPE html>
<html>
<head>
<title>LMV Test</title>
<!-- Import polyfill -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.3/webcomponents.min.js"></script>
<!-- Import firefly.js -->
<script src="http://autodeskviewer.com/viewers-dev/latest/firefly.js"></script>
<!-- Import lmv-viewer element -->
<link rel="import" href="https://rawgit.com/nopjia/lmv-viewer/develop/lmv-viewer.html">
</head>
<body>
<!-- insert lmv-viewer element -->
<lmv-viewer url="https://lmv.rocks/data/engineraw/0.svf"></lmv-viewer>
</body>
</html>