Closed FMD2021 closed 1 year ago
It sounds like you're missing some project references. E.g. it sounds like you're missing a reference to Xbim.CobieExpress
What does your csproj look like?
It sounds like you're missing some project references. E.g. it sounds like you're missing a reference to
Xbim.CobieExpress
What does your csproj look like?
I tried to add the reference, but with no success. The erros persist. My csproj looks like this:
`using System; using System.Windows.Forms; using Xbim.Ifc; using System.IO; using Xbim.IO.Memory; using XbimExchanger.IfcToCOBieExpress; using Xbim.CobieExpress;
namespace IFC_to_COBie { public partial class Form1 : Form { private string fileName; private XbimEditorCredentials editor;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.ShowDialog();
string filename = dialog.FileName;
if (filename == "")
return;
var editor = new XbimEditorCredentials
{
ApplicationDevelopersName = "Some Name",
ApplicationFullName = "Some Name",
ApplicationIdentifier = "0001",
ApplicationVersion = "4.0",
//your user
EditorsFamilyName = "Some Name",
EditorsGivenName = "Some Name",
EditorsOrganisationName = "Name of work place"
};
var ifc = MemoryModel.OpenReadStep21(fileName);
var cobie = new CobieModel();
using (var txn = cobie.BeginTransaction("IFC to COBie transaction"))
{
var exchanger = new IfcToCoBieExpressExchanger(ifc, cobie);
exchanger.Convert();
txn.Commit();
}
var output = Path.ChangeExtension(fileName, ".cobie");
cobie.SaveAsEsent(output);
textBox1.Text = "A new COBie was created";
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}`
Thank you.
You need to fix your package references. The yellow warning signs on the packages will probably tell you what the issue is.
If you still can sort it, why don't you just share a repo with your test project? Really we need to see _IFC_ToCOBie.csproj
I'm trying to run a simple code based on the examples provided. In detail, I want to be able to export an IFC file to COBie format. However, I'm having issues with these lines:
`var cobie = new CobieModel();
Both CobieModel() and IfcToCoBieExpressExchanger(ifc, cobie) are not being detected.
Here is the overall script: `using System; using System.Windows.Forms; using Xbim.Ifc; using System.IO; using Xbim.IO.Memory; using XbimExchanger.IfcToCOBieExpress;
namespace IFC_to_COBie { public partial class Form1 : Form { private string fileName; private XbimEditorCredentials editor;
} `
I'm pretty new to XBIM, so any help would be appreciated.
Thank you.