Skip to content

Commit 86ff39e

Browse files
committed
v. 0.2.0
* Added bodies fillet feature * Added extrude surface with caps feature * Added capturing of logs
1 parent 3394f85 commit 86ff39e

24 files changed

+1509
-353
lines changed

Installer/AddInReg.wxs

Lines changed: 42 additions & 30 deletions
Large diffs are not rendered by default.

Installer/Product.wxs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3-
<Product Id="*" Name="Geometry++" Language="1033" Version="0.1.0.0" Manufacturer="CodeStack" UpgradeCode="{56083FFE-D237-4BC0-A853-BA1C65BC9F68}">
3+
<Product Id="*" Name="Geometry++" Language="1033" Version="0.2.0.0" Manufacturer="CodeStack" UpgradeCode="{56083FFE-D237-4BC0-A853-BA1C65BC9F68}">
44
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
55

66
<MajorUpgrade DowngradeErrorMessage="A newer version of Geometry++ is already installed." />
@@ -55,6 +55,15 @@
5555
<File Id="Xarial.VPages.Framework.dllID" Name="Xarial.VPages.Framework.dll" Source="$(var.SourceOutDir)\Xarial.VPages.Framework.dll" />
5656
<File Id="Xarial.Signal2Go.dllID" Name="Xarial.Signal2Go.dll" Source="$(var.SourceOutDir)\Xarial.Signal2Go.dll" />
5757
</Component>
58+
<Component Id="unity" Guid="{29D7AFE1-EB1D-475B-A42D-7DE5B0E1C7B7}">
59+
<File Id="Unity.Abstractions.dllID" Name="Unity.Abstractions.dll" Source="$(var.SourceOutDir)\Unity.Abstractions.dll" />
60+
<File Id="Unity.Configuration.dllID" Name="Unity.Configuration.dll" Source="$(var.SourceOutDir)\Unity.Configuration.dll" />
61+
<File Id="Unity.Container.dllID" Name="Unity.Container.dll" Source="$(var.SourceOutDir)\Unity.Container.dll" />
62+
<File Id="Unity.Interception.Configuration.dllID" Name="Unity.Interception.Configuration.dll" Source="$(var.SourceOutDir)\Unity.Interception.Configuration.dll" />
63+
<File Id="Unity.Interception.dllID" Name="Unity.Interception.dll" Source="$(var.SourceOutDir)\Unity.Interception.dll" />
64+
<File Id="Unity.RegistrationByConvention.dllID" Name="Unity.RegistrationByConvention.dll" Source="$(var.SourceOutDir)\Unity.RegistrationByConvention.dll" />
65+
<File Id="Unity.ServiceLocation.dllID" Name="Unity.ServiceLocation.dll" Source="$(var.SourceOutDir)\Unity.ServiceLocation.dll" />
66+
</Component>
5867
</ComponentGroup>
5968
</Fragment>
6069
</Wix>

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1-
# geometry-plus-plus
1+
# Geometry++ for SOLIDWORKS
2+
![Geometry++ Logo](https://www.codestack.net/labs/solidworks/geometry-plus-plus/logo.png)
3+
Geometry++ is a SOLIDWORKS add-in extending the functionality related to geometry creation and manipulation. Add-in is fully integrated into SOLIDWORKS and provides same look and feel of additional features as any other built-in features.
4+
5+
[User Guide](https://www.codestack.net/labs/solidworks/geometry-plus-plus/)
6+
7+
## Features
8+
9+
### Convert Solid To Surface
10+
![Convert Solid To Surface](https://www.codestack.net/labs/solidworks/geometry-plus-plus/user-guide/convert-solid-to-surface/icon.png)
11+
12+
This feature converts solid bodies to surface bodies.
13+
14+
### Crop Bodies
15+
![Crop Bodies](https://www.codestack.net/labs/solidworks/geometry-plus-plus/user-guide/crop-bodies/icon.png)
16+
This command allows cropping surface and solid (target bodies) using sketches or sketch regions (trimming tools).
17+
18+
### Extrude Surface With Caps
19+
![Extrude Surface With Caps](https://www.codestack.net/labs/solidworks/geometry-plus-plus/user-guide/extrude-surface-cap/icon.png)
20+
This command allows extruding the surface and adding the caps at the ends of extrusion
21+
22+
### Bodies Fillet
23+
![Bodies Fillet](https://www.codestack.net/labs/solidworks/geometry-plus-plus/user-guide/body-fillet/icon.png)
24+
25+
This command allows adding the fillet to entire bodies, faces, edges and vertices supporting multiple bodies within a single feature

Sw/AddIn.cs

Lines changed: 10 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
using CodeStack.Community.GeometryPlusPlus.Features.BodiesFillet;
1+
using CodeStack.Community.GeometryPlusPlus.Core;
2+
using CodeStack.Community.GeometryPlusPlus.Features.BodiesFillet;
23
using CodeStack.Community.GeometryPlusPlus.Features.ExtrudeSurfaceCap;
34
using CodeStack.Community.GeometryPlusPlus.Features.SolidToSurface;
4-
using CodeStack.Community.GeometryPlusPlus.Features.TrimSurfacesByRegion;
55
using CodeStack.Community.GeometryPlusPlus.Properties;
66
using CodeStack.SwEx.AddIn;
77
using CodeStack.SwEx.AddIn.Attributes;
88
using CodeStack.SwEx.AddIn.Enums;
9+
using CodeStack.SwEx.Common.Attributes;
910
using System;
1011
using System.Collections.Generic;
1112
using System.ComponentModel;
@@ -27,124 +28,22 @@ namespace CodeStack.Community.GeometryPlusPlus
2728
#if DEBUG
2829
[AutoRegister("Geometry++", "Additional geometry functionality for SOLIDWORKS")]
2930
#endif
31+
[LoggerOptions(true, LOGGER_NAME)]
3032
public class AddIn : SwAddInEx
3133
{
32-
//TODO: redundancy - make commands to load from the available macro features
34+
internal const string LOGGER_NAME = "Geometry++";
3335

34-
[Title("Geometry++")]
35-
[Icon(typeof(Resources), nameof(Resources.geometry_plus_plus))]
36-
private enum Commands_e
37-
{
38-
[Icon(typeof(Resources), nameof(Resources.solid_to_surface))]
39-
[Title("Convert Solid To Surface")]
40-
[CommandItemInfo(true, true, swWorkspaceTypes_e.Part, true)]
41-
SolidToSurface,
42-
43-
[Icon(typeof(Resources), nameof(Resources.trim_surface_region))]
44-
[Title("Trim Surface By Region")]
45-
[CommandItemInfo(true, true, swWorkspaceTypes_e.Part, true)]
46-
TrimSurfaceByRegion,
47-
48-
[Icon(typeof(Resources), nameof(Resources.extrude_surface_caps))]
49-
[Title("Extrude Surface Cap")]
50-
[CommandItemInfo(true, true, swWorkspaceTypes_e.Part, true)]
51-
ExtrudeSurfaceCap,
52-
53-
[Icon(typeof(Resources), nameof(Resources.fillet))]
54-
[Title("Bodies Fillet")]
55-
[CommandItemInfo(true, true, swWorkspaceTypes_e.Part, true)]
56-
BodiesFillet,
57-
58-
[Title("About...")]
59-
[Description("About Geometry++")]
60-
[CommandItemInfo(true, false, swWorkspaceTypes_e.All)]
61-
[Icon(typeof(Resources), nameof(Resources.about_icon))]
62-
About
63-
}
64-
65-
private ServicesManager m_Kit;
36+
private ServicesContainer m_Services;
6637

6738
public override bool OnConnect()
68-
{
69-
m_Kit = new ServicesManager(this.GetType().Assembly, new IntPtr(App.IFrameObject().GetHWnd()),
70-
typeof(UpdatesService),
71-
typeof(SystemEventLogService),
72-
typeof(AboutApplicationService));
73-
74-
m_Kit.HandleError += OnHandleError;
75-
76-
var syncContext = SynchronizationContext.Current;
77-
78-
if (syncContext == null)
79-
{
80-
syncContext = new System.Windows.Forms.WindowsFormsSynchronizationContext();
81-
}
82-
83-
Task.Run(() =>
84-
{
85-
SynchronizationContext.SetSynchronizationContext(
86-
syncContext);
87-
m_Kit.StartServicesAsync().Wait();
88-
});
89-
90-
this.AddCommandGroup<Commands_e>(OnButtonClicked);
91-
92-
return true;
93-
}
94-
95-
private bool OnHandleError(Exception ex)
96-
{
97-
try
98-
{
99-
m_Kit.GetService<ILogService>().LogException(ex);
100-
}
101-
catch
102-
{
103-
}
104-
105-
return true;
106-
}
107-
108-
private void OnButtonClicked(Commands_e btn)
10939
{
110-
switch (btn)
111-
{
112-
//TODO: use dependency injection with singleton
113-
114-
case Commands_e.SolidToSurface:
115-
{
116-
new SolidToSurfaceMacroFeature().Insert(App, App.IActiveDoc2);
117-
break;
118-
}
40+
m_Services = new ServicesContainer(App);
11941

120-
case Commands_e.TrimSurfaceByRegion:
121-
{
122-
new TrimSurfacesByRegionMacroFeature().Insert(App, App.IActiveDoc2);
123-
break;
124-
}
42+
var cmdBar = m_Services.GetService<GeometryFeaturesCommandGroupSpec>();
12543

126-
case Commands_e.ExtrudeSurfaceCap:
127-
{
128-
App.SendMsgToUser("Not implemented");
129-
new ExtrudeSurfaceCapMacroFeature().Insert(App, App.IActiveDoc2);
130-
break;
131-
}
44+
this.AddCommandGroup(cmdBar);
13245

133-
case Commands_e.BodiesFillet:
134-
{
135-
App.SendMsgToUser("Not implemented");
136-
new BodiesFilletMacroFeature().Insert(App, App.IActiveDoc2);
137-
break;
138-
}
139-
140-
case Commands_e.About:
141-
m_Kit.GetService<IAboutApplicationService>().ShowAboutForm();
142-
break;
143-
144-
default:
145-
App.SendMsgToUser("Not implemented");
146-
break;
147-
}
46+
return true;
14847
}
14948
}
15049
}

0 commit comments

Comments
 (0)