• 大小: 23.37MB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2023-07-08
  • 语言: C/C++
  • 标签: IFCViewer  Editor  c#源码  

资源简介

C#_IFC_Viewer_Editor 最新Csharp源码 2017_12_22版本 ifc文件解析,里面有C#、C++、VB三个版本,实现ifc文件的读取和绘制

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using IfcEngine;

namespace ifceditor
{
    public partial class Form1 : Form
    {
        private Int32 model;
        private Entity[] myEntities;
        private List myInstances = new List();

        public Form1()
        {
            model = 0;
            InitializeComponent();
            textBoxFileName.Text = AppDomain.CurrentDomain.baseDirectory + “myFile.ifc“;
        }

        private void button1_Click(object sender EventArgs e)
        {
            string fileName = textBoxFileName.Text;

            if (model != 0)
            {
                IfcEngine.x86.sdaiCloseModel(model);
            }

            model = IfcEngine.x86.sdaiOpenModelBN(0 fileName “IFC2X3_TC1.exp“);
            if (model != 0)
            {
                IntPtr outputValue = IntPtr.Zero;
                IfcEngine.x86.GetSPFFHeaderItem(model 9 0 IfcEngine.x86.sdaiSTRING out outputValue);
                string s = Marshal.PtrToStringAnsi(outputValue);
                if (s.Contains(“IFC2“) == false)
                {
                    IfcEngine.x86.sdaiCloseModel(model);
                    model = 0;
                    if (s.Contains(“IFC4“) == true)
                    {
                        model = IfcEngine.x86.sdaiOpenModelBN(0 fileName “IFC4.exp“);
                    }
                }
            }

            treeViewLP.Nodes.Clear();
            if (model != 0)
            {
                Int32 cnt = IfcEngine.x86.engiGetEntityCount(model)
                      i = 0;

                myEntities = new Entity[cnt];
                while (i < cnt) {
                    myEntities[i] = new Entity(IfcEngine.x86.engiGetEntityElement(model i));
                    myEntities[i].attributeCnt = IfcEngine.x86.engiGetEntityNoArguments(myEntities[i].ifcEntity);
                    myEntities[i].instanceCnt = IfcEngine.x86.sdaiGetMemberCount(IfcEngine.x86.sdaiGetEntityExtent(model myEntities[i].ifcEntity));
                    i++;
                }

                while (i != 0) {
                    i--;
                    Int32 ifcParentEntity = IfcEngine.x86.engiGetEntityParent(myEntities[i].ifcEntity);
                    if (ifcParentEntity != 0)
                    {
                        Int32 j = 0;
                        while (j < cnt)
                        {
                            if (ifcParentEntity == myEntities[j].ifcEntity)
                            {
                                if (myEntities[j].child != null)
                                {
                                    myEntities[i].next = myEntities[j].child;
                                }
                           

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        163  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\app.config

     文件     266688  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Debug\IFC2X3_TC1.exp

     文件     387456  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Debug\IFC4.exp

     文件      43008  2017-12-22 16:30  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Debug\IfcEditor-C#_32bit.exe

     文件        163  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Debug\IfcEditor-C#_32bit.exe.config

     文件      23168  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Debug\IfcEditor-C#_32bit.vshost.exe

     文件        163  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Debug\IfcEditor-C#_32bit.vshost.exe.config

     文件    1247232  2017-12-22 15:02  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Debug\ifcengine.dll

     文件      36963  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Debug\myFile.ifc

     文件      23040  2017-12-22 16:15  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Debug\Version.exe

     文件     266688  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Release\IFC2X3_TC1.exp

     文件     387456  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Release\IFC4.exp

     文件      41984  2017-12-22 16:30  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Release\IfcEditor-C#_32bit.exe

     文件        163  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Release\IfcEditor-C#_32bit.exe.config

     文件    1247232  2017-12-22 15:02  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Release\ifcengine.dll

     文件      36963  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Release\myFile.ifc

     文件      23040  2017-12-22 16:15  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\bin\Release\Version.exe

     文件      33191  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\Form1.cs

     文件       4678  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\Form1.Designer.cs

     文件       6020  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\Form1.resx

     文件       5684  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\ifceditor.csproj

     文件        478  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\ifceditor.csproj.user

     文件      41916  2017-12-22 14:56  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\IfcEngine.cs

     文件       7132  2017-12-22 16:30  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件      43008  2017-12-22 16:30  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\obj\x86\Debug\IfcEditor-C#_32bit.exe

     文件        769  2017-12-22 16:30  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\obj\x86\Debug\ifceditor.csproj.FileListAbsolute.txt

     文件        977  2017-12-22 16:30  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\obj\x86\Debug\ifceditor.csproj.GenerateResource.Cache

     文件        180  2017-12-22 16:30  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\obj\x86\Debug\ifceditor.Form1.resources

     文件        180  2017-12-22 16:30  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\obj\x86\Debug\ifceditor.Properties.Resources.resources

     文件          0  2017-12-22 16:26  C#_IFC_Viewer_Editor\32bit-IFCEditor\ifceditor\obj\x86\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

............此处省略515个文件信息

评论

共有 条评论