├── LICENSE
├── README.md
├── edrawings-api
├── BatchExportPdf
│ ├── BatchExportPdf.sln
│ └── BatchExportPdf
│ │ ├── BatchExportPdf.vbproj
│ │ ├── EDrawingsHost.vb
│ │ ├── Module1.vb
│ │ └── My Project
│ │ ├── Application.Designer.vb
│ │ ├── Application.myapp
│ │ ├── AssemblyInfo.vb
│ │ ├── Resources.Designer.vb
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.vb
│ │ └── Settings.settings
├── Export
│ ├── App.config
│ ├── EDrawingsHost.cs
│ ├── Export.csproj
│ ├── Export.sln
│ ├── Program.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
├── MeasurementSurveying
│ ├── MeasurementSurveying.sln
│ └── MeasurementSurveying
│ │ ├── EDrawingsHost.cs
│ │ ├── EDrawingsUserControl.Designer.cs
│ │ ├── EDrawingsUserControl.cs
│ │ ├── MainForm.Designer.cs
│ │ ├── MainForm.cs
│ │ ├── MainForm.resx
│ │ ├── MeasurementSurveying.csproj
│ │ ├── Program.cs
│ │ └── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
├── eDrawingsWinFormsHost
│ ├── eDrawingsWinFormsHost.sln
│ └── eDrawingsWinFormsHost
│ │ ├── EDrawingsHost.cs
│ │ ├── EDrawingsUserControl.Designer.cs
│ │ ├── EDrawingsUserControl.cs
│ │ ├── MainForm.Designer.cs
│ │ ├── MainForm.cs
│ │ ├── MainForm.resx
│ │ ├── Program.cs
│ │ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ │ └── eDrawingsWinFormsHost.csproj
├── eDrawingsWpfHost
│ ├── eDrawingsWpfHost.sln
│ └── eDrawingsWpfHost
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── EDrawingsHost.cs
│ │ ├── EDrawingsHostControl.xaml
│ │ ├── EDrawingsHostControl.xaml.cs
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ │ └── eDrawingsWpfHost.csproj
└── thirdpty
│ ├── eDrawings.Interop.EModelMarkupControl.dll
│ └── eDrawings.Interop.EModelViewControl.dll
└── swex
├── add-in
├── create-geometry-api
│ ├── ConsoleApplicationCSharp
│ │ ├── App.config
│ │ ├── ConsoleApplicationCSharp.csproj
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ ├── ConsoleApplicationVB
│ │ ├── App.config
│ │ ├── ConsoleApplicationVB.vbproj
│ │ ├── Module1.vb
│ │ ├── My Project
│ │ │ ├── Application.Designer.vb
│ │ │ ├── Application.myapp
│ │ │ ├── AssemblyInfo.vb
│ │ │ ├── Resources.Designer.vb
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.vb
│ │ │ └── Settings.settings
│ │ └── packages.config
│ ├── CreateGeometryAddIn.sln
│ ├── CreateGeometryAddIn
│ │ ├── AddIn.cs
│ │ ├── CreateGeometryAddIn.csproj
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ └── README.md
├── distance-heat-map
│ ├── DistanceHeatMap
│ │ ├── AddIn.cs
│ │ ├── ColorizerDocument.cs
│ │ ├── DistanceColorContour.cs
│ │ ├── DistanceHeatMap.csproj
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ └── distance-heat-map.sln
├── export-components
│ ├── csharp
│ │ ├── ComponentExtension.cs
│ │ ├── ExportCommands.cs
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ └── Resources.resx
│ │ ├── README.txt
│ │ ├── Resources
│ │ │ ├── export.png
│ │ │ ├── export_iges.png
│ │ │ ├── export_parasolid.png
│ │ │ └── export_step.png
│ │ ├── SwExportComponent.csproj
│ │ ├── SwExportComponent.sln
│ │ ├── SwExportComponentAddIn.cs
│ │ └── packages.config
│ └── vb-net
│ │ ├── ComponentExtension.vb
│ │ ├── ExportCommands.vb
│ │ ├── My Project
│ │ ├── Application.Designer.vb
│ │ ├── Application.myapp
│ │ ├── AssemblyInfo.vb
│ │ ├── Resources.Designer.vb
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.vb
│ │ └── Settings.settings
│ │ ├── README.txt
│ │ ├── Resources
│ │ ├── export.png
│ │ ├── export_iges.png
│ │ ├── export_parasolid.png
│ │ └── export_step.png
│ │ ├── SwExportComponent.sln
│ │ ├── SwExportComponent.vbproj
│ │ ├── SwExportComponentAddIn.vb
│ │ └── packages.config
├── face-indexer
│ ├── FaceIndexer.sln
│ ├── FaceIndexer
│ │ ├── FaceIndexer.csproj
│ │ ├── FaceIndexerAddIn.cs
│ │ ├── FaceIndexerAddInApi.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ ├── README.md
│ └── StandAlone
│ │ ├── App.config
│ │ ├── FaceIndexerCallback.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── StandAlone.csproj
│ │ └── packages.config
├── form-selection-box
│ ├── FormSelectionBox.sln
│ ├── FormSelectionBox
│ │ ├── FormSelectionBox.csproj
│ │ ├── FormSelectionBoxAddIn.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── SelectionBox.cs
│ │ ├── SelectionForm.Designer.cs
│ │ ├── SelectionForm.cs
│ │ ├── SelectionForm.resx
│ │ └── packages.config
│ └── README.md
├── geometry-helper-api-rot
│ ├── GeometryHelperAddIn
│ │ ├── GeometryHelperAddIn.csproj
│ │ ├── GeometryHelperApiObject.cs
│ │ ├── GeometryHelperApiObjectProxy.cs
│ │ ├── GeometryHelperService.cs
│ │ ├── MainAddIn.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── RotHelper.cs
│ │ └── packages.config
│ ├── GeometryHelperApiObject
│ │ ├── GeometryHelperApiObject.csproj
│ │ ├── GeometryHelperApiObjectFactory.cs
│ │ ├── IGeometryHelperApiObject.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ ├── README.md
│ ├── RotApiObject.sln
│ └── StandAlone
│ │ ├── App.config
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ └── StandAlone.csproj
├── issues-manager
│ ├── csharp
│ │ ├── IssuesManager
│ │ │ ├── AddIn.cs
│ │ │ ├── Commands
│ │ │ │ └── RelayCommand.cs
│ │ │ ├── Converters
│ │ │ │ ├── IssueForegroundConverter.cs
│ │ │ │ ├── IssueTitleConverter.cs
│ │ │ │ └── ObjectIsNotNullToVisibilityConverter.cs
│ │ │ ├── IssuesDocument.cs
│ │ │ ├── IssuesManager.csproj
│ │ │ ├── Models
│ │ │ │ ├── Issue.cs
│ │ │ │ ├── IssueInfo.cs
│ │ │ │ ├── Severity.cs
│ │ │ │ └── Status.cs
│ │ │ ├── Properties
│ │ │ │ ├── AssemblyInfo.cs
│ │ │ │ ├── Resources.Designer.cs
│ │ │ │ └── Resources.resx
│ │ │ ├── Resources
│ │ │ │ ├── issues-icon.png
│ │ │ │ └── new-issue-icon.png
│ │ │ ├── ViewModels
│ │ │ │ ├── IssueVM.cs
│ │ │ │ └── IssuesVM.cs
│ │ │ ├── Views
│ │ │ │ ├── IssuesControl.xaml
│ │ │ │ ├── IssuesControl.xaml.cs
│ │ │ │ ├── IssuesControlHost.Designer.cs
│ │ │ │ ├── IssuesControlHost.cs
│ │ │ │ └── IssuesControlHost.resx
│ │ │ └── packages.config
│ │ └── issues-manager.sln
│ └── vb-net
│ │ ├── IssuesManager.sln
│ │ └── IssuesManager
│ │ ├── AddIn.vb
│ │ ├── Issue.vb
│ │ ├── IssuesControl.xaml
│ │ ├── IssuesControl.xaml.vb
│ │ ├── IssuesControlHost.Designer.vb
│ │ ├── IssuesControlHost.resx
│ │ ├── IssuesControlHost.vb
│ │ ├── IssuesDocument.vb
│ │ ├── IssuesManager.vbproj
│ │ ├── My Project
│ │ ├── Application.Designer.vb
│ │ ├── Application.myapp
│ │ ├── AssemblyInfo.vb
│ │ ├── Resources.Designer.vb
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.vb
│ │ └── Settings.settings
│ │ ├── Resources
│ │ ├── issues-icon.png
│ │ └── new-issue-icon.png
│ │ └── packages.config
├── opengl
│ ├── OglTetrahedron
│ │ ├── OglTetrahedron.sln
│ │ └── OglTetrahedron
│ │ │ ├── AddIn.vb
│ │ │ ├── My Project
│ │ │ ├── Application.Designer.vb
│ │ │ ├── Application.myapp
│ │ │ ├── AssemblyInfo.vb
│ │ │ ├── Resources.Designer.vb
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.vb
│ │ │ └── Settings.settings
│ │ │ ├── OglTetrahedron.vbproj
│ │ │ ├── OpenGL.vb
│ │ │ ├── OpenGlDocumentHandler.vb
│ │ │ └── packages.config
│ ├── OpenGlBoxGrid
│ │ ├── OpenGlBoxGrid.sln
│ │ └── OpenGlBoxGrid
│ │ │ ├── AddIn.cs
│ │ │ ├── OpenGL.cs
│ │ │ ├── OpenGlBoxGrid.csproj
│ │ │ ├── OpenGlDocumentHandler.cs
│ │ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ │ └── packages.config
│ └── XamlImporter
│ │ ├── XamlImporter.sln
│ │ └── XamlImporter
│ │ ├── AddIn.cs
│ │ ├── MeshRendererModel.cs
│ │ ├── OpenTK.dll.config
│ │ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ │ ├── Resources
│ │ └── xaml.png
│ │ ├── XamlImporter.csproj
│ │ └── packages.config
├── progress-handler
│ ├── ProgressHandler.sln
│ └── ProgressHandler
│ │ ├── AddIn.cs
│ │ ├── ProgressForm.Designer.cs
│ │ ├── ProgressForm.cs
│ │ ├── ProgressForm.resx
│ │ ├── ProgressHandler.csproj
│ │ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ │ ├── Resources
│ │ ├── a.png
│ │ ├── b.png
│ │ ├── bl.png
│ │ ├── c.png
│ │ ├── d.png
│ │ ├── e.png
│ │ └── toggle.png
│ │ └── packages.config
└── signalr-model-builder
│ ├── ModelBuilder.sln
│ ├── ModelBuilder
│ ├── IModelBuilderClient.cs
│ ├── ModelBuilder.cs
│ ├── ModelBuilder.csproj
│ ├── ModelBuilderAddIn.cs
│ ├── ModelBuilderHub.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── app.config
│ └── packages.config
│ └── WebClient.html
├── macro-feature
├── convert-solid-to-surface
│ └── vb-net
│ │ ├── AddIn.vb
│ │ ├── ConvertSolidToSurface.sln
│ │ ├── ConvertSolidToSurface.vbproj
│ │ ├── DataModel.vb
│ │ ├── MacroFeature.vb
│ │ ├── My Project
│ │ ├── Application.Designer.vb
│ │ ├── Application.myapp
│ │ ├── AssemblyInfo.vb
│ │ ├── Resources.Designer.vb
│ │ ├── Resources.resx
│ │ ├── Resources.ru.Designer.vb
│ │ ├── Resources.ru.resx
│ │ ├── Settings.Designer.vb
│ │ └── Settings.settings
│ │ ├── PropertyPage.vb
│ │ ├── Resources
│ │ ├── solid-body.png
│ │ └── solid-to-surface.png
│ │ └── packages.config
└── link-external-file
│ ├── csharp
│ ├── LinkFeatureToExternalFile.sln
│ └── LinkFeatureToExternalFile
│ │ ├── AddIn.cs
│ │ ├── LinkFeatureToExternalFile.csproj
│ │ ├── LinkFileMacroFeature.cs
│ │ ├── LinkFileMacroFeatureHandler.cs
│ │ ├── LinkFileMacroFeatureParameters.cs
│ │ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ │ ├── Resources
│ │ └── linked-part-icon.png
│ │ └── packages.config
│ └── vb-net
│ ├── LinkFeatureToExternalFile.sln
│ └── LinkFeatureToExternalFile
│ ├── AddIn.vb
│ ├── LinkFeatureToExternalFile.vbproj
│ ├── LinkFileMacroFeature.vb
│ ├── LinkFileMacroFeatureHandler.vb
│ ├── LinkFileMacroFeatureParameters.vb
│ ├── My Project
│ ├── Application.Designer.vb
│ ├── Application.myapp
│ ├── AssemblyInfo.vb
│ ├── Resources.Designer.vb
│ ├── Resources.resx
│ ├── Settings.Designer.vb
│ └── Settings.settings
│ ├── Resources
│ └── linked-part-icon.png
│ └── packages.config
├── pmpage
└── InsertNote
│ └── csharp
│ ├── App.config
│ ├── InsertNote.csproj
│ ├── InsertNote.sln
│ ├── InsertNoteAddIn.cs
│ ├── InsertNotePMPageHandler.cs
│ ├── NoteData.cs
│ ├── NoteHelper.cs
│ ├── NoteSize.cs
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
│ ├── Resources
│ └── insert_note_icon.png
│ └── packages.config
└── tutorials
└── geometrical-primitives
├── csharp
├── PrimitivesStandardFeatures
│ ├── PrimitivesStandardFeatures.sln
│ └── PrimitivesStandardFeatures
│ │ ├── AddIn.cs
│ │ ├── ModelDocEx.cs
│ │ ├── PrimitivesStandardFeatures.csproj
│ │ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ │ ├── Resources
│ │ ├── box-icon.png
│ │ ├── cylinder-icon.png
│ │ └── primitives-icon.png
│ │ └── packages.config
└── PrimitivesStandardFeaturesPMPage
│ ├── PrimitivesStandardFeaturesPMPage.sln
│ └── PrimitivesStandardFeaturesPMPage
│ ├── AddIn.cs
│ ├── BoxData.cs
│ ├── CylinderData.cs
│ ├── ModelDocEx.cs
│ ├── PrimitivesStandardFeaturesPMPage.csproj
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
│ ├── PropertyPageHandler.cs
│ ├── ReferenceSelectionCustomFilter.cs
│ ├── Resources
│ ├── box-icon.png
│ ├── cylinder-icon.png
│ ├── height-icon.png
│ └── primitives-icon.png
│ └── packages.config
└── vb-net
├── PrimitivesStandardFeatures
├── PrimitivesStandardFeatures.sln
└── PrimitivesStandardFeatures
│ ├── AddIn.vb
│ ├── ModelDocEx.vb
│ ├── My Project
│ ├── Application.Designer.vb
│ ├── Application.myapp
│ ├── AssemblyInfo.vb
│ ├── Resources.Designer.vb
│ ├── Resources.resx
│ ├── Settings.Designer.vb
│ └── Settings.settings
│ ├── PrimitivesStandardFeatures.vbproj
│ ├── Resources
│ ├── box-icon.png
│ ├── cylinder-icon.png
│ └── primitives-icon.png
│ └── packages.config
└── PrimitivesStandardFeaturesPMPage
├── PrimitivesStandardFeaturesPMPage.sln
└── PrimitivesStandardFeaturesPMPage
├── AddIn.vb
├── BoxData.vb
├── CylinderData.vb
├── ModelDocEx.vb
├── PrimitivesStandardFeaturesPMPage.vbproj
├── Properties
├── AssemblyInfo.vb
├── Resources.Designer.vb
└── Resources.resx
├── PropertyPageHandler.vb
├── ReferenceSelectionCustomFilter.vb
├── Resources
├── box-icon.png
├── cylinder-icon.png
├── height-icon.png
└── primitives-icon.png
└── packages.config
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Code Stack
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 |
--------------------------------------------------------------------------------
/edrawings-api/BatchExportPdf/BatchExportPdf.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27130.2026
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "BatchExportPdf", "BatchExportPdf\BatchExportPdf.vbproj", "{AAE63356-3E7D-46D7-B8E2-7DA532E5EB12}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {AAE63356-3E7D-46D7-B8E2-7DA532E5EB12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {AAE63356-3E7D-46D7-B8E2-7DA532E5EB12}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {AAE63356-3E7D-46D7-B8E2-7DA532E5EB12}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {AAE63356-3E7D-46D7-B8E2-7DA532E5EB12}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {A2A6D160-1BCD-4F18-B96E-C80F6A471BFE}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/edrawings-api/BatchExportPdf/BatchExportPdf/EDrawingsHost.vb:
--------------------------------------------------------------------------------
1 | '**********************
2 | 'Batch export SOLIDWORKS files to PDF via eDrawings API (without SOLIDWORKS)
3 | 'Copyright(C) 2019 www.codestack.net
4 | 'License: https://github.com/codestack-net-dev/solidworks-api-examples/blob/master/LICENSE
5 | 'Product URL: https://www.codestack.net/edrawings-api/output/print-to-pdf/
6 | '**********************
7 |
8 | Imports System.Windows.Forms
9 | Imports eDrawings.Interop.EModelViewControl
10 |
11 | Public Class EDrawingsHost
12 | Inherits AxHost
13 |
14 | Public Event ControlLoaded As Action(Of EModelViewControl)
15 | Private m_IsLoaded As Boolean
16 |
17 | Public Sub New()
18 | MyBase.New("22945A69-1191-4DCF-9E6F-409BDE94D101")
19 | m_IsLoaded = False
20 | End Sub
21 |
22 | Protected Overrides Sub OnCreateControl()
23 | MyBase.OnCreateControl()
24 |
25 | If Not m_IsLoaded Then
26 | m_IsLoaded = True
27 | Dim ctrl = TryCast(Me.GetOcx(), EModelViewControl)
28 | RaiseEvent ControlLoaded(TryCast(Me.GetOcx(), EModelViewControl))
29 | End If
30 | End Sub
31 |
32 | End Class
33 |
--------------------------------------------------------------------------------
/edrawings-api/BatchExportPdf/BatchExportPdf/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
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 | Option Strict On
12 | Option Explicit On
13 |
14 |
--------------------------------------------------------------------------------
/edrawings-api/BatchExportPdf/BatchExportPdf/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 | false
5 | 0
6 | true
7 | 0
8 | 2
9 | true
10 |
11 |
--------------------------------------------------------------------------------
/edrawings-api/BatchExportPdf/BatchExportPdf/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports System.Runtime.InteropServices
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/edrawings-api/BatchExportPdf/BatchExportPdf/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/edrawings-api/Export/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/edrawings-api/Export/EDrawingsHost.cs:
--------------------------------------------------------------------------------
1 | //**********************
2 | //Batch export files via eDrawings API (without SOLIDWORKS)
3 | //Copyright(C) 2019 www.codestack.net
4 | //License: https://github.com/codestack-net-dev/solidworks-api-examples/blob/master/LICENSE
5 | //Product URL: https://www.codestack.net/edrawings-api/output/export/
6 | //**********************
7 |
8 | using System;
9 | using System.Windows.Forms;
10 | using eDrawings.Interop.EModelViewControl;
11 |
12 | namespace Export
13 | {
14 | public class EDrawingsHost : AxHost
15 | {
16 | public event Action ControlLoaded;
17 | private bool m_IsLoaded;
18 |
19 | public EDrawingsHost() : base("22945A69-1191-4DCF-9E6F-409BDE94D101")
20 | {
21 | m_IsLoaded = false;
22 | }
23 |
24 | protected override void OnCreateControl()
25 | {
26 | base.OnCreateControl();
27 |
28 | if (!m_IsLoaded)
29 | {
30 | m_IsLoaded = true;
31 | var ctrl = GetOcx() as EModelViewControl;
32 | ControlLoaded?.Invoke(GetOcx() as EModelViewControl);
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/edrawings-api/Export/Export.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.757
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Export", "Export.csproj", "{C988DF41-F3D6-4D78-AB2F-20785EACD664}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {C988DF41-F3D6-4D78-AB2F-20785EACD664}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {C988DF41-F3D6-4D78-AB2F-20785EACD664}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {C988DF41-F3D6-4D78-AB2F-20785EACD664}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {C988DF41-F3D6-4D78-AB2F-20785EACD664}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {C43DBD1C-0BF6-420E-9152-BD5929EC40C8}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/edrawings-api/Export/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | [assembly: AssemblyTitle("Export")]
5 | [assembly: AssemblyDescription("")]
6 | [assembly: AssemblyConfiguration("")]
7 | [assembly: AssemblyCompany("CodeStack")]
8 | [assembly: AssemblyProduct("Export")]
9 | [assembly: AssemblyCopyright("Copyright © www.codestack.net 2019")]
10 | [assembly: AssemblyTrademark("")]
11 | [assembly: AssemblyCulture("")]
12 |
13 | [assembly: ComVisible(false)]
14 |
15 | [assembly: Guid("c988df41-f3d6-4d78-ab2f-20785eacd664")]
16 |
17 | [assembly: AssemblyVersion("1.0.0.0")]
18 | [assembly: AssemblyFileVersion("1.0.0.0")]
19 |
--------------------------------------------------------------------------------
/edrawings-api/MeasurementSurveying/MeasurementSurveying.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27130.2026
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeasurementSurveying", "MeasurementSurveying\MeasurementSurveying.csproj", "{64C1331B-6DD1-4540-B3D7-AA14FB0635AB}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {64C1331B-6DD1-4540-B3D7-AA14FB0635AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {64C1331B-6DD1-4540-B3D7-AA14FB0635AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {64C1331B-6DD1-4540-B3D7-AA14FB0635AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {64C1331B-6DD1-4540-B3D7-AA14FB0635AB}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {83A50F20-71DE-4B50-A122-07D6B3B86635}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/edrawings-api/MeasurementSurveying/MeasurementSurveying/EDrawingsHost.cs:
--------------------------------------------------------------------------------
1 | //**********************
2 | //Hosting eDrawings control in Windows Forms
3 | //Copyright(C) 2019 www.codestack.net
4 | //License: https://github.com/codestack-net-dev/solidworks-api-examples/blob/master/LICENSE
5 | //Product URL: https://www.codestack.net/edrawings-api/gettings-started/winforms/
6 | //**********************
7 |
8 | using eDrawings.Interop.EModelViewControl;
9 | using System;
10 | using System.Windows.Forms;
11 |
12 | namespace CodeStack.Examples.eDrawingsApi
13 | {
14 | public class EDrawingsHost : AxHost
15 | {
16 | public event Action ControlLoaded;
17 |
18 | private bool m_IsLoaded;
19 |
20 | public EDrawingsHost() : base("22945A69-1191-4DCF-9E6F-409BDE94D101")
21 | {
22 | m_IsLoaded = false;
23 | }
24 |
25 | protected override void OnCreateControl()
26 | {
27 | base.OnCreateControl();
28 |
29 | if (!m_IsLoaded)
30 | {
31 | m_IsLoaded = true;
32 | var ctrl = this.GetOcx() as EModelViewControl;
33 | ControlLoaded?.Invoke(this.GetOcx() as EModelViewControl);
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/edrawings-api/MeasurementSurveying/MeasurementSurveying/EDrawingsUserControl.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace CodeStack.Examples.eDrawingsApi
2 | {
3 | partial class EDrawingsUserControl
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 Component 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 | components = new System.ComponentModel.Container();
32 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
33 | }
34 |
35 | #endregion
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/edrawings-api/MeasurementSurveying/MeasurementSurveying/EDrawingsUserControl.cs:
--------------------------------------------------------------------------------
1 | //**********************
2 | //Hosting eDrawings control in Windows Forms
3 | //Copyright(C) 2019 www.codestack.net
4 | //License: https://github.com/codestack-net-dev/solidworks-api-examples/blob/master/LICENSE
5 | //Product URL: https://www.codestack.net/edrawings-api/gettings-started/winforms/
6 | //**********************
7 |
8 | using System;
9 | using System.Windows.Forms;
10 | using eDrawings.Interop.EModelViewControl;
11 |
12 | namespace CodeStack.Examples.eDrawingsApi
13 | {
14 | public partial class EDrawingsUserControl : UserControl
15 | {
16 | public event Action EDrawingsControlLoaded;
17 |
18 | public EDrawingsUserControl()
19 | {
20 | InitializeComponent();
21 | }
22 |
23 | public void LoadEDrawings()
24 | {
25 | var host = new EDrawingsHost();
26 | host.ControlLoaded += OnControlLoaded;
27 | this.Controls.Add(host);
28 | host.Dock = DockStyle.Fill;
29 | }
30 |
31 | private void OnControlLoaded(EModelViewControl ctrl)
32 | {
33 | EDrawingsControlLoaded?.Invoke(ctrl);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/edrawings-api/MeasurementSurveying/MeasurementSurveying/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace CodeStack.Examples.eDrawingsApi
5 | {
6 | static class Program
7 | {
8 | [STAThread]
9 | static void Main()
10 | {
11 | Application.EnableVisualStyles();
12 | Application.SetCompatibleTextRenderingDefault(false);
13 | Application.Run(new MainForm());
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/edrawings-api/MeasurementSurveying/MeasurementSurveying/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("eDrawingsWinFormsHost")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("")]
9 | [assembly: AssemblyProduct("eDrawingsWinFormsHost")]
10 | [assembly: AssemblyCopyright("Copyright © www.codestack.net 2019")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | [assembly: ComVisible(false)]
15 |
16 | [assembly: Guid("409aa6f8-51a5-4ac3-ba5c-f7e1005bf76f")]
17 |
18 | [assembly: AssemblyVersion("1.0.0.0")]
19 | [assembly: AssemblyFileVersion("1.0.0.0")]
20 |
--------------------------------------------------------------------------------
/edrawings-api/MeasurementSurveying/MeasurementSurveying/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 CodeStack.Examples.eDrawingsApi.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 |
--------------------------------------------------------------------------------
/edrawings-api/MeasurementSurveying/MeasurementSurveying/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWinFormsHost/eDrawingsWinFormsHost.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27130.2026
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eDrawingsWinFormsHost", "eDrawingsWinFormsHost\eDrawingsWinFormsHost.csproj", "{409AA6F8-51A5-4AC3-BA5C-F7E1005BF76F}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {409AA6F8-51A5-4AC3-BA5C-F7E1005BF76F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {409AA6F8-51A5-4AC3-BA5C-F7E1005BF76F}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {409AA6F8-51A5-4AC3-BA5C-F7E1005BF76F}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {409AA6F8-51A5-4AC3-BA5C-F7E1005BF76F}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {83A50F20-71DE-4B50-A122-07D6B3B86635}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWinFormsHost/eDrawingsWinFormsHost/EDrawingsHost.cs:
--------------------------------------------------------------------------------
1 | //**********************
2 | //Hosting eDrawings control in Windows Forms
3 | //Copyright(C) 2019 www.codestack.net
4 | //License: https://github.com/codestack-net-dev/solidworks-api-examples/blob/master/LICENSE
5 | //Product URL: https://www.codestack.net/edrawings-api/gettings-started/winforms/
6 | //**********************
7 |
8 | using eDrawings.Interop.EModelViewControl;
9 | using System;
10 | using System.Windows.Forms;
11 |
12 | namespace CodeStack.Examples.eDrawingsApi
13 | {
14 | public class EDrawingsHost : AxHost
15 | {
16 | public event Action ControlLoaded;
17 |
18 | private bool m_IsLoaded;
19 |
20 | public EDrawingsHost() : base("22945A69-1191-4DCF-9E6F-409BDE94D101")
21 | {
22 | m_IsLoaded = false;
23 | }
24 |
25 | protected override void OnCreateControl()
26 | {
27 | base.OnCreateControl();
28 |
29 | if (!m_IsLoaded)
30 | {
31 | m_IsLoaded = true;
32 | var ctrl = this.GetOcx() as EModelViewControl;
33 | ControlLoaded?.Invoke(this.GetOcx() as EModelViewControl);
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWinFormsHost/eDrawingsWinFormsHost/EDrawingsUserControl.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace CodeStack.Examples.eDrawingsApi
2 | {
3 | partial class EDrawingsUserControl
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 Component 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 | components = new System.ComponentModel.Container();
32 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
33 | }
34 |
35 | #endregion
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWinFormsHost/eDrawingsWinFormsHost/EDrawingsUserControl.cs:
--------------------------------------------------------------------------------
1 | //**********************
2 | //Hosting eDrawings control in Windows Forms
3 | //Copyright(C) 2019 www.codestack.net
4 | //License: https://github.com/codestack-net-dev/solidworks-api-examples/blob/master/LICENSE
5 | //Product URL: https://www.codestack.net/edrawings-api/gettings-started/winforms/
6 | //**********************
7 |
8 | using System;
9 | using System.Windows.Forms;
10 | using eDrawings.Interop.EModelViewControl;
11 |
12 | namespace CodeStack.Examples.eDrawingsApi
13 | {
14 | public partial class EDrawingsUserControl : UserControl
15 | {
16 | public event Action EDrawingsControlLoaded;
17 |
18 | public EDrawingsUserControl()
19 | {
20 | InitializeComponent();
21 | }
22 |
23 | public void LoadEDrawings()
24 | {
25 | var host = new EDrawingsHost();
26 | host.ControlLoaded += OnControlLoaded;
27 | this.Controls.Add(host);
28 | host.Dock = DockStyle.Fill;
29 | }
30 |
31 | private void OnControlLoaded(EModelViewControl ctrl)
32 | {
33 | EDrawingsControlLoaded?.Invoke(ctrl);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWinFormsHost/eDrawingsWinFormsHost/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace CodeStack.Examples.eDrawingsApi
5 | {
6 | static class Program
7 | {
8 | [STAThread]
9 | static void Main()
10 | {
11 | Application.EnableVisualStyles();
12 | Application.SetCompatibleTextRenderingDefault(false);
13 | Application.Run(new MainForm());
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWinFormsHost/eDrawingsWinFormsHost/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("eDrawingsWinFormsHost")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("")]
9 | [assembly: AssemblyProduct("eDrawingsWinFormsHost")]
10 | [assembly: AssemblyCopyright("Copyright © www.codestack.net 2019")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | [assembly: ComVisible(false)]
15 |
16 | [assembly: Guid("409aa6f8-51a5-4ac3-ba5c-f7e1005bf76f")]
17 |
18 | [assembly: AssemblyVersion("1.0.0.0")]
19 | [assembly: AssemblyFileVersion("1.0.0.0")]
20 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWinFormsHost/eDrawingsWinFormsHost/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 CodeStack.Examples.eDrawingsApi.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 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWinFormsHost/eDrawingsWinFormsHost/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWpfHost/eDrawingsWpfHost.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eDrawingsWpfHost", "eDrawingsWpfHost\eDrawingsWpfHost.csproj", "{61B985A3-FC65-4A86-9631-00BA506507EB}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {61B985A3-FC65-4A86-9631-00BA506507EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {61B985A3-FC65-4A86-9631-00BA506507EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {61B985A3-FC65-4A86-9631-00BA506507EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {61B985A3-FC65-4A86-9631-00BA506507EB}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWpfHost/eDrawingsWpfHost/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWpfHost/eDrawingsWpfHost/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Windows;
7 |
8 | namespace CodeStack.Examples.eDrawings
9 | {
10 | ///
11 | /// Interaction logic for App.xaml
12 | ///
13 | public partial class App : Application
14 | {
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWpfHost/eDrawingsWpfHost/EDrawingsHost.cs:
--------------------------------------------------------------------------------
1 | //**********************
2 | //Hosting SOLIDWORKS eDrawings control in Windows Presentation Foundation (WPF)
3 | //Copyright(C) 2019 www.codestack.net
4 | //License: https://github.com/codestack-net-dev/solidworks-api-examples/blob/master/LICENSE
5 | //Product URL: https://www.codestack.net/edrawings-api/gettings-started/wpf/
6 | //**********************
7 |
8 | using eDrawings.Interop.EModelViewControl;
9 | using System;
10 | using System.Windows.Forms;
11 |
12 | namespace CodeStack.Examples.eDrawings
13 | {
14 | public class EDrawingsHost : AxHost
15 | {
16 | public event Action ControlLoaded;
17 |
18 | private bool m_IsLoaded;
19 |
20 | public EDrawingsHost() : base("22945A69-1191-4DCF-9E6F-409BDE94D101")
21 | {
22 | m_IsLoaded = false;
23 | }
24 |
25 | protected override void OnCreateControl()
26 | {
27 | base.OnCreateControl();
28 |
29 | if (!m_IsLoaded)
30 | {
31 | m_IsLoaded = true;
32 | var ctrl = this.GetOcx() as EModelViewControl;
33 | ControlLoaded?.Invoke(this.GetOcx() as EModelViewControl);
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWpfHost/eDrawingsWpfHost/EDrawingsHostControl.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWpfHost/eDrawingsWpfHost/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWpfHost/eDrawingsWpfHost/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | //**********************
2 | //Hosting SOLIDWORKS eDrawings control in Windows Presentation Foundation (WPF)
3 | //Copyright(C) 2019 www.codestack.net
4 | //License: https://github.com/codestack-net-dev/solidworks-api-examples/blob/master/LICENSE
5 | //Product URL: https://www.codestack.net/edrawings-api/gettings-started/wpf/
6 | //**********************
7 |
8 | using System.Windows;
9 |
10 | namespace CodeStack.Examples.eDrawings
11 | {
12 | public partial class MainWindow : Window
13 | {
14 | public MainWindow()
15 | {
16 | InitializeComponent();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWpfHost/eDrawingsWpfHost/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | [assembly: AssemblyTitle("eDrawingsWpfHost")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("eDrawingsWpfHost")]
12 | [assembly: AssemblyCopyright("Copyright © www.codestack.net 2019")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | [assembly: ComVisible(false)]
17 |
18 | [assembly: ThemeInfo(
19 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
20 | //(used if a resource is not found in the page,
21 | // or application resource dictionaries)
22 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
23 | //(used if a resource is not found in the page,
24 | // app, or any theme specific resource dictionaries)
25 | )]
26 |
27 |
28 | // Version information for an assembly consists of the following four values:
29 | //
30 | // Major Version
31 | // Minor Version
32 | // Build Number
33 | // Revision
34 | //
35 | // You can specify all the values or you can default the Build and Revision Numbers
36 | // by using the '*' as shown below:
37 | // [assembly: AssemblyVersion("1.0.*")]
38 | [assembly: AssemblyVersion("1.0.0.0")]
39 | [assembly: AssemblyFileVersion("1.0.0.0")]
40 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWpfHost/eDrawingsWpfHost/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 CodeStack.Examples.eDrawings.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.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 |
--------------------------------------------------------------------------------
/edrawings-api/eDrawingsWpfHost/eDrawingsWpfHost/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/edrawings-api/thirdpty/eDrawings.Interop.EModelMarkupControl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/edrawings-api/thirdpty/eDrawings.Interop.EModelMarkupControl.dll
--------------------------------------------------------------------------------
/edrawings-api/thirdpty/eDrawings.Interop.EModelViewControl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/edrawings-api/thirdpty/eDrawings.Interop.EModelViewControl.dll
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/ConsoleApplicationCSharp/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/ConsoleApplicationCSharp/Program.cs:
--------------------------------------------------------------------------------
1 | using CodeStack.Examples.CreateGeometryAddIn;
2 | using SolidWorks.Interop.sldworks;
3 | using System;
4 |
5 | namespace ConsoleApplicationCSharp
6 | {
7 | class Program
8 | {
9 | static void Main(string[] args)
10 | {
11 | var app = Activator.CreateInstance(Type.GetTypeFromProgID("SldWorks.Application")) as ISldWorks;
12 | var geomAddIn = app.GetAddInObject("CodeStack.GeometryAddIn") as IGeometryAddIn;
13 | var feat = geomAddIn.CreateCylinder(0.2, 0.2);
14 | feat.Name = "MyCylinder";
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/ConsoleApplicationCSharp/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("ConsoleApplicationCSharp")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ConsoleApplicationCSharp")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
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("63a0307a-ff4e-47d5-add2-20cd095a765a")]
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 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/ConsoleApplicationCSharp/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/ConsoleApplicationVB/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/ConsoleApplicationVB/Module1.vb:
--------------------------------------------------------------------------------
1 | Imports CodeStack.Examples.CreateGeometryAddIn
2 | Imports SolidWorks.Interop.sldworks
3 |
4 | Module Module1
5 |
6 | Sub Main()
7 | Dim app As ISldWorks = GetObject("", "SldWorks.Application")
8 | Dim geomAddIn As IGeometryAddIn = app.GetAddInObject("CodeStack.GeometryAddIn")
9 | Dim feat As IFeature = geomAddIn.CreateCylinder(0.2, 0.2)
10 | feat.Name = "MyCylinder"
11 | End Sub
12 |
13 | End Module
14 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/ConsoleApplicationVB/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
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 | Option Strict On
12 | Option Explicit On
13 |
14 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/ConsoleApplicationVB/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 | false
5 | 0
6 | true
7 | 0
8 | 2
9 | true
10 |
11 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/ConsoleApplicationVB/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports 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 |
9 | ' Review the values of the assembly attributes
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM
21 |
22 |
23 | ' Version information for an assembly consists of the following four values:
24 | '
25 | ' Major Version
26 | ' Minor Version
27 | ' Build Number
28 | ' Revision
29 | '
30 | ' You can specify all the values or you can default the Build and Revision Numbers
31 | ' by using the '*' as shown below:
32 | '
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/ConsoleApplicationVB/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/ConsoleApplicationVB/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/CreateGeometryAddIn/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("CreateGeometryAddIn")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("CreateGeometryAddIn")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
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("92702b3b-15b8-4769-8814-8f2f4f792a66")]
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 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/CreateGeometryAddIn/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/swex/add-in/create-geometry-api/README.md:
--------------------------------------------------------------------------------
1 | [More Information](https://www.codestack.net/solidworks-api/getting-started/inter-process-communication/invoke-add-in-functions/via-add-in-object/)
--------------------------------------------------------------------------------
/swex/add-in/distance-heat-map/DistanceHeatMap/AddIn.cs:
--------------------------------------------------------------------------------
1 | using CodeStack.SwEx.AddIn.Attributes;
2 | using CodeStack.SwEx.AddIn.Base;
3 | using CodeStack.SwEx.AddIn.Core;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Runtime.InteropServices;
8 | using System.Text;
9 |
10 | namespace CodeStack.SwEx.AddIn.Examples.DistanceHeatMap
11 | {
12 | [AutoRegister("Distance Heat Map")]
13 | [Guid("4F856841-AEF5-43DF-B5E6-6AB978C0E3F6")]
14 | [ComVisible(true)]
15 | public class AddIn : SwAddInEx
16 | {
17 | private IDocumentsHandler m_DocHandler;
18 |
19 | public override bool OnConnect()
20 | {
21 | m_DocHandler = CreateDocumentsHandler();
22 |
23 | return true;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/swex/add-in/distance-heat-map/DistanceHeatMap/ColorizerDocument.cs:
--------------------------------------------------------------------------------
1 | using CodeStack.SwEx.AddIn.Base;
2 | using CodeStack.SwEx.AddIn.Core;
3 | using SolidWorks.Interop.sldworks;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 |
9 | namespace CodeStack.SwEx.AddIn.Examples.DistanceHeatMap
10 | {
11 | public class ColorizerDocument : IDocumentHandler
12 | {
13 | private DistanceColorContour m_Contour;
14 | private IModelDoc2 m_Model;
15 |
16 | public void Init(ISldWorks app, IModelDoc2 model)
17 | {
18 | if (model is IPartDoc)
19 | {
20 | m_Contour = new DistanceColorContour(model as IPartDoc);
21 | m_Model = model;
22 | m_Model.Extension.InstallModelColorizer(m_Contour);
23 | }
24 | }
25 |
26 | public void Dispose()
27 | {
28 | if (m_Contour != null)
29 | {
30 | m_Model.Extension.RemoveModelColorizer(m_Contour);
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/swex/add-in/distance-heat-map/DistanceHeatMap/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("DistanceHeatMap")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("DistanceHeatMap")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
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("29efbd18-f51b-4b18-b94e-8be743875729")]
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 |
--------------------------------------------------------------------------------
/swex/add-in/distance-heat-map/DistanceHeatMap/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/swex/add-in/distance-heat-map/distance-heat-map.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27130.2026
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DistanceHeatMap", "DistanceHeatMap\DistanceHeatMap.csproj", "{29EFBD18-F51B-4B18-B94E-8BE743875729}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {29EFBD18-F51B-4B18-B94E-8BE743875729}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {29EFBD18-F51B-4B18-B94E-8BE743875729}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {29EFBD18-F51B-4B18-B94E-8BE743875729}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {29EFBD18-F51B-4B18-B94E-8BE743875729}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {05A351C7-4614-417C-8BF9-0C641E381EBB}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/csharp/ComponentExtension.cs:
--------------------------------------------------------------------------------
1 | using SolidWorks.Interop.swconst;
2 | using System;
3 |
4 | namespace SolidWorks.Interop.sldworks
5 | {
6 | public static class ComponentExtension
7 | {
8 | public static void Export(this IComponent2 comp, string filePath)
9 | {
10 | var model = comp.IGetModelDoc();
11 |
12 | if (model != null)
13 | {
14 | int err = -1;
15 | int warn = -1;
16 |
17 | model.Extension.SaveAs(filePath, (int)swSaveAsVersion_e.swSaveAsCurrentVersion,
18 | (int)swSaveAsOptions_e.swSaveAsOptions_Silent, null, ref err, ref warn);
19 | }
20 | else
21 | {
22 | throw new NullReferenceException("Model");
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/csharp/ExportCommands.cs:
--------------------------------------------------------------------------------
1 | using CodeStack.SwEx.AddIn.Attributes;
2 | using CodeStack.SwEx.AddIn.Enums;
3 | using CodeStack.SwEx.AddIn.Examples.SwExportComponent.Properties;
4 | using CodeStack.SwEx.Common.Attributes;
5 | using SolidWorks.Interop.swconst;
6 | using System.ComponentModel;
7 |
8 | namespace CodeStack.SwEx.AddIn.Examples.SwExportComponent
9 | {
10 | [Title(typeof(Resources), nameof(Resources.ToolbarTitle))]
11 | [Description("Exports selected component to neutral format")]
12 | [Icon(typeof(Resources), nameof(Resources.export))]
13 | public enum ExportCommands_e
14 | {
15 | [Title("Export To Parasolid")]
16 | [Description("Exports selected component to parasolid")]
17 | [Icon(typeof(Resources), nameof(Resources.export_parasolid))]
18 | [CommandItemInfo(true, true, swWorkspaceTypes_e.Assembly,
19 | true, swCommandTabButtonTextDisplay_e.swCommandTabButton_TextBelow)]
20 | Parasolid,
21 |
22 | [Title("Export To Iges")]
23 | [Description("Exports selected component to iges")]
24 | [Icon(typeof(Resources), nameof(Resources.export_iges))]
25 | [CommandItemInfo(true, true, swWorkspaceTypes_e.Assembly,
26 | true, swCommandTabButtonTextDisplay_e.swCommandTabButton_TextBelow)]
27 | Iges,
28 |
29 | [Title("Export To Step")]
30 | [Description("Exports selected component to step")]
31 | [Icon(typeof(Resources), nameof(Resources.export_step))]
32 | [CommandItemInfo(true, true, swWorkspaceTypes_e.Assembly,
33 | true, swCommandTabButtonTextDisplay_e.swCommandTabButton_TextBelow)]
34 | Step
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/csharp/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("SwExportComponent")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("SwExportComponent")]
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("e2c86d6a-86ac-4729-9853-ec327ed042d1")]
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 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/csharp/README.txt:
--------------------------------------------------------------------------------
1 | Icons used in the video are by Oxygen (or based on the icons by Oxygen): http://www.iconarchive.com/icons/oxygen-icons.org/oxygen/authors.txt
--------------------------------------------------------------------------------
/swex/add-in/export-components/csharp/Resources/export.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/export-components/csharp/Resources/export.png
--------------------------------------------------------------------------------
/swex/add-in/export-components/csharp/Resources/export_iges.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/export-components/csharp/Resources/export_iges.png
--------------------------------------------------------------------------------
/swex/add-in/export-components/csharp/Resources/export_parasolid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/export-components/csharp/Resources/export_parasolid.png
--------------------------------------------------------------------------------
/swex/add-in/export-components/csharp/Resources/export_step.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/export-components/csharp/Resources/export_step.png
--------------------------------------------------------------------------------
/swex/add-in/export-components/csharp/SwExportComponent.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SwExportComponent", "SwExportComponent.csproj", "{E2C86D6A-86AC-4729-9853-EC327ED042D1}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {E2C86D6A-86AC-4729-9853-EC327ED042D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {E2C86D6A-86AC-4729-9853-EC327ED042D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {E2C86D6A-86AC-4729-9853-EC327ED042D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {E2C86D6A-86AC-4729-9853-EC327ED042D1}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/csharp/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/ComponentExtension.vb:
--------------------------------------------------------------------------------
1 | Imports SolidWorks.Interop.sldworks
2 | Imports SolidWorks.Interop.swconst
3 | Imports System.Runtime.CompilerServices
4 |
5 | Module ComponentExtension
6 |
7 |
8 | Sub Export(ByVal comp As IComponent2, ByVal filePath As String)
9 |
10 | Dim model = comp.IGetModelDoc()
11 |
12 | If model IsNot Nothing Then
13 | Dim err As Integer = -1
14 | Dim warn As Integer = -1
15 | model.Extension.SaveAs(filePath, CInt(swSaveAsVersion_e.swSaveAsCurrentVersion),
16 | CInt(swSaveAsOptions_e.swSaveAsOptions_Silent), Nothing, err, warn)
17 | Else
18 | Throw New NullReferenceException("Model")
19 | End If
20 |
21 | End Sub
22 |
23 | End Module
24 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/ExportCommands.vb:
--------------------------------------------------------------------------------
1 | Imports CodeStack.SwEx.AddIn.Attributes
2 | Imports CodeStack.SwEx.AddIn.Enums
3 | Imports CodeStack.SwEx.AddIn.Examples.SwExportComponent.My.Resources
4 | Imports System.ComponentModel
5 | Imports SolidWorks.Interop.swconst
6 | Imports CodeStack.SwEx.Common.Attributes
7 |
8 |
9 |
10 |
11 | Public Enum ExportCommands_e
12 |
13 |
14 |
15 |
16 |
18 | Parasolid
19 |
20 |
21 |
22 |
23 |
25 | Iges
26 |
27 |
28 |
29 |
30 |
32 | [Step]
33 |
34 | End Enum
35 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
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 | Option Strict On
12 | Option Explicit On
13 |
14 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 | false
5 | 0
6 | true
7 | 0
8 | 1
9 | true
10 |
11 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports 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 |
9 | ' Review the values of the assembly attributes
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM
21 |
22 |
23 | ' Version information for an assembly consists of the following four values:
24 | '
25 | ' Major Version
26 | ' Minor Version
27 | ' Build Number
28 | ' Revision
29 | '
30 | ' You can specify all the values or you can default the Build and Revision Numbers
31 | ' by using the '*' as shown below:
32 | '
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/README.txt:
--------------------------------------------------------------------------------
1 | Icons used in the video are by Oxygen (or based on the icons by Oxygen): http://www.iconarchive.com/icons/oxygen-icons.org/oxygen/authors.txt
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/Resources/export.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/export-components/vb-net/Resources/export.png
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/Resources/export_iges.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/export-components/vb-net/Resources/export_iges.png
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/Resources/export_parasolid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/export-components/vb-net/Resources/export_parasolid.png
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/Resources/export_step.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/export-components/vb-net/Resources/export_step.png
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/SwExportComponent.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SwExportComponent", "SwExportComponent.vbproj", "{C771744A-27F8-4600-B384-C39C55B73212}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {C771744A-27F8-4600-B384-C39C55B73212}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {C771744A-27F8-4600-B384-C39C55B73212}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {C771744A-27F8-4600-B384-C39C55B73212}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {C771744A-27F8-4600-B384-C39C55B73212}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/swex/add-in/export-components/vb-net/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/swex/add-in/face-indexer/FaceIndexer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FaceIndexer", "FaceIndexer\FaceIndexer.csproj", "{49F79F78-CA0E-477F-A936-7ED9B073B543}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StandAlone", "StandAlone\StandAlone.csproj", "{F3D31DA0-8492-4599-A858-767E0F3A8844}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {49F79F78-CA0E-477F-A936-7ED9B073B543}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {49F79F78-CA0E-477F-A936-7ED9B073B543}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {49F79F78-CA0E-477F-A936-7ED9B073B543}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {49F79F78-CA0E-477F-A936-7ED9B073B543}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {F3D31DA0-8492-4599-A858-767E0F3A8844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {F3D31DA0-8492-4599-A858-767E0F3A8844}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {F3D31DA0-8492-4599-A858-767E0F3A8844}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {F3D31DA0-8492-4599-A858-767E0F3A8844}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/swex/add-in/face-indexer/FaceIndexer/FaceIndexerAddInApi.cs:
--------------------------------------------------------------------------------
1 | using SolidWorks.Interop.sldworks;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace CodeStack.FaceIndexer
5 | {
6 | ///
7 | /// Face Indexer API Callback
8 | ///
9 | [ComVisible(true)]
10 | public interface IFaceIndexerCallback
11 | {
12 | ///
13 | /// Invoked when in-process indexing is completed
14 | ///
15 | /// Assembly with indexed faces
16 | /// Count of indexed faces
17 | void IndexFacesCompleted(IAssemblyDoc assm, int count);
18 | }
19 |
20 | ///
21 | /// Face Indexer API Definition
22 | ///
23 | [ComVisible(true)]
24 | public interface IFaceIndexerAddIn
25 | {
26 | ///
27 | /// Puts the face indexing request into the processing queue
28 | ///
29 | /// Assembly to index faces
30 | /// Callback to call once faces are indexed
31 | /// The faces are indexed in-process
32 | void BeginIndexFaces(IAssemblyDoc assm, IFaceIndexerCallback callback);
33 |
34 | ///
35 | /// Index faces out-of-process
36 | ///
37 | /// Assembly to index faces
38 | /// Count of indexed faces
39 | /// Faces are indexed out-of-process
40 | int IndexFaces(IAssemblyDoc assm);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/swex/add-in/face-indexer/FaceIndexer/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("FaceIndexer")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FaceIndexer")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
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("49f79f78-ca0e-477f-a936-7ed9b073b543")]
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 |
--------------------------------------------------------------------------------
/swex/add-in/face-indexer/FaceIndexer/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/swex/add-in/face-indexer/README.md:
--------------------------------------------------------------------------------
1 | [More Information](https://www.codestack.net/solidworks-api/getting-started/inter-process-communication/invoke-add-in-functions/in-process-invoking/)
--------------------------------------------------------------------------------
/swex/add-in/face-indexer/StandAlone/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/swex/add-in/face-indexer/StandAlone/FaceIndexerCallback.cs:
--------------------------------------------------------------------------------
1 | using CodeStack.FaceIndexer;
2 | using SolidWorks.Interop.sldworks;
3 | using System;
4 | using System.Runtime.InteropServices;
5 |
6 | namespace StandAlone
7 | {
8 | [ComVisible(true)]
9 | public class FaceIndexerCallback : IFaceIndexerCallback
10 | {
11 | public void IndexFacesCompleted(IAssemblyDoc assm, int count)
12 | {
13 | Console.WriteLine($"Indexing completed in '{(assm as IModelDoc2).GetTitle()}' for {count} face(s) in stand-alone application");
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/swex/add-in/face-indexer/StandAlone/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("StandAlone")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("StandAlone")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
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("f3d31da0-8492-4599-a858-767e0f3a8844")]
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 |
--------------------------------------------------------------------------------
/swex/add-in/face-indexer/StandAlone/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/swex/add-in/form-selection-box/FormSelectionBox.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FormSelectionBox", "FormSelectionBox\FormSelectionBox.csproj", "{CFC4687C-A7C1-4DEE-AFC4-4E2ADC897D82}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {CFC4687C-A7C1-4DEE-AFC4-4E2ADC897D82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {CFC4687C-A7C1-4DEE-AFC4-4E2ADC897D82}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {CFC4687C-A7C1-4DEE-AFC4-4E2ADC897D82}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {CFC4687C-A7C1-4DEE-AFC4-4E2ADC897D82}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/swex/add-in/form-selection-box/FormSelectionBox/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("FormSelectionBox")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FormSelectionBox")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
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("cfc4687c-a7c1-4dee-afc4-4e2adc897d82")]
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 |
--------------------------------------------------------------------------------
/swex/add-in/form-selection-box/FormSelectionBox/SelectionForm.cs:
--------------------------------------------------------------------------------
1 | //**********************
2 | //Selection Box Control In Windows Forms
3 | //Copyright(C) 2019 www.codestack.net
4 | //License: https://github.com/codestackdev/solidworks-api-examples/blob/master/LICENSE
5 | //Product URL: https://www.codestack.net/labs/solidworks/swex/add-in/
6 | //**********************
7 |
8 | using CodeStack.SwEx.AddIn.Core;
9 | using SolidWorks.Interop.swconst;
10 | using System;
11 | using System.Collections.Generic;
12 | using System.ComponentModel;
13 | using System.Data;
14 | using System.Drawing;
15 | using System.Linq;
16 | using System.Text;
17 | using System.Threading.Tasks;
18 | using System.Windows.Forms;
19 |
20 | namespace CodeStack
21 | {
22 | public partial class SelectionForm : Form
23 | {
24 | public SelectionForm(DocumentHandler doc)
25 | {
26 | InitializeComponent();
27 | selBox.Context = doc;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/swex/add-in/form-selection-box/FormSelectionBox/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/swex/add-in/form-selection-box/README.md:
--------------------------------------------------------------------------------
1 | This example demonstrates how to implement the Selection Box control to use in Windows Forms application. The control emulates the behavior of [Selection Box](https://www.codestack.net/labs/solidworks/swex/pmpage/controls/selection-box/) control in Property Manager Pages.
2 |
3 | * Handles the selected object and displays the item in the list
4 | * Names the item according to the type of the selected object
5 | * Allows specifying filters for selection
6 | * Allows specifying selection mark
7 | * Handles new object and clear selections
8 | * Toggles the selection when (e.g. deselects the selected object on second click)
--------------------------------------------------------------------------------
/swex/add-in/geometry-helper-api-rot/GeometryHelperAddIn/GeometryHelperApiObject.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace CodeStack.GeometryHelper
4 | {
5 | [ComVisible(true)]
6 | public class GeometryHelperApiObject : IGeometryHelperApiObject
7 | {
8 | private readonly GeometryHelperService m_GeomSvc;
9 |
10 | internal GeometryHelperApiObject(GeometryHelperService geomSvc)
11 | {
12 | m_GeomSvc = geomSvc;
13 | }
14 |
15 |
16 | public int GetFacesCount(double minArea)
17 | {
18 | return m_GeomSvc.GetFacesCountFromSelectedBody(minArea);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/swex/add-in/geometry-helper-api-rot/GeometryHelperAddIn/GeometryHelperApiObjectProxy.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace CodeStack.GeometryHelper
5 | {
6 | [ComVisible(true)]
7 | public class GeometryHelperApiObjectProxy : IGeometryHelperApiObject
8 | {
9 | internal event Func GetFacesCountRequested;
10 |
11 | public int GetFacesCount(double minArea)
12 | {
13 | if (GetFacesCountRequested != null)
14 | {
15 | return GetFacesCountRequested.Invoke(minArea);
16 | }
17 | else
18 | {
19 | throw new Exception("API object not connected");
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/swex/add-in/geometry-helper-api-rot/GeometryHelperAddIn/GeometryHelperService.cs:
--------------------------------------------------------------------------------
1 | using SolidWorks.Interop.sldworks;
2 | using System;
3 | using System.Linq;
4 |
5 | namespace CodeStack.GeometryHelper
6 | {
7 | internal class GeometryHelperService
8 | {
9 | private readonly ISldWorks m_App;
10 |
11 | internal GeometryHelperService(ISldWorks app)
12 | {
13 | m_App = app;
14 | }
15 |
16 | internal int GetFacesCountFromSelectedBody(double minArea)
17 | {
18 | var model = m_App.IActiveDoc2;
19 |
20 | if (model != null)
21 | {
22 | var body = model.ISelectionManager.GetSelectedObject6(1, -1) as IBody2;
23 |
24 | if (body != null)
25 | {
26 | var faces = body.GetFaces() as object[];
27 |
28 | if (faces != null)
29 | {
30 | return faces.Count(f => (f as IFace2).GetArea() >= minArea);
31 | }
32 | else
33 | {
34 | throw new NullReferenceException("No faces in the body");
35 | }
36 | }
37 | else
38 | {
39 | throw new NullReferenceException("Body is not selected");
40 | }
41 | }
42 | else
43 | {
44 | throw new NullReferenceException("Model is not opened");
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/swex/add-in/geometry-helper-api-rot/GeometryHelperAddIn/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("RotApiObject")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("RotApiObject")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
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("2dd2880f-304a-4152-9884-56bee4e5895e")]
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 |
--------------------------------------------------------------------------------
/swex/add-in/geometry-helper-api-rot/GeometryHelperAddIn/RotHelper.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 | using System.Runtime.InteropServices.ComTypes;
3 |
4 | namespace CodeStack.GeometryHelper
5 | {
6 | public static class RotHelper
7 | {
8 | [DllImport("ole32.dll", ExactSpelling = true, PreserveSig = false)]
9 | private static extern IRunningObjectTable GetRunningObjectTable(
10 | int reserved);
11 |
12 | [DllImport("ole32.dll", CharSet = CharSet.Unicode,
13 | ExactSpelling = true, PreserveSig = false)]
14 | private static extern IMoniker CreateItemMoniker(
15 | [In] string lpszDelim, [In] string lpszItem);
16 |
17 | public static void Register(object obj, string name)
18 | {
19 | IRunningObjectTable rot = null;
20 | IMoniker moniker = null;
21 |
22 | try
23 | {
24 | rot = GetRunningObjectTable(0);
25 |
26 | moniker = CreateItemMoniker("!", name);
27 |
28 | const int ROTFLAGS_REGISTRATIONKEEPSALIVE = 1;
29 | var cookie = rot.Register(ROTFLAGS_REGISTRATIONKEEPSALIVE, obj, moniker);
30 | }
31 | finally
32 | {
33 | if (moniker != null)
34 | {
35 | Marshal.ReleaseComObject(moniker);
36 | }
37 | if (rot != null)
38 | {
39 | Marshal.ReleaseComObject(rot);
40 | }
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/swex/add-in/geometry-helper-api-rot/GeometryHelperAddIn/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/swex/add-in/geometry-helper-api-rot/GeometryHelperApiObject/IGeometryHelperApiObject.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace CodeStack.GeometryHelper
4 | {
5 | [ComVisible(true)]
6 | public interface IGeometryHelperApiObject
7 | {
8 | int GetFacesCount(double minArea);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/swex/add-in/geometry-helper-api-rot/GeometryHelperApiObject/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("ApiObjectInterface")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ApiObjectInterface")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
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("7f4437e8-b2db-47d7-9177-b67cb33aa646")]
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 |
--------------------------------------------------------------------------------
/swex/add-in/geometry-helper-api-rot/README.md:
--------------------------------------------------------------------------------
1 | Refer [Call functions of SOLIDWORKS add-in via Running Objects Table (ROT)](https://www.codestack.net/solidworks-api/getting-started/inter-process-communication/invoke-add-in-functions/via-rot/) for more information.
--------------------------------------------------------------------------------
/swex/add-in/geometry-helper-api-rot/StandAlone/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/swex/add-in/geometry-helper-api-rot/StandAlone/Program.cs:
--------------------------------------------------------------------------------
1 | using CodeStack.GeometryHelper;
2 | using System;
3 | using System.Diagnostics;
4 | using System.Linq;
5 |
6 | namespace StandAlone
7 | {
8 | class Program
9 | {
10 | static void Main(string[] args)
11 | {
12 | try
13 | {
14 | var minArea = double.Parse(args[0]);
15 |
16 | var swPrcId = Process.GetProcessesByName("SLDWORKS").First().Id;
17 |
18 | var geomHelperFactory = new GeometryHelperApiObjectFactory();
19 |
20 | var geomHelperApi = geomHelperFactory.GetInstance(swPrcId);
21 |
22 | var count = geomHelperApi.GetFacesCount(minArea);
23 |
24 | Console.WriteLine($"Selected body contains {count} faces of area more or equal to {minArea}");
25 | }
26 | catch(Exception ex)
27 | {
28 | Console.ForegroundColor = ConsoleColor.Red;
29 | Console.Write(ex.Message);
30 | Console.ResetColor();
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/swex/add-in/geometry-helper-api-rot/StandAlone/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("StandAlone")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("StandAlone")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
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("eb7e5e99-930d-4ee9-9a02-3f1c6b72e538")]
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 |
--------------------------------------------------------------------------------
/swex/add-in/issues-manager/csharp/IssuesManager/Commands/RelayCommand.cs:
--------------------------------------------------------------------------------
1 | //**********************
2 | //Examples for SwEx Framework
3 | //Copyright(C) 2019 www.codestack.net
4 | //License: https://github.com/codestack-net-dev/swex-examples/blob/master/LICENSE
5 | //Product URL: https://www.codestack.net/labs/solidworks/swex/add-in/
6 | //**********************
7 |
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 | using System.Text;
12 | using System.Threading.Tasks;
13 | using System.Windows.Input;
14 |
15 | namespace CodeStack.SwEx.AddIn.Examples.IssuesManager.Commands
16 | {
17 | public class RelayCommand : ICommand
18 | {
19 | public event EventHandler CanExecuteChanged
20 | {
21 | add { CommandManager.RequerySuggested += value; }
22 | remove { CommandManager.RequerySuggested -= value; }
23 | }
24 |
25 | private readonly Action