:::info 實作目標 : 商業棟3FL.ifc的某部分指向N3-1.ifc 方法 : 比較商業棟3FL.ifc及N3-1.ifc :::  利用[ifcViewer](https://joyce-ifcjs.com/IfcViewer/index_web.html)查看商業棟3FL.ifc得到點擊的物件中的ifcType名稱為N3-1,藉此利用ifcType:N3-1去對應同為N3-1名稱的IFC檔案。  但這樣會根據{ifcType_name}.ifc去對應,**但命名方式可能會根據設計者或是軟體不同而不同**。  `expressID:370406`在此對應到的是`ifcName`為`3F-N011`  `expressID:352546`在此對應到的是`ifcType`為`N3-1`  程式碼 ```javascript= async function pick(event) { const found = cast(event)[0]; if (found) { const index = found.faceIndex; const geometry = found.object.geometry; const ifc = ifcLoader.ifcManager; const id = ifc.getExpressId(geometry, index); const modelID = 0; const props = await ifc.getPropertySets(modelID,id) const ifctype = props[0].HasProperties console.log(ifctype) for(var i=0;i<ifctype.length;i++){ var type=[] type.push(ifctype[i]) //console.log(type[0].value) var a = new Promise(function(resolve, reject){ resolve(ifc.getItemProperties(0,type[0].value)); }) a.then(function(value){ console.log(value.NominalValue.value); }) } } } ``` 下一步? 相同的協定? > reference : [IFC-.js](https://ifcjs.github.io/info/docs/Guide/web-ifc-viewer/Tutorials/Picking)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up