Quantcast
Channel: Questions in topic: "dllimport"
Viewing all articles
Browse latest Browse all 160

Integrate Xbim Tool external library into Unity

$
0
0
I'm trying to transfer geometric and architectural data from an .ifc file into Unity In order to accomplish this task, I'm using Xbim Tool's C# libraries

[Github Link here][1]
[Nuget Link here][2]

Libraries are Xbim Essentials and Xbim Geometries.
I followed [this tutorial][3] to make Visual studio accept the packages and prevent them to be wiped out by the rebuild Unity does at every start up.

Since Unity only accept dlls to be stored into the asset folder, I've used the package "Nuget for Unity" to download the packages into the asset folder.

This is the code I wrote

using System.Collections; using System.Collections.Generic; using UnityEngine; using Xbim.Ifc; using Xbim.ModelGeometry.Scene; public class Testprogetto : MonoBehaviour { // Start is called before the first frame update void Start() { const string fileName = "Muro finestrato.ifc"; using (var Stepmodel = IfcStore.Open(fileName, null, -1)) { Stepmodel.SaveAs("Muro finestrato.ifcxml"); } using (var model = IfcStore.Open("Muro finestrato.ifcxml")) { var context = new Xbim3DModelContext(model); context.CreateContext(); } } // Update is called once per frame void Update() { } }

In visual studio this compiles heavenly, but in Unity the internal compiler returns the error like I missed to import the libraries.

![alt text][4] [1]: https://github.com/xBimTeam?utf8=%E2%9C%93&q=&type=&language= [2]: https://www.nuget.org/packages?q=xbim [3]: https://www.what-could-possibly-go-wrong.com/unity-and-nuget/#usingnugetwithaseparatevisualstudiosolution [4]: /storage/temp/134998-console-error.png

Viewing all articles
Browse latest Browse all 160

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>