-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DUI3-325 Add Civil3d 2024 connector #3531
Changes from 12 commits
1e925f5
b2365e4
87f9077
0d8f5c7
3eab4db
261bec8
67b3596
3914a22
f3d823c
ade2092
3bb1584
9f94f9d
b28852d
1fe7e02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,7 @@ public static class HostApplications | |
Unity = new("Unity", "unity"), | ||
GSA = new("GSA", "gsa"), | ||
Civil = new("Civil 3D", "civil3d"), | ||
Civil3D = new("Civil 3D", "civil3d"), | ||
AutoCAD = new("AutoCAD", "autocad"), | ||
MicroStation = new("MicroStation", "microstation"), | ||
OpenRoads = new("OpenRoads", "openroads"), | ||
|
@@ -124,6 +125,11 @@ public static HostApplication GetHostAppFromString(string? appname) | |
return Civil; | ||
} | ||
|
||
if (appname.Contains("civil3d")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is the difference with "civil"? because this will always return the previous one I believe because it will contain already "civil" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah good point, will fix this |
||
{ | ||
return Civil3D; | ||
} | ||
|
||
if (appname.Contains("rhino")) | ||
{ | ||
return Rhino; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#if AUTOCAD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might make sense to put note here why we do this |
||
using Speckle.Autofac; | ||
using Speckle.Autofac.DependencyInjection; | ||
using Speckle.Connectors.Autocad.Bindings; | ||
|
@@ -47,7 +48,6 @@ public void Load(SpeckleContainerBuilder builder) | |
builder.AddScoped<IRootObjectBuilder<AutocadRootObject>, AutocadRootObjectBuilder>(); | ||
|
||
// Register bindings | ||
|
||
builder.AddSingleton<IBinding, TestBinding>(); | ||
builder.AddSingleton<IBinding, ConfigBinding>("connectorName", "Autocad"); // POC: Easier like this for now, should be cleaned up later | ||
builder.AddSingleton<IBinding, AccountBinding>(); | ||
|
@@ -64,3 +64,4 @@ public void Load(SpeckleContainerBuilder builder) | |
builder.AddSingleton<ISendConversionCache, SendConversionCache>(); | ||
} | ||
} | ||
#endif |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can have shared module for autocad verticals, seems we are having many dups |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#if CIVIL3D | ||
using Speckle.Autofac; | ||
using Speckle.Autofac.DependencyInjection; | ||
using Speckle.Connectors.Autocad.Bindings; | ||
using Speckle.Connectors.Autocad.Filters; | ||
using Speckle.Connectors.Autocad.HostApp; | ||
using Speckle.Connectors.Autocad.Interfaces; | ||
using Speckle.Connectors.Autocad.Operations.Send; | ||
using Speckle.Connectors.Autocad.Plugin; | ||
using Speckle.Connectors.DUI; | ||
using Speckle.Connectors.DUI.Bindings; | ||
using Speckle.Connectors.DUI.Models; | ||
using Speckle.Connectors.DUI.Models.Card.SendFilter; | ||
using Speckle.Connectors.DUI.WebView; | ||
using Speckle.Connectors.Utils; | ||
using Speckle.Connectors.Utils.Builders; | ||
using Speckle.Connectors.Utils.Caching; | ||
using Speckle.Connectors.Utils.Operations; | ||
using Speckle.Core.Models.GraphTraversal; | ||
|
||
namespace Speckle.Connectors.Autocad.DependencyInjection; | ||
|
||
public class Civil3dConnectorModule : ISpeckleModule | ||
{ | ||
public void Load(SpeckleContainerBuilder builder) | ||
{ | ||
builder.AddAutofac(); | ||
builder.AddConnectorUtils(); | ||
builder.AddDUI(); | ||
builder.AddDUIView(); | ||
|
||
// Register other connector specific types | ||
builder.AddSingleton<IAutocadPlugin, AutocadPlugin>(); | ||
builder.AddTransient<TransactionContext>(); | ||
builder.AddSingleton(new AutocadDocumentManager()); // TODO: Dependent to TransactionContext, can be moved to AutocadContext | ||
builder.AddSingleton<DocumentModelStore, AutocadDocumentStore>(); | ||
builder.AddSingleton<AutocadContext>(); | ||
builder.AddSingleton<AutocadLayerManager>(); | ||
builder.AddSingleton<AutocadIdleManager>(); | ||
|
||
// Operations | ||
builder.AddScoped<SendOperation<AutocadRootObject>>(); | ||
builder.AddSingleton(DefaultTraversal.CreateTraversalFunc()); | ||
|
||
// Object Builders | ||
builder.AddScoped<IRootObjectBuilder<AutocadRootObject>, AutocadRootObjectBuilder>(); | ||
|
||
// Register bindings | ||
builder.AddSingleton<IBinding, TestBinding>(); | ||
builder.AddSingleton<IBinding, ConfigBinding>("connectorName", "Civil3d"); // POC: Easier like this for now, should be cleaned up later | ||
builder.AddSingleton<IBinding, AccountBinding>(); | ||
builder.AddSingleton<IBinding, AutocadBasicConnectorBinding>(); | ||
builder.AddSingleton<IBasicConnectorBinding, AutocadBasicConnectorBinding>(); | ||
builder.AddSingleton<IBinding, AutocadSelectionBinding>(); | ||
builder.AddSingleton<IBinding, AutocadSendBinding>(); | ||
|
||
// register send filters | ||
builder.AddTransient<ISendFilter, AutocadSelectionFilter>(); | ||
|
||
// register send conversion cache | ||
builder.AddSingleton<ISendConversionCache, SendConversionCache>(); | ||
} | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this one if we added Civil3D?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, to prevent breaking the DUI2 connectors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should start to consider have new Applications(?) class for DUI3 only instead populating old.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: @BovineOx added as subtask under the other relevant story (assigned to Ian) https://spockle.atlassian.net/browse/DUI3-431