├── 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 m_Execute; 26 | private readonly Func m_CanExecute; 27 | 28 | public RelayCommand(Action execute, Func canExecute = null) 29 | { 30 | if (execute == null) 31 | { 32 | throw new ArgumentNullException(nameof(execute)); 33 | } 34 | 35 | m_Execute = execute; 36 | m_CanExecute = canExecute; 37 | } 38 | 39 | public bool CanExecute(object parameter) 40 | { 41 | return m_CanExecute != null ? m_CanExecute.Invoke(parameter) : true; 42 | } 43 | 44 | public void Execute(object parameter) 45 | { 46 | m_Execute.Invoke(parameter); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/IssuesManager/Converters/IssueForegroundConverter.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 CodeStack.SwEx.AddIn.Examples.IssuesManager.Models; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Globalization; 12 | using System.Linq; 13 | using System.Text; 14 | using System.Threading.Tasks; 15 | using System.Windows.Data; 16 | using System.Windows.Media; 17 | 18 | namespace CodeStack.SwEx.AddIn.Examples.IssuesManager.Converters 19 | { 20 | public class IssueForegroundConverter : IValueConverter 21 | { 22 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 23 | { 24 | if (value is Severity_e) 25 | { 26 | switch ((Severity_e)value) 27 | { 28 | case Severity_e.Low: 29 | return Brushes.Green; 30 | 31 | case Severity_e.Medium: 32 | return Brushes.Black; 33 | 34 | case Severity_e.High: 35 | return Brushes.DarkRed; 36 | } 37 | } 38 | 39 | return null; 40 | } 41 | 42 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 43 | { 44 | throw new NotImplementedException(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/IssuesManager/Converters/IssueTitleConverter.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.Globalization; 11 | using System.Linq; 12 | using System.Text; 13 | using System.Threading.Tasks; 14 | using System.Windows.Data; 15 | 16 | namespace CodeStack.SwEx.AddIn.Examples.IssuesManager.Converters 17 | { 18 | public class IssueTitleConverter : IMultiValueConverter 19 | { 20 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 21 | { 22 | if (values != null && values.Length == 2 && values[0] is int) 23 | { 24 | var id = (int)values[0]; 25 | var title = values[1] as string; 26 | 27 | return string.Format($"Issue #{id} - {title}"); 28 | } 29 | 30 | return ""; 31 | } 32 | 33 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/IssuesManager/Converters/ObjectIsNotNullToVisibilityConverter.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.Globalization; 11 | using System.Linq; 12 | using System.Text; 13 | using System.Threading.Tasks; 14 | using System.Windows; 15 | using System.Windows.Data; 16 | 17 | namespace CodeStack.SwEx.AddIn.Examples.IssuesManager.Converters 18 | { 19 | public class ObjectIsNotNullToVisibilityConverter : IValueConverter 20 | { 21 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 22 | { 23 | if (value != null) 24 | { 25 | return Visibility.Visible; 26 | } 27 | else 28 | { 29 | return Visibility.Collapsed; 30 | } 31 | } 32 | 33 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/IssuesManager/Models/Issue.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.Runtime.Serialization; 12 | using System.Text; 13 | 14 | namespace CodeStack.SwEx.AddIn.Examples.IssuesManager.Models 15 | { 16 | [DataContract] 17 | public class Issue : IssueInfo 18 | { 19 | [DataMember] 20 | public string Description { get; set; } 21 | 22 | [DataMember] 23 | public string Author { get; set; } 24 | 25 | [DataMember] 26 | public DateTime DateCreated { get; set; } 27 | 28 | public Issue(int id) 29 | { 30 | Id = id; 31 | } 32 | 33 | public Issue(IssueInfo info) : this(info.Id) 34 | { 35 | Summary = info.Summary; 36 | Severity = info.Severity; 37 | Status = info.Status; 38 | } 39 | 40 | public IssueInfo GetInfo() 41 | { 42 | return new IssueInfo() 43 | { 44 | Id = Id, 45 | Summary = Summary, 46 | Severity = Severity, 47 | Status = Status 48 | }; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/IssuesManager/Models/IssueInfo.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.Runtime.Serialization; 12 | using System.Text; 13 | using System.Threading.Tasks; 14 | 15 | namespace CodeStack.SwEx.AddIn.Examples.IssuesManager.Models 16 | { 17 | [DataContract] 18 | public class IssueInfo 19 | { 20 | [DataMember] 21 | public int Id { get; set; } 22 | 23 | [DataMember] 24 | public Severity_e Severity { get; set; } 25 | 26 | [DataMember] 27 | public string Summary { get; set; } 28 | 29 | [DataMember] 30 | public Status_e Status { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/IssuesManager/Models/Severity.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.Runtime.Serialization; 12 | using System.Text; 13 | using System.Threading.Tasks; 14 | 15 | namespace CodeStack.SwEx.AddIn.Examples.IssuesManager.Models 16 | { 17 | [DataContract] 18 | public enum Severity_e 19 | { 20 | [EnumMember] 21 | Low, 22 | 23 | [EnumMember] 24 | Medium, 25 | 26 | [EnumMember] 27 | High 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/IssuesManager/Models/Status.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.Runtime.Serialization; 12 | using System.Text; 13 | using System.Threading.Tasks; 14 | 15 | namespace CodeStack.SwEx.AddIn.Examples.IssuesManager.Models 16 | { 17 | [DataContract] 18 | public enum Status_e 19 | { 20 | [EnumMember] 21 | Open, 22 | 23 | [EnumMember] 24 | Closed 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/IssuesManager/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("IssuesManager")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("IssuesManager")] 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("f5d4b99a-2fc6-4eca-b087-8144f479fa4b")] 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/Resources/issues-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/issues-manager/csharp/IssuesManager/Resources/issues-icon.png -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/IssuesManager/Resources/new-issue-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/issues-manager/csharp/IssuesManager/Resources/new-issue-icon.png -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/IssuesManager/Views/IssuesControl.xaml.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; 14 | using System.Windows.Controls; 15 | using System.Windows.Data; 16 | using System.Windows.Documents; 17 | using System.Windows.Input; 18 | using System.Windows.Media; 19 | using System.Windows.Media.Imaging; 20 | using System.Windows.Navigation; 21 | using System.Windows.Shapes; 22 | 23 | namespace CodeStack.SwEx.AddIn.Examples.IssuesManager.Views 24 | { 25 | public partial class IssuesControl : UserControl 26 | { 27 | public IssuesControl() 28 | { 29 | InitializeComponent(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/IssuesManager/Views/IssuesControlHost.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.ComponentModel; 11 | using System.Drawing; 12 | using System.Data; 13 | using System.Linq; 14 | using System.Text; 15 | using System.Threading.Tasks; 16 | using System.Windows.Forms; 17 | using System.Runtime.InteropServices; 18 | 19 | namespace CodeStack.SwEx.AddIn.Examples.IssuesManager.Views 20 | { 21 | [ComVisible(true)] 22 | public partial class IssuesControlHost : UserControl 23 | { 24 | public IssuesControlHost() 25 | { 26 | InitializeComponent(); 27 | } 28 | 29 | internal IssuesControl IssuesControl 30 | { 31 | get 32 | { 33 | return ctrlIssues; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/IssuesManager/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/csharp/issues-manager.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}") = "IssuesManager", "IssuesManager\IssuesManager.csproj", "{F5D4B99A-2FC6-4ECA-B087-8144F479FA4B}" 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 | {F5D4B99A-2FC6-4ECA-B087-8144F479FA4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {F5D4B99A-2FC6-4ECA-B087-8144F479FA4B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {F5D4B99A-2FC6-4ECA-B087-8144F479FA4B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {F5D4B99A-2FC6-4ECA-B087-8144F479FA4B}.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/issues-manager/vb-net/IssuesManager.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}") = "IssuesManager", "IssuesManager\IssuesManager.vbproj", "{47AE4833-B3A9-4165-883B-205EA4102A37}" 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 | {47AE4833-B3A9-4165-883B-205EA4102A37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {47AE4833-B3A9-4165-883B-205EA4102A37}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {47AE4833-B3A9-4165-883B-205EA4102A37}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {47AE4833-B3A9-4165-883B-205EA4102A37}.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/issues-manager/vb-net/IssuesManager/AddIn.vb: -------------------------------------------------------------------------------- 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 | Imports System.Runtime.InteropServices 9 | Imports CodeStack.SwEx.AddIn.Attributes 10 | Imports CodeStack.SwEx.AddIn.Base 11 | Imports CodeStack.SwEx.AddIn.Examples.IssuesManager.My.Resources 12 | Imports CodeStack.SwEx.Common.Attributes 13 | 14 | 15 | 16 | Public Class AddIn 17 | Inherits SwAddInEx 18 | 19 | 20 | 21 | Enum IssuesManagerCommands_e 22 | 23 | 24 | CreateNewIssue 25 | End Enum 26 | 27 | Dim m_Ctrl As IssuesControl 28 | Dim m_DocsHandler As IDocumentsHandler(Of IssuesDocument) 29 | 30 | Public Overrides Function OnConnect() As Boolean 31 | Dim ctrl As IssuesControlHost = Nothing 32 | CreateTaskPane(Of IssuesControlHost, IssuesManagerCommands_e)(AddressOf OnCreateNewIssue, ctrl) 33 | m_Ctrl = ctrl.IssuesControl 34 | m_DocsHandler = CreateDocumentsHandler(Of IssuesDocument)() 35 | AddHandler m_DocsHandler.HandlerCreated, AddressOf OnDocumentHandlerCreated 36 | 37 | Return True 38 | End Function 39 | 40 | Sub OnCreateNewIssue(cmd As IssuesManagerCommands_e) 41 | Select Case cmd 42 | Case IssuesManagerCommands_e.CreateNewIssue 43 | m_DocsHandler(App.IActiveDoc2).CreateNewIssue() 44 | End Select 45 | End Sub 46 | 47 | Sub OnDocumentHandlerCreated(docsHandler As IssuesDocument) 48 | docsHandler.IssuesControl = m_Ctrl 49 | End Sub 50 | 51 | End Class 52 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/vb-net/IssuesManager/Issue.vb: -------------------------------------------------------------------------------- 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 | Public Class Issue 9 | Public Property Id As Integer 10 | Public Property Summary As String 11 | Public Property Description As String 12 | End Class 13 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/vb-net/IssuesManager/IssuesControl.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/vb-net/IssuesManager/IssuesControl.xaml.vb: -------------------------------------------------------------------------------- 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 | Public Class IssuesControl 9 | 10 | End Class 11 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/vb-net/IssuesManager/IssuesControlHost.Designer.vb: -------------------------------------------------------------------------------- 1 |  _ 2 | Partial Class IssuesControlHost 3 | Inherits System.Windows.Forms.UserControl 4 | 5 | 'UserControl overrides dispose to clean up the component list. 6 | _ 7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean) 8 | Try 9 | If disposing AndAlso components IsNot Nothing Then 10 | components.Dispose() 11 | End If 12 | Finally 13 | MyBase.Dispose(disposing) 14 | End Try 15 | End Sub 16 | 17 | 'Required by the Windows Form Designer 18 | Private components As System.ComponentModel.IContainer 19 | 20 | 'NOTE: The following procedure is required by the Windows Form Designer 21 | 'It can be modified using the Windows Form Designer. 22 | 'Do not modify it using the code editor. 23 | _ 24 | Private Sub InitializeComponent() 25 | Me.ElementHost1 = New System.Windows.Forms.Integration.ElementHost() 26 | Me.ctrlIssues = New IssuesManager.IssuesControl() 27 | Me.SuspendLayout() 28 | ' 29 | 'ElementHost1 30 | ' 31 | Me.ElementHost1.Dock = System.Windows.Forms.DockStyle.Fill 32 | Me.ElementHost1.Location = New System.Drawing.Point(0, 0) 33 | Me.ElementHost1.Name = "ElementHost1" 34 | Me.ElementHost1.Size = New System.Drawing.Size(150, 150) 35 | Me.ElementHost1.TabIndex = 0 36 | Me.ElementHost1.Text = "ElementHost1" 37 | Me.ElementHost1.Child = Me.ctrlIssues 38 | ' 39 | 'IssuesControlHost 40 | ' 41 | Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) 42 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font 43 | Me.Controls.Add(Me.ElementHost1) 44 | Me.Name = "IssuesControlHost" 45 | Me.ResumeLayout(False) 46 | 47 | End Sub 48 | 49 | Friend WithEvents ElementHost1 As Windows.Forms.Integration.ElementHost 50 | Friend ctrlIssues As IssuesControl 51 | End Class 52 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/vb-net/IssuesManager/IssuesControlHost.vb: -------------------------------------------------------------------------------- 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 | Public Class IssuesControlHost 9 | Public ReadOnly Property IssuesControl As IssuesControl 10 | Get 11 | Return ctrlIssues 12 | End Get 13 | End Property 14 | End Class 15 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/vb-net/IssuesManager/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/issues-manager/vb-net/IssuesManager/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/issues-manager/vb-net/IssuesManager/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/issues-manager/vb-net/IssuesManager/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /swex/add-in/issues-manager/vb-net/IssuesManager/Resources/issues-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/issues-manager/vb-net/IssuesManager/Resources/issues-icon.png -------------------------------------------------------------------------------- /swex/add-in/issues-manager/vb-net/IssuesManager/Resources/new-issue-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/issues-manager/vb-net/IssuesManager/Resources/new-issue-icon.png -------------------------------------------------------------------------------- /swex/add-in/issues-manager/vb-net/IssuesManager/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /swex/add-in/opengl/OglTetrahedron/OglTetrahedron.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}") = "OglTetrahedron", "OglTetrahedron\OglTetrahedron.vbproj", "{7DE46E73-7EFB-473C-801D-D848FCB0FA1F}" 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 | {7DE46E73-7EFB-473C-801D-D848FCB0FA1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7DE46E73-7EFB-473C-801D-D848FCB0FA1F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7DE46E73-7EFB-473C-801D-D848FCB0FA1F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7DE46E73-7EFB-473C-801D-D848FCB0FA1F}.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/opengl/OglTetrahedron/OglTetrahedron/AddIn.vb: -------------------------------------------------------------------------------- 1 | '********************** 2 | 'Render Tetrahedron And Handle View Display Modes 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/solidworks-api/adornment/opengl/display-mode-tetrahedron/ 6 | '********************** 7 | 8 | Imports CodeStack.SwEx.AddIn 9 | Imports CodeStack.SwEx.AddIn.Attributes 10 | Imports System.Runtime.InteropServices 11 | 12 | 13 | 14 | Public Class AddIn 15 | Inherits SwAddInEx 16 | 17 | Public Overrides Function OnConnect() As Boolean 18 | CreateDocumentsHandler(Of OpenGlDocumentHandler)() 19 | Return True 20 | End Function 21 | End Class -------------------------------------------------------------------------------- /swex/add-in/opengl/OglTetrahedron/OglTetrahedron/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/opengl/OglTetrahedron/OglTetrahedron/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/opengl/OglTetrahedron/OglTetrahedron/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 | -------------------------------------------------------------------------------- /swex/add-in/opengl/OglTetrahedron/OglTetrahedron/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /swex/add-in/opengl/OglTetrahedron/OglTetrahedron/OpenGL.vb: -------------------------------------------------------------------------------- 1 | '********************** 2 | 'Render Tetrahedron And Handle View Display Modes 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/solidworks-api/adornment/opengl/display-mode-tetrahedron/ 6 | '********************** 7 | 8 | Imports System.Runtime.InteropServices 9 | 10 | Public Class OpenGl 11 | 12 | 13 | Public Shared Sub glBegin(ByVal mode As UInteger) 14 | End Sub 15 | 16 | 17 | Public Shared Sub glEnd() 18 | End Sub 19 | 20 | 21 | Public Shared Sub glVertex3d(ByVal x As Double, ByVal y As Double, ByVal z As Double) 22 | End Sub 23 | 24 | 25 | Public Shared Sub glDisable(ByVal cap As UInteger) 26 | End Sub 27 | 28 | 29 | Public Shared Sub glColor4f(ByVal R As Single, ByVal G As Single, ByVal B As Single, ByVal A As Single) 30 | End Sub 31 | 32 | 33 | Public Shared Sub glEnable(ByVal cap As UInteger) 34 | End Sub 35 | 36 | 37 | Public Shared Sub glPolygonMode(ByVal face As UInteger, ByVal mode As UInteger) 38 | End Sub 39 | 40 | 41 | Public Shared Sub glLineWidth(ByVal width As Single) 42 | End Sub 43 | 44 | 45 | Public Shared Sub glLineStipple(ByVal factor As Integer, ByVal pattern As UShort) 46 | End Sub 47 | 48 | Public Const GL_FRONT_AND_BACK As Integer = &H408 49 | Public Const GL_LINE As UInteger = &H1B01 50 | Public Const GL_FILL As UInteger = &H1B02 51 | 52 | Public Const GL_TRIANGLES As UInteger = &H4 53 | Public Const GL_LINE_LOOP As UInteger = &H2 54 | Public Const GL_LIGHTING As UInteger = &HB50 55 | Public Const GL_LINE_SMOOTH As UInteger = &HB20 56 | Public Const GL_LINE_STIPPLE As UInteger = &HB24 57 | 58 | End Class 59 | -------------------------------------------------------------------------------- /swex/add-in/opengl/OglTetrahedron/OglTetrahedron/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /swex/add-in/opengl/OpenGlBoxGrid/OpenGlBoxGrid.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}") = "OpenGlBoxGrid", "OpenGlBoxGrid\OpenGlBoxGrid.csproj", "{4E7CE8E4-3018-410C-B25C-23B771628C77}" 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 | {4E7CE8E4-3018-410C-B25C-23B771628C77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {4E7CE8E4-3018-410C-B25C-23B771628C77}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {4E7CE8E4-3018-410C-B25C-23B771628C77}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {4E7CE8E4-3018-410C-B25C-23B771628C77}.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/opengl/OpenGlBoxGrid/OpenGlBoxGrid/AddIn.cs: -------------------------------------------------------------------------------- 1 | //********************** 2 | //Render Box Grid With Transparency 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/solidworks-api/adornment/opengl/box-grid-transparency/ 6 | //********************** 7 | 8 | using CodeStack.SwEx.AddIn; 9 | using CodeStack.SwEx.AddIn.Attributes; 10 | using System; 11 | using System.Runtime.InteropServices; 12 | 13 | namespace CodeStack.OpenGlBoxGrid 14 | { 15 | [ComVisible(true), Guid("FAB0F03B-785E-4113-B120-E18E7C73B9EB")] 16 | [AutoRegister("OpenGL Box Grid")] 17 | public class AddIn : SwAddInEx 18 | { 19 | public override bool OnConnect() 20 | { 21 | CreateDocumentsHandler(); 22 | return true; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /swex/add-in/opengl/OpenGlBoxGrid/OpenGlBoxGrid/OpenGL.cs: -------------------------------------------------------------------------------- 1 | //********************** 2 | //Render Box Grid With Transparency 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/solidworks-api/adornment/opengl/box-grid-transparency/ 6 | //********************** 7 | 8 | using System.Runtime.InteropServices; 9 | 10 | namespace CodeStack.OpenGlBoxGrid 11 | { 12 | public static class OpenGL 13 | { 14 | [DllImport("opengl32")] 15 | public static extern void glBegin(uint mode); 16 | 17 | [DllImport("opengl32")] 18 | public static extern void glEnd(); 19 | 20 | [DllImport("opengl32")] 21 | public static extern void glVertex3d(double x, double y, double z); 22 | 23 | [DllImport("opengl32.dll")] 24 | public static extern void glDisable(uint cap); 25 | 26 | [DllImport("opengl32.dll")] 27 | public static extern void glColor4f(float R, float G, float B, float A); 28 | 29 | [DllImport("opengl32.dll")] 30 | public static extern void glEnable(uint cap); 31 | 32 | [DllImport("opengl32.dll")] 33 | public static extern void glBlendFunc(uint sfactor, uint dfactor); 34 | 35 | public const int GL_TRIANGLE_STRIP = 0x0005; 36 | public const uint GL_LIGHTING = 0x0B50; 37 | public const int GL_BLEND = 0x0BE2; 38 | public const int GL_SRC_ALPHA = 0x0302; 39 | public const int GL_ONE_MINUS_SRC_ALPHA = 0x0303; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /swex/add-in/opengl/OpenGlBoxGrid/OpenGlBoxGrid/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 | [assembly: AssemblyTitle("OpenGlBoxGrid")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("CodeStack")] 11 | [assembly: AssemblyProduct("OpenGlBoxGrid")] 12 | [assembly: AssemblyCopyright("Copyright © www.codestack.net 2019")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | [assembly: ComVisible(false)] 17 | 18 | [assembly: Guid("4e7ce8e4-3018-410c-b25c-23b771628c77")] 19 | 20 | [assembly: AssemblyVersion("1.0.0.0")] 21 | [assembly: AssemblyFileVersion("1.0.0.0")] 22 | -------------------------------------------------------------------------------- /swex/add-in/opengl/OpenGlBoxGrid/OpenGlBoxGrid/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /swex/add-in/opengl/XamlImporter/XamlImporter.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}") = "XamlImporter", "XamlImporter\XamlImporter.csproj", "{A16AA5A6-91D0-4C20-919B-4442BBC20B7B}" 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 | {A16AA5A6-91D0-4C20-919B-4442BBC20B7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {A16AA5A6-91D0-4C20-919B-4442BBC20B7B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {A16AA5A6-91D0-4C20-919B-4442BBC20B7B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {A16AA5A6-91D0-4C20-919B-4442BBC20B7B}.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/opengl/XamlImporter/XamlImporter/OpenTK.dll.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /swex/add-in/opengl/XamlImporter/XamlImporter/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("ColorStlTranslator")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("CodeStack")] 9 | [assembly: AssemblyProduct("ColorStlTranslator")] 10 | [assembly: AssemblyCopyright("Copyright © www.codestack.net 2019")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | [assembly: ComVisible(false)] 15 | 16 | [assembly: Guid("a16aa5a6-91d0-4c20-919b-4442bbc20b7b")] 17 | 18 | [assembly: AssemblyVersion("1.0.0.0")] 19 | [assembly: AssemblyFileVersion("1.0.0.0")] 20 | -------------------------------------------------------------------------------- /swex/add-in/opengl/XamlImporter/XamlImporter/Resources/xaml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/opengl/XamlImporter/XamlImporter/Resources/xaml.png -------------------------------------------------------------------------------- /swex/add-in/opengl/XamlImporter/XamlImporter/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /swex/add-in/progress-handler/ProgressHandler.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}") = "ProgressHandler", "ProgressHandler\ProgressHandler.csproj", "{CF796EF0-02E2-43DD-AC91-8EEE6D3454B1}" 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 | {CF796EF0-02E2-43DD-AC91-8EEE6D3454B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {CF796EF0-02E2-43DD-AC91-8EEE6D3454B1}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {CF796EF0-02E2-43DD-AC91-8EEE6D3454B1}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {CF796EF0-02E2-43DD-AC91-8EEE6D3454B1}.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/progress-handler/ProgressHandler/ProgressForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace CodeStack.ProgressHandler 12 | { 13 | public partial class ProgressForm : Form 14 | { 15 | public ProgressForm() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | public void Init(string title, int upperBound) 21 | { 22 | lblMessage.Text = title; 23 | prgProgress.Maximum = upperBound; 24 | } 25 | 26 | public void SetTitle(string title) 27 | { 28 | lblMessage.Text = title; 29 | } 30 | 31 | public void SetProgress(int pos) 32 | { 33 | prgProgress.Value = pos; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /swex/add-in/progress-handler/ProgressHandler/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("ProgressHandler")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ProgressHandler")] 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("cf796ef0-02e2-43dd-ac91-8eee6d3454b1")] 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/progress-handler/ProgressHandler/Resources/a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/progress-handler/ProgressHandler/Resources/a.png -------------------------------------------------------------------------------- /swex/add-in/progress-handler/ProgressHandler/Resources/b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/progress-handler/ProgressHandler/Resources/b.png -------------------------------------------------------------------------------- /swex/add-in/progress-handler/ProgressHandler/Resources/bl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/progress-handler/ProgressHandler/Resources/bl.png -------------------------------------------------------------------------------- /swex/add-in/progress-handler/ProgressHandler/Resources/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/progress-handler/ProgressHandler/Resources/c.png -------------------------------------------------------------------------------- /swex/add-in/progress-handler/ProgressHandler/Resources/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/progress-handler/ProgressHandler/Resources/d.png -------------------------------------------------------------------------------- /swex/add-in/progress-handler/ProgressHandler/Resources/e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/progress-handler/ProgressHandler/Resources/e.png -------------------------------------------------------------------------------- /swex/add-in/progress-handler/ProgressHandler/Resources/toggle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/add-in/progress-handler/ProgressHandler/Resources/toggle.png -------------------------------------------------------------------------------- /swex/add-in/progress-handler/ProgressHandler/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /swex/add-in/signalr-model-builder/ModelBuilder.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}") = "ModelBuilder", "ModelBuilder\ModelBuilder.csproj", "{EEF635B9-AF41-4213-879B-FB8007B20D0B}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{83C723BD-277D-4035-95F0-D88645D5AE48}" 9 | ProjectSection(SolutionItems) = preProject 10 | WebClient.html = WebClient.html 11 | EndProjectSection 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Any CPU = Debug|Any CPU 16 | Release|Any CPU = Release|Any CPU 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {EEF635B9-AF41-4213-879B-FB8007B20D0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 20 | {EEF635B9-AF41-4213-879B-FB8007B20D0B}.Debug|Any CPU.Build.0 = Debug|Any CPU 21 | {EEF635B9-AF41-4213-879B-FB8007B20D0B}.Release|Any CPU.ActiveCfg = Release|Any CPU 22 | {EEF635B9-AF41-4213-879B-FB8007B20D0B}.Release|Any CPU.Build.0 = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(SolutionProperties) = preSolution 25 | HideSolutionNode = FALSE 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /swex/add-in/signalr-model-builder/ModelBuilder/IModelBuilderClient.cs: -------------------------------------------------------------------------------- 1 | //********************** 2 | //Connect Web Page To Desktop Application 3 | //Copyright(C) 2019 www.codestack.net 4 | //License: https://github.com/codestackdev/solidworks-api-examples/blob/master/LICENSE 5 | //Product URL: https://blog.codestack.net/connect-web-page-desktop 6 | //********************** 7 | 8 | namespace CodeStack.ModelBuilder 9 | { 10 | public interface IModelBuilderClient 11 | { 12 | void SendResult(double mass); 13 | void UpdateStatus(int totalModelsBuilt); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /swex/add-in/signalr-model-builder/ModelBuilder/ModelBuilderHub.cs: -------------------------------------------------------------------------------- 1 | //********************** 2 | //Connect Web Page To Desktop Application 3 | //Copyright(C) 2019 www.codestack.net 4 | //License: https://github.com/codestackdev/solidworks-api-examples/blob/master/LICENSE 5 | //Product URL: https://blog.codestack.net/connect-web-page-desktop 6 | //********************** 7 | 8 | using Microsoft.AspNet.SignalR; 9 | using Microsoft.AspNet.SignalR.Hubs; 10 | 11 | namespace CodeStack.ModelBuilder 12 | { 13 | [HubName("ModelBuilder")] 14 | public class ModelBuilderHub : Hub 15 | { 16 | private readonly ModelBuilder m_ModelBuilder; 17 | 18 | public ModelBuilderHub(ModelBuilder modelBuilder) 19 | { 20 | m_ModelBuilder = modelBuilder; 21 | } 22 | 23 | public void Build(double width, double length, double height) 24 | { 25 | int totalModelsBuilt; 26 | var mass = m_ModelBuilder.Build(width, height, length, out totalModelsBuilt); 27 | Clients.All.UpdateStatus(totalModelsBuilt); 28 | Clients.Caller.SendResult(mass); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /swex/add-in/signalr-model-builder/ModelBuilder/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("ModelBuilder")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyCompany("CodeStack")] 8 | [assembly: AssemblyProduct("ModelBuilder")] 9 | [assembly: AssemblyCopyright("Copyright © 2019")] 10 | [assembly: AssemblyTrademark("")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | [assembly: ComVisible(false)] 14 | 15 | [assembly: Guid("eef635b9-af41-4213-879b-fb8007b20d0b")] 16 | 17 | [assembly: AssemblyVersion("1.0.0.0")] 18 | [assembly: AssemblyFileVersion("1.0.0.0")] 19 | -------------------------------------------------------------------------------- /swex/add-in/signalr-model-builder/ModelBuilder/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /swex/add-in/signalr-model-builder/ModelBuilder/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /swex/add-in/signalr-model-builder/WebClient.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | SOLIDWORKS Web Client 5 | 6 | 7 |
8 | 9 | 10 |

Status

11 |
12 | 13 | 14 | 15 | 16 | 17 | 40 | 41 | -------------------------------------------------------------------------------- /swex/macro-feature/convert-solid-to-surface/vb-net/AddIn.vb: -------------------------------------------------------------------------------- 1 | Imports System.Runtime.InteropServices 2 | Imports CodeStack.SwEx.AddIn 3 | Imports CodeStack.SwEx.AddIn.Attributes 4 | Imports CodeStack.SwEx.Common.Attributes 5 | Imports CodeStack.SwEx.MacroFeature.Examples.ConvertSolidToSurface.My.Resources 6 | Imports SolidWorks.Interop.sldworks 7 | 8 | 9 | 10 | 11 | Public Enum Commands_e 12 | 13 | 14 | 15 | 16 | ConvertSolidToSurface 17 | End Enum 18 | 19 | 20 | 21 | 22 | 23 | 24 | Public Class AddIn 25 | Inherits SwAddInEx 26 | 27 | Dim m_Page As PropertyPage 28 | 29 | Public Overrides Function OnConnect() As Boolean 30 | Me.AddCommandGroup(Of Commands_e)(AddressOf OnButtonClicked) 31 | Return True 32 | End Function 33 | 34 | Private Sub OnButtonClicked(btn As Commands_e) 35 | Select Case btn 36 | Case Commands_e.ConvertSolidToSurface 37 | m_Page = New PropertyPage(App, App.IActiveDoc2, New DataModel()) 38 | AddHandler m_Page.PageClosed, AddressOf OnPageClosed 39 | m_Page.Show() 40 | End Select 41 | End Sub 42 | 43 | Private Sub OnPageClosed(model As IModelDoc2, feat As IFeature, featData As IMacroFeatureData, data As DataModel, isOk As Boolean) 44 | If isOk Then 45 | model.FeatureManager.InsertComFeature(Of MacroFeature, DataModel)(data) 46 | End If 47 | End Sub 48 | 49 | End Class 50 | -------------------------------------------------------------------------------- /swex/macro-feature/convert-solid-to-surface/vb-net/ConvertSolidToSurface.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}") = "ConvertSolidToSurface", "ConvertSolidToSurface.vbproj", "{40B537D0-FEB1-4751-AB85-B1171B09D4FD}" 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 | {40B537D0-FEB1-4751-AB85-B1171B09D4FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {40B537D0-FEB1-4751-AB85-B1171B09D4FD}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {40B537D0-FEB1-4751-AB85-B1171B09D4FD}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {40B537D0-FEB1-4751-AB85-B1171B09D4FD}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /swex/macro-feature/convert-solid-to-surface/vb-net/DataModel.vb: -------------------------------------------------------------------------------- 1 | Imports System.ComponentModel 2 | Imports CodeStack.SwEx.MacroFeature.Attributes 3 | Imports CodeStack.SwEx.PMPage.Attributes 4 | Imports CodeStack.SwEx.MacroFeature.Examples.ConvertSolidToSurface.My.Resources 5 | Imports SolidWorks.Interop.sldworks 6 | Imports CodeStack.SwEx.Common.Attributes 7 | 8 | 10 | 11 | 12 | Public Class DataModel 13 | 14 | 15 | 16 | 17 | 18 | Public Property Bodies As List(Of IBody2) 19 | 20 | End Class 21 | -------------------------------------------------------------------------------- /swex/macro-feature/convert-solid-to-surface/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/macro-feature/convert-solid-to-surface/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/macro-feature/convert-solid-to-surface/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/macro-feature/convert-solid-to-surface/vb-net/My Project/Resources.ru.Designer.vb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/macro-feature/convert-solid-to-surface/vb-net/My Project/Resources.ru.Designer.vb -------------------------------------------------------------------------------- /swex/macro-feature/convert-solid-to-surface/vb-net/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /swex/macro-feature/convert-solid-to-surface/vb-net/Resources/solid-body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/macro-feature/convert-solid-to-surface/vb-net/Resources/solid-body.png -------------------------------------------------------------------------------- /swex/macro-feature/convert-solid-to-surface/vb-net/Resources/solid-to-surface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/macro-feature/convert-solid-to-surface/vb-net/Resources/solid-to-surface.png -------------------------------------------------------------------------------- /swex/macro-feature/convert-solid-to-surface/vb-net/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/csharp/LinkFeatureToExternalFile.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}") = "LinkFeatureToExternalFile", "LinkFeatureToExternalFile\LinkFeatureToExternalFile.csproj", "{AD85E364-6412-49AB-B38A-04010DABE575}" 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 | {AD85E364-6412-49AB-B38A-04010DABE575}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {AD85E364-6412-49AB-B38A-04010DABE575}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {AD85E364-6412-49AB-B38A-04010DABE575}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {AD85E364-6412-49AB-B38A-04010DABE575}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/csharp/LinkFeatureToExternalFile/LinkFileMacroFeature.cs: -------------------------------------------------------------------------------- 1 | using CodeStack.SwEx.MacroFeature; 2 | using CodeStack.SwEx.MacroFeature.Attributes; 3 | using System; 4 | using System.Linq; 5 | using System.Runtime.InteropServices; 6 | using CodeStack.SwEx.MacroFeature.Base; 7 | using SolidWorks.Interop.sldworks; 8 | using CodeStack.SwEx.Common.Attributes; 9 | using CodeStack.SwEx.Examples.LinkFeatureToExternalFile.Properties; 10 | 11 | namespace CodeStack.SwEx.Examples.LinkFeatureToExternalFile 12 | { 13 | 14 | [ComVisible(true), Guid("3590F6C4-6345-4A0A-9161-196896F3B335")] 15 | [ProgId("CodeStack.LinkFileMacroFeature.CSharp")] 16 | [Options("LinkFileMacroFeature")] 17 | [Icon(typeof(Resources), nameof(Resources.linked_part_icon))] 18 | public class LinkFileMacroFeature : MacroFeatureEx 19 | { 20 | protected override MacroFeatureRebuildResult OnRebuild(LinkFileMacroFeatureHandler handler, LinkFileMacroFeatureParameters parameters) 21 | { 22 | if (handler.LastError == null) 23 | { 24 | parameters.FileLastUpdateTimeStamp = handler.LastUpdateStamp; 25 | 26 | SetParameters(handler.Model, handler.Feature, handler.Feature.GetDefinition() as IMacroFeatureData, parameters); 27 | 28 | return MacroFeatureRebuildResult.FromBodies( 29 | handler.CachedBodies.Select(b => b.ICopy()).ToArray(), 30 | handler.Feature.GetDefinition() as IMacroFeatureData); 31 | } 32 | else 33 | { 34 | return MacroFeatureRebuildResult.FromStatus(false, handler.LastError.ToString()); 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/csharp/LinkFeatureToExternalFile/LinkFileMacroFeatureParameters.cs: -------------------------------------------------------------------------------- 1 | namespace CodeStack.SwEx.Examples.LinkFeatureToExternalFile 2 | { 3 | public class LinkFileMacroFeatureParameters 4 | { 5 | public long FileLastUpdateTimeStamp { get; set; } 6 | public string LinkedFilePath { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/csharp/LinkFeatureToExternalFile/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("LinkFeatureToExternalFile")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("LinkFeatureToExternalFile")] 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("ad85e364-6412-49ab-b38a-04010dabe575")] 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/macro-feature/link-external-file/csharp/LinkFeatureToExternalFile/Resources/linked-part-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/macro-feature/link-external-file/csharp/LinkFeatureToExternalFile/Resources/linked-part-icon.png -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/csharp/LinkFeatureToExternalFile/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/vb-net/LinkFeatureToExternalFile.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}") = "LinkFeatureToExternalFile", "LinkFeatureToExternalFile\LinkFeatureToExternalFile.vbproj", "{F51016E9-0ED0-46DC-BA61-9B390D2303A8}" 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 | {F51016E9-0ED0-46DC-BA61-9B390D2303A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {F51016E9-0ED0-46DC-BA61-9B390D2303A8}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {F51016E9-0ED0-46DC-BA61-9B390D2303A8}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {F51016E9-0ED0-46DC-BA61-9B390D2303A8}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/vb-net/LinkFeatureToExternalFile/AddIn.vb: -------------------------------------------------------------------------------- 1 | Imports CodeStack.SwEx.AddIn 2 | Imports CodeStack.SwEx.AddIn.Attributes 3 | Imports System.Runtime.InteropServices 4 | Imports SolidWorks.Interop.sldworks 5 | Imports CodeStack.SwEx.Common.Attributes 6 | Imports CodeStack.SwEx.Examples.LinkFeatureToExternalFile.My.Resources 7 | Imports System.Windows.Forms 8 | Imports System.ComponentModel 9 | 10 | Namespace CodeStack.SwEx.Examples.LinkFeatureToExternalFile 11 | 12 | 13 | 14 | Public Class AddIn 15 | Inherits SwAddInEx 16 | 17 | 18 | 19 | Private Enum Commands_e 20 | 21 | 22 | 23 | InsertLinkToFile 24 | End Enum 25 | 26 | Public Overrides Function OnConnect() As Boolean 27 | Me.AddCommandGroup(Of Commands_e)(AddressOf OnButtonClick) 28 | Return True 29 | End Function 30 | 31 | Private Sub OnButtonClick(ByVal cmd As Commands_e) 32 | Select Case cmd 33 | Case Commands_e.InsertLinkToFile 34 | InsertLinkToFileMacroFeature() 35 | End Select 36 | End Sub 37 | 38 | Private Sub InsertLinkToFileMacroFeature() 39 | Using openFileDlg = New OpenFileDialog() 40 | openFileDlg.Filter = "SOLIDWORKS Part Files (*.sldprt)|*.sldprt|All Files (*.*)|*.*" 41 | openFileDlg.RestoreDirectory = True 42 | 43 | If openFileDlg.ShowDialog() = DialogResult.OK Then 44 | Dim linkedFilePath = openFileDlg.FileName 45 | App.IActiveDoc2.FeatureManager.InsertComFeature(Of LinkFileMacroFeature, LinkFileMacroFeatureParameters)( 46 | New LinkFileMacroFeatureParameters() With 47 | { 48 | .LinkedFilePath = linkedFilePath 49 | }) 50 | End If 51 | End Using 52 | End Sub 53 | 54 | End Class 55 | 56 | End Namespace 57 | -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/vb-net/LinkFeatureToExternalFile/LinkFileMacroFeature.vb: -------------------------------------------------------------------------------- 1 | Imports CodeStack.SwEx.MacroFeature 2 | Imports CodeStack.SwEx.MacroFeature.Attributes 3 | Imports System.Runtime.InteropServices 4 | Imports CodeStack.SwEx.MacroFeature.Base 5 | Imports SolidWorks.Interop.sldworks 6 | Imports CodeStack.SwEx.Common.Attributes 7 | Imports CodeStack.SwEx.Examples.LinkFeatureToExternalFile.My.Resources 8 | 9 | 10 | 11 | 12 | 13 | Public Class LinkFileMacroFeature 14 | Inherits MacroFeatureEx(Of LinkFileMacroFeatureParameters, LinkFileMacroFeatureHandler) 15 | 16 | Protected Overrides Function OnRebuild(ByVal handler As LinkFileMacroFeatureHandler, ByVal parameters As LinkFileMacroFeatureParameters) As MacroFeatureRebuildResult 17 | If handler.LastError Is Nothing Then 18 | parameters.FileLastUpdateTimeStamp = handler.LastUpdateStamp 19 | SetParameters(handler.Model, handler.Feature, TryCast(handler.Feature.GetDefinition(), IMacroFeatureData), parameters) 20 | Return MacroFeatureRebuildResult.FromBodies(handler.CachedBodies.Select(Function(b) b.ICopy()).ToArray(), TryCast(handler.Feature.GetDefinition(), IMacroFeatureData)) 21 | Else 22 | Return MacroFeatureRebuildResult.FromStatus(False, handler.LastError.ToString()) 23 | End If 24 | End Function 25 | 26 | End Class 27 | -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/vb-net/LinkFeatureToExternalFile/LinkFileMacroFeatureParameters.vb: -------------------------------------------------------------------------------- 1 | Public Class LinkFileMacroFeatureParameters 2 | Public Property FileLastUpdateTimeStamp As Long 3 | Public Property LinkedFilePath As String 4 | End Class -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/vb-net/LinkFeatureToExternalFile/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/macro-feature/link-external-file/vb-net/LinkFeatureToExternalFile/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 |  2 | 3 | false 4 | false 5 | 0 6 | true 7 | 0 8 | 1 9 | true 10 | 11 | -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/vb-net/LinkFeatureToExternalFile/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/macro-feature/link-external-file/vb-net/LinkFeatureToExternalFile/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/vb-net/LinkFeatureToExternalFile/Resources/linked-part-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/macro-feature/link-external-file/vb-net/LinkFeatureToExternalFile/Resources/linked-part-icon.png -------------------------------------------------------------------------------- /swex/macro-feature/link-external-file/vb-net/LinkFeatureToExternalFile/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /swex/pmpage/InsertNote/csharp/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /swex/pmpage/InsertNote/csharp/InsertNote.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}") = "InsertNote", "InsertNote.csproj", "{DB0088DB-AACF-47BA-A367-470DCEF8CD7D}" 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 | {DB0088DB-AACF-47BA-A367-470DCEF8CD7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {DB0088DB-AACF-47BA-A367-470DCEF8CD7D}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {DB0088DB-AACF-47BA-A367-470DCEF8CD7D}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {DB0088DB-AACF-47BA-A367-470DCEF8CD7D}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /swex/pmpage/InsertNote/csharp/InsertNotePMPageHandler.cs: -------------------------------------------------------------------------------- 1 | using CodeStack.SwEx.PMPage; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Runtime.InteropServices; 6 | using System.Text; 7 | 8 | namespace InsertNote 9 | { 10 | [ComVisible(true)] 11 | public class InsertNotePMPageHandler : PropertyManagerPageHandlerEx 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /swex/pmpage/InsertNote/csharp/NoteData.cs: -------------------------------------------------------------------------------- 1 | using CodeStack.SwEx.PMPage.Attributes; 2 | using SolidWorks.Interop.sldworks; 3 | using SolidWorks.Interop.swconst; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.ComponentModel; 7 | using System.Linq; 8 | using System.Text; 9 | 10 | namespace InsertNote 11 | { 12 | [PageOptions(swPropertyManagerPageOptions_e.swPropertyManagerOptions_CancelButton 13 | | swPropertyManagerPageOptions_e.swPropertyManagerOptions_OkayButton)] 14 | public class NoteData 15 | { 16 | [Description("Note Text")] 17 | public string Text { get; set; } 18 | 19 | [Description("Font Size")] 20 | [NumberBoxOptions(swNumberboxUnitType_e.swNumberBox_UnitlessInteger, 8, 100, 5, true, 21 | 10, 1, swPropMgrPageNumberBoxStyle_e.swPropMgrPageNumberBoxStyle_Thumbwheel)] 22 | public int Size { get; set; } = 48; 23 | 24 | public NotePosition Position { get; set; } = new NotePosition(); 25 | } 26 | 27 | public class NotePosition 28 | { 29 | [Description("Attached Entity")] 30 | [SelectionBox(swSelectType_e.swSelFACES, swSelectType_e.swSelEDGES, swSelectType_e.swSelVERTICES)] 31 | [ControlAttribution(swControlBitmapLabelType_e.swBitmapLabel_SelectEdgeFaceVertex)] 32 | public IEntity AttachedEntity { get; set; } 33 | 34 | [Description("X Offset")] 35 | [NumberBoxOptions(swNumberboxUnitType_e.swNumberBox_Length, 0, 1000, 0.01, true, 0.02, 0.001)] 36 | public double X { get; set; } 37 | 38 | [Description("Y Offset")] 39 | [NumberBoxOptions(swNumberboxUnitType_e.swNumberBox_Length, 0, 1000, 0.01, true, 0.02, 0.001)] 40 | public double Y { get; set; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /swex/pmpage/InsertNote/csharp/NoteHelper.cs: -------------------------------------------------------------------------------- 1 | using SolidWorks.Interop.sldworks; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace InsertNote 8 | { 9 | public static class NoteHelper 10 | { 11 | public static void InsertNote(IDrawingDoc draw, string text, NoteSize size) 12 | { 13 | int height = 0; 14 | 15 | switch (size) 16 | { 17 | case NoteSize.Small: 18 | height = 24; 19 | break; 20 | 21 | case NoteSize.Normal: 22 | height = 36; 23 | break; 24 | 25 | case NoteSize.Large: 26 | height = 64; 27 | break; 28 | } 29 | 30 | InsertNote(draw, text, height, 0, 0, null); 31 | } 32 | 33 | public static void InsertNote(IDrawingDoc draw, string text, int height, double offsetX, double offsetY, IEntity entity) 34 | { 35 | double x = 0; 36 | double y = 0; 37 | 38 | if (entity != null) 39 | { 40 | entity.Select4(false, null); 41 | 42 | var view = (draw as IModelDoc2).ISelectionManager.GetSelectedObjectsDrawingView2(1, -1); 43 | 44 | var viewOutline = view.GetOutline() as double[]; 45 | 46 | x = viewOutline[0] + offsetX; 47 | y = viewOutline[1] - offsetY; 48 | } 49 | else 50 | { 51 | double sheetWidth = 0; 52 | double sheetHeight = 0; 53 | draw.IGetCurrentSheet().GetSize(ref sheetWidth, ref sheetHeight); 54 | 55 | x = offsetX; 56 | y = sheetHeight - offsetY; 57 | } 58 | 59 | var note = (draw as IModelDoc2).InsertNote(text) as INote; 60 | 61 | note.SetHeightInPoints(height); 62 | 63 | note.IGetAnnotation().SetPosition2(x, y, 0); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /swex/pmpage/InsertNote/csharp/NoteSize.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace InsertNote 7 | { 8 | public enum NoteSize 9 | { 10 | Small, 11 | Normal, 12 | Large 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /swex/pmpage/InsertNote/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("InsertNote")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("InsertNote")] 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("db0088db-aacf-47ba-a367-470dcef8cd7d")] 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/pmpage/InsertNote/csharp/Resources/insert_note_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/pmpage/InsertNote/csharp/Resources/insert_note_icon.png -------------------------------------------------------------------------------- /swex/pmpage/InsertNote/csharp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeatures/PrimitivesStandardFeatures.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}") = "PrimitivesStandardFeatures", "PrimitivesStandardFeatures\PrimitivesStandardFeatures.csproj", "{1B9A616E-2C25-4EA0-9600-E50A766C6E4A}" 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 | {1B9A616E-2C25-4EA0-9600-E50A766C6E4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {1B9A616E-2C25-4EA0-9600-E50A766C6E4A}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {1B9A616E-2C25-4EA0-9600-E50A766C6E4A}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {1B9A616E-2C25-4EA0-9600-E50A766C6E4A}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("PrimitivesStandardFeatures")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyCompany("CodeStack")] 8 | [assembly: AssemblyProduct("PrimitivesStandardFeatures")] 9 | [assembly: AssemblyCopyright("Copyright © www.codestack.net 2019")] 10 | [assembly: AssemblyTrademark("")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | [assembly: ComVisible(false)] 14 | 15 | [assembly: Guid("1b9a616e-2c25-4ea0-9600-e50a766c6e4a")] 16 | 17 | [assembly: AssemblyVersion("1.0.0.0")] 18 | [assembly: AssemblyFileVersion("1.0.0.0")] 19 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Resources/box-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Resources/box-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Resources/cylinder-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Resources/cylinder-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Resources/primitives-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Resources/primitives-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeatures/PrimitivesStandardFeatures/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage.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}") = "PrimitivesStandardFeaturesPMPage", "PrimitivesStandardFeaturesPMPage\PrimitivesStandardFeaturesPMPage.csproj", "{88236175-54EE-4D2B-B7CB-D20DB6DF3560}" 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 | {88236175-54EE-4D2B-B7CB-D20DB6DF3560}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {88236175-54EE-4D2B-B7CB-D20DB6DF3560}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {88236175-54EE-4D2B-B7CB-D20DB6DF3560}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {88236175-54EE-4D2B-B7CB-D20DB6DF3560}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/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("PrimitivesStandardFeatures")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PrimitivesStandardFeatures")] 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("1b9a616e-2c25-4ea0-9600-e50a766c6e4a")] 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/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/PropertyPageHandler.cs: -------------------------------------------------------------------------------- 1 | //********************** 2 | //SwEx - development tools for SOLIDWORKS 3 | //Copyright(C) 2019 www.codestack.net 4 | //License: https://github.com/codestackdev/swex-common/blob/master/LICENSE 5 | //Product URL: https://www.codestack.net/labs/solidworks/swex 6 | //********************** 7 | 8 | using CodeStack.SwEx.PMPage; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Linq; 12 | using System.Runtime.InteropServices; 13 | using System.Text; 14 | using System.Threading.Tasks; 15 | 16 | namespace CodeStack.PrimitivesStandardFeaturesPMPage 17 | { 18 | [ComVisible(true)] 19 | public class PropertyPageHandler : PropertyManagerPageHandlerEx 20 | { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/ReferenceSelectionCustomFilter.cs: -------------------------------------------------------------------------------- 1 | //********************** 2 | //SwEx - development tools for SOLIDWORKS 3 | //Copyright(C) 2019 www.codestack.net 4 | //License: https://github.com/codestackdev/swex-common/blob/master/LICENSE 5 | //Product URL: https://www.codestack.net/labs/solidworks/swex 6 | //********************** 7 | 8 | using CodeStack.SwEx.PMPage.Base; 9 | using CodeStack.SwEx.PMPage.Controls; 10 | using SolidWorks.Interop.sldworks; 11 | using SolidWorks.Interop.swconst; 12 | 13 | namespace CodeStack.PrimitivesStandardFeaturesPMPage 14 | { 15 | public class ReferenceSelectionCustomFilter : SelectionCustomFilter 16 | { 17 | protected override bool Filter(IPropertyManagerPageControlEx selBox, IEntity selection, swSelectType_e selType, ref string itemText) 18 | { 19 | if (selType == swSelectType_e.swSelFACES) 20 | { 21 | if (selType == swSelectType_e.swSelFACES) 22 | { 23 | var face = selection as IFace2; 24 | 25 | if (!face.IGetSurface().IsPlane()) 26 | { 27 | return false; 28 | } 29 | } 30 | } 31 | 32 | return true; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/box-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/box-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/cylinder-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/cylinder-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/height-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/height-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/primitives-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/primitives-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/csharp/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeatures/PrimitivesStandardFeatures.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}") = "PrimitivesStandardFeatures", "PrimitivesStandardFeatures\PrimitivesStandardFeatures.vbproj", "{214E1BE1-8B90-462D-A9BB-998715845ABD}" 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 | {214E1BE1-8B90-462D-A9BB-998715845ABD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {214E1BE1-8B90-462D-A9BB-998715845ABD}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {214E1BE1-8B90-462D-A9BB-998715845ABD}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {214E1BE1-8B90-462D-A9BB-998715845ABD}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeatures/PrimitivesStandardFeatures/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/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeatures/PrimitivesStandardFeatures/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 |  2 | 3 | false 4 | false 5 | 0 6 | true 7 | 0 8 | 1 9 | true 10 | 11 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeatures/PrimitivesStandardFeatures/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 | 19 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeatures/PrimitivesStandardFeatures/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Resources/box-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Resources/box-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Resources/cylinder-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Resources/cylinder-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Resources/primitives-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeatures/PrimitivesStandardFeatures/Resources/primitives-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeatures/PrimitivesStandardFeatures/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage.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}") = "PrimitivesStandardFeaturesPMPage", "PrimitivesStandardFeaturesPMPage\PrimitivesStandardFeaturesPMPage.vbproj", "{3A07E01E-98B6-02DA-3593-1873D44801C0}" 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 | {3A07E01E-98B6-02DA-3593-1873D44801C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {3A07E01E-98B6-02DA-3593-1873D44801C0}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {3A07E01E-98B6-02DA-3593-1873D44801C0}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {3A07E01E-98B6-02DA-3593-1873D44801C0}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/CylinderData.vb: -------------------------------------------------------------------------------- 1 | '********************** 2 | 'SwEx - development tools for SOLIDWORKS 3 | 'Copyright(C) 2019 www.codestack.net 4 | 'License: https://github.com/codestackdev/swex-common/blob/master/LICENSE 5 | 'Product URL: https://www.codestack.net/labs/solidworks/swex 6 | '********************** 7 | 8 | Imports CodeStack.PrimitivesStandardFeaturesPMPage.CodeStack.PrimitivesStandardFeaturesPMPage.Properties 9 | Imports CodeStack.SwEx.Common.Attributes 10 | Imports CodeStack.SwEx.PMPage.Attributes 11 | Imports SolidWorks.Interop.sldworks 12 | Imports SolidWorks.Interop.swconst 13 | Imports System 14 | Imports System.ComponentModel 15 | 16 | 17 | 18 | 19 | Public Class CylinderData 20 | 21 | 22 | 23 | 24 | 25 | Public Property Reference As IEntity 26 | 27 | 28 | 29 | 30 | Public Property Diameter As Double 31 | 32 | 33 | 34 | 35 | Public Property Height As Double 36 | 37 | End Class 38 | 39 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Properties/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System.Reflection 2 | Imports System.Runtime.CompilerServices 3 | Imports System.Runtime.InteropServices 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/PropertyPageHandler.vb: -------------------------------------------------------------------------------- 1 | '********************** 2 | 'SwEx - development tools for SOLIDWORKS 3 | 'Copyright(C) 2019 www.codestack.net 4 | 'License: https://github.com/codestackdev/swex-common/blob/master/LICENSE 5 | 'Product URL: https://www.codestack.net/labs/solidworks/swex 6 | '********************** 7 | 8 | Imports CodeStack.SwEx.PMPage 9 | Imports System.Runtime.InteropServices 10 | 11 | 12 | Public Class PropertyPageHandler 13 | Inherits PropertyManagerPageHandlerEx 14 | End Class 15 | 16 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/ReferenceSelectionCustomFilter.vb: -------------------------------------------------------------------------------- 1 | '********************** 2 | 'SwEx - development tools for SOLIDWORKS 3 | 'Copyright(C) 2019 www.codestack.net 4 | 'License: https://github.com/codestackdev/swex-common/blob/master/LICENSE 5 | 'Product URL: https://www.codestack.net/labs/solidworks/swex 6 | '********************** 7 | 8 | Imports CodeStack.SwEx.PMPage.Base 9 | Imports CodeStack.SwEx.PMPage.Controls 10 | Imports SolidWorks.Interop.sldworks 11 | Imports SolidWorks.Interop.swconst 12 | 13 | Public Class ReferenceSelectionCustomFilter 14 | Inherits SelectionCustomFilter(Of IEntity) 15 | 16 | Protected Overrides Function Filter(ByVal selBox As IPropertyManagerPageControlEx, ByVal selection As IEntity, ByVal selType As swSelectType_e, ByRef itemText As String) As Boolean 17 | If selType = swSelectType_e.swSelFACES Then 18 | 19 | If selType = swSelectType_e.swSelFACES Then 20 | Dim face = TryCast(selection, IFace2) 21 | 22 | If Not face.IGetSurface().IsPlane() Then 23 | Return False 24 | End If 25 | End If 26 | End If 27 | 28 | Return True 29 | End Function 30 | 31 | End Class 32 | -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/box-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/box-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/cylinder-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/cylinder-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/height-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/height-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/primitives-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codestackdev/solidworks-api-examples/c92924a5d5b69d47345fb30de79ee8ba11fbf697/swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/Resources/primitives-icon.png -------------------------------------------------------------------------------- /swex/tutorials/geometrical-primitives/vb-net/PrimitivesStandardFeaturesPMPage/PrimitivesStandardFeaturesPMPage/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | --------------------------------------------------------------------------------