├── .gitignore
├── LICENSE
├── README.md
├── cs-ifc-exporter-samples-winform
├── .gitignore
├── App.config
├── FrmExporter.Designer.cs
├── FrmExporter.cs
├── FrmExporter.resx
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── cs-ifc-exporter-samples-winform.csproj
└── sample.ifc
├── cs-ifc-exporter-samples
├── .gitignore
├── App.config
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── cs-ifc-exporter-samples.csproj
└── sample.ifc
├── cs-ifc-exporter.sln
├── cs-ifc-exporter
├── .gitignore
├── IOUtils.cs
├── IfcConvert.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Resources
│ └── IfcConvert.exe
└── cs-ifc-exporter.csproj
├── icon.jpg
└── nuget
├── cs-ifc-exporter.1.0.1.nupkg
├── cs-ifc-exporter.nuspec
└── nuget-packaging.md
/.gitignore:
--------------------------------------------------------------------------------
1 | *.user
2 | *.suo
3 | *.dll
4 | *.obj
5 |
6 | .vs/
7 | packages/
8 | bin/
9 | obj/
10 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Chen Caishun
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # cs-ifc-exporter
2 |
3 | .Net library to that export BIM IFC files as SVG, OBJ, XML, DAE, STEP, IGES files.
4 |
5 | This project makes use of the [IfcOpenShell](http://ifcopenshell.org/ifcconvert.html)
6 |
7 | # Install
8 |
9 | ```bash
10 | Install-Package cs-ifc-exporter
11 | ```
12 |
13 | # Usage
14 |
15 | The sample codes below shows how to use the IfConvert to convert IFC files into OBJ, XML or other formats:
16 |
17 | ```cs
18 | using System;
19 | using System.Collections.Generic;
20 | using System.Linq;
21 | using System.Text;
22 | using System.Threading.Tasks;
23 |
24 | namespace IfcExport
25 | {
26 | class Program
27 | {
28 | static void Main(string[] args)
29 | {
30 | IfcConvert.Convert("sample.ifc", "sample.obj");
31 | IfcConvert.Convert("sample.ifc", "sample.xml");
32 | IfcConvert.Convert("sample.ifc", "sample.dae");
33 | IfcConvert.Convert("sample.ifc", "sample.igs");
34 | IfcConvert.Convert("sample.ifc", "sample.svg");
35 | }
36 | }
37 | }
38 |
39 | ```
40 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples-winform/.gitignore:
--------------------------------------------------------------------------------
1 | *.user
2 | *.suo
3 | *.dll
4 | *.obj
5 |
6 | .vs/
7 | packages/
8 | bin/
9 | obj/
10 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples-winform/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples-winform/FrmExporter.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace IfcExport
2 | {
3 | partial class FrmExporter
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.txtIFC = new System.Windows.Forms.TextBox();
33 | this.btnBrowseIFC = new System.Windows.Forms.Button();
34 | this.btnConvert = new System.Windows.Forms.Button();
35 | this.txtMessage = new System.Windows.Forms.TextBox();
36 | this.SuspendLayout();
37 | //
38 | // label1
39 | //
40 | this.label1.AutoSize = true;
41 | this.label1.Location = new System.Drawing.Point(21, 18);
42 | this.label1.Name = "label1";
43 | this.label1.Size = new System.Drawing.Size(145, 13);
44 | this.label1.TabIndex = 0;
45 | this.label1.Text = "Source BIM File (IFC Format):";
46 | //
47 | // txtIFC
48 | //
49 | this.txtIFC.Location = new System.Drawing.Point(172, 15);
50 | this.txtIFC.Name = "txtIFC";
51 | this.txtIFC.Size = new System.Drawing.Size(392, 20);
52 | this.txtIFC.TabIndex = 1;
53 | //
54 | // btnBrowseIFC
55 | //
56 | this.btnBrowseIFC.Location = new System.Drawing.Point(582, 13);
57 | this.btnBrowseIFC.Name = "btnBrowseIFC";
58 | this.btnBrowseIFC.Size = new System.Drawing.Size(75, 23);
59 | this.btnBrowseIFC.TabIndex = 2;
60 | this.btnBrowseIFC.Text = "Browse";
61 | this.btnBrowseIFC.UseVisualStyleBackColor = true;
62 | this.btnBrowseIFC.Click += new System.EventHandler(this.btnBrowseIFC_Click);
63 | //
64 | // btnConvert
65 | //
66 | this.btnConvert.Location = new System.Drawing.Point(24, 61);
67 | this.btnConvert.Name = "btnConvert";
68 | this.btnConvert.Size = new System.Drawing.Size(153, 23);
69 | this.btnConvert.TabIndex = 3;
70 | this.btnConvert.Text = "Convert";
71 | this.btnConvert.UseVisualStyleBackColor = true;
72 | this.btnConvert.Click += new System.EventHandler(this.btnConvert_Click);
73 | //
74 | // txtMessage
75 | //
76 | this.txtMessage.Location = new System.Drawing.Point(198, 61);
77 | this.txtMessage.Multiline = true;
78 | this.txtMessage.Name = "txtMessage";
79 | this.txtMessage.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
80 | this.txtMessage.Size = new System.Drawing.Size(459, 131);
81 | this.txtMessage.TabIndex = 4;
82 | //
83 | // FrmExporter
84 | //
85 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
86 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
87 | this.ClientSize = new System.Drawing.Size(686, 204);
88 | this.Controls.Add(this.txtMessage);
89 | this.Controls.Add(this.btnConvert);
90 | this.Controls.Add(this.btnBrowseIFC);
91 | this.Controls.Add(this.txtIFC);
92 | this.Controls.Add(this.label1);
93 | this.Name = "FrmExporter";
94 | this.Text = "IFC Converter";
95 | this.Load += new System.EventHandler(this.FrmExporter_Load);
96 | this.ResumeLayout(false);
97 | this.PerformLayout();
98 |
99 | }
100 |
101 | #endregion
102 |
103 | private System.Windows.Forms.Label label1;
104 | private System.Windows.Forms.TextBox txtIFC;
105 | private System.Windows.Forms.Button btnBrowseIFC;
106 | private System.Windows.Forms.Button btnConvert;
107 | private System.Windows.Forms.TextBox txtMessage;
108 | }
109 | }
110 |
111 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples-winform/FrmExporter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.IO;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading;
10 | using System.Threading.Tasks;
11 | using System.Windows.Forms;
12 |
13 | namespace IfcExport
14 | {
15 | public partial class FrmExporter : Form
16 | {
17 | delegate void StringArgReturningVoidDelegate(string text);
18 |
19 | public FrmExporter()
20 | {
21 | InitializeComponent();
22 | }
23 |
24 | private void btnBrowseIFC_Click(object sender, EventArgs e)
25 | {
26 | OpenFileDialog openFileDialog1 = new OpenFileDialog();
27 | openFileDialog1.Filter = "IFC Files|*.ifc";
28 | openFileDialog1.Title = "Select an IFC File";
29 |
30 | string currentDir = Directory.GetCurrentDirectory();
31 |
32 | // Show the Dialog.
33 | // If the user clicked OK in the dialog and
34 | // a .CUR file was selected, open it.
35 | if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
36 | {
37 | Directory.SetCurrentDirectory(currentDir);
38 | // Assign the cursor in the Stream to the Form's Cursor property.
39 | txtIFC.Text = openFileDialog1.FileName;
40 | } else
41 | {
42 | Directory.SetCurrentDirectory(currentDir);
43 | }
44 | }
45 |
46 | private void btnConvert_Click(object sender, EventArgs e)
47 | {
48 | SaveFileDialog saveFileDialog = new SaveFileDialog();
49 |
50 | saveFileDialog.Filter = "OBJ Files|*.obj";
51 | saveFileDialog.Title = "Export As";
52 |
53 | string currentDir = Directory.GetCurrentDirectory();
54 |
55 | txtMessage.Text = "";
56 |
57 |
58 | // Show the Dialog.
59 | // If the user clicked OK in the dialog and
60 | // a .CUR file was selected, open it.
61 | if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
62 | {
63 | Directory.SetCurrentDirectory(currentDir);
64 | // Assign the cursor in the Stream to the Form's Cursor property.
65 | string outputFilePath = saveFileDialog.FileName;
66 |
67 |
68 | if (File.Exists(outputFilePath))
69 | {
70 | File.Delete(outputFilePath);
71 | }
72 |
73 | IfcConvert.Convert(txtIFC.Text, outputFilePath, message =>
74 | {
75 | AppendText(message);
76 | });
77 |
78 | IfcConvert.Convert(txtIFC.Text, outputFilePath.Replace(".obj", ".xml"), message =>
79 | {
80 | AppendText(message);
81 | });
82 | }
83 | else
84 | {
85 | Directory.SetCurrentDirectory(currentDir);
86 | }
87 | }
88 |
89 | private void FrmExporter_Load(object sender, EventArgs e)
90 | {
91 | txtIFC.Text = Path.Combine(IOUtils.AssemblyDirectory, "..", "..", "sample.ifc");
92 | }
93 |
94 | private void AppendText(string message)
95 | {
96 | // InvokeRequired required compares the thread ID of the
97 | // calling thread to the thread ID of the creating thread.
98 | // If these threads are different, it returns true.
99 | if (this.txtMessage.InvokeRequired)
100 | {
101 | StringArgReturningVoidDelegate d = new StringArgReturningVoidDelegate(AppendText);
102 | this.Invoke(d, new object[] { message });
103 | }
104 | else
105 | {
106 | txtMessage.Text += message + "\r\n";
107 | }
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples-winform/FrmExporter.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples-winform/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace IfcExport
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new FrmExporter());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples-winform/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("cs-ifc-exporter-samples-winform")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("cs-ifc-exporter-samples-winform")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("370afa62-8d4e-4ae4-ac40-e87d21bc3c26")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples-winform/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace IfcExport.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IfcExport.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples-winform/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples-winform/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace IfcExport.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples-winform/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples-winform/cs-ifc-exporter-samples-winform.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {370AFA62-8D4E-4AE4-AC40-E87D21BC3C26}
8 | WinExe
9 | IfcExport
10 | cs-ifc-exporter-samples-winform
11 | v4.6.1
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | Form
50 |
51 |
52 | FrmExporter.cs
53 |
54 |
55 |
56 |
57 | FrmExporter.cs
58 |
59 |
60 | ResXFileCodeGenerator
61 | Resources.Designer.cs
62 | Designer
63 |
64 |
65 | True
66 | Resources.resx
67 | True
68 |
69 |
70 | SettingsSingleFileGenerator
71 | Settings.Designer.cs
72 |
73 |
74 | True
75 | Settings.settings
76 | True
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | {bbf410c0-1843-4102-878f-1a9a02d22609}
85 | cs-ifc-exporter
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples/.gitignore:
--------------------------------------------------------------------------------
1 | *.user
2 | *.suo
3 | *.dll
4 | *.obj
5 |
6 | .vs/
7 | packages/
8 | bin/
9 | obj/
10 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace IfcExport
8 | {
9 | class Program
10 | {
11 | static void Main(string[] args)
12 | {
13 | IfcConvert.Convert("sample.ifc", "sample.obj");
14 | IfcConvert.Convert("sample.ifc", "sample.xml");
15 | IfcConvert.Convert("sample.ifc", "sample.dae");
16 | IfcConvert.Convert("sample.ifc", "sample.igs");
17 | IfcConvert.Convert("sample.ifc", "sample.svg");
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("cs-ifc-exporter-samples")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("cs-ifc-exporter-samples")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("4fcf7b3d-e5dd-4971-9ba2-e38d0908b266")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/cs-ifc-exporter-samples/cs-ifc-exporter-samples.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {4FCF7B3D-E5DD-4971-9BA2-E38D0908B266}
8 | Exe
9 | IfcExport
10 | cs-ifc-exporter-samples
11 | v4.6.1
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | {bbf410c0-1843-4102-878f-1a9a02d22609}
54 | cs-ifc-exporter
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/cs-ifc-exporter.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27130.2024
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cs-ifc-exporter", "cs-ifc-exporter\cs-ifc-exporter.csproj", "{BBF410C0-1843-4102-878F-1A9A02D22609}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cs-ifc-exporter-samples", "cs-ifc-exporter-samples\cs-ifc-exporter-samples.csproj", "{4FCF7B3D-E5DD-4971-9BA2-E38D0908B266}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cs-ifc-exporter-samples-winform", "cs-ifc-exporter-samples-winform\cs-ifc-exporter-samples-winform.csproj", "{370AFA62-8D4E-4AE4-AC40-E87D21BC3C26}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|Any CPU = Debug|Any CPU
15 | Release|Any CPU = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {BBF410C0-1843-4102-878F-1A9A02D22609}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {BBF410C0-1843-4102-878F-1A9A02D22609}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {BBF410C0-1843-4102-878F-1A9A02D22609}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {BBF410C0-1843-4102-878F-1A9A02D22609}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {4FCF7B3D-E5DD-4971-9BA2-E38D0908B266}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {4FCF7B3D-E5DD-4971-9BA2-E38D0908B266}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {4FCF7B3D-E5DD-4971-9BA2-E38D0908B266}.Release|Any CPU.ActiveCfg = Release|Any CPU
25 | {4FCF7B3D-E5DD-4971-9BA2-E38D0908B266}.Release|Any CPU.Build.0 = Release|Any CPU
26 | {370AFA62-8D4E-4AE4-AC40-E87D21BC3C26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {370AFA62-8D4E-4AE4-AC40-E87D21BC3C26}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {370AFA62-8D4E-4AE4-AC40-E87D21BC3C26}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 | {370AFA62-8D4E-4AE4-AC40-E87D21BC3C26}.Release|Any CPU.Build.0 = Release|Any CPU
30 | EndGlobalSection
31 | GlobalSection(SolutionProperties) = preSolution
32 | HideSolutionNode = FALSE
33 | EndGlobalSection
34 | GlobalSection(ExtensibilityGlobals) = postSolution
35 | SolutionGuid = {BAE74BD1-2F8E-4FCC-8209-68AF04F874BF}
36 | EndGlobalSection
37 | EndGlobal
38 |
--------------------------------------------------------------------------------
/cs-ifc-exporter/.gitignore:
--------------------------------------------------------------------------------
1 | *.user
2 | *.suo
3 | *.dll
4 | *.obj
5 |
6 | .vs/
7 | packages/
8 | bin/
9 | obj/
10 |
--------------------------------------------------------------------------------
/cs-ifc-exporter/IOUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Reflection;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace IfcExport
10 | {
11 | public class IOUtils
12 | {
13 | public static string AssemblyDirectory
14 | {
15 | get
16 | {
17 | string codeBase = Assembly.GetExecutingAssembly().CodeBase;
18 | UriBuilder uri = new UriBuilder(codeBase);
19 | string path = Uri.UnescapeDataString(uri.Path);
20 | return Path.GetDirectoryName(path);
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/cs-ifc-exporter/IfcConvert.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Diagnostics;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace IfcExport
11 | {
12 | public class IfcConvert
13 | {
14 | public static void InstallIfcConvert()
15 | {
16 | InstallBinaryFile("IfcConvert.exe", Properties.Resources.IfcConvert);
17 | }
18 |
19 | private static void InstallBinaryFile(string filename, byte[] bytes)
20 | {
21 | string path = Path.Combine(IOUtils.AssemblyDirectory, filename);
22 | if (File.Exists(path)) return;
23 | File.WriteAllBytes(path, bytes);
24 | }
25 |
26 | public static void Convert(string source, string target, Action callback = null)
27 | {
28 | InstallIfcConvert();
29 |
30 | string executablePath = Path.Combine(IOUtils.AssemblyDirectory, "IfcConvert.exe");
31 |
32 | var info = new ProcessStartInfo();
33 | info.FileName = string.Format("\"{0}\"", executablePath);
34 | info.WorkingDirectory = IOUtils.AssemblyDirectory;
35 | info.Arguments = string.Format("\"{0}\" \"{1}\"", source, target);
36 |
37 | info.RedirectStandardInput = false;
38 | info.RedirectStandardOutput = true;
39 | info.UseShellExecute = false;
40 | info.CreateNoWindow = true;
41 |
42 |
43 | using (var proc = new Process())
44 | {
45 | proc.StartInfo = info;
46 | proc.Start();
47 | string message = proc.StandardOutput.ReadToEnd();
48 | if (callback != null){
49 | callback(message);
50 | } else {
51 | Console.WriteLine();
52 | }
53 |
54 | }
55 | }
56 | }
57 | }
58 |
59 |
--------------------------------------------------------------------------------
/cs-ifc-exporter/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("cs-ifc-exporter")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("cs-ifc-exporter")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("bbf410c0-1843-4102-878f-1a9a02d22609")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/cs-ifc-exporter/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace IfcExport.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IfcExport.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Byte[].
65 | ///
66 | internal static byte[] IfcConvert {
67 | get {
68 | object obj = ResourceManager.GetObject("IfcConvert", resourceCulture);
69 | return ((byte[])(obj));
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/cs-ifc-exporter/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\IfcConvert.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
123 |
124 |
--------------------------------------------------------------------------------
/cs-ifc-exporter/Resources/IfcConvert.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cschen1205/cs-ifc-exporter/94f13c6eb09541670588fba4ab1c7082aac6cfef/cs-ifc-exporter/Resources/IfcConvert.exe
--------------------------------------------------------------------------------
/cs-ifc-exporter/cs-ifc-exporter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {BBF410C0-1843-4102-878F-1A9A02D22609}
8 | Library
9 | Properties
10 | IfcExport
11 | cs-ifc-exporter
12 | v4.6.1
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | pdbonly
26 | true
27 | bin\Release\
28 | TRACE
29 | prompt
30 | 4
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | True
48 | True
49 | Resources.resx
50 |
51 |
52 |
53 |
54 | ResXFileCodeGenerator
55 | Resources.Designer.cs
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/icon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cschen1205/cs-ifc-exporter/94f13c6eb09541670588fba4ab1c7082aac6cfef/icon.jpg
--------------------------------------------------------------------------------
/nuget/cs-ifc-exporter.1.0.1.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cschen1205/cs-ifc-exporter/94f13c6eb09541670588fba4ab1c7082aac6cfef/nuget/cs-ifc-exporter.1.0.1.nupkg
--------------------------------------------------------------------------------
/nuget/cs-ifc-exporter.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | cs-ifc-exporter
5 | 1.0.1
6 | cschen1205
7 | cschen1205
8 | https://github.com/cschen1205/cs-ifc-exporter/blob/master/LICENSE
9 | https://github.com/cschen1205/cs-ifc-exporter
10 | https://rawgit.com/cschen1205/cs-ifc-exporter/master/icon.jpg
11 | false
12 | Export BIM IFC files to SVG, IGES, OBJ, XML, DAE and so on
13 | Library to export BIM IFC files to SVG, IGES, OBJ, XML, DAE and so on in .NET 4.6.1
14 | Copyright 2018
15 | BIM, IFC, OBJ, IGES, XML, OBJ, DAE, c-sharp
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/nuget/nuget-packaging.md:
--------------------------------------------------------------------------------
1 | Run the following command line:
2 |
3 | ```bash
4 | cd nuget/
5 | nuget pack cs-ifc-exporter.nuspec
6 | ```
--------------------------------------------------------------------------------