2017-02-15 120 views
0

是否有任何可能的方式來插入一個Revit文件到html頁面?我有一個rvt文件,我試圖將其轉換成geojson文件...之後,我打電話給它...它不是工作...任何人可以幫助我....添加Revit文件到html

這是GeoJSON的:

[ 
    { 
     "type": "FeatureCollection", 
     "crs": { 
      "type": "name", 
      "properties": { 
       "name": "urn:ogc:def:crs:OGC:1.3:CRS84" 
      } 
     }, 
     "features": [ 
      { 
       "type": "Feature", 
       "properties": { 
        "name": "CEO", 
        "roomno": 1, 
        "ph": 200 
       }, 
       "geometry": { 
        "type": "Polygon", 
        "coordinates": [ 
         [ 
          [ 
           77.5987896482477, 
           12.983168941037594 
          ], 
          [ 
           77.59896972798799, 
           12.983169878952907 
          ], 
          [ 
           77.59896972798799, 
           12.983106369240323 
          ], 
          [ 
           77.5990585784097, 
           12.983106485384665 
          ], 
          [ 
           77.59905799603237, 
           12.982853151249317 
          ], 
          [ 
           77.5987896482477, 
           12.98285279440386 
          ], 
          [ 
           77.5987896482477, 
           12.983168941037594 
          ] 
         ] 
        ] 
       } 
      }, 
      { 
       "type": "Feature", 
       "properties": { 
        "name": "MD", 
        "roomno": 2, 
        "ph": 201 
       }, 
       "geometry": { 
        "type": "Polygon", 
        "coordinates": [ 
         [ 
          [ 
           77.5987896482477, 
           12.983168941037594 
          ], 
          [ 
           77.59878830101773, 
           12.983479517309322 
          ], 
          [ 
           77.59905944627795, 
           12.983484008075912 
          ], 
          [ 
           77.59905885920351, 
           12.983228630695868 
          ], 
          [ 
           77.59896972798799, 
           12.983228514488285 
          ], 
          [ 
           77.59896972798799, 
           12.983169878952907 
          ], 
          [ 
           77.5987896482477, 
           12.983168941037594 
          ] 
         ] 
        ] 
       } 
      }, 
      { 
       "type": "Feature", 
       "properties": { 
        "name": "Hall", 
        "roomno": 8, 
        "ph": null 
       }, 
       "geometry": { 
        "type": "Polygon", 
        "coordinates": [ 
         [ 
          [ 
           77.59932180408867, 
           12.983287156750118 
          ], 
          [ 
           77.59950020019542, 
           12.98328612555875 
          ], 
          [ 
           77.5995003304455, 
           12.98322920627767 
          ], 
          [ 
           77.59976293746367, 
           12.983229548659702 
          ], 
          [ 
           77.59994467341478, 
           12.983229785603577 
          ], 
          [ 
           77.59994467341478, 
           12.98310764367879 
          ], 
          [ 
           77.599716099465, 
           12.983107344889312 
          ], 
          [ 
           77.59950060994909, 
           12.98310706320367 
          ], 
          [ 
           77.59950118963468, 
           12.982853740602511 
          ], 
          [ 
           77.59932180408867, 
           12.982853502057903 
          ], 
          [ 
           77.59932180408867, 
           12.98310682947052 
          ], 
          [ 
           77.5990585784097, 
           12.983106485384665 
          ], 
          [ 
           77.59896972798799, 
           12.983106369240323 
          ], 
          [ 
           77.59896972798799, 
           12.983169878952907 
          ], 
          [ 
           77.59896972798799, 
           12.983228514488285 
          ], 
          [ 
           77.59905885920351, 
           12.983228630695868 
          ], 
          [ 
           77.59932180408867, 
           12.983228973518404 
          ], 
          [ 
           77.59932180408867, 
           12.983287156750118 
          ] 
         ] 
        ] 
       } 
      }, 
      { 
       "type": "Feature", 
       "properties": { 
        "name": "StairCase", 
        "roomno": 9, 
        "ph": null 
       }, 
       "geometry": { 
        "type": "Polygon", 
        "coordinates": [ 
         [ 
          [ 
           77.59950020019542, 
           12.98328612555875 
          ], 
          [ 
           77.59932180408867, 
           12.983287156750118 
          ], 
          [ 
           77.59932180408867, 
           12.983484008075912 
          ], 
          [ 
           77.59949974737502, 
           12.983484008075912 
          ], 
          [ 
           77.59950020019542, 
           12.98328612555875 
          ] 
         ] 
        ] 
       } 
      }, 
      { 
       "type": "Feature", 
       "properties": { 
        "name": "Development Area", 
        "roomno": 4, 
        "ph": 204 
       }, 
       "geometry": { 
        "type": "Polygon", 
        "coordinates": [ 
         [ 
          [ 
           77.59971805557235, 
           12.982854028988067 
          ], 
          [ 
           77.59950118963468, 
           12.982853740602511 
          ], 
          [ 
           77.59950060994909, 
           12.98310706320367 
          ], 
          [ 
           77.599716099465, 
           12.983107344889312 
          ], 
          [ 
           77.59971805557235, 
           12.982854028988067 
          ] 
         ] 
        ] 
       } 
      }, 
      { 
       "type": "Feature", 
       "properties": { 
        "name": "Conference", 
        "roomno": 3, 
        "ph": 203 
       }, 
       "geometry": { 
        "type": "Polygon", 
        "coordinates": [ 
         [ 
          [ 
           77.59994467341478, 
           12.982854330341581 
          ], 
          [ 
           77.59971805557235, 
           12.982854028988067 
          ], 
          [ 
           77.599716099465, 
           12.983107344889312 
          ], 
          [ 
           77.59994467341478, 
           12.98310764367879 
          ], 
          [ 
           77.59994467341478, 
           12.982854330341581 
          ] 
         ] 
        ] 
       } 
      }, 
      { 
       "type": "Feature", 
       "properties": { 
        "name": "Cabin 2", 
        "roomno": 6, 
        "ph": 206 
       }, 
       "geometry": { 
        "type": "Polygon", 
        "coordinates": [ 
         [ 
          [ 
           77.59932180408867, 
           12.982853502057903 
          ], 
          [ 
           77.59905799603237, 
           12.982853151249317 
          ], 
          [ 
           77.5990585784097, 
           12.983106485384665 
          ], 
          [ 
           77.59932180408867, 
           12.98310682947052 
          ], 
          [ 
           77.59932180408867, 
           12.982853502057903 
          ] 
         ] 
        ] 
       } 
      }, 
      { 
       "type": "Feature", 
       "properties": { 
        "name": "Refreshment", 
        "roomno": 7, 
        "ph": null 
       }, 
       "geometry": { 
        "type": "Polygon", 
        "coordinates": [ 
         [ 
          [ 
           77.59994467341478, 
           12.983229785603577 
          ], 
          [ 
           77.59976293746367, 
           12.983229548659702 
          ], 
          [ 
           77.59976064503648, 
           12.983484008075912 
          ], 
          [ 
           77.59994467341478, 
           12.983484008075912 
          ], 
          [ 
           77.59994467341478, 
           12.983229785603577 
          ] 
         ] 
        ] 
       } 
      }, 
      { 
       "type": "Feature", 
       "properties": { 
        "name": "Canteen", 
        "roomno": 6, 
        "ph": 206 
       }, 
       "geometry": { 
        "type": "Polygon", 
        "coordinates": [ 
         [ 
          [ 
           77.59976293746367, 
           12.983229548659702 
          ], 
          [ 
           77.5995003304455, 
           12.98322920627767 
          ], 
          [ 
           77.59949974737502, 
           12.983484008075912 
          ], 
          [ 
           77.59976064503648, 
           12.983484008075912 
          ], 
          [ 
           77.59976293746367, 
           12.983229548659702 
          ] 
         ] 
        ] 
       } 
      }, 
      { 
       "type": "Feature", 
       "properties": { 
        "name": "Cabin 1", 
        "roomno": 5, 
        "ph": 205 
       }, 
       "geometry": { 
        "type": "Polygon", 
        "coordinates": [ 
         [ 
          [ 
           77.59932180408867, 
           12.983228973518404 
          ], 
          [ 
           77.59905885920351, 
           12.983228630695868 
          ], 
          [ 
           77.59905944627795, 
           12.983484008075912 
          ], 
          [ 
           77.59932180408867, 
           12.983484008075912 
          ], 
          [ 
           77.59932180408867, 
           12.983228973518404 
          ] 
         ] 
        ] 
       } 
      }, 
      { 
       "type": "Feature", 
       "properties": { 
        "name": "entrance", 
        "roomno": 10, 
        "ph": null 
       }, 
       "geometry": { 
        "type": "Polygon", 
        "coordinates": [ 
         [ 
          [ 
           77.59950118963468, 
           12.982853740602511 
          ], 
          [ 
           77.59950131349133, 
           12.982799615247522 
          ], 
          [ 
           77.59932180408867, 
           12.982799615247522 
          ], 
          [ 
           77.59932180408867, 
           12.982853502057903 
          ], 
          [ 
           77.59950118963468, 
           12.982853740602511 
          ] 
         ] 
        ] 
       } 
      } 
     ] 
    } 
] 

,這是我的腳本:

var map = new L.Map('map'); 
map.setView([12.98317,77.59941], 16, 
false); 
map.setView([12.98317,77.59941], 16, false); 
map.setView([12.98317,77.59941], 16, false); 
map.setView([12.98317,77.59941], 16, false); 

new L.TileLayer('http://{s}.tiles.mapbox.com/v3/osmbuildings.kbpalbpk/{z}/{x}/{y}.png', 
{ attribution: 'Map tiles &copy; <a 
href="http://mapbox.com"MapBox</a', maxZoom: 15, maxNativeZoom: 
20 }).addTo(map); 

var osmb = new OSMBuildings(map); 

//************************************************************ 

var geoJsonBlock; 

function getCenter(geoJson) { var geometry, len = 0, lat = 0, lon = 
0; 

    for (var i = 0, il = geoJson.features.length; i < il; i++) { 
    geometry = geoJson.features[i].geometry.coordinates[0]; 
    if (geometry[0][0][0]) { 
     geometry = geometry[0]; 
    } 

    len += geometry.length-1; 
    for (var j = 0, jl = geometry.length-1; j < jl; j++) { 
     lat += geometry[j][1]; 
     lon += geometry[j][0]; 
    } } 

    return { lat:lat/len, lon:lon/len }; } 

function setGeoJSON() { try { 
    var geoJson = JSON.parse(geoJsonBlock.value); } catch(e) {} osmb.addGeoJSON('C:\Users\......\Desktop\.....\groundfloor_polygon.geojson'); 
var center = getCenter(geoJson); map.setView([center.lat, 
center.lon], 17) } 

geoJsonBlock = document.querySelector('textarea'); setGeoJSON(); 

回答

0

是的,你可以很容易的確添加將Revit模型轉換爲HTML頁面。更好的是,您可以使用Forge或A360查看器添加它,使用戶可以使用平移,縮放,旋轉以及查詢其數據結構和屬性來導航模型。只需使用免費帳戶將您的模型上傳到A360,然後使用嵌入選項創建一個可添加到現有HTML頁面的HTML片段。