Compare commits

..

1 Commits

Author SHA1 Message Date
oguzhankoral 6c74f55679 Comments POC 2025-01-23 01:17:06 +03:00
253 changed files with 3212 additions and 5434 deletions
+38 -29
View File
@@ -1,46 +1,30 @@
<!---
Provide a short summary in the Title above. Use the following template:
Provide a short summary in the Title above. Examples of good PR titles:
category(project): summary
* "Feature: adds metrics to component"
Categories:
* "Fix: resolves duplication in comment thread"
* feat: (new feature for the user, not a new feature for build script)
* fix: (bug fix for the user, not a fix to a build script)
* docs: (changes to the documentation)
* style: (formatting, missing semi colons, etc; no production code change)
* refactor: (refactoring production code, eg. renaming a variable)
* test: (adding missing tests, refactoring tests; no production code change)
* chore: (updating grunt tasks etc; no production code change)
Example:
feat(revit): added category filter to send
* "Update: apollo v2.34.0"
-->
## Description
## Description & motivation
<!---
Describe your changes, and why you're making them.
Describe your changes, and why you're making them. What benefit will this have to others?
Link related github issues here ->
Fixes #85, Fixes #22, Connects #123
Is this linked to an open Github issue, a thread in Speckle community,
or another pull request? Link it here.
If it is related to a Github issue, and resolves it, please link to the issue number, e.g.:
Fixes #85, Fixes #22, Fixes username/repo#123
Connects #123
-->
## User Value
<!---
Describe in 1 sentence the user value.
This can also be a link to the relevant thread in Speckle community, or a link to the Linear issue.
-->
## Changes:
<!---
@@ -84,10 +68,35 @@ Describe what tests have been added or amended, and why these demonstrate it wor
<!---
This checklist is a useful reminder of related tasks to uphold our repo quality. Amend this list as needed for the pr.
This checklist is mostly useful as a reminder of small things that can easily be
forgotten it is meant as a helpful tool rather than hoops to jump through.
Put an `x` between the square brackets, e.g. [x], for all the items that apply,
make notes next to any that haven't been addressed, and remove any items that are not relevant to this PR.
-->
- [ ] My pull request follows the guidelines in the [Contributing guide](https://github.com/specklesystems/speckle-server/blob/main/CONTRIBUTING.md)?
- [ ] My pull request does not duplicate any other open [Pull Requests](../../pulls) for the same update/change?
- [ ] My commits are related to the pull request and do not amend unrelated code or documentation.
- [ ] My code follows a similar style to existing code.
- [ ] I have added appropriate tests.
- [ ] I have updated or added relevant documentation.
## References
<!---
(Optional -- remove this section if not needed )
Include **important** links regarding the implementation of this PR.
This usually includes a RFC or an aggregation of issues and/or individual conversations
that helped put this solution together. This helps ensure we retain and share knowledge
regarding the implementation, and may help others understand motivation and design decisions etc..
-->
@@ -101,7 +101,7 @@ jobs:
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
with:
files: Converters/**/coverage.xml
file: Converters/**/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Push to nuget.org
-7
View File
@@ -58,13 +58,6 @@ public static class Consts
new("Connectors/Tekla/Speckle.Connector.Tekla2023", "net48"),
new("Connectors/Tekla/Speckle.Connector.Tekla2024", "net48")
]
),
new(
"etabs",
[
new("Connectors/CSi/Speckle.Connectors.ETABS21", "net48"),
new("Connectors/CSi/Speckle.Connectors.ETABS22", "net8.0-windows"),
]
)
};
}
+29 -59
View File
@@ -18,7 +18,6 @@ const string BUILD_SERVER_VERSION = "build-server-version";
const string CLEAN_LOCKS = "clean-locks";
const string CHECK_SOLUTIONS = "check-solutions";
const string DEEP_CLEAN = "deep-clean";
const string DEEP_CLEAN_LOCAL = "deep-clean-local";
//need to pass arguments
/*var arguments = new List<string>();
@@ -28,59 +27,18 @@ if (args.Length > 1)
args = new[] { arguments.First() };
//arguments = arguments.Skip(1).ToList();
}*/
void Build(string solution, string configuration)
{
Console.WriteLine();
Console.WriteLine();
Console.WriteLine($"Building solution '{solution}' as '{configuration}'");
Console.WriteLine();
Run("dotnet", $"build .\\{solution} --configuration {configuration} --no-restore");
}
void Restore(string solution)
{
Console.WriteLine();
Console.WriteLine($"Restoring solution '{solution}'");
Console.WriteLine();
Run("dotnet", $"restore .\\{solution} --no-cache");
}
void DeleteFiles(string pattern)
{
foreach (var f in Glob.Files(".", pattern))
{
Console.WriteLine("Found and will delete: " + f);
File.Delete(f);
}
}
void DeleteDirectories(string pattern)
{
foreach (var f in Glob.Directories(".", pattern))
{
if (f.StartsWith("Build"))
{
continue;
}
Console.WriteLine("Found and will delete: " + f);
Directory.Delete(f, true);
}
}
void CleanSolution(string solution, string configuration)
{
Console.WriteLine("Cleaning solution: " + solution);
DeleteDirectories("**/bin");
DeleteDirectories("**/obj");
DeleteFiles("**/*.lock.json");
Restore(solution);
Build(solution, configuration);
}
Target(
CLEAN_LOCKS,
() =>
{
DeleteFiles("**/*.lock.json");
Restore("Speckle.Connectors.sln");
foreach (var f in Glob.Files(".", "**/*.lock.json"))
{
Console.WriteLine("Found and will delete: " + f);
File.Delete(f);
}
Console.WriteLine("Running restore now.");
Run("dotnet", "restore .\\Speckle.Connectors.sln --no-cache");
}
);
@@ -88,14 +46,26 @@ Target(
DEEP_CLEAN,
() =>
{
CleanSolution("Speckle.Connectors.sln", "debug");
}
);
Target(
DEEP_CLEAN_LOCAL,
() =>
{
CleanSolution("Local.sln", "local");
foreach (var f in Glob.Directories(".", "**/bin"))
{
if (f.StartsWith("Build"))
{
continue;
}
Console.WriteLine("Found and will delete: " + f);
Directory.Delete(f, true);
}
foreach (var f in Glob.Directories(".", "**/obj"))
{
if (f.StartsWith("Build"))
{
continue;
}
Console.WriteLine("Found and will delete: " + f);
Directory.Delete(f, true);
}
Console.WriteLine("Running restore now.");
Run("dotnet", "restore .\\Speckle.Connectors.sln --no-cache");
}
);
@@ -206,10 +176,10 @@ Target(
Glob.Files(".", "**/*.Tests.csproj"),
file =>
{
Run("dotnet", $"build {file} -c Release --no-incremental");
Run("dotnet", $"restore {file} --locked-mode");
Run(
"dotnet",
$"test {file} -c Release --no-build --verbosity=minimal /p:AltCover=true /p:AltCoverAttributeFilter=ExcludeFromCodeCoverage /p:AltCoverVerbosity=Warning"
$"test {file} -c Release --no-restore --verbosity=minimal /p:AltCover=true /p:AltCoverAttributeFilter=ExcludeFromCodeCoverage /p:AltCoverVerbosity=Warning"
);
}
);
@@ -19,7 +19,7 @@ namespace Speckle.Connectors.ArcGIS.Bindings;
public sealed class ArcGISReceiveBinding : IReceiveBinding
{
public string Name { get; } = "receiveBinding";
private readonly ICancellationManager _cancellationManager;
private readonly CancellationManager _cancellationManager;
private readonly DocumentModelStore _store;
private readonly IServiceProvider _serviceProvider;
private readonly IOperationProgressManager _operationProgressManager;
@@ -32,7 +32,7 @@ public sealed class ArcGISReceiveBinding : IReceiveBinding
public ArcGISReceiveBinding(
DocumentModelStore store,
IBrowserBridge parent,
ICancellationManager cancellationManager,
CancellationManager cancellationManager,
IServiceProvider serviceProvider,
IOperationProgressManager operationProgressManager,
ILogger<ArcGISReceiveBinding> logger,
@@ -60,7 +60,7 @@ public sealed class ArcGISReceiveBinding : IReceiveBinding
throw new InvalidOperationException("No download model card was found.");
}
using var cancellationItem = _cancellationManager.GetCancellationItem(modelCardId);
CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId);
using var scope = _serviceProvider.CreateScope();
scope
.ServiceProvider.GetRequiredService<IConverterSettingsStore<ArcGISConversionSettings>>()
@@ -76,8 +76,8 @@ public sealed class ArcGISReceiveBinding : IReceiveBinding
.ServiceProvider.GetRequiredService<ReceiveOperation>()
.Execute(
modelCard.GetReceiveInfo("ArcGIS"), // POC: get host app name from settings? same for GetSendInfo
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
cancellationItem.Token
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationToken),
cancellationToken
);
modelCard.BakedObjectIds = receiveOperationResults.BakedObjectIds.ToList();
@@ -39,7 +39,7 @@ public sealed class ArcGISSendBinding : ISendBinding
private readonly DocumentModelStore _store;
private readonly IServiceProvider _serviceProvider;
private readonly List<ISendFilter> _sendFilters;
private readonly ICancellationManager _cancellationManager;
private readonly CancellationManager _cancellationManager;
private readonly ISendConversionCache _sendConversionCache;
private readonly IOperationProgressManager _operationProgressManager;
private readonly ILogger<ArcGISSendBinding> _logger;
@@ -64,7 +64,7 @@ public sealed class ArcGISSendBinding : ISendBinding
IBrowserBridge parent,
IEnumerable<ISendFilter> sendFilters,
IServiceProvider serviceProvider,
ICancellationManager cancellationManager,
CancellationManager cancellationManager,
ISendConversionCache sendConversionCache,
IOperationProgressManager operationProgressManager,
ILogger<ArcGISSendBinding> logger,
@@ -372,7 +372,7 @@ public sealed class ArcGISSendBinding : ISendBinding
throw new InvalidOperationException("No publish model card was found.");
}
using var cancellationItem = _cancellationManager.GetCancellationItem(modelCardId);
CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId);
using var scope = _serviceProvider.CreateScope();
scope
@@ -415,8 +415,8 @@ public sealed class ArcGISSendBinding : ISendBinding
.Execute(
mapMembers,
modelCard.GetSendInfo("ArcGIS"), // POC: get host app name from settings? same for GetReceiveInfo
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
cancellationItem.Token
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationToken),
cancellationToken
);
await Commands.SetModelSendResult(modelCardId, sendResult.RootObjId, sendResult.ConversionResults);
@@ -20,7 +20,7 @@
<ArcGIS defaultAssembly="Speckle.Connectors.ArcGIS3.dll" defaultNamespace="Speckle.Connectors.ArcGIS" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd">
<AddInInfo id="{6CB1D25C-B8BF-4A33-9099-C1F8D1B32EFC}" version="1.0" desktopVersion="3.0.34047">
<Name>Speckle</Name>
<Description>Next Gen Speckle Connector (Beta) for ArcGIS</Description>
<Description>Speckle connector for ArcGIS</Description>
<Image>Images\AddinDesktop32.png</Image>
<Author>Speckle Systems</Author>
<Company>Speckle Systems</Company>
@@ -33,14 +33,14 @@
<insertModule id="ConnectorArcGIS_Module" className="SpeckleModule" autoLoad="false" caption="SpeckleModule">
<!-- uncomment to have the control hosted on a separate tab-->
<tabs>
<tab id="Speckle_Tab1" caption="Speckle">
<!--<tab id="Speckle_Tab1" caption="New Tab">
<group refID="Speckle_Group1"/>
</tab>
</tab>-->
</tabs>
<groups>
<!-- comment this out if you have no controls on the Addin tab to avoid
an empty group. change appearsOnAddinTab to "True" if control is to be in the addin tab-->
<group id="Speckle_Group1" caption="Speckle" appearsOnAddInTab="false" keytip="G1">
an empty group-->
<group id="Speckle_Group1" caption="Speckle" appearsOnAddInTab="true" keytip="G1">
<!-- host controls within groups -->
<button refID="SpeckleDUI3_SpeckleDUI3OpenButton" size="large" />
</group>
@@ -59,7 +59,7 @@
</controls>
<dockPanes>
<dockPane id="SpeckleDUI3_SpeckleDUI3" caption="Speckle (Beta)" className="SpeckleDUI3ViewModel" keytip="DockPane" initiallyVisible="true" dock="group" dockWith="esri_core_projectDockPane">
<dockPane id="SpeckleDUI3_SpeckleDUI3" caption="Speckle (Beta) for ArcGIS" className="SpeckleDUI3ViewModel" keytip="DockPane" initiallyVisible="true" dock="group" dockWith="esri_core_projectDockPane">
<content className="SpeckleDUI3Wrapper" />
</dockPane>
</dockPanes>
@@ -53,7 +53,7 @@ public class ArcGISHostObjectBuilder : IHostObjectBuilder
_colorManager = colorManager;
}
public Task<HostObjectBuilderResult> Build(
public HostObjectBuilderResult Build(
Base rootObject,
string projectName,
string modelName,
@@ -226,7 +226,7 @@ public class ArcGISHostObjectBuilder : IHostObjectBuilder
bakedObjectIds.AddRange(createdLayerGroups.Values.Select(x => x.URI));
// TODO: validated a correct set regarding bakedobject ids
return Task.FromResult(new HostObjectBuilderResult(bakedObjectIds, results));
return new(bakedObjectIds, results);
}
private IReadOnlyCollection<LocalToGlobalMap> GetObjectsToConvert(Base rootObject)
@@ -49,7 +49,7 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<ADM.MapMember>
_mapMemberUtils = mapMemberUtils;
}
public async Task<RootObjectBuilderResult> Build(
public async Task<RootObjectBuilderResult> BuildAsync(
IReadOnlyList<ADM.MapMember> layers,
SendInfo __,
IProgress<CardProgress> onOperationProgressed,
@@ -166,6 +166,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -226,9 +231,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -236,8 +241,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -261,7 +266,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -291,26 +296,20 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -320,14 +319,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
},
"net6.0-windows7.0/win-x64": {
@@ -164,6 +164,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -259,9 +264,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +274,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -294,7 +299,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -330,26 +335,20 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -359,14 +358,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
}
}
@@ -164,6 +164,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -259,9 +264,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +274,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -294,7 +299,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -330,26 +335,20 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -359,14 +358,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
}
}
@@ -164,6 +164,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -259,9 +264,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +274,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -295,7 +300,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -331,26 +336,20 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -360,14 +359,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
}
}
@@ -155,6 +155,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -215,9 +220,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -225,8 +230,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -251,7 +256,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -287,26 +292,20 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
@@ -315,14 +314,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
},
"net8.0-windows7.0/win-x64": {
@@ -19,7 +19,7 @@ public sealed class AutocadReceiveBinding : IReceiveBinding
public IBrowserBridge Parent { get; }
private readonly DocumentModelStore _store;
private readonly ICancellationManager _cancellationManager;
private readonly CancellationManager _cancellationManager;
private readonly IServiceProvider _serviceProvider;
private readonly IOperationProgressManager _operationProgressManager;
private readonly ILogger<AutocadReceiveBinding> _logger;
@@ -31,7 +31,7 @@ public sealed class AutocadReceiveBinding : IReceiveBinding
public AutocadReceiveBinding(
DocumentModelStore store,
IBrowserBridge parent,
ICancellationManager cancellationManager,
CancellationManager cancellationManager,
IServiceProvider serviceProvider,
IOperationProgressManager operationProgressManager,
ILogger<AutocadReceiveBinding> logger,
@@ -67,7 +67,7 @@ public sealed class AutocadReceiveBinding : IReceiveBinding
throw new InvalidOperationException("No download model card was found.");
}
using var cancellationItem = _cancellationManager.GetCancellationItem(modelCardId);
CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId);
// Disable document activation (document creation and document switch)
// Not disabling results in DUI model card being out of sync with the active document
@@ -79,8 +79,8 @@ public sealed class AutocadReceiveBinding : IReceiveBinding
.ServiceProvider.GetRequiredService<ReceiveOperation>()
.Execute(
modelCard.GetReceiveInfo(_speckleApplication.Slug),
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
cancellationItem.Token
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationToken),
cancellationToken
);
await Commands.SetModelReceiveResult(
@@ -1,48 +1,42 @@
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Speckle.Connectors.Autocad.HostApp.Extensions;
using Speckle.Connectors.Autocad.Plugin;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Eventing;
namespace Speckle.Connectors.Autocad.Bindings;
public class AutocadSelectionBinding : ISelectionBinding
{
private const string SELECTION_EVENT = "setSelection";
private readonly IEventAggregator _eventAggregator;
private readonly HashSet<string> _visitedDocuments = new();
private readonly ITopLevelExceptionHandler _topLevelExceptionHandler;
private readonly IThreadContext _threadContext;
private readonly HashSet<Document> _visitedDocuments = new();
public string Name => "selectionBinding";
public IBrowserBridge Parent { get; }
public AutocadSelectionBinding(IBrowserBridge parent, IEventAggregator eventAggregator)
public AutocadSelectionBinding(
IBrowserBridge parent,
IThreadContext threadContext,
ITopLevelExceptionHandler topLevelExceptionHandler
)
{
_eventAggregator = eventAggregator;
_topLevelExceptionHandler = topLevelExceptionHandler;
Parent = parent;
_threadContext = threadContext;
// POC: Use here Context for doc. In converters it's OK but we are still lacking to use context into bindings.
// It is with the case of if binding created with already a document
// This is valid when user opens acad file directly double clicking
TryRegisterDocumentForSelection(Application.DocumentManager.MdiActiveDocument);
eventAggregator.GetEvent<DocumentActivatedEvent>().Subscribe(OnDocumentChanged);
eventAggregator.GetEvent<ImpliedSelectionChangedEvent>().Subscribe(OnSelectionChanged);
eventAggregator.GetEvent<DocumentToBeDestroyedEvent>().Subscribe(OnDocumentDestroyed);
Application.DocumentManager.DocumentActivated += (_, e) =>
_topLevelExceptionHandler.CatchUnhandled(() => OnDocumentChanged(e.Document));
}
private void OnDocumentDestroyed(DocumentCollectionEventArgs e)
{
if (!_visitedDocuments.Contains(e.Document.Name))
{
e.Document.ImpliedSelectionChanged -= DocumentOnImpliedSelectionChanged;
_visitedDocuments.Remove(e.Document.Name);
}
}
private void OnDocumentChanged(DocumentCollectionEventArgs e) => TryRegisterDocumentForSelection(e.Document);
private void OnDocumentChanged(Document? document) => TryRegisterDocumentForSelection(document);
private void TryRegisterDocumentForSelection(Document? document)
{
@@ -51,24 +45,21 @@ public class AutocadSelectionBinding : ISelectionBinding
return;
}
if (!_visitedDocuments.Contains(document.Name))
if (!_visitedDocuments.Contains(document))
{
document.ImpliedSelectionChanged += DocumentOnImpliedSelectionChanged;
document.ImpliedSelectionChanged += (_, _) =>
_topLevelExceptionHandler.FireAndForget(async () => await _threadContext.RunOnMainAsync(OnSelectionChanged));
_visitedDocuments.Add(document.Name);
_visitedDocuments.Add(document);
}
}
// ReSharper disable once AsyncVoidMethod
private async void DocumentOnImpliedSelectionChanged(object? sender, EventArgs e) =>
await _eventAggregator.GetEvent<ImpliedSelectionChangedEvent>().PublishAsync(e);
// NOTE: Autocad 2022 caused problems, so we need to refactor things a bit in here to always store
// selection info locally (and get it updated by the event, which we can control to run on the main thread).
// Ui requests to GetSelection() should just return this local copy that is kept up to date by the event handler.
private SelectionInfo _selectionInfo;
private async Task OnSelectionChanged(EventArgs _)
private async Task OnSelectionChanged()
{
_selectionInfo = GetSelectionInternal();
await Parent.Send(SELECTION_EVENT, _selectionInfo);
@@ -1,12 +1,10 @@
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Speckle.Connectors.Autocad.HostApp;
using Speckle.Connectors.Autocad.HostApp.Extensions;
using Speckle.Connectors.Autocad.Operations.Send;
using Speckle.Connectors.Autocad.Plugin;
using Speckle.Connectors.Common.Caching;
using Speckle.Connectors.Common.Cancellation;
using Speckle.Connectors.Common.Operations;
@@ -25,7 +23,6 @@ using Speckle.Sdk.Common;
namespace Speckle.Connectors.Autocad.Bindings;
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
public abstract class AutocadSendBaseBinding : ISendBinding
{
public string Name => "sendBinding";
@@ -34,15 +31,16 @@ public abstract class AutocadSendBaseBinding : ISendBinding
public IBrowserBridge Parent { get; }
private readonly DocumentModelStore _store;
private readonly IAutocadIdleManager _idleManager;
private readonly List<ISendFilter> _sendFilters;
private readonly ICancellationManager _cancellationManager;
private readonly CancellationManager _cancellationManager;
private readonly IServiceProvider _serviceProvider;
private readonly ISendConversionCache _sendConversionCache;
private readonly IOperationProgressManager _operationProgressManager;
private readonly ILogger<AutocadSendBinding> _logger;
private readonly ITopLevelExceptionHandler _topLevelExceptionHandler;
private readonly ISpeckleApplication _speckleApplication;
private readonly IThreadContext _threadContext;
private readonly IEventAggregator _eventAggregator;
/// <summary>
/// Used internally to aggregate the changed objects' id. Note we're using a concurrent dictionary here as the expiry check method is not thread safe, and this was causing problems. See:
@@ -54,19 +52,22 @@ public abstract class AutocadSendBaseBinding : ISendBinding
protected AutocadSendBaseBinding(
DocumentModelStore store,
IAutocadIdleManager idleManager,
IBrowserBridge parent,
IEnumerable<ISendFilter> sendFilters,
ICancellationManager cancellationManager,
CancellationManager cancellationManager,
IServiceProvider serviceProvider,
ISendConversionCache sendConversionCache,
IOperationProgressManager operationProgressManager,
ILogger<AutocadSendBinding> logger,
ISpeckleApplication speckleApplication,
ITopLevelExceptionHandler topLevelExceptionHandler,
IThreadContext threadContext,
IEventAggregator eventAggregator
)
{
_store = store;
_idleManager = idleManager;
_serviceProvider = serviceProvider;
_cancellationManager = cancellationManager;
_sendFilters = sendFilters.ToList();
@@ -75,46 +76,28 @@ public abstract class AutocadSendBaseBinding : ISendBinding
_logger = logger;
_speckleApplication = speckleApplication;
_threadContext = threadContext;
_eventAggregator = eventAggregator;
_topLevelExceptionHandler = topLevelExceptionHandler;
Parent = parent;
Commands = new SendBindingUICommands(parent);
Application.DocumentManager.DocumentActivated += (_, args) =>
_topLevelExceptionHandler.CatchUnhandled(() => SubscribeToObjectChanges(args.Document));
if (Application.DocumentManager.CurrentDocument != null)
{
// catches the case when autocad just opens up with a blank new doc
TryRegisterSubscribeToObjectChanges(Application.DocumentManager.CurrentDocument);
SubscribeToObjectChanges(Application.DocumentManager.CurrentDocument);
}
// Since ids of the objects generates from same seed, we should clear the cache always whenever doc swapped.
eventAggregator.GetEvent<DocumentActivatedEvent>().Subscribe(SubscribeToObjectChanges);
eventAggregator.GetEvent<DocumentStoreChangedEvent>().Subscribe(OnDocumentStoreChangedEvent);
eventAggregator.GetEvent<DocumentToBeDestroyedEvent>().Subscribe(OnDocumentDestroyed);
eventAggregator.GetEvent<ObjectAppendedEvent>().Subscribe(OnObjectAppended);
eventAggregator.GetEvent<ObjectErasedEvent>().Subscribe(ObjectErased);
eventAggregator.GetEvent<ObjectModifiedEvent>().Subscribe(ObjectModified);
}
private void OnDocumentDestroyed(DocumentCollectionEventArgs args)
{
Document doc = args.Document;
if (!_docSubsTracker.Contains(doc.Name))
{
doc.Database.ObjectAppended -= DatabaseOnObjectAppended;
doc.Database.ObjectErased -= DatabaseOnObjectErased;
doc.Database.ObjectModified -= DatabaseObjectModified;
_docSubsTracker.Remove(doc.Name);
}
}
private void OnDocumentStoreChangedEvent(object _) => _sendConversionCache.ClearCache();
private readonly List<string> _docSubsTracker = new();
private void SubscribeToObjectChanges(DocumentCollectionEventArgs e) =>
TryRegisterSubscribeToObjectChanges(e.Document);
private void TryRegisterSubscribeToObjectChanges(Document? doc)
private void SubscribeToObjectChanges(Document doc)
{
if (doc == null || doc.Database == null || _docSubsTracker.Contains(doc.Name))
{
@@ -122,33 +105,23 @@ public abstract class AutocadSendBaseBinding : ISendBinding
}
_docSubsTracker.Add(doc.Name);
doc.Database.ObjectAppended += DatabaseOnObjectAppended;
doc.Database.ObjectErased += DatabaseOnObjectErased;
doc.Database.ObjectModified += DatabaseObjectModified;
doc.Database.ObjectAppended += (_, e) => OnObjectChanged(e.DBObject);
doc.Database.ObjectErased += (_, e) => OnObjectChanged(e.DBObject);
doc.Database.ObjectModified += (_, e) => OnObjectChanged(e.DBObject);
}
private async void DatabaseOnObjectAppended(object sender, ObjectEventArgs e) =>
await _eventAggregator.GetEvent<ObjectAppendedEvent>().PublishAsync(e);
private async void DatabaseOnObjectErased(object sender, ObjectErasedEventArgs e) =>
await _eventAggregator.GetEvent<ObjectErasedEvent>().PublishAsync(e);
private async void DatabaseObjectModified(object sender, ObjectEventArgs e) =>
await _eventAggregator.GetEvent<ObjectModifiedEvent>().PublishAsync(e);
private void OnObjectAppended(ObjectEventArgs e) => OnChangeChangedObjectIds(e.DBObject);
private void ObjectErased(ObjectErasedEventArgs e) => OnChangeChangedObjectIds(e.DBObject);
private void ObjectModified(ObjectEventArgs e) => OnChangeChangedObjectIds(e.DBObject);
private void OnObjectChanged(DBObject dbObject)
{
_topLevelExceptionHandler.CatchUnhandled(() => OnChangeChangedObjectIds(dbObject));
}
private void OnChangeChangedObjectIds(DBObject dBObject)
{
ChangedObjectIds[dBObject.GetSpeckleApplicationId()] = 1;
_eventAggregator.GetEvent<IdleEvent>().OneTimeSubscribe(nameof(AutocadSendBinding), RunExpirationChecks);
_idleManager.SubscribeToIdle(nameof(AutocadSendBinding), async () => await RunExpirationChecks());
}
private async Task RunExpirationChecks(object _)
private async Task RunExpirationChecks()
{
var senders = _store.GetSenders();
string[] objectIdsList = ChangedObjectIds.Keys.ToArray();
@@ -192,7 +165,7 @@ public abstract class AutocadSendBaseBinding : ISendBinding
using var scope = _serviceProvider.CreateScope();
InitializeSettings(scope.ServiceProvider);
using var cancellationItem = _cancellationManager.GetCancellationItem(modelCardId);
CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId);
// Disable document activation (document creation and document switch)
// Not disabling results in DUI model card being out of sync with the active document
@@ -215,8 +188,8 @@ public abstract class AutocadSendBaseBinding : ISendBinding
.Execute(
autocadObjects,
modelCard.GetSendInfo(_speckleApplication.Slug),
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
cancellationItem.Token
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationToken),
cancellationToken
);
await Commands.SetModelSendResult(modelCardId, sendResult.RootObjId, sendResult.ConversionResults);
@@ -1,5 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Speckle.Connectors.Autocad.HostApp;
using Speckle.Connectors.Common.Caching;
using Speckle.Connectors.Common.Cancellation;
using Speckle.Connectors.Common.Threading;
@@ -20,20 +21,23 @@ public sealed class AutocadSendBinding : AutocadSendBaseBinding
public AutocadSendBinding(
DocumentModelStore store,
IAutocadIdleManager idleManager,
IBrowserBridge parent,
IEnumerable<ISendFilter> sendFilters,
ICancellationManager cancellationManager,
CancellationManager cancellationManager,
IServiceProvider serviceProvider,
ISendConversionCache sendConversionCache,
IOperationProgressManager operationProgressManager,
ILogger<AutocadSendBinding> logger,
IAutocadConversionSettingsFactory autocadConversionSettingsFactory,
ISpeckleApplication speckleApplication,
ITopLevelExceptionHandler topLevelExceptionHandler,
IThreadContext threadContext,
IEventAggregator eventAggregator
)
: base(
store,
idleManager,
parent,
sendFilters,
cancellationManager,
@@ -42,6 +46,7 @@ public sealed class AutocadSendBinding : AutocadSendBaseBinding
operationProgressManager,
logger,
speckleApplication,
topLevelExceptionHandler,
threadContext,
eventAggregator
)
@@ -13,6 +13,7 @@ using Speckle.Connectors.Common.Operations;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Models.Card.SendFilter;
using Speckle.Connectors.DUI.WebView;
using Speckle.Sdk.Models.GraphTraversal;
@@ -48,6 +49,8 @@ public static class SharedRegistration
serviceCollection.AddScoped<AutocadMaterialUnpacker>();
serviceCollection.AddScoped<IAutocadMaterialBaker, AutocadMaterialBaker>();
serviceCollection.AddSingleton<IAppIdleManager, AutocadIdleManager>();
// operation progress manager
serviceCollection.AddSingleton<IOperationProgressManager, OperationProgressManager>();
@@ -1,5 +1,4 @@
using Autodesk.AutoCAD.ApplicationServices;
using Speckle.Connectors.Autocad.Plugin;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Eventing;
using Speckle.Connectors.DUI.Models;
using Speckle.Connectors.DUI.Utils;
@@ -8,7 +7,7 @@ namespace Speckle.Connectors.Autocad.HostApp;
public class AutocadDocumentStore : DocumentModelStore
{
private const string NULL_DOCUMENT_NAME = "Null Doc";
private readonly string _nullDocumentName = "Null Doc";
private string _previousDocName;
private readonly AutocadDocumentManager _autocadDocumentManager;
private readonly IEventAggregator _eventAggregator;
@@ -16,23 +15,15 @@ public class AutocadDocumentStore : DocumentModelStore
public AutocadDocumentStore(
IJsonSerializer jsonSerializer,
AutocadDocumentManager autocadDocumentManager,
ITopLevelExceptionHandler topLevelExceptionHandler,
IEventAggregator eventAggregator
)
: base(jsonSerializer)
{
_autocadDocumentManager = autocadDocumentManager;
_eventAggregator = eventAggregator;
_previousDocName = NULL_DOCUMENT_NAME;
_previousDocName = _nullDocumentName;
eventAggregator.GetEvent<DocumentActivatedEvent>().Subscribe(DocChanged);
// since below event triggered as secondary, it breaks the logic in OnDocChangeInternal function, leaving it here for now.
// Autodesk.AutoCAD.ApplicationServices.Application.DocumentWindowCollection.DocumentWindowActivated += (_, args) =>
// OnDocChangeInternal((Document)args.DocumentWindow.Document);
}
public override async Task OnDocumentStoreInitialized()
{
// POC: Will be addressed to move it into AutocadContext!
if (Application.DocumentManager.MdiActiveDocument != null)
{
@@ -40,15 +31,20 @@ public class AutocadDocumentStore : DocumentModelStore
// POC: this logic might go when we have document management in context
// It is with the case of if binding created with already a document
// This is valid when user opens acad file directly double clicking
await TryDocChanged(Application.DocumentManager.MdiActiveDocument);
OnDocChangeInternal(Application.DocumentManager.MdiActiveDocument);
}
Application.DocumentManager.DocumentActivated += (_, e) =>
topLevelExceptionHandler.CatchUnhandled(() => OnDocChangeInternal(e.Document));
// since below event triggered as secondary, it breaks the logic in OnDocChangeInternal function, leaving it here for now.
// Autodesk.AutoCAD.ApplicationServices.Application.DocumentWindowCollection.DocumentWindowActivated += (_, args) =>
// OnDocChangeInternal((Document)args.DocumentWindow.Document);
}
private async Task DocChanged(DocumentCollectionEventArgs e) => await TryDocChanged(e.Document);
private async Task TryDocChanged(Document? doc)
private async void OnDocChangeInternal(Document? doc)
{
var currentDocName = doc != null ? doc.Name : NULL_DOCUMENT_NAME;
var currentDocName = doc != null ? doc.Name : _nullDocumentName;
if (_previousDocName == currentDocName)
{
return;
@@ -0,0 +1,22 @@
using Speckle.Connectors.DUI.Bridge;
using Speckle.InterfaceGenerator;
namespace Speckle.Connectors.Autocad.HostApp;
public partial interface IAutocadIdleManager : IAppIdleManager;
[GenerateAutoInterface]
public sealed class AutocadIdleManager(IIdleCallManager idleCallManager)
: AppIdleManager(idleCallManager),
IAutocadIdleManager
{
private readonly IIdleCallManager _idleCallManager = idleCallManager;
protected override void AddEvent()
{
Application.Idle += AutocadAppOnIdle;
}
private void AutocadAppOnIdle(object? sender, EventArgs e) =>
_idleCallManager.AppOnIdle(() => Application.Idle -= AutocadAppOnIdle);
}
@@ -31,7 +31,7 @@ public class AutocadHostObjectBuilder(
RootObjectUnpacker rootObjectUnpacker
) : IHostObjectBuilder
{
public Task<HostObjectBuilderResult> Build(
public HostObjectBuilderResult Build(
Base rootObject,
string projectName,
string modelName,
@@ -139,7 +139,7 @@ public class AutocadHostObjectBuilder(
results.UnionWith(groupResults);
}
return Task.FromResult(new HostObjectBuilderResult(bakedObjectIds, results));
return new HostObjectBuilderResult(bakedObjectIds, results);
}
private void PreReceiveDeepClean(string baseLayerPrefix)
@@ -16,7 +16,7 @@ using Speckle.Sdk.Models.Instances;
namespace Speckle.Connectors.Autocad.Operations.Send;
public abstract class AutocadRootObjectBaseBuilder : IRootObjectBuilder<AutocadRootObject>
public abstract class AutocadRootObjectBaseBuilder : RootObjectBuilderBase<AutocadRootObject>
{
private readonly IRootToSpeckleConverter _converter;
private readonly string[] _documentPathSeparator = ["\\"];
@@ -58,7 +58,7 @@ public abstract class AutocadRootObjectBaseBuilder : IRootObjectBuilder<AutocadR
proxy classes yet. So I'm supressing this one now!!!
"""
)]
public Task<RootObjectBuilderResult> Build(
public override RootObjectBuilderResult Build(
IReadOnlyList<AutocadRootObject> objects,
SendInfo sendInfo,
IProgress<CardProgress> onOperationProgressed,
@@ -133,7 +133,7 @@ public abstract class AutocadRootObjectBaseBuilder : IRootObjectBuilder<AutocadR
// add any additional properties (most likely from verticals)
AddAdditionalProxiesToRoot(root);
return Task.FromResult(new RootObjectBuilderResult(root, results));
return new RootObjectBuilderResult(root, results);
}
}
@@ -4,7 +4,6 @@ using Autodesk.AutoCAD.Windows;
using Microsoft.Extensions.DependencyInjection;
using Speckle.Connectors.Common;
using Speckle.Connectors.DUI;
using Speckle.Connectors.DUI.Eventing;
using Speckle.Connectors.DUI.WebView;
#if AUTOCAD
using Speckle.Connectors.Autocad.DependencyInjection;
@@ -32,7 +31,7 @@ public class AutocadCommand
return;
}
PaletteSet = new PaletteSet($"Speckle (Beta)", s_id)
PaletteSet = new PaletteSet($"Speckle (Beta) for {AppUtils.App.Name}", s_id)
{
Size = new Size(400, 500),
DockEnabled = (DockSides)((int)DockSides.Left + (int)DockSides.Right)
@@ -49,12 +48,11 @@ public class AutocadCommand
services.AddCivil3dConverters();
#endif
Container = services.BuildServiceProvider();
AutocadEvents.Register(Container.GetRequiredService<IEventAggregator>());
Container.UseDUI();
var panelWebView = Container.GetRequiredService<DUI3ControlWebView>();
PaletteSet.AddVisual("Speckle (Beta)", panelWebView);
PaletteSet.AddVisual($"Speckle (Beta) for {AppUtils.App.Name} WebView", panelWebView);
FocusPalette();
}
@@ -1,38 +0,0 @@
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Eventing;
namespace Speckle.Connectors.Autocad.Plugin;
public class DocumentActivatedEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: ThreadedEvent<DocumentCollectionEventArgs>(threadContext, exceptionHandler);
public class DocumentToBeDestroyedEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: ThreadedEvent<DocumentCollectionEventArgs>(threadContext, exceptionHandler);
public class ImpliedSelectionChangedEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: ThreadedEvent<EventArgs>(threadContext, exceptionHandler);
public class ObjectAppendedEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: ThreadedEvent<ObjectEventArgs>(threadContext, exceptionHandler);
public class ObjectErasedEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: ThreadedEvent<ObjectErasedEventArgs>(threadContext, exceptionHandler);
public class ObjectModifiedEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: ThreadedEvent<ObjectEventArgs>(threadContext, exceptionHandler);
public static class AutocadEvents
{
public static void Register(IEventAggregator eventAggregator)
{
Application.Idle += async (_, e) => await eventAggregator.GetEvent<IdleEvent>().PublishAsync(e);
Application.DocumentManager.DocumentActivated += async (_, e) =>
await eventAggregator.GetEvent<DocumentActivatedEvent>().PublishAsync(e);
Application.DocumentManager.DocumentToBeDestroyed += async (_, e) =>
await eventAggregator.GetEvent<DocumentToBeDestroyedEvent>().PublishAsync(e);
}
}
@@ -46,20 +46,20 @@ public class AutocadRibbon
private void Create()
{
RibbonTab tab = FindOrMakeTab("Speckle");
RibbonPanelSource source = new() { Title = "Speckle (Beta)" };
RibbonTab tab = FindOrMakeTab("Add-ins");
RibbonPanelSource source = new() { Title = "Speckle 2 (New Beta)" };
RibbonPanel panel = new() { Source = source };
tab.Panels.Add(panel);
RibbonToolTip speckleToolTip =
new()
{
Title = "Speckle (Beta)",
Content = $"Next Gen Speckle Connector (Beta) for {AppUtils.App.Name}",
Title = "Speckle 2 (New Beta)",
Content = "Speckle Connector for " + AppUtils.App.Name,
IsHelpEnabled = true // Without this "Press F1 for help" does not appear in the tooltip
};
_ = CreateSpeckleButton("Speckle (Beta)", source, null, speckleToolTip, "logo");
_ = CreateSpeckleButton("Connector " + AppUtils.App.Name + " (New)", source, null, speckleToolTip, "logo");
}
private void ComponentManager_ItemInitialized(object? sender, RibbonItemEventArgs e)
@@ -29,6 +29,7 @@
<Compile Include="$(MSBuildThisFileDirectory)HostApp\AutocadContext.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\AutocadDocumentManager.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\AutocadDocumentModelStore.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\AutocadIdleManager.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\AutocadMaterialUnpacker.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\Extensions\DatabaseExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\Extensions\DocumentExtensions.cs" />
@@ -40,7 +41,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\AutocadRootObject.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\AutocadRootObjectBaseBuilder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\AutocadRootObjectBuilder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Plugin\AutocadEvents.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Plugin\AutocadRibbon.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Plugin\AutocadExtensionApplication.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Plugin\AutocadCommand.cs" />
@@ -173,6 +173,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -268,9 +273,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -278,8 +283,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -304,7 +309,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -340,26 +345,20 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -369,14 +368,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
}
}
@@ -173,6 +173,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -268,9 +273,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -278,8 +283,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -304,7 +309,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -340,26 +345,20 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -369,14 +368,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
}
}
@@ -173,6 +173,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -268,9 +273,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -278,8 +283,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -304,7 +309,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -340,26 +345,20 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -369,14 +368,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
}
}
@@ -164,6 +164,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -224,9 +229,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -234,8 +239,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -261,7 +266,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -297,26 +302,20 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
@@ -325,14 +324,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
},
"net8.0-windows7.0/win-x64": {
@@ -1,6 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Speckle.Connectors.Autocad.Bindings;
using Speckle.Connectors.Autocad.HostApp;
using Speckle.Connectors.Common.Caching;
using Speckle.Connectors.Common.Cancellation;
using Speckle.Connectors.Common.Threading;
@@ -23,9 +24,10 @@ public sealed class Civil3dSendBinding : AutocadSendBaseBinding
public Civil3dSendBinding(
DocumentModelStore store,
IAutocadIdleManager idleManager,
IBrowserBridge parent,
IEnumerable<ISendFilter> sendFilters,
ICancellationManager cancellationManager,
CancellationManager cancellationManager,
IServiceProvider serviceProvider,
ISendConversionCache sendConversionCache,
IOperationProgressManager operationProgressManager,
@@ -33,11 +35,13 @@ public sealed class Civil3dSendBinding : AutocadSendBaseBinding
ICivil3dConversionSettingsFactory civil3dConversionSettingsFactory,
IAutocadConversionSettingsFactory autocadConversionSettingsFactory,
ISpeckleApplication speckleApplication,
ITopLevelExceptionHandler topLevelExceptionHandler,
IThreadContext threadContext,
IEventAggregator eventAggregator
)
: base(
store,
idleManager,
parent,
sendFilters,
cancellationManager,
@@ -46,6 +50,7 @@ public sealed class Civil3dSendBinding : AutocadSendBaseBinding
operationProgressManager,
logger,
speckleApplication,
topLevelExceptionHandler,
threadContext,
eventAggregator
)
@@ -1,6 +1,5 @@
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Eventing;
using Speckle.Connectors.DUI.Models;
using Speckle.Connectors.DUI.Models.Card;
using Speckle.Sdk;
@@ -11,7 +10,7 @@ public class CsiSharedBasicConnectorBinding : IBasicConnectorBinding
{
private readonly ISpeckleApplication _speckleApplication;
private readonly DocumentModelStore _store;
private readonly IEventAggregator _eventAggregator;
public string Name => "baseBinding";
public IBrowserBridge Parent { get; }
public BasicConnectorBindingCommands Commands { get; }
@@ -19,28 +18,22 @@ public class CsiSharedBasicConnectorBinding : IBasicConnectorBinding
public CsiSharedBasicConnectorBinding(
IBrowserBridge parent,
ISpeckleApplication speckleApplication,
DocumentModelStore store,
IEventAggregator eventAggregator
DocumentModelStore store
)
{
Parent = parent;
_speckleApplication = speckleApplication;
_store = store;
Commands = new BasicConnectorBindingCommands(Parent);
_eventAggregator = eventAggregator;
_eventAggregator.GetEvent<DocumentStoreChangedEvent>().Subscribe(OnDocumentStoreChangedEvent);
Commands = new BasicConnectorBindingCommands(parent);
}
private async Task OnDocumentStoreChangedEvent(object _) => await Commands.NotifyDocumentChanged();
public string GetConnectorVersion() => _speckleApplication.SpeckleVersion;
public string GetSourceApplicationName() => _speckleApplication.Slug;
public string GetSourceApplicationVersion() => _speckleApplication.HostApplicationVersion;
public DocumentInfo? GetDocumentInfo() => new("ETABS Model", "ETABS Model", "1");
public DocumentInfo? GetDocumentInfo() => new DocumentInfo("ETABS Model", "ETABS Model", "1");
public DocumentModelStore GetDocumentState() => _store;
@@ -1,43 +1,21 @@
using Speckle.Connectors.CSiShared.Events;
using Speckle.Connectors.CSiShared.HostApp;
using Speckle.Connectors.CSiShared.HostApp;
using Speckle.Connectors.CSiShared.Utils;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Eventing;
using Speckle.Converters.CSiShared.Utils;
namespace Speckle.Connectors.CSiShared.Bindings;
public sealed class CsiSharedSelectionBinding : ISelectionBinding
public class CsiSharedSelectionBinding : ISelectionBinding
{
private readonly ICsiApplicationService _csiApplicationService;
private HashSet<string> _lastSelection = new();
public IBrowserBridge Parent { get; }
public string Name => "selectionBinding";
public IBrowserBridge Parent { get; }
private readonly ICsiApplicationService _csiApplicationService;
public CsiSharedSelectionBinding(
IBrowserBridge parent,
ICsiApplicationService csiApplicationService,
IEventAggregator eventAggregator
)
public CsiSharedSelectionBinding(IBrowserBridge parent, ICsiApplicationService csiApplicationService)
{
Parent = parent;
_csiApplicationService = csiApplicationService;
eventAggregator.GetEvent<SelectionBindingEvent>().SubscribePeriodic(TimeSpan.FromSeconds(1), CheckSelectionChanged);
}
private void CheckSelectionChanged(object _)
{
var currentSelection = GetSelection();
var currentIds = new HashSet<string>(currentSelection.SelectedObjectIds);
if (!_lastSelection.SetEquals(currentIds))
{
_lastSelection = currentIds;
Parent.Send(SelectionBindingEvents.SET_SELECTION, currentSelection);
}
}
/// <summary>
@@ -49,8 +27,8 @@ public sealed class CsiSharedSelectionBinding : ISelectionBinding
public SelectionInfo GetSelection()
{
int numberItems = 0;
int[] objectType = [];
string[] objectName = [];
int[] objectType = Array.Empty<int>();
string[] objectName = Array.Empty<string>();
_csiApplicationService.SapModel.SelectObj.GetSelected(ref numberItems, ref objectType, ref objectName);
@@ -29,7 +29,7 @@ public sealed class CsiSharedSendBinding : ISendBinding
private readonly DocumentModelStore _store;
private readonly IServiceProvider _serviceProvider;
private readonly List<ISendFilter> _sendFilters;
private readonly ICancellationManager _cancellationManager;
private readonly CancellationManager _cancellationManager;
private readonly IOperationProgressManager _operationProgressManager;
private readonly ILogger<CsiSharedSendBinding> _logger;
private readonly ICsiApplicationService _csiApplicationService;
@@ -42,7 +42,7 @@ public sealed class CsiSharedSendBinding : ISendBinding
IBrowserBridge parent,
IEnumerable<ISendFilter> sendFilters,
IServiceProvider serviceProvider,
ICancellationManager cancellationManager,
CancellationManager cancellationManager,
IOperationProgressManager operationProgressManager,
ILogger<CsiSharedSendBinding> logger,
ICsiConversionSettingsFactory csiConversionSettingsFactory,
@@ -84,7 +84,7 @@ public sealed class CsiSharedSendBinding : ISendBinding
.ServiceProvider.GetRequiredService<IConverterSettingsStore<CsiConversionSettings>>()
.Initialize(_csiConversionSettingsFactory.Create(_csiApplicationService.SapModel));
using var cancellationItem = _cancellationManager.GetCancellationItem(modelCardId);
CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId);
List<ICsiWrapper> wrappers = modelCard
.SendFilter.NotNull()
@@ -102,8 +102,8 @@ public sealed class CsiSharedSendBinding : ISendBinding
.Execute(
wrappers,
modelCard.GetSendInfo(_speckleApplication.Slug),
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
cancellationItem.Token
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationToken),
cancellationToken
);
await Commands.SetModelSendResult(modelCardId, sendResult.RootObjId, sendResult.ConversionResults);
@@ -1,8 +0,0 @@
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Eventing;
namespace Speckle.Connectors.CSiShared.Events;
public class ModelChangedEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: PeriodicThreadedEvent(threadContext, exceptionHandler);
@@ -1,8 +0,0 @@
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Eventing;
namespace Speckle.Connectors.CSiShared.Events;
public class SelectionBindingEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: PeriodicThreadedEvent(threadContext, exceptionHandler);
@@ -1,3 +1,5 @@
using Speckle.Sdk.Common;
namespace Speckle.Connectors.CSiShared.HostApp;
/// <summary>
@@ -13,4 +15,19 @@ namespace Speckle.Connectors.CSiShared.HostApp;
public interface ICsiApplicationService
{
cSapModel SapModel { get; }
void Initialize(cSapModel sapModel, cPluginCallback pluginCallback);
}
public class CsiApplicationService : ICsiApplicationService
{
private cSapModel? _sapModel;
public cSapModel SapModel => _sapModel.NotNull();
private cPluginCallback? _pluginCallback;
public void Initialize(cSapModel sapModel, cPluginCallback pluginCallback)
{
_sapModel = sapModel;
_pluginCallback = pluginCallback;
}
}
@@ -1,7 +1,5 @@
using System.IO;
using Microsoft.Extensions.Logging;
using Speckle.Connectors.CSiShared.Events;
using Speckle.Connectors.DUI.Eventing;
using Speckle.Connectors.DUI.Models;
using Speckle.Connectors.DUI.Utils;
using Speckle.Sdk;
@@ -15,73 +13,34 @@ public class CsiDocumentModelStore : DocumentModelStore
private readonly ISpeckleApplication _speckleApplication;
private readonly ILogger<CsiDocumentModelStore> _logger;
private readonly ICsiApplicationService _csiApplicationService;
private readonly IEventAggregator _eventAggregator;
private string _lastModelFilename = string.Empty;
private string HostAppUserDataPath { get; set; }
private string DocumentStateFile { get; set; }
private string ModelPathHash { get; set; }
public CsiDocumentModelStore(
IJsonSerializer jsonSerializer,
IJsonSerializer jsonSerializerSettings,
ISpeckleApplication speckleApplication,
ILogger<CsiDocumentModelStore> logger,
ICsiApplicationService csiApplicationService,
IEventAggregator eventAggregator
ICsiApplicationService csiApplicationService
)
: base(jsonSerializer)
: base(jsonSerializerSettings)
{
_speckleApplication = speckleApplication;
_logger = logger;
_csiApplicationService = csiApplicationService;
_eventAggregator = eventAggregator;
eventAggregator.GetEvent<ModelChangedEvent>().SubscribePeriodic(TimeSpan.FromSeconds(1), CheckModelChanges);
}
private async Task CheckModelChanges(object _)
{
string currentFilename = _csiApplicationService.SapModel.GetModelFilename();
if (string.IsNullOrEmpty(currentFilename) || currentFilename == _lastModelFilename)
{
return;
}
_lastModelFilename = currentFilename;
SetPaths();
LoadState();
await _eventAggregator.GetEvent<DocumentStoreChangedEvent>().PublishAsync(new object());
}
public override Task OnDocumentStoreInitialized()
{
var currentFilename = _csiApplicationService.SapModel.GetModelFilename();
if (!string.IsNullOrEmpty(currentFilename))
{
_lastModelFilename = currentFilename;
SetPaths();
LoadState();
}
return Task.CompletedTask;
}
private void SetPaths()
{
try
{
ModelPathHash = Crypt.Md5(_csiApplicationService.SapModel.GetModelFilename(), length: 32);
HostAppUserDataPath = Path.Combine(
SpecklePathProvider.UserSpeckleFolderPath,
"ConnectorsFileData",
_speckleApplication.Slug
);
DocumentStateFile = Path.Combine(HostAppUserDataPath, $"{ModelPathHash}.json");
_logger.LogDebug($"Paths set - Hash: {ModelPathHash}, File: {DocumentStateFile}");
}
catch (Exception ex) when (!ex.IsFatal())
{
_logger.LogError(ex, "Error in setting paths for CsiDocumentModelStore");
}
ModelPathHash = Crypt.Md5(_csiApplicationService.SapModel.GetModelFilepath(), length: 32);
HostAppUserDataPath = Path.Combine(
SpecklePathProvider.UserSpeckleFolderPath,
"ConnectorsFileData",
_speckleApplication.Slug
);
DocumentStateFile = Path.Combine(HostAppUserDataPath, $"{ModelPathHash}.json");
}
protected override void HostAppSaveState(string modelCardState)
@@ -92,32 +51,29 @@ public class CsiDocumentModelStore : DocumentModelStore
{
Directory.CreateDirectory(HostAppUserDataPath);
}
File.WriteAllText(DocumentStateFile, modelCardState);
}
catch (Exception ex) when (!ex.IsFatal())
{
_logger.LogError(ex, "Failed to save state");
_logger.LogError(ex.Message);
}
}
protected override void LoadState()
{
try
if (!Directory.Exists(HostAppUserDataPath))
{
if (!File.Exists(DocumentStateFile))
{
ClearAndSave();
return;
}
string serializedState = File.ReadAllText(DocumentStateFile);
LoadFromString(serializedState);
}
catch (Exception ex) when (!ex.IsFatal())
{
_logger.LogError(ex, "Failed to load state, initializing empty state");
ClearAndSave();
return;
}
if (!File.Exists(DocumentStateFile))
{
ClearAndSave();
return;
}
string serializedState = File.ReadAllText(DocumentStateFile);
LoadFromString(serializedState);
}
}
@@ -34,8 +34,11 @@ public class CsiFrameSectionPropertyExtractor : IFrameSectionPropertyExtractor
_settingsStore.Current.SapModel.PropFrame.GetMaterial(sectionName, ref materialName);
// append to General Data of properties dictionary
Dictionary<string, object?> generalData = properties.EnsureNested(SectionPropertyCategory.GENERAL_DATA);
generalData["Material"] = materialName;
Dictionary<string, object?> generalData = DictionaryUtils.EnsureNestedDictionary(
properties,
SectionPropertyCategory.GENERAL_DATA
);
generalData["material"] = materialName;
}
private void GetSectionProperties(string sectionName, Dictionary<string, object?> properties)
@@ -69,26 +72,22 @@ public class CsiFrameSectionPropertyExtractor : IFrameSectionPropertyExtractor
ref radiusOfGyrationAboutMinorAxis
);
string distanceUnit = _settingsStore.Current.SpeckleUnits;
string areaUnit = $"{distanceUnit}²"; // // TODO: Formalize this better
string modulusUnit = $"{distanceUnit}³"; // // TODO: Formalize this better
string inertiaUnit = $"{distanceUnit}\u2074"; // TODO: Formalize this better
Dictionary<string, object?> mechanicalProperties = properties.EnsureNested(
Dictionary<string, object?> mechanicalProperties = DictionaryUtils.EnsureNestedDictionary(
properties,
SectionPropertyCategory.SECTION_PROPERTIES
);
mechanicalProperties.AddWithUnits("Area", crossSectionalArea, areaUnit);
mechanicalProperties.AddWithUnits("As2", shearAreaInMajorAxisDirection, areaUnit);
mechanicalProperties.AddWithUnits("As3", shearAreaInMinorAxisDirection, areaUnit);
mechanicalProperties.AddWithUnits("J", torsionalConstant, inertiaUnit);
mechanicalProperties.AddWithUnits("I22", momentOfInertiaAboutMajorAxis, inertiaUnit);
mechanicalProperties.AddWithUnits("I33", momentOfInertiaAboutMinorAxis, inertiaUnit);
mechanicalProperties.AddWithUnits("S22", sectionModulusAboutMajorAxis, modulusUnit);
mechanicalProperties.AddWithUnits("S33", sectionModulusAboutMinorAxis, modulusUnit);
mechanicalProperties.AddWithUnits("Z22", plasticModulusAboutMajorAxis, modulusUnit);
mechanicalProperties.AddWithUnits("Z33", plasticModulusAboutMinorAxis, modulusUnit);
mechanicalProperties.AddWithUnits("R22", radiusOfGyrationAboutMajorAxis, distanceUnit);
mechanicalProperties.AddWithUnits("R33", radiusOfGyrationAboutMinorAxis, distanceUnit);
mechanicalProperties["area"] = crossSectionalArea;
mechanicalProperties["As2"] = shearAreaInMajorAxisDirection;
mechanicalProperties["As3"] = shearAreaInMinorAxisDirection;
mechanicalProperties["torsion"] = torsionalConstant;
mechanicalProperties["I22"] = momentOfInertiaAboutMajorAxis;
mechanicalProperties["I33"] = momentOfInertiaAboutMinorAxis;
mechanicalProperties["S22"] = sectionModulusAboutMajorAxis;
mechanicalProperties["S33"] = sectionModulusAboutMinorAxis;
mechanicalProperties["Z22"] = plasticModulusAboutMajorAxis;
mechanicalProperties["Z33"] = plasticModulusAboutMinorAxis;
mechanicalProperties["R22"] = radiusOfGyrationAboutMajorAxis;
mechanicalProperties["R33"] = radiusOfGyrationAboutMinorAxis;
}
private void GetPropertyModifiers(string sectionName, Dictionary<string, object?> properties)
@@ -99,17 +98,20 @@ public class CsiFrameSectionPropertyExtractor : IFrameSectionPropertyExtractor
Dictionary<string, object?> modifiers =
new()
{
["Cross-section (Axial) Area"] = stiffnessModifiersArray[0],
["Shear Area in 2 Direction"] = stiffnessModifiersArray[1],
["Shear Area in 3 Direction"] = stiffnessModifiersArray[2],
["Torsional Constant"] = stiffnessModifiersArray[3],
["Moment of Inertia about 2 Axis"] = stiffnessModifiersArray[4],
["Moment of Inertia about 3 Axis"] = stiffnessModifiersArray[5],
["Mass"] = stiffnessModifiersArray[6],
["Weight"] = stiffnessModifiersArray[7],
["crossSectionalAreaModifier"] = stiffnessModifiersArray[0],
["shearAreaInLocal2DirectionModifier"] = stiffnessModifiersArray[1],
["shearAreaInLocal3DirectionModifier"] = stiffnessModifiersArray[2],
["torsionalConstantModifier"] = stiffnessModifiersArray[3],
["momentOfInertiaAboutLocal2AxisModifier"] = stiffnessModifiersArray[4],
["momentOfInertiaAboutLocal3AxisModifier"] = stiffnessModifiersArray[5],
["mass"] = stiffnessModifiersArray[6],
["weight"] = stiffnessModifiersArray[7],
};
Dictionary<string, object?> generalData = properties.EnsureNested(SectionPropertyCategory.GENERAL_DATA);
generalData["Modifiers"] = modifiers;
Dictionary<string, object?> generalData = DictionaryUtils.EnsureNestedDictionary(
properties,
SectionPropertyCategory.GENERAL_DATA
);
generalData["modifiers"] = modifiers;
}
}
@@ -18,14 +18,14 @@ public class CsiMaterialPropertyExtractor
/// </summary>
private static class MechanicalPropertyNames
{
public const string MODULUS_OF_ELASTICITY = "Modulus of Elasticity, E";
public const string MODULUS_OF_ELASTICITY_ARRAY = "Modulus of Elasticity Array, E";
public const string POISSON_RATIO = "Poisson's Ratio, U";
public const string POISSON_RATIO_ARRAY = "Poisson's Ratio Array, U";
public const string THERMAL_COEFFICIENT = "Coefficient of Thermal Expansion, A";
public const string THERMAL_COEFFICIENT_ARRAY = "Coefficient of Thermal Expansion Array, A";
public const string SHEAR_MODULUS = "Shear Modulus, G";
public const string SHEAR_MODULUS_ARRAY = "Shear Modulus Array, G";
public const string MODULUS_OF_ELASTICITY = "modulusOfElasticity";
public const string MODULUS_OF_ELASTICITY_ARRAY = "modulusOfElasticityArray";
public const string POISSON_RATIO = "poissonRatio";
public const string POISSON_RATIO_ARRAY = "poissonRatioArray";
public const string THERMAL_COEFFICIENT = "thermalCoefficient";
public const string THERMAL_COEFFICIENT_ARRAY = "thermalCoefficientArray";
public const string SHEAR_MODULUS = "shearModulus";
public const string SHEAR_MODULUS_ARRAY = "shearModulusArray";
}
private readonly IConverterSettingsStore<CsiConversionSettings> _settingsStore;
@@ -38,8 +38,8 @@ public class CsiMaterialPropertyExtractor
public void ExtractProperties(string materialName, Dictionary<string, object?> properties)
{
GetGeneralProperties(materialName, properties);
GetWeightAndMassProperties(materialName, properties); // TODO: Add units
GetMechanicalProperties(materialName, properties); // TODO: Add units
GetWeightAndMassProperties(materialName, properties);
GetMechanicalProperties(materialName, properties);
}
private void GetGeneralProperties(string materialName, Dictionary<string, object?> properties)
@@ -58,10 +58,10 @@ public class CsiMaterialPropertyExtractor
ref materialGuid
);
var generalData = properties.EnsureNested(SectionPropertyCategory.GENERAL_DATA);
generalData["Name"] = materialName;
generalData["Type"] = materialType.ToString();
generalData["Notes"] = materialNotes;
var generalData = DictionaryUtils.EnsureNestedDictionary(properties, SectionPropertyCategory.GENERAL_DATA);
generalData["name"] = materialName;
generalData["type"] = materialType.ToString();
generalData["notes"] = materialNotes;
}
}
@@ -76,9 +76,9 @@ public class CsiMaterialPropertyExtractor
ref massPerUnitVolume
);
var weightAndMass = properties.EnsureNested("Weight and Mass");
weightAndMass["Weight per Unit Volume"] = weightPerUnitVolume;
weightAndMass["Mass per Unit Volume"] = massPerUnitVolume;
var weightAndMass = DictionaryUtils.EnsureNestedDictionary(properties, "Weight and Mass");
weightAndMass["w"] = weightPerUnitVolume;
weightAndMass["m"] = massPerUnitVolume;
}
private void GetMechanicalProperties(string materialName, Dictionary<string, object?> properties)
@@ -101,8 +101,8 @@ public class CsiMaterialPropertyExtractor
_ => throw new ArgumentException($"Unknown symmetry type: {materialDirectionalSymmetryKey}")
};
var mechanicalProperties = properties.EnsureNested("Mechanical Properties");
mechanicalProperties["Directional Symmetry Type"] = materialDirectionalSymmetryValue.ToString();
var mechanicalProperties = DictionaryUtils.EnsureNestedDictionary(properties, "Mechanical Properties");
mechanicalProperties["directionalSymmetryType"] = materialDirectionalSymmetryValue.ToString();
GetMechanicalPropertiesByType(materialName, materialDirectionalSymmetryValue, mechanicalProperties);
}
@@ -38,8 +38,8 @@ public class CsiShellSectionPropertyExtractor : IShellSectionPropertyExtractor
_ => throw new ArgumentException($"Unknown property type: {propertyTypeKey}"),
};
var generalData = properties.EnsureNested(SectionPropertyCategory.GENERAL_DATA);
generalData["Property Type"] = propertyTypeValue.ToString();
var generalData = DictionaryUtils.EnsureNestedDictionary(properties, SectionPropertyCategory.GENERAL_DATA);
generalData["propertyType"] = propertyTypeValue;
}
private void GetPropertyModifiers(string sectionName, Dictionary<string, object?> properties)
@@ -50,19 +50,19 @@ public class CsiShellSectionPropertyExtractor : IShellSectionPropertyExtractor
Dictionary<string, object?> modifiers =
new()
{
["Membrane f11 Direction"] = stiffnessModifiersArray[0],
["Membrane f22 Direction"] = stiffnessModifiersArray[1],
["Membrane f12 Direction"] = stiffnessModifiersArray[2],
["Bending m11 Direction"] = stiffnessModifiersArray[3],
["Bending m22 Direction"] = stiffnessModifiersArray[3],
["Bending m12 Direction"] = stiffnessModifiersArray[4],
["Shear v13 Direction"] = stiffnessModifiersArray[5],
["Shear v23 Direction"] = stiffnessModifiersArray[6],
["Mass"] = stiffnessModifiersArray[7],
["Weight"] = stiffnessModifiersArray[8]
["f11"] = stiffnessModifiersArray[0],
["f22"] = stiffnessModifiersArray[1],
["f12"] = stiffnessModifiersArray[2],
["m11"] = stiffnessModifiersArray[3],
["m22"] = stiffnessModifiersArray[3],
["m12"] = stiffnessModifiersArray[4],
["v13"] = stiffnessModifiersArray[5],
["v23"] = stiffnessModifiersArray[6],
["mass"] = stiffnessModifiersArray[7],
["weight"] = stiffnessModifiersArray[8]
};
var generalData = properties.EnsureNested(SectionPropertyCategory.GENERAL_DATA);
generalData["Modifiers"] = modifiers;
var generalData = DictionaryUtils.EnsureNestedDictionary(properties, SectionPropertyCategory.GENERAL_DATA);
generalData["modifiers"] = modifiers;
}
}
@@ -1,12 +1,12 @@
using Microsoft.Extensions.Logging;
using Speckle.Connectors.Common.Builders;
using Speckle.Connectors.Common.Caching;
using Speckle.Connectors.Common.Conversion;
using Speckle.Connectors.Common.Operations;
using Speckle.Connectors.CSiShared.HostApp;
using Speckle.Connectors.CSiShared.HostApp.Helpers;
using Speckle.Converters.Common;
using Speckle.Converters.CSiShared;
using Speckle.Converters.CSiShared.Extensions;
using Speckle.Sdk;
using Speckle.Sdk.Logging;
using Speckle.Sdk.Models;
@@ -30,6 +30,7 @@ namespace Speckle.Connectors.CSiShared.Builders;
public class CsiRootObjectBuilder : IRootObjectBuilder<ICsiWrapper>
{
private readonly IRootToSpeckleConverter _rootToSpeckleConverter;
private readonly ISendConversionCache _sendConversionCache;
private readonly IConverterSettingsStore<CsiConversionSettings> _converterSettings;
private readonly CsiSendCollectionManager _sendCollectionManager;
private readonly MaterialUnpacker _materialUnpacker;
@@ -40,6 +41,7 @@ public class CsiRootObjectBuilder : IRootObjectBuilder<ICsiWrapper>
public CsiRootObjectBuilder(
IRootToSpeckleConverter rootToSpeckleConverter,
ISendConversionCache sendConversionCache,
IConverterSettingsStore<CsiConversionSettings> converterSettings,
CsiSendCollectionManager sendCollectionManager,
MaterialUnpacker materialUnpacker,
@@ -49,6 +51,7 @@ public class CsiRootObjectBuilder : IRootObjectBuilder<ICsiWrapper>
ICsiApplicationService csiApplicationService
)
{
_sendConversionCache = sendConversionCache;
_converterSettings = converterSettings;
_sendCollectionManager = sendCollectionManager;
_materialUnpacker = materialUnpacker;
@@ -68,7 +71,7 @@ public class CsiRootObjectBuilder : IRootObjectBuilder<ICsiWrapper>
/// 2. Converts each object with caching and progress tracking
/// 3. Creates proxies for materials and sections
/// </remarks>
public async Task<RootObjectBuilderResult> Build(
public async Task<RootObjectBuilderResult> BuildAsync(
IReadOnlyList<ICsiWrapper> csiObjects,
SendInfo sendInfo,
IProgress<CardProgress> onOperationProgressed,
@@ -91,7 +94,7 @@ public class CsiRootObjectBuilder : IRootObjectBuilder<ICsiWrapper>
cancellationToken.ThrowIfCancellationRequested();
using var _2 = _activityFactory.Start("Convert");
var result = ConvertCsiObject(csiObject, rootObjectCollection);
var result = ConvertCsiObject(csiObject, rootObjectCollection, sendInfo.ProjectId);
results.Add(result);
count++;
@@ -120,40 +123,28 @@ public class CsiRootObjectBuilder : IRootObjectBuilder<ICsiWrapper>
/// <summary>
/// Converts a single Csi wrapper "object" to a data object with appropriate collection management.
/// </summary>
private SendConversionResult ConvertCsiObject(ICsiWrapper csiObject, Collection typeCollection)
private SendConversionResult ConvertCsiObject(ICsiWrapper csiObject, Collection typeCollection, string projectId)
{
string applicationId = $"{csiObject.ObjectType}{csiObject.Name}"; // TODO: NO! Use GUID
string sourceType = csiObject.ObjectName;
string applicationId = csiObject switch
{
CsiJointWrapper jointWrapper => jointWrapper.GetSpeckleApplicationId(_csiApplicationService.SapModel),
CsiFrameWrapper frameWrapper => frameWrapper.GetSpeckleApplicationId(_csiApplicationService.SapModel),
CsiCableWrapper cableWrapper => cableWrapper.GetSpeckleApplicationId(_csiApplicationService.SapModel),
CsiTendonWrapper tendonWrapper => tendonWrapper.ObjectName, // No GetGUID method in the Csi API available
CsiShellWrapper shellWrapper => shellWrapper.GetSpeckleApplicationId(_csiApplicationService.SapModel),
CsiSolidWrapper solidWrapper => solidWrapper.GetSpeckleApplicationId(_csiApplicationService.SapModel),
CsiLinkWrapper linkWrapper => linkWrapper.GetSpeckleApplicationId(_csiApplicationService.SapModel),
_ => throw new ArgumentException($"Unsupported wrapper type: {csiObject.GetType()}", nameof(csiObject))
};
try
{
Base converted = _rootToSpeckleConverter.Convert(csiObject);
Base converted;
if (_sendConversionCache.TryGetValue(projectId, applicationId, out ObjectReference? value))
{
converted = value;
}
else
{
converted = _rootToSpeckleConverter.Convert(csiObject);
}
var collection = _sendCollectionManager.AddObjectCollectionToRoot(converted, typeCollection);
collection.elements.Add(converted);
return new(Status.SUCCESS, applicationId, sourceType, converted);
}
// Expected not implemented:
// TODO: SAP 2000: CsiCableWrapper, CsiSolidWrapper
// TODO: ETABS: CsiLinkWrapper, CsiTendonWrapper
// NOTE: CsiLinkWrapper - not important to data extraction workflow
// NOTE: CsiTendonWrapper - not typically modelled in ETABS, rather SAFE
catch (NotImplementedException ex)
{
_logger.LogError(ex, sourceType);
return new(Status.WARNING, applicationId, sourceType, null, ex);
}
catch (Exception ex) when (!ex.IsFatal())
{
_logger.LogError(ex, sourceType);
@@ -10,8 +10,8 @@ public abstract class CSiPluginBase : cPluginContract, IDisposable
public void Main(ref cSapModel sapModel, ref cPluginCallback pluginCallback)
{
_panel = CreateForm();
_panel.Initialize(ref sapModel, ref pluginCallback);
_panel.FormClosed += (_, _) => Dispose();
_panel.SetSapModel(ref sapModel, ref pluginCallback);
_panel.FormClosed += (s, e) => Dispose();
if (string.Equals(s_modality, "Non-Modal", StringComparison.OrdinalIgnoreCase))
{
@@ -1,5 +1,4 @@
using System.ComponentModel;
using System.Reflection;
using System.Windows.Forms.Integration;
using Microsoft.Extensions.DependencyInjection;
using Speckle.Connectors.Common;
@@ -12,22 +11,28 @@ using Speckle.Sdk.Host;
namespace Speckle.Connectors.CSiShared;
[DesignerCategory("")]
public abstract class SpeckleFormBase : Form, ICsiApplicationService
public abstract class SpeckleFormBase : Form
{
private ElementHost Host { get; set; }
protected ElementHost Host { get; set; }
public static new ServiceProvider? Container { get; set; }
private cSapModel _sapModel;
private cPluginCallback _pluginCallback;
private bool _disposed;
#pragma warning disable CA2213
private ServiceProvider _container;
#pragma warning restore CA2213
protected SpeckleFormBase()
{
Text = "Speckle (Beta)";
Size = new System.Drawing.Size(400, 600);
}
public cSapModel SapModel { get; private set; }
var services = new ServiceCollection();
ConfigureServices(services);
Container = services.BuildServiceProvider();
Container.UseDUI(false);
var webview = Container.GetRequiredService<DUI3ControlWebView>();
Host = new() { Child = webview, Dock = DockStyle.Fill };
Controls.Add(Host);
FormClosing += Form1Closing;
}
protected virtual void ConfigureServices(IServiceCollection services)
{
@@ -40,61 +45,23 @@ public abstract class SpeckleFormBase : Form, ICsiApplicationService
protected abstract HostAppVersion GetVersion();
public void Initialize(ref cSapModel sapModel, ref cPluginCallback pluginCallback)
public void SetSapModel(ref cSapModel sapModel, ref cPluginCallback pluginCallback)
{
// store app-specific model and callback references (callback if at all possible?)
SapModel = sapModel;
_sapModel = sapModel;
_pluginCallback = pluginCallback;
string assemblyName =
Assembly.GetExecutingAssembly().GetName().Name
?? throw new InvalidOperationException("Could not determine executing assembly name");
string resourcePath = $"{assemblyName}.Resources.et_element_Speckle.bmp";
// load and set the speckle icon from embedded resources
using (var stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(resourcePath))
{
if (stream == null)
{
throw new InvalidOperationException($"Could not find resource: {resourcePath}");
}
using var bmp = new Bitmap(stream);
Icon = Icon.FromHandle(bmp.GetHicon());
}
// configure dependency injection services
var services = new ServiceCollection();
services.AddSingleton<ICsiApplicationService>(this);
ConfigureServices(services);
// build service container and initialize ui framework
_container = services.BuildServiceProvider();
_container.UseDUI();
// setup webview control and form properties
var webview = _container.GetRequiredService<DUI3ControlWebView>();
Host = new() { Child = webview, Dock = DockStyle.Fill };
Controls.Add(Host);
FormBorderStyle = FormBorderStyle.Sizable;
// this.TopLevel = true;
// TODO: Get IntrPtr for Csi window
FormClosing += Form1Closing;
var csiService = Container.GetRequiredService<ICsiApplicationService>();
csiService.Initialize(sapModel, pluginCallback);
}
private void Form1Closing(object? sender, FormClosingEventArgs e) => _pluginCallback.Finish(0);
protected override void Dispose(bool disposing)
protected void Form1Closing(object? sender, FormClosingEventArgs e)
{
if (!_disposed)
{
if (disposing)
{
_container.Dispose();
Host.Dispose();
base.Dispose(disposing);
}
_disposed = true;
}
Host.Dispose();
_pluginCallback.Finish(0);
}
public new void ShowDialog()
{
base.ShowDialog();
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 KiB

@@ -23,6 +23,7 @@ public static class ServiceRegistration
public static IServiceCollection AddCsi(this IServiceCollection services)
{
services.AddSingleton<IBrowserBridge, BrowserBridge>();
services.AddSingleton<ICsiApplicationService, CsiApplicationService>();
services.AddConnectorUtils();
services.AddDUI<DefaultThreadContext, CsiDocumentModelStore>();
@@ -8,17 +8,10 @@
<PropertyGroup Label="Configuration">
<Import_RootNamespace>Speckle.Connectors.CSiShared</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Resources\et_element_Speckle.bmp">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Bindings\CsiSharedBasicConnectorBinding.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bindings\CsiSharedSelectionBinding.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bindings\CsiSharedSendBinding.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Events\ModelChangedEvent.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Events\SelectionBindingEvent.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Filters\CsiSharedSelectionFilter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\MaterialUnpacker.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\CsiSendCollectionManager.cs" />
@@ -37,7 +30,4 @@
<Compile Include="$(MSBuildThisFileDirectory)ServiceRegistration.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Utils\ObjectIdentifiers.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)Resources\et_element_Speckle.bmp" />
</ItemGroup>
</Project>
@@ -2,13 +2,14 @@
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU</Platforms>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<ETABSVersion>21</ETABSVersion>
<DefineConstants>$(DefineConstants);ETABS21</DefineConstants>
<EnableDynamicLoading>true</EnableDynamicLoading>
<Configurations>Debug;Release;Local</Configurations>
</PropertyGroup>
<ItemGroup>
@@ -164,6 +164,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -259,9 +264,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +274,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -287,7 +292,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"speckle.converters.etabs21": {
@@ -329,26 +334,20 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -358,14 +357,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
}
}
@@ -2,13 +2,14 @@
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU</Platforms>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<ETABSVersion>22</ETABSVersion>
<DefineConstants>$(DefineConstants);ETABS22;ETABS22_OR_GREATER</DefineConstants>
<EnableDynamicLoading>true</EnableDynamicLoading>
<Configurations>Debug;Release;Local</Configurations>
</PropertyGroup>
<ItemGroup>
@@ -155,6 +155,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -215,9 +220,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -225,8 +230,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -243,7 +248,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"speckle.converters.etabs22": {
@@ -285,26 +290,20 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
@@ -313,14 +312,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
}
}
@@ -48,14 +48,9 @@ public class EtabsSendCollectionManager : CsiSendCollectionManager
return DEFAULT_LEVEL;
}
if (
properties.TryGetValue(ObjectPropertyCategory.OBJECT_ID, out var objectId)
&& objectId is Dictionary<string, object> parameters
)
if (properties.TryGetValue("Object ID", out var objectId) && objectId is Dictionary<string, object> parameters)
{
return parameters.TryGetValue(CommonObjectProperty.LEVEL, out var level)
? level?.ToString() ?? DEFAULT_LEVEL
: DEFAULT_LEVEL;
return parameters.TryGetValue("level", out var level) ? level?.ToString() ?? DEFAULT_LEVEL : DEFAULT_LEVEL;
}
return DEFAULT_LEVEL;
@@ -77,12 +72,9 @@ public class EtabsSendCollectionManager : CsiSendCollectionManager
&& obj["properties"] is Dictionary<string, object> properties
)
{
if (
properties.TryGetValue(ObjectPropertyCategory.OBJECT_ID, out var objectId)
&& objectId is Dictionary<string, object> parameters
)
if (properties.TryGetValue("Object ID", out var objectId) && objectId is Dictionary<string, object> parameters)
{
if (parameters.TryGetValue(CommonObjectProperty.DESIGN_ORIENTATION, out var orientation))
if (parameters.TryGetValue("designOrientation", out var orientation))
{
return GetCategoryFromDesignOrientation(orientation?.ToString(), type);
}
@@ -58,19 +58,21 @@ public class EtabsFrameSectionPropertyExtractor : IApplicationFrameSectionProper
if (sectionIndex != -1)
{
// General Data
var generalData = properties.EnsureNested(SectionPropertyCategory.GENERAL_DATA);
generalData["Section Shape"] = propTypes[sectionIndex].ToString();
var generalData = DictionaryUtils.EnsureNestedDictionary(properties, SectionPropertyCategory.GENERAL_DATA);
generalData["type"] = propTypes[sectionIndex].ToString();
// Section Dimensions
string unit = _settingsStore.Current.SpeckleUnits;
var sectionDimensions = properties.EnsureNested(SectionPropertyCategory.SECTION_DIMENSIONS);
sectionDimensions.AddWithUnits("t3", t3[sectionIndex], unit);
sectionDimensions.AddWithUnits("t2", t2[sectionIndex], unit);
sectionDimensions.AddWithUnits("tf", tf[sectionIndex], unit);
sectionDimensions.AddWithUnits("tw", tw[sectionIndex], unit);
sectionDimensions.AddWithUnits("t2b", t2b[sectionIndex], unit);
sectionDimensions.AddWithUnits("tfb", tfb[sectionIndex], unit);
sectionDimensions.AddWithUnits("Area", area[sectionIndex], $"{unit}²");
var sectionDimensions = DictionaryUtils.EnsureNestedDictionary(
properties,
SectionPropertyCategory.SECTION_DIMENSIONS
);
sectionDimensions["t3"] = t3[sectionIndex];
sectionDimensions["t2"] = t2[sectionIndex];
sectionDimensions["tf"] = tf[sectionIndex];
sectionDimensions["tw"] = tw[sectionIndex];
sectionDimensions["t2b"] = t2b[sectionIndex];
sectionDimensions["tfb"] = tfb[sectionIndex];
sectionDimensions["area"] = area[sectionIndex];
}
}
}
@@ -54,7 +54,7 @@ public class EtabsShellSectionPropertyExtractor : IApplicationShellSectionProper
continue;
}
var nestedProperties = properties.EnsureNested(nestedDictionary.Key);
var nestedProperties = DictionaryUtils.EnsureNestedDictionary(properties, nestedDictionary.Key);
foreach (var kvp in nestedValues)
{
nestedProperties[kvp.Key] = kvp.Value;
@@ -78,16 +78,16 @@ public class WallSectionResolver(IConverterSettingsStore<CsiConversionSettings>
);
Dictionary<string, object?> generalData = [];
generalData["Property Name"] = sectionName;
generalData["Property Type"] = wallPropType.ToString();
generalData["Material"] = matProp;
generalData["Modeling Type"] = shellType.ToString();
generalData["Display Color"] = color;
generalData["Notes"] = notes;
generalData["name"] = sectionName;
generalData["type"] = wallPropType.ToString();
generalData["material"] = matProp;
generalData["modelingType"] = shellType.ToString();
generalData["color"] = color;
generalData["notes"] = notes;
Dictionary<string, object?> propertyData = [];
propertyData["Type"] = "Wall";
propertyData.AddWithUnits("Thickness", thickness, settingsStore.Current.SpeckleUnits);
propertyData["type"] = "Wall";
propertyData["thickness"] = thickness;
Dictionary<string, object?> properties = [];
properties[SectionPropertyCategory.GENERAL_DATA] = generalData;
@@ -121,15 +121,15 @@ public class SlabSectionResolver(IConverterSettingsStore<CsiConversionSettings>
);
Dictionary<string, object?> generalData = [];
generalData["Property Name"] = sectionName;
generalData["Material"] = matProp;
generalData["Modeling Type"] = shellType.ToString();
generalData["Display Color"] = color;
generalData["Notes"] = notes;
generalData["name"] = sectionName;
generalData["material"] = matProp;
generalData["modelingType"] = shellType.ToString();
generalData["color"] = color;
generalData["notes"] = notes;
Dictionary<string, object?> propertyData = [];
propertyData["Type"] = slabType.ToString();
propertyData.AddWithUnits("Thickness", thickness, settingsStore.Current.SpeckleUnits);
propertyData["type"] = slabType.ToString();
propertyData["thickness"] = thickness;
Dictionary<string, object?> properties = [];
properties[SectionPropertyCategory.GENERAL_DATA] = generalData;
@@ -163,15 +163,15 @@ public class DeckSectionResolver(IConverterSettingsStore<CsiConversionSettings>
);
Dictionary<string, object?> generalData = [];
generalData["Property Name"] = sectionName;
generalData["Property Type"] = deckType.ToString();
generalData["Material"] = deckMatProp;
generalData["Modeling Type"] = shellType.ToString();
generalData["Display Color"] = color;
generalData["Notes"] = notes;
generalData["name"] = sectionName;
generalData["type"] = deckType.ToString();
generalData["material"] = deckMatProp;
generalData["modelingType"] = shellType.ToString();
generalData["color"] = color;
generalData["notes"] = notes;
Dictionary<string, object?> propertyData = [];
propertyData.AddWithUnits("Thickness", thickness, settingsStore.Current.SpeckleUnits);
propertyData["thickness"] = thickness;
Dictionary<string, object?> properties = [];
properties[SectionPropertyCategory.GENERAL_DATA] = generalData;
@@ -7,7 +7,7 @@ public abstract class EtabsPluginBase : CSiPluginBase
{
public override int Info(ref string text)
{
text = "Next Gen Speckle Connector for ETABS";
text = "Hey Speckler! This is our next-gen ETABS Connector.";
return 0;
}
@@ -9,13 +9,13 @@
<NavisworksVersion>2020</NavisworksVersion>
<DefineConstants>$(DefineConstants);TRACE;NAVIS2020;NAVIS</DefineConstants>
<Configurations>Debug;Release;Local</Configurations>
</PropertyGroup>
<Import Project="..\Speckle.Connectors.NavisworksShared\Speckle.Connectors.NavisworksShared.projitems" Label="Shared"/>
<ItemGroup>
<Reference Include="WindowsFormsIntegration"/>
<PackageReference Include="Speckle.Objects"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2020.0.0"/>
</ItemGroup>
@@ -39,6 +39,15 @@
"resolved": "2020.0.0",
"contentHash": "biB2RR0HNxrbHD7zBZoJUhwzPwVE5IFg9l4/747bHOLRJC3FM5UtzdjGwvRZwfOlFyM4P26NYARSiCaxSNIBpg=="
},
"Speckle.Objects": {
"type": "Direct",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"GraphQL.Client": {
"type": "Transitive",
"resolved": "6.0.0",
@@ -164,6 +173,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -259,9 +273,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +283,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -287,7 +301,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"speckle.converters.navisworks2020": {
@@ -331,26 +345,11 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -360,14 +359,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
},
".NETFramework,Version=v4.8/win-x64": {
@@ -9,13 +9,13 @@
<NavisworksVersion>2021</NavisworksVersion>
<DefineConstants>$(DefineConstants);TRACE;NAVIS2021;NAVIS</DefineConstants>
<Configurations>Debug;Release;Local</Configurations>
</PropertyGroup>
<Import Project="..\Speckle.Connectors.NavisworksShared\Speckle.Connectors.NavisworksShared.projitems" Label="Shared"/>
<ItemGroup>
<Reference Include="WindowsFormsIntegration"/>
<PackageReference Include="Speckle.Objects"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2021.0.0"/>
</ItemGroup>
@@ -39,6 +39,15 @@
"resolved": "2021.0.0",
"contentHash": "cY7sU8dxISfTQLinUIOki/azS+bIX28uEZQO4ijrq0eOUhJlKcKWS273kHPoL0+T0Xrkd+1OWj2YFa2PbHGgwQ=="
},
"Speckle.Objects": {
"type": "Direct",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"GraphQL.Client": {
"type": "Transitive",
"resolved": "6.0.0",
@@ -164,6 +173,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -259,9 +273,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +283,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -287,7 +301,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"speckle.converters.navisworks2021": {
@@ -331,26 +345,11 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -360,14 +359,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
},
".NETFramework,Version=v4.8/win-x64": {
@@ -9,13 +9,13 @@
<NavisworksVersion>2022</NavisworksVersion>
<DefineConstants>$(DefineConstants);TRACE;NAVIS2022;NAVIS</DefineConstants>
<Configurations>Debug;Release;Local</Configurations>
</PropertyGroup>
<Import Project="..\Speckle.Connectors.NavisworksShared\Speckle.Connectors.NavisworksShared.projitems" Label="Shared"/>
<ItemGroup>
<Reference Include="WindowsFormsIntegration"/>
<PackageReference Include="Speckle.Objects"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2022.0.0"/>
</ItemGroup>
@@ -39,6 +39,15 @@
"resolved": "2022.0.0",
"contentHash": "x0RW4Iqw8YHVK4ZiLEyLLfI5ffuRBR0KhEvmy9ZpT8SLNeDL/c6jn+7JWBVFUJPu+ObVnU+KqJjLdHmphN0lMQ=="
},
"Speckle.Objects": {
"type": "Direct",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"GraphQL.Client": {
"type": "Transitive",
"resolved": "6.0.0",
@@ -164,6 +173,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -259,9 +273,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +283,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -287,7 +301,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"speckle.converters.navisworks2022": {
@@ -331,26 +345,11 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -360,14 +359,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
},
".NETFramework,Version=v4.8/win-x64": {
@@ -9,13 +9,13 @@
<NavisworksVersion>2023</NavisworksVersion>
<DefineConstants>$(DefineConstants);TRACE;NAVIS2023;NAVIS</DefineConstants>
<Configurations>Debug;Release;Local</Configurations>
</PropertyGroup>
<Import Project="..\Speckle.Connectors.NavisworksShared\Speckle.Connectors.NavisworksShared.projitems" Label="Shared"/>
<ItemGroup>
<Reference Include="WindowsFormsIntegration"/>
<PackageReference Include="Speckle.Objects"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2023.0.0"/>
</ItemGroup>
@@ -39,6 +39,15 @@
"resolved": "2023.0.0",
"contentHash": "+qRmcyLD3DpuSSwX2IbEwp0gJllbiKgv313PZfEfh8I2uvxf+5YNqDzY0OGOxWIdPKqaQmdUZ1ELzoDtucCWzA=="
},
"Speckle.Objects": {
"type": "Direct",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"GraphQL.Client": {
"type": "Transitive",
"resolved": "6.0.0",
@@ -164,6 +173,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -259,9 +273,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +283,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -287,7 +301,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"speckle.converters.navisworks2023": {
@@ -331,26 +345,11 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -360,14 +359,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
},
".NETFramework,Version=v4.8/win-x64": {
@@ -9,13 +9,13 @@
<NavisworksVersion>2024</NavisworksVersion>
<DefineConstants>$(DefineConstants);TRACE;NAVIS2024;NAVIS</DefineConstants>
<Configurations>Debug;Release;Local</Configurations>
</PropertyGroup>
<Import Project="..\Speckle.Connectors.NavisworksShared\Speckle.Connectors.NavisworksShared.projitems" Label="Shared"/>
<ItemGroup>
<Reference Include="WindowsFormsIntegration"/>
<PackageReference Include="Speckle.Objects"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2024.0.0"/>
</ItemGroup>
@@ -39,6 +39,15 @@
"resolved": "2024.0.0",
"contentHash": "SnkvhcENMy3YLWbzy4lCweMuWdAbNzAtwvffFH2xVHmnm/2INnMGucYGazAHN496d6wgl9YRGa4qftgVsg7T7A=="
},
"Speckle.Objects": {
"type": "Direct",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"GraphQL.Client": {
"type": "Transitive",
"resolved": "6.0.0",
@@ -164,6 +173,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -259,9 +273,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +283,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -287,7 +301,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"speckle.converters.navisworks2024": {
@@ -331,26 +345,11 @@
"resolved": "1.0.1938.49",
"contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -360,14 +359,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
},
".NETFramework,Version=v4.8/win-x64": {
@@ -9,13 +9,13 @@
<NavisworksVersion>2025</NavisworksVersion>
<DefineConstants>$(DefineConstants);TRACE;NAVIS2025;NAVIS</DefineConstants>
<Configurations>Debug;Release;Local</Configurations>
</PropertyGroup>
<Import Project="..\Speckle.Connectors.NavisworksShared\Speckle.Connectors.NavisworksShared.projitems" Label="Shared"/>
<ItemGroup>
<Reference Include="WindowsFormsIntegration"/>
<PackageReference Include="Speckle.Objects"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2025.0.0"/>
<PackageReference Include="Microsoft.Web.WebView2" VersionOverride="1.0.2045.28" />
</ItemGroup>
@@ -45,6 +45,15 @@
"resolved": "2025.0.0",
"contentHash": "+q2IObnUGqtC1O/ddy2p0HKm1eXRo7Yi80oD9VIWClidvGb3rVsXKZWBHiv4HwSn5JcOMSEt1cdSlRQLm8Ehjg=="
},
"Speckle.Objects": {
"type": "Direct",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"GraphQL.Client": {
"type": "Transitive",
"resolved": "6.0.0",
@@ -170,6 +179,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -265,9 +279,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -275,8 +289,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui.webview": {
@@ -293,7 +307,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"speckle.converters.navisworks2025": {
@@ -331,26 +345,11 @@
"resolved": "2.2.0",
"contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -360,14 +359,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
},
".NETFramework,Version=v4.8/win-x64": {
@@ -1,3 +1,5 @@
using Speckle.Connector.Navisworks.HostApp;
using Speckle.Connectors.Common.Caching;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Models;
@@ -13,17 +15,23 @@ public class NavisworksBasicConnectorBinding : IBasicConnectorBinding
public BasicConnectorBindingCommands Commands { get; }
private readonly DocumentModelStore _store;
private readonly ISendConversionCache _sendConversionCache;
private readonly ISpeckleApplication _speckleApplication;
private readonly NavisworksDocumentEvents _documentEvents;
public NavisworksBasicConnectorBinding(
IBrowserBridge parent,
DocumentModelStore store,
ISpeckleApplication speckleApplication
ISendConversionCache sendConversionCache,
ISpeckleApplication speckleApplication,
NavisworksDocumentEvents documentEvents
)
{
Parent = parent;
_store = store;
_sendConversionCache = sendConversionCache;
_speckleApplication = speckleApplication;
_documentEvents = documentEvents;
Commands = new BasicConnectorBindingCommands(parent);
}
@@ -1,38 +1,37 @@
using Speckle.Connector.Navisworks.Services;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Eventing;
namespace Speckle.Connector.Navisworks.Bindings;
public class NavisworksSelectionBinding : ISelectionBinding
{
private readonly IAppIdleManager _appIdleManager;
private readonly IElementSelectionService _selectionService;
private readonly IEventAggregator _eventAggregator;
private const string SELECTION_EVENT = "setSelection";
public string Name { get; } = "selectionBinding";
public IBrowserBridge Parent { get; }
public NavisworksSelectionBinding(
IAppIdleManager idleManager,
IBrowserBridge parent,
IElementSelectionService selectionService,
IEventAggregator eventAggregator
IElementSelectionService selectionService
)
{
_selectionService = selectionService;
_eventAggregator = eventAggregator;
_appIdleManager = idleManager;
Parent = parent;
eventAggregator.GetEvent<SelectionChangedEvent>().Subscribe(OnSelectionChange);
NavisworksApp.ActiveDocument.CurrentSelection.Changed += OnSelectionChange;
}
private void OnSelectionChange(object _) =>
_eventAggregator.GetEvent<IdleEvent>().OneTimeSubscribe(nameof(NavisworksSelectionBinding), UpdateSelectionAsync);
private void OnSelectionChange(object? o, EventArgs eventArgs) =>
_appIdleManager.SubscribeToIdle(nameof(NavisworksSelectionBinding), async () => await UpdateSelectionAsync());
private async Task UpdateSelectionAsync(object _)
private async Task UpdateSelectionAsync()
{
var selInfo = GetSelection();
await Parent.Send(SELECTION_EVENT, selInfo);
await Parent.Send<SelectionInfo>(SELECTION_EVENT, selInfo);
}
public SelectionInfo GetSelection()
@@ -53,7 +52,7 @@ public class NavisworksSelectionBinding : ISelectionBinding
);
return new SelectionInfo(
selectedObjectsIds,
[.. selectedObjectsIds],
$"{selectedObjectsIds.Count} object{(selectedObjectsIds.Count != 1 ? "s" : "")}"
);
}
@@ -30,7 +30,7 @@ public class NavisworksSendBinding : ISendBinding
private readonly DocumentModelStore _store;
private readonly IServiceProvider _serviceProvider;
private readonly List<ISendFilter> _sendFilters;
private readonly ICancellationManager _cancellationManager;
private readonly CancellationManager _cancellationManager;
private readonly IOperationProgressManager _operationProgressManager;
private readonly ILogger<NavisworksSendBinding> _logger;
private readonly ISpeckleApplication _speckleApplication;
@@ -44,7 +44,7 @@ public class NavisworksSendBinding : ISendBinding
IBrowserBridge parent,
IEnumerable<ISendFilter> sendFilters,
IServiceProvider serviceProvider,
ICancellationManager cancellationManager,
CancellationManager cancellationManager,
IOperationProgressManager operationProgressManager,
ILogger<NavisworksSendBinding> logger,
ISpeckleApplication speckleApplication,
@@ -93,11 +93,11 @@ public class NavisworksSendBinding : ISendBinding
InitializeConverterSettings(scope, modelCard);
using var cancellationItem = _cancellationManager.GetCancellationItem(modelCardId);
CancellationToken token = _cancellationManager.InitCancellationTokenSource(modelCardId);
var navisworksModelItems = GetNavisworksModelItems(modelCard);
var sendResult = await ExecuteSendOperation(scope, modelCard, navisworksModelItems, cancellationItem.Token);
var sendResult = await ExecuteSendOperation(scope, modelCard, navisworksModelItems, token);
await Commands.SetModelSendResult(modelCardId, sendResult.RootObjId, sendResult.ConversionResults);
}
@@ -7,10 +7,12 @@ using Speckle.Connector.Navisworks.Operations.Send.Settings;
using Speckle.Connector.Navisworks.Services;
using Speckle.Connectors.Common;
using Speckle.Connectors.Common.Builders;
using Speckle.Connectors.Common.Cancellation;
using Speckle.Connectors.Common.Operations;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Models;
using Speckle.Connectors.DUI.Models.Card.SendFilter;
using Speckle.Connectors.DUI.WebView;
@@ -58,6 +60,8 @@ public static class NavisworksConnectorServiceRegistration
serviceCollection.AddSingleton<IOperationProgressManager, OperationProgressManager>();
// Register Intercom/interop
serviceCollection.AddTransient<CancellationManager>();
serviceCollection.AddSingleton<IAppIdleManager, NavisworksIdleManager>();
serviceCollection.AddSingleton<NavisworksDocumentModelStore>();
serviceCollection.AddSingleton<DocumentModelStore>(sp => sp.GetRequiredService<NavisworksDocumentModelStore>());
serviceCollection.AddSingleton<NavisworksDocumentEvents>();
@@ -1,7 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Speckle.Connector.Navisworks.Bindings;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Eventing;
using Speckle.Connectors.DUI.Bridge;
namespace Speckle.Connector.Navisworks.HostApp;
@@ -9,14 +9,17 @@ namespace Speckle.Connector.Navisworks.HostApp;
/// Manages document and model state change notifications for the Navisworks connector.
/// Coalesces various document events into batched updates to be processed during idle time.
/// </summary>
public sealed class NavisworksDocumentEvents
public sealed class NavisworksDocumentEvents : IDisposable
{
private readonly IServiceProvider _serviceProvider;
private readonly IEventAggregator _eventAggregator;
private readonly ITopLevelExceptionHandler _topLevelExceptionHandler;
private readonly IAppIdleManager _idleManager;
private readonly IBrowserBridge _parent;
private readonly object _subscriptionLock = new();
private bool _isSubscribed;
private bool _isProcessing;
private bool _disposed;
private int _priorModelCount;
private int _finalModelCount;
@@ -25,22 +28,28 @@ public sealed class NavisworksDocumentEvents
/// Initializes a new instance of the <see cref="NavisworksDocumentEvents"/> class and subscribes to document events.
/// </summary>
/// <param name="serviceProvider">The service provider for dependency injection.</param>
public NavisworksDocumentEvents(IServiceProvider serviceProvider, IEventAggregator eventAggregator)
/// <param name="topLevelExceptionHandler">Handles exceptions during event processing.</param>
/// <param name="idleManager">Manages idle processing.</param>
public NavisworksDocumentEvents(
IServiceProvider serviceProvider,
ITopLevelExceptionHandler topLevelExceptionHandler,
IAppIdleManager idleManager,
IBrowserBridge parent
)
{
_serviceProvider = serviceProvider;
_eventAggregator = eventAggregator;
_topLevelExceptionHandler = topLevelExceptionHandler;
_idleManager = idleManager;
_eventAggregator.GetEvent<ActiveDocumentChangingEvent>().Subscribe(UnsubscribeFromDocumentModelEvents);
_eventAggregator.GetEvent<ActiveDocumentChangedEvent>().Subscribe(SubscribeToDocumentModelEvents);
_eventAggregator.GetEvent<CollectionChangingEvent>().Subscribe(HandleDocumentModelCountChanging);
_eventAggregator.GetEvent<CollectionChangedEvent>().Subscribe(HandleDocumentModelCountChanged);
SubscribeToDocumentModelEvents(new object());
_parent = parent;
SubscribeToDocumentModelEvents();
}
/// <summary>
/// Subscribes to document-level events to monitor model state changes.
/// </summary>
private void SubscribeToDocumentModelEvents(object _)
private void SubscribeToDocumentModelEvents()
{
lock (_subscriptionLock)
{
@@ -52,39 +61,34 @@ public sealed class NavisworksDocumentEvents
var activeDocument = NavisworksApp.ActiveDocument;
if (activeDocument != null)
{
activeDocument.Models.CollectionChanged += OnCollectionChanged;
activeDocument.Models.CollectionChanging += OnCollectionChanging;
activeDocument.Models.CollectionChanging += HandleDocumentModelCountChanging;
activeDocument.Models.CollectionChanged += HandleDocumentModelCountChanged;
}
_isSubscribed = true;
}
}
private async void OnCollectionChanged(object sender, EventArgs _) =>
await _eventAggregator.GetEvent<CollectionChangedEvent>().PublishAsync(sender);
private async void OnCollectionChanging(object sender, EventArgs _) =>
await _eventAggregator.GetEvent<CollectionChangingEvent>().PublishAsync(sender);
/// <summary>
/// Tracks the current model count before changes occur.
/// </summary>
private void HandleDocumentModelCountChanging(object sender) =>
private void HandleDocumentModelCountChanging(object sender, EventArgs e) =>
_priorModelCount = ((NAV.Document)sender).Models.Count;
/// <summary>
/// Schedules processing of model count changes during idle time.
/// </summary>
private void HandleDocumentModelCountChanged(object sender)
private void HandleDocumentModelCountChanged(object sender, EventArgs e)
{
_finalModelCount = ((NAV.Document)sender).Models.Count;
_eventAggregator
.GetEvent<IdleEvent>()
.OneTimeSubscribe(nameof(NavisworksDocumentEvents), ProcessModelStateChangeAsync);
_topLevelExceptionHandler.CatchUnhandled(
() =>
_idleManager.SubscribeToIdle(nameof(NavisworksDocumentEvents), async () => await ProcessModelStateChangeAsync())
);
}
private async Task ProcessModelStateChangeAsync(object _)
private async Task ProcessModelStateChangeAsync()
{
if (_isProcessing)
{
@@ -120,7 +124,48 @@ public sealed class NavisworksDocumentEvents
}
}
private void UnsubscribeFromDocumentModelEvents(object _)
/// <summary>
/// Processes model state changes by updating the store and notifying commands.
/// </summary>
private async Task NotifyValidModelStateChange()
{
if (_isProcessing)
{
return;
}
_isProcessing = true;
try
{
var store = _serviceProvider.GetRequiredService<NavisworksDocumentModelStore>();
var basicBinding = _serviceProvider.GetRequiredService<IBasicConnectorBinding>();
var commands = (basicBinding as NavisworksBasicConnectorBinding)?.Commands;
switch (_finalModelCount)
{
case 0 when _priorModelCount > 0:
// Clear the store when models are removed
store.ClearAndSave();
break;
case > 0 when _priorModelCount == 0:
// Load state when models are added
store.ReloadState();
break;
}
if (commands != null)
{
await commands.NotifyDocumentChanged();
}
}
finally
{
_isProcessing = false;
}
}
private void UnsubscribeFromDocumentModelEvents()
{
var activeDocument = NavisworksApp.ActiveDocument;
if (activeDocument != null)
@@ -133,13 +178,39 @@ public sealed class NavisworksDocumentEvents
private void UnsubscribeFromModelEvents(NAV.Document document)
{
document.Models.CollectionChanged -= OnCollectionChanged;
document.Models.CollectionChanging -= OnCollectionChanging;
document.Models.CollectionChanged -= HandleDocumentModelCountChanged;
document.Models.CollectionChanging -= HandleDocumentModelCountChanging;
var sendBinding = _serviceProvider
.GetRequiredService<IEnumerable<IBinding>>()
.OfType<NavisworksSendBinding>()
.First();
var sendBinding = _serviceProvider.GetRequiredService<NavisworksSendBinding>();
sendBinding.CancelAllSendOperations();
}
/// <summary>
/// Disposes of resources and unsubscribes from events.
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
{
if (_disposed)
{
return;
}
if (disposing)
{
UnsubscribeFromDocumentModelEvents();
}
_disposed = true;
}
~NavisworksDocumentEvents()
{
Dispose(false);
}
}
@@ -0,0 +1,30 @@
using Speckle.Connectors.DUI.Bridge;
namespace Speckle.Connector.Navisworks.HostApp;
/// <summary>
/// Manages the scheduling of deferred operations during Navisworks idle periods.
/// Ensures UI updates and operations are batched efficiently to prevent UI freezing.
/// </summary>
public sealed class NavisworksIdleManager : AppIdleManager
{
private readonly IIdleCallManager _idleCallManager;
/// <summary>
/// Initializes a new instance of the NavisworksIdleManager.
/// </summary>
/// <param name="idleCallManager">The manager responsible for queuing and executing deferred operations.</param>
public NavisworksIdleManager(IIdleCallManager idleCallManager)
: base(idleCallManager)
{
_idleCallManager = idleCallManager;
}
/// <summary>
/// Subscribes to Navisworks idle events when operations are queued.
/// </summary>
protected override void AddEvent() => NavisworksApp.Idle += NavisworksAppOnIdle;
private void NavisworksAppOnIdle(object? sender, EventArgs e) =>
_idleCallManager.AppOnIdle(() => NavisworksApp.Idle -= NavisworksAppOnIdle);
}
@@ -1,34 +0,0 @@
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Eventing;
namespace Speckle.Connector.Navisworks;
public class SelectionChangedEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: ThreadedEvent<object>(threadContext, exceptionHandler);
public class ActiveDocumentChangingEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: ThreadedEvent<object>(threadContext, exceptionHandler);
public class ActiveDocumentChangedEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: ThreadedEvent<object>(threadContext, exceptionHandler);
public class CollectionChangingEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: ThreadedEvent<object>(threadContext, exceptionHandler);
public class CollectionChangedEvent(IThreadContext threadContext, ITopLevelExceptionHandler exceptionHandler)
: ThreadedEvent<object>(threadContext, exceptionHandler);
public static class NavisworksEvents
{
public static void Register(IEventAggregator eventAggregator)
{
NavisworksApp.Idle += async (_, _) => await eventAggregator.GetEvent<IdleEvent>().PublishAsync(new object());
NavisworksApp.ActiveDocument.CurrentSelection.Changed += async (_, _) =>
await eventAggregator.GetEvent<SelectionChangedEvent>().PublishAsync(new object());
NavisworksApp.ActiveDocumentChanging += async (_, _) =>
await eventAggregator.GetEvent<ActiveDocumentChangingEvent>().PublishAsync(new object());
NavisworksApp.ActiveDocumentChanged += async (_, _) =>
await eventAggregator.GetEvent<ActiveDocumentChangedEvent>().PublishAsync(new object());
}
}
@@ -5,7 +5,6 @@ using Speckle.Connectors.Common.Builders;
using Speckle.Connectors.Common.Caching;
using Speckle.Connectors.Common.Conversion;
using Speckle.Connectors.Common.Operations;
using Speckle.Converter.Navisworks.Helpers;
using Speckle.Converter.Navisworks.Settings;
using Speckle.Converters.Common;
using Speckle.Objects.Data;
@@ -41,7 +40,7 @@ public class NavisworksRootObjectBuilder(
/// <param name="cancellationToken">Token to cancel the operation.</param>
/// <returns>A result containing the root collection and conversion results.</returns>
/// <exception cref="SpeckleException">Thrown when no objects can be converted.</exception>
public async Task<RootObjectBuilderResult> Build(
public async Task<RootObjectBuilderResult> BuildAsync(
IReadOnlyList<NAV.ModelItem> navisworksModelItems,
SendInfo sendInfo,
IProgress<CardProgress> onOperationProgressed,
@@ -195,23 +194,12 @@ public class NavisworksRootObjectBuilder(
finalElements.Add(collection);
break;
default:
if (CreateNavisworksObject(kvp.Value) is { } navisworksObject)
{
finalElements.Add(navisworksObject);
}
finalElements.Add(CreateNavisworksObject(kvp.Value));
break;
}
}
}
private (string name, string path) GetContext(string applicationId)
{
var modelItem = elementSelectionService.GetModelItemFromPath(applicationId);
var context = HierarchyHelper.ExtractContext(modelItem);
return (context.Name, context.Path);
}
/// <summary>
/// Processes and adds any remaining non-grouped elements.
/// </summary>
@@ -219,45 +207,30 @@ public class NavisworksRootObjectBuilder(
/// Handles both Collection and Base type elements differently.
/// Only processes elements that weren't handled in grouped processing.
/// </remarks>
private NavisworksObject CreateNavisworksObject(string groupKey, List<Base> siblingBases)
{
(string name, string path) = GetContext(groupKey);
return new NavisworksObject
private NavisworksObject CreateNavisworksObject(string groupKey, List<Base> siblingBases) =>
new()
{
name = name,
name = elementSelectionService.GetModelItemFromPath(groupKey).DisplayName ?? string.Empty,
displayValue = siblingBases.SelectMany(b => b["displayValue"] as List<Base> ?? []).ToList(),
properties = siblingBases.First()["properties"] as Dictionary<string, object?> ?? [],
units = converterSettings.Current.Derived.SpeckleUnits,
applicationId = groupKey,
["path"] = path
applicationId = groupKey
};
}
/// <summary>
/// Creates a NavisworksObject from a single converted base.
/// </summary>
/// <param name="convertedBase">The converted Speckle Base object.</param>
/// <returns>A new NavisworksObject containing the converted data.</returns>
private NavisworksObject? CreateNavisworksObject(Base convertedBase)
{
if (convertedBase.applicationId == null)
private NavisworksObject CreateNavisworksObject(Base convertedBase) =>
new()
{
return null;
}
(string name, string path) = GetContext(convertedBase.applicationId);
return new NavisworksObject
{
name = name,
name = convertedBase["name"] as string ?? string.Empty,
displayValue = convertedBase["displayValue"] as List<Base> ?? [],
properties = convertedBase["properties"] as Dictionary<string, object?> ?? [],
units = converterSettings.Current.Derived.SpeckleUnits,
applicationId = convertedBase.applicationId,
["path"] = path
applicationId = convertedBase.applicationId
};
}
private Task AddProxiesToCollection(
Collection rootCollection,
@@ -73,7 +73,6 @@ public class ToSpeckleSettingsManagerNavisworks : IToSpeckleSettingsManagerNavis
EvictCacheForModelCard(modelCard);
}
}
_originModeCache[modelCard.ModelCardId.NotNull()] = origin;
return origin;
}
@@ -0,0 +1,31 @@
using Speckle.Sdk.Host;
namespace Speckle.Connector.Navisworks.NavisPlugin;
public static class AppUtils
{
public static HostApplication App =>
#if NAVIS
HostApplications.Navisworks;
#else
throw new NotSupportedException();
#endif
public static HostAppVersion Version =>
#if NAVIS2020
HostAppVersion.v2020;
#elif NAVIS2021
HostAppVersion.v2021;
#elif NAVIS2022
HostAppVersion.v2022;
#elif NAVIS2023
HostAppVersion.v2023;
#elif NAVIS2024
HostAppVersion.v2024;
#elif NAVIS2025
HostAppVersion.v2025;
#elif NAVIS2026
HostAppVersion.v2026;
#else
throw new NotSupportedException("This version is not supported");
#endif
}
@@ -0,0 +1,7 @@
namespace Speckle.Connector.Navisworks.Plugin;
public abstract class LaunchSpeckleConnector
{
public const string COMMAND = "Speckle_Launch";
public const string PLUGIN = "SpeckleUI3";
}
@@ -3,11 +3,8 @@ using System.Windows.Forms;
using System.Windows.Forms.Integration;
using Microsoft.Extensions.DependencyInjection;
using Speckle.Connector.Navisworks.DependencyInjection;
using Speckle.Connector.Navisworks.HostApp;
using Speckle.Connector.Navisworks.Plugin.Tools;
using Speckle.Connectors.Common;
using Speckle.Connectors.DUI;
using Speckle.Connectors.DUI.Eventing;
using Speckle.Connectors.DUI.WebView;
using Speckle.Converter.Navisworks.DependencyInjection;
using Speckle.Sdk.Host;
@@ -17,12 +14,12 @@ namespace Speckle.Connector.Navisworks.Plugin;
[
NAV.Plugins.DockPanePlugin(450, 750, FixedSize = false, AutoScroll = true, MinimumHeight = 410, MinimumWidth = 250),
NAV.Plugins.Plugin(
SpeckleV3Tool.PLUGIN,
SpeckleV3Tool.DEVELOPER_ID,
DisplayName = SpeckleV3Tool.DISPLAY_NAME,
LaunchSpeckleConnector.PLUGIN,
"Speckle",
DisplayName = "Speckle",
Options = NAV.Plugins.PluginOptions.None,
ToolTip = "Speckle Connector for Navisworks",
ExtendedToolTip = "Next Gen Speckle Connector (Beta) for Navisworks"
ExtendedToolTip = "Speckle Connector for Navisworks"
)
]
[SuppressMessage(
@@ -40,15 +37,13 @@ internal sealed class Connector : NAV.Plugins.DockPanePlugin
var services = new ServiceCollection();
services.Initialize(HostApplications.Navisworks, SpeckleV3Tool.Version);
services.Initialize(HostApplications.Navisworks, HostAppVersion.v2024);
services.AddNavisworks();
services.AddNavisworksConverter();
Container = services.BuildServiceProvider();
NavisworksEvents.Register(Container.GetRequiredService<IEventAggregator>());
Container.UseDUI();
Container.GetRequiredService<NavisworksDocumentEvents>();
var u = Container.GetRequiredService<DUI3ControlWebView>();
@@ -2,9 +2,8 @@
# do NOT need translating.
$utf8
DisplayName=Speckle
Speckle.DisplayName=Speckle
SpeckleV3.Title=Speckle (Beta)
SpeckleV2.Title=Speckle
Speckle_Launch.DisplayName=Speckle (Beta)
Speckle_Launch_V2.DisplayName=Speckle
# DisplayName=
# SpeckleNextGen
# Speckle.DisplayName=
# SpeckleNextGen
@@ -1,28 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<RibbonControl
x:Uid="Speckle_Ribbon"
xmlns="clr-namespace:Autodesk.Windows;assembly=AdWindows"
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:gui="clr-namespace:Autodesk.Navisworks.Gui.Roamer.AIRLook;assembly=navisworks.gui.roamer">
xmlns:gui="clr-namespace:Autodesk.Navisworks.Gui.Roamer.AIRLook;assembly=navisworks.gui.roamer"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<RibbonTab Id="Speckle" KeyTip="SP">
<RibbonPanel x:Uid="Panel_Speckle">
<RibbonPanelSource Id="SpeckleV3Source" x:Uid="PanelSource_Speckle_V3" Title="Speckle">
<gui:NWRibbonButton
x:Uid="Button_Speckle_V3"
Id="Speckle_Launch"
Size="Large"
KeyTip="3"
ShowText="True"
Orientation="Vertical" />
<gui:NWRibbonButton
x:Uid="Button_Speckle_V2"
Id="Speckle_Launch_V2"
Size="Large"
KeyTip="2"
ShowText="True"
Orientation="Vertical" />
<!-- SPECKLE -->
<RibbonPanel x:Uid="RibbonPanel">
<RibbonPanelSource Id="RibbonPanelSource" x:Uid="RibbonPanelSource" KeyTip="SP" Title="Speckle">
<gui:NWRibbonButton x:Uid="Button_Speckle_LaunchSpeckleConnector" IsVisible="False" Id="Speckle_Launch"
Size="Large" KeyTip="S" ShowText="True" Orientation="Vertical" />
</RibbonPanelSource>
</RibbonPanel>
</RibbonTab>
@@ -1,122 +1,171 @@
using System.Diagnostics.CodeAnalysis;
using System.Windows.Forms;
using Speckle.Connector.Navisworks.Plugin.Tools;
#if DEBUG
using System.Text;
#endif
namespace Speckle.Connector.Navisworks.Plugin;
/// <summary>
/// Handles plugin state and ribbon management for the Speckle V3 and V2 connectors.
/// </summary>
[
NAV.Plugins.Plugin(SpeckleV3Tool.PLUGIN_ID, SpeckleV3Tool.DEVELOPER_ID, DisplayName = SpeckleV3Tool.DISPLAY_NAME),
NAV.Plugins.Strings(SpeckleV3Tool.RIBBON_STRINGS),
NAV.Plugins.Plugin("SpeckleNavisworksNextGen", "Speckle", DisplayName = "Speckle Next Gen"),
NAV.Plugins.Strings("NavisworksRibbon.name"),
NAV.Plugins.RibbonLayout("NavisworksRibbon.xaml"),
NAV.Plugins.RibbonTab(
SpeckleV3Tool.RIBBON_TAB_ID,
DisplayName = SpeckleV3Tool.RIBBON_TAB_DISPLAY_NAME,
LoadForCanExecute = true
),
NAV.Plugins.RibbonTab("Speckle", DisplayName = "Speckle Next Gen", LoadForCanExecute = true),
NAV.Plugins.Command(
SpeckleV3Tool.COMMAND,
LaunchSpeckleConnector.COMMAND,
LoadForCanExecute = true,
Icon = "Resources/v3_logo16.png",
LargeIcon = "Resources/v3_logo32.png",
ToolTip = "Speckle Connector for Navisworks",
DisplayName = "$Speckle_Launch.DisplayName"
Icon = "Resources/s2logo16.png",
LargeIcon = "Resources/s2logo32.png",
ToolTip = "Next Gen Speckle Connector for Navisworks",
DisplayName = "Speckle\rConnector"
),
NAV.Plugins.Command(
SpeckleV2Tool.COMMAND,
LoadForCanExecute = true,
Icon = "Resources/v2_logo16.png",
LargeIcon = "Resources/v2_logo32.png",
ToolTip = "Legacy Speckle v2 Connector",
DisplayName = "$Speckle_Launch_V2.DisplayName"
)
]
[SuppressMessage(
"design",
"CA1812:Avoid uninstantiated internal classes",
Justification = "Instantiated by Navisworks"
)]
internal sealed class RibbonHandler : NAV.Plugins.CommandHandlerPlugin
{
private static bool? s_isV2PluginAvailable; // Nullable to indicate uncached state.
private static bool s_isV2RibbonHidden; // Tracks if the ribbon tab is already hidden.
static RibbonHandler()
{
// Subscribe to the static PluginRecordsChanged event
NAV.ApplicationParts.ApplicationPlugins.PluginRecordsChanged += OnPluginRecordsChanged;
}
private static void OnPluginRecordsChanged(object sender, EventArgs e) => s_isV2PluginAvailable = null;
// ReSharper disable once CollectionNeverQueried.Local
private static readonly Dictionary<NAV.Plugins.Plugin, bool> s_loadedPlugins = [];
/// <summary>
/// Determines whether a command can be executed and manages V2 plugin visibility.
/// Determines the state of a command in Navisworks.
/// </summary>
/// <param name="commandId">The command identifier to check.</param>
/// <returns>A CommandState indicating whether the command can be executed.</returns>
public override NAV.Plugins.CommandState CanExecuteCommand(string commandId)
/// <param name="commandId">The ID of the command to check.</param>
/// <returns>The state of the command.</returns>
public override NAV.Plugins.CommandState CanExecuteCommand(string commandId) =>
commandId == LaunchSpeckleConnector.COMMAND
? new NAV.Plugins.CommandState(true)
: new NAV.Plugins.CommandState(false);
/// <summary>
/// Loads a plugin in Navisworks.
/// </summary>
/// <param name="plugin">The name of the plugin to load.</param>
/// <param name="notAutomatedCheck">Optional. Specifies whether to check if the application is automated. Default is true.</param>
/// <param name="command">Optional. The command associated with the plugin. Default is an empty string.</param>
private static void LoadPlugin(string plugin, bool notAutomatedCheck = true, string command = "")
{
switch (commandId)
{
case SpeckleV3Tool.COMMAND:
return new NAV.Plugins.CommandState(true);
case SpeckleV2Tool.COMMAND:
{
// Find the v2 plugin
NAV.Plugins.PluginRecord? v2Plugin = PluginUtilities.FindV2Plugin();
s_isV2PluginAvailable = v2Plugin != null;
// Pass the plugin to the method for managing ribbon visibility
HideV2RibbonTab();
return new NAV.Plugins.CommandState((bool)s_isV2PluginAvailable);
}
default:
return new NAV.Plugins.CommandState(false);
}
}
private static void HideV2RibbonTab()
{
if (s_isV2RibbonHidden)
{
return; // Skip if already hidden.
}
var v2RibbonTab = Autodesk.Windows.ComponentManager.Ribbon.Tabs.FirstOrDefault(tab =>
tab.Id == SpeckleV2Tool.RIBBON_TAB_ID + SpeckleV2Tool.PLUGIN_SUFFIX
);
if (v2RibbonTab == null)
if (ShouldSkipLoad(notAutomatedCheck))
{
return;
}
Autodesk.Windows.ComponentManager.Ribbon.Tabs.Remove(v2RibbonTab);
s_isV2RibbonHidden = true; // Mark as hidden to avoid redundant calls.
if (ShouldSkipPluginLoad(plugin, command))
{
return;
}
var pluginRecord = NavisworksApp.Plugins.FindPlugin(plugin + ".Speckle");
if (pluginRecord is null)
{
return;
}
var loadedPlugin = pluginRecord.LoadedPlugin ?? pluginRecord.LoadPlugin();
ActivatePluginPane(pluginRecord, loadedPlugin, command);
}
/// <summary>
/// Executes the specified command after validating the Navisworks version.
/// Checks whether the load should be skipped based on the notAutomatedCheck flag and application automation status.
/// </summary>
/// <param name="commandId">The command to execute.</param>
/// <param name="parameters">Additional command parameters.</param>
/// <returns>0 if successful, non-zero otherwise.</returns>
/// <param name="notAutomatedCheck">The flag indicating whether to check if the application is automated.</param>
/// <returns>True if the load should be skipped, False otherwise.</returns>
private static bool ShouldSkipLoad(bool notAutomatedCheck) => notAutomatedCheck && NavisworksApp.IsAutomated;
/// <summary>
/// Checks whether the plugin load should be skipped based on the plugin and command values.
/// </summary>
/// <param name="plugin">The name of the plugin.</param>
/// <param name="command">The command associated with the plugin.</param>
/// <returns>True if the plugin load should be skipped, False otherwise.</returns>
private static bool ShouldSkipPluginLoad(string plugin, string command) =>
string.IsNullOrEmpty(plugin) || string.IsNullOrEmpty(command);
/// <summary>
/// Activates the plugin's pane if it is of the right type.
/// </summary>
/// <param name="pluginRecord">The plugin record.</param>
/// <param name="loadedPlugin">The loaded plugin instance.</param>
/// <param name="command">The command associated with the plugin.</param>
private static void ActivatePluginPane(NAV.Plugins.PluginRecord pluginRecord, object loadedPlugin, string command)
{
if (ShouldActivatePluginPane(pluginRecord))
{
var dockPanePlugin = (NAV.Plugins.DockPanePlugin)loadedPlugin;
dockPanePlugin.ActivatePane();
s_loadedPlugins[dockPanePlugin] = true;
}
else
{
#if DEBUG
ShowPluginInfoMessageBox();
ShowPluginNotLoadedMessageBox(command);
#endif
}
}
/// <summary>
/// Checks whether the plugin's pane should be activated based on the plugin record.
/// </summary>
/// <param name="pluginRecord">The plugin record.</param>
/// <returns>True if the plugin's pane should be activated, False otherwise.</returns>
private static bool ShouldActivatePluginPane(NAV.Plugins.PluginRecord pluginRecord) =>
pluginRecord.IsLoaded && pluginRecord is NAV.Plugins.DockPanePluginRecord && pluginRecord.IsEnabled;
public override int ExecuteCommand(string commandId, params string[] parameters)
{
if (!IsValidVersion())
// ReSharper disable once RedundantAssignment
var buildVersion = string.Empty;
#if NAVIS2020
buildVersion = "2020";
#endif
#if NAVIS2021
buildVersion = "2021";
#endif
#if NAVIS2022
buildVersion = "2022";
#endif
#if NAVIS2023
buildVersion = "2023";
#endif
#if NAVIS2024
buildVersion = "2024";
#endif
#if NAVIS2025
buildVersion = "2025";
#endif
// Version
if (!NavisworksApp.Version.RuntimeProductName.Contains(buildVersion))
{
MessageBox.Show(
"This Add-In was built for Navisworks "
+ buildVersion
+ ", please contact jonathon@speckle.systems for assistance...",
"Cannot Continue!",
MessageBoxButtons.OK,
MessageBoxIcon.Error
);
return 0;
}
switch (commandId)
{
case SpeckleV3Tool.COMMAND:
HandleCommand(SpeckleV3Tool.PLUGIN, commandId);
case LaunchSpeckleConnector.COMMAND:
{
LoadPlugin(LaunchSpeckleConnector.PLUGIN, command: commandId);
break;
}
case SpeckleV2Tool.COMMAND:
HandleCommand(SpeckleV2Tool.PLUGIN, $"{SpeckleV2Tool.PLUGIN}.{SpeckleV2Tool.DEVELOPER_ID}");
break;
default:
{
MessageBox.Show($"You have clicked on an unexpected command with ID = '{commandId}'");
MessageBox.Show("You have clicked on an unexpected command with ID = '" + commandId + "'");
break;
}
}
@@ -124,37 +173,25 @@ internal sealed class RibbonHandler : NAV.Plugins.CommandHandlerPlugin
return 0;
}
private static void HandleCommand(string pluginId, string commandId)
#if DEBUG
/// <summary>
/// Shows a message box displaying plugin information.
/// </summary>
private static void ShowPluginInfoMessageBox()
{
if (PluginUtilities.ShouldSkipLoad(pluginId, commandId, true))
var sb = new StringBuilder();
foreach (var pr in NavisworksApp.Plugins.PluginRecords)
{
return;
sb.AppendLine(pr.Name + ": " + pr.DisplayName + ", " + pr.Id);
}
var pluginRecord = NavisworksApp.Plugins.FindPlugin(pluginId + SpeckleV3Tool.PLUGIN_SUFFIX);
if (pluginRecord == null)
{
return;
}
_ = pluginRecord.LoadedPlugin ?? pluginRecord.LoadPlugin();
PluginUtilities.ActivatePluginPane(pluginRecord);
MessageBox.Show(sb.ToString());
}
private static bool IsValidVersion()
{
if (NavisworksApp.Version.RuntimeProductName.Contains(SpeckleV3Tool.Version.ToString().Replace("v", "")))
{
return true;
}
MessageBox.Show(
$"This Add-In was built for Navisworks {SpeckleV3Tool.Version}, "
+ $"please contact support@speckle.systems for assistance...",
"Cannot Continue!",
MessageBoxButtons.OK,
MessageBoxIcon.Error
);
return false;
}
/// <summary>
/// Shows a message box indicating that the plugin was not loaded.
/// </summary>
/// <param name="command">The command associated with the plugin.</param>
private static void ShowPluginNotLoadedMessageBox(string command) => MessageBox.Show(command + " Plugin not loaded.");
#endif
}
@@ -2,42 +2,36 @@
<ApplicationPackage SchemaVersion="1.0" AutodeskProduct="Navisworks" Name="Speckle for Navisworks"
Description="Welcome to Multiplayer BIM." AppVersion="0.1.0" FriendlyVersion="0.1.0">
<CompanyDetails Name="Speckle"/>
<CompanyDetails Name="Speckle" />
<Components>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw22" SeriesMax="Nw22"/>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw22" SeriesMax="Nw22" />
<ComponentEntry AppName="SpeckleNavisworks" AppType="ManagedPlugin" Version="0.1.0"
ModuleName="./Contents/2025/Speckle.Connectors.Navisworks2025.dll"
AppDescription="Speckle.Connector.Navisworks2025"/>
ModuleName="./Contents/2025/Speckle.Connectors.Navisworks2025.dll" AppDescription="Speckle.Connector.Navisworks2025" />
</Components>
<Components>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw21" SeriesMax="Nw21"/>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw21" SeriesMax="Nw21" />
<ComponentEntry AppName="SpeckleNavisworks" AppType="ManagedPlugin" Version="0.1.0"
ModuleName="./Contents/2024/Speckle.Connectors.Navisworks2024.dll"
AppDescription="Speckle.Connector.Navisworks2024"/>
ModuleName="./Contents/2024/Speckle.Connectors.Navisworks2024.dll" AppDescription="Speckle.Connector.Navisworks2024" />
</Components>
<Components>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw20" SeriesMax="Nw20"/>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw20" SeriesMax="Nw20" />
<ComponentEntry AppName="SpeckleNavisworks" AppType="ManagedPlugin" Version="0.1.0"
ModuleName="./Contents/2023/Speckle.Connectors.Navisworks2023.dll"
AppDescription="Speckle.Connector.Navisworks2023"/>
ModuleName="./Contents/2023/Speckle.Connectors.Navisworks2023.dll" AppDescription="Speckle.Connector.Navisworks2023" />
</Components>
<Components>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw19" SeriesMax="Nw19"/>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw19" SeriesMax="Nw19" />
<ComponentEntry AppName="SpeckleNavisworks" AppType="ManagedPlugin" Version="0.1.0"
ModuleName="./Contents/2022/Speckle.Connectors.Navisworks2022.dll"
AppDescription="Speckle.Connector.Navisworks2022"/>
ModuleName="./Contents/2022/Speckle.Connectors.Navisworks2022.dll" AppDescription="Speckle.Connector.Navisworks2022" />
</Components>
<Components>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw18" SeriesMax="Nw18"/>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw18" SeriesMax="Nw18" />
<ComponentEntry AppName="SpeckleNavisworks" AppType="ManagedPlugin" Version="0.1.0"
ModuleName="./Contents/2021/Speckle.Connectors.Navisworks2021.dll"
AppDescription="Speckle.Connector.Navisworks2021"/>
ModuleName="./Contents/2021/Speckle.Connectors.Navisworks2021.dll" AppDescription="Speckle.Connector.Navisworks2021" />
</Components>
<Components>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw17" SeriesMax="Nw17"/>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw17" SeriesMax="Nw17" />
<ComponentEntry AppName="SpeckleNavisworks" AppType="ManagedPlugin" Version="0.1.0"
ModuleName="./Contents/2020/Speckle.Connectors.Navisworks2020.dll"
AppDescription="Speckle.Connector.Navisworks2020"/>
ModuleName="./Contents/2020/Speckle.Connectors.Navisworks2020.dll" AppDescription="Speckle.Connector.Navisworks2020" />
</Components>
</ApplicationPackage>
@@ -1,10 +0,0 @@
namespace Speckle.Connector.Navisworks.Plugin.Tools;
public static class SpeckleV2Tool
{
public const string COMMAND = "Speckle_Launch_V2";
public const string PLUGIN = "SpeckleUI";
public const string RIBBON_TAB_ID = "SpeckleNavisworks.Speckle";
public const string PLUGIN_SUFFIX = ".Speckle";
public const string DEVELOPER_ID = "Speckle";
}
@@ -1,41 +0,0 @@
using Speckle.Sdk.Host;
namespace Speckle.Connector.Navisworks.Plugin.Tools;
public static class SpeckleV3Tool
{
public const string DEVELOPER_ID = "Speckle";
public const string COMMAND = "Speckle_Launch";
public const string PLUGIN = "SpeckleUI3";
public const string PLUGIN_ID = "SpeckleNavisworksNextGen";
public const string DISPLAY_NAME = "Speckle (Beta)";
public const string RIBBON_TAB_ID = "Speckle";
public const string RIBBON_TAB_DISPLAY_NAME = "Speckle";
public const string RIBBON_STRINGS = "NavisworksRibbon.name";
public const string PLUGIN_SUFFIX = ".Speckle";
public static HostApplication App =>
#if NAVIS
HostApplications.Navisworks;
#else
throw new NotSupportedException();
#endif
public static HostAppVersion Version =>
#if NAVIS2020
HostAppVersion.v2020;
#elif NAVIS2021
HostAppVersion.v2021;
#elif NAVIS2022
HostAppVersion.v2022;
#elif NAVIS2023
HostAppVersion.v2023;
#elif NAVIS2024
HostAppVersion.v2024;
#elif NAVIS2025
HostAppVersion.v2025;
#elif NAVIS2026
HostAppVersion.v2026;
#else
throw new NotSupportedException("This version is not supported");
#endif
}
@@ -1,31 +0,0 @@
using Autodesk.Navisworks.Api.Plugins;
using Speckle.Connector.Navisworks.Plugin.Tools;
namespace Speckle.Connector.Navisworks.Plugin;
internal static class PluginUtilities
{
public static bool ShouldSkipLoad(string plugin, string command, bool notAutomatedCheck) =>
notAutomatedCheck && NavisworksApp.IsAutomated || string.IsNullOrEmpty(plugin) || string.IsNullOrEmpty(command);
internal static PluginRecord? FindV2Plugin()
{
var pluginRecords = NavisworksApp.Plugins.PluginRecords;
var v2Plugin = pluginRecords.FirstOrDefault(p => p.Id == SpeckleV2Tool.RIBBON_TAB_ID);
return v2Plugin ?? null;
}
public static void ActivatePluginPane(PluginRecord? pluginRecord)
{
if (pluginRecord is null || !pluginRecord.IsEnabled || !pluginRecord.IsLoaded)
{
return;
}
if (pluginRecord.LoadedPlugin is DockPanePlugin dockPanePlugin)
{
dockPanePlugin.ActivatePane();
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

@@ -9,51 +9,44 @@
<Import_RootNamespace>Speckle.Connectors.NavisworksShared</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Bindings\NavisworksBasicConnectorBinding.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Bindings\NavisworksSelectionBinding.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Bindings\NavisworksSendBinding.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)DependencyInjection\NavisworksConnectorServiceRegistration.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Extensions\ElementSelectionService.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)GlobalUsing.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)HostApp\NavisworksColorUnpacker.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)HostApp\NavisworksDocumentEvents.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)HostApp\NavisworksDocumentModelStore.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)HostApp\NavisworksMaterialUnpacker.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)NavisworksEvents.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\GeometryNodeMerger.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\NavisworksRootObjectBuilder.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Settings\ConvertHiddenEleementsSetting.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Settings\IncludeInternalPropertiesSetting.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Settings\OriginModeSetting.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Settings\ToSpeckleSettingsManagerNavisworks.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Settings\VisualRepresentationSetting.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Filters\NavisworksSelectionFilter.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)PathConstants.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Plugin\BrowserPane.xaml.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Plugin\DockableConnectorPane.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Plugin\NavisworksRibbon.xaml.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Plugin\Tools\SpeckleV2Tool.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Plugin\Tools\SpeckleV3Tool.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Plugin\Utilities.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Bindings\NavisworksBasicConnectorBinding.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bindings\NavisworksSelectionBinding.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bindings\NavisworksSendBinding.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DependencyInjection\NavisworksConnectorServiceRegistration.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\ElementSelectionService.cs" />
<Compile Include="$(MSBuildThisFileDirectory)GlobalUsing.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\NavisworksColorUnpacker.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\NavisworksDocumentEvents.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\NavisworksDocumentModelStore.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\NavisworksIdleManager.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\NavisworksMaterialUnpacker.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\GeometryNodeMerger.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\NavisworksRootObjectBuilder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Settings\ConvertHiddenEleementsSetting.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Settings\IncludeInternalPropertiesSetting.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Settings\OriginModeSetting.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Settings\ToSpeckleSettingsManagerNavisworks.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Settings\VisualRepresentationSetting.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Filters\NavisworksSelectionFilter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)PathConstants.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Plugin\AppUtils.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Plugin\BrowserPane.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Plugin\Commands.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Plugin\DockableConnectorPane.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Plugin\NavisworksRibbon.xaml.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)Plugin\BrowserPane.xaml"/>
<Content Include="$(MSBuildThisFileDirectory)Plugin\BrowserPane.xaml" />
<Content Include="$(MSBuildThisFileDirectory)Plugin\PackageContents.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="$(MSBuildThisFileDirectory)Plugin\NavisworksRibbon.name">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="$(MSBuildThisFileDirectory)Resources\v2_logo16.png">
<Content Include="$(MSBuildThisFileDirectory)Resources\s2logo16.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="$(MSBuildThisFileDirectory)Resources\v2_logo32.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="$(MSBuildThisFileDirectory)Resources\v3_logo16.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="$(MSBuildThisFileDirectory)Resources\v3_logo32.png">
<Content Include="$(MSBuildThisFileDirectory)Resources\s2logo32.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
@@ -62,4 +55,4 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
</Project>
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{62813838-52F7-43CB-9062-BB2611C00C79}</ProjectGuid>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props"/>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props"/>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets"/>
<Import Project="Speckle.Connectors.NavisworksShared.projitems" Label="Shared"/>
<PropertyGroup Label="Globals">
<ProjectGuid>{62813838-52F7-43CB-9062-BB2611C00C79}</ProjectGuid>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props"/>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props"/>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets"/>
<Import Project="Speckle.Connectors.NavisworksShared.projitems" Label="Shared"/>
</Project>
@@ -192,6 +192,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -287,9 +292,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -297,8 +302,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.logging": {
@@ -308,7 +313,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"speckle.converters.revit2022": {
@@ -345,19 +350,13 @@
"resolved": "2.2.0",
"contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Revit.API": {
@@ -368,9 +367,9 @@
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -380,14 +379,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
}
}
@@ -192,6 +192,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -287,9 +292,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -297,8 +302,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.logging": {
@@ -308,7 +313,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"speckle.converters.revit2023": {
@@ -345,19 +350,13 @@
"resolved": "2.2.0",
"contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Revit.API": {
@@ -368,9 +367,9 @@
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -380,14 +379,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
}
}
@@ -192,6 +192,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -287,9 +292,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -297,8 +302,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.logging": {
@@ -308,7 +313,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"speckle.converters.revit2024": {
@@ -345,19 +350,13 @@
"resolved": "2.2.0",
"contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Revit.API": {
@@ -368,9 +367,9 @@
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -380,14 +379,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
}
}
@@ -177,6 +177,11 @@
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.DoubleNumerics": {
"type": "Transitive",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
@@ -237,9 +242,9 @@
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )",
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.dui": {
@@ -247,8 +252,8 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.255, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.255, )"
"Speckle.Sdk": "[3.1.0-dev.234, )",
"Speckle.Sdk.Dependencies": "[3.1.0-dev.234, )"
}
},
"speckle.connectors.logging": {
@@ -258,7 +263,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.0-dev.234, )"
}
},
"speckle.converters.revit2025": {
@@ -295,19 +300,13 @@
"resolved": "2.2.0",
"contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "vM/aRt+t3yB6JOk+2UdgD40yLiZRFlc5+bUf2dQLbgN4AciSMge3vU6cYnfeV/gMPnQM3XR3Lv9UP/VaLYDwkA==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.0-dev.234"
}
},
"Speckle.Revit.API": {
@@ -318,9 +317,9 @@
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "9MRVpu0bFWeAWE5BFqc+W3eDFmRJPe46TcSFguYcBGebJzdWPgwqyZt4O0vNBXOuM3NSOz8UpZXe1H0vjX4jRg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
@@ -329,14 +328,14 @@
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.0-dev.234"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "koFeWc/EB2XrMH2aKl2Hqwrqk/fAGYEVKgxFlFpnEAsbZf7Kk57gBQ3ViV5l6X9vqMHGWFc4dWUp24diq/XPtQ=="
"requested": "[3.1.0-dev.234, )",
"resolved": "3.1.0-dev.234",
"contentHash": "wx++uIHVTiFEiAYoqhsTfN3yJOBiaV2doXP4pttPC52eWwvhOjThKrcRW/Lx2uWlUC8HcyBA3mBV9GaIl7n+1A=="
}
},
"net8.0-windows7.0/win-x64": {
@@ -1,5 +1,4 @@
using Autodesk.Revit.DB;
using Revit.Async;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Eventing;
using Speckle.Connectors.DUI.Models;
@@ -21,13 +20,13 @@ internal sealed class BasicConnectorBindingRevit : IBasicConnectorBinding
public BasicConnectorBindingCommands Commands { get; }
private readonly DocumentModelStore _store;
private readonly IRevitContext _revitContext;
private readonly RevitContext _revitContext;
private readonly ISpeckleApplication _speckleApplication;
public BasicConnectorBindingRevit(
DocumentModelStore store,
IBrowserBridge parent,
IRevitContext revitContext,
RevitContext revitContext,
ISpeckleApplication speckleApplication,
IEventAggregator eventAggregator
)
@@ -118,7 +117,7 @@ internal sealed class BasicConnectorBindingRevit : IBasicConnectorBinding
{
elementIds = receiverModelCard
.BakedObjectIds.NotNull()
.Select(uid => ElementIdHelper.GetElementIdFromUniqueId(activeUIDoc.Document, uid))
.Select(uid => ElementIdHelper.GetElementIdFromUniqueId(activeUIDoc.Document, uid.Value))
.Where(el => el is not null)
.Cast<ElementId>()
.ToList();
@@ -130,46 +129,38 @@ internal sealed class BasicConnectorBindingRevit : IBasicConnectorBinding
return;
}
await HighlightObjectsOnView(elementIds);
HighlightObjectsOnView(elementIds);
}
/// <summary>
/// Highlights the objects from the given ids.
/// </summary>
/// <param name="objectIds"> UniqueId's of the DB.Elements.</param>
public async Task HighlightObjects(IReadOnlyList<string> objectIds)
public Task HighlightObjects(IReadOnlyList<string> objectIds)
{
var activeUIDoc =
_revitContext.UIApplication?.ActiveUIDocument
?? throw new SpeckleException("Unable to retrieve active UI document");
await HighlightObjectsOnView(
objectIds
.Select(uid => ElementIdHelper.GetElementIdFromUniqueId(activeUIDoc.Document, uid))
.Where(el => el is not null)
.Cast<ElementId>()
.ToList()
)
.ConfigureAwait(false);
HighlightObjectsOnView(
objectIds
.Select(uid => ElementIdHelper.GetElementIdFromUniqueId(activeUIDoc.Document, uid))
.Where(el => el is not null)
.Cast<ElementId>()
.ToList()
);
return Task.CompletedTask;
}
private async Task HighlightObjectsOnView(List<ElementId> objectIds)
private void HighlightObjectsOnView(List<ElementId> objectIds)
{
// POC: don't know if we can rely on storing the ActiveUIDocument, hence getting it each time
var activeUIDoc =
_revitContext.UIApplication?.ActiveUIDocument
?? throw new SpeckleException("Unable to retrieve active UI document");
await RevitTask
.RunAsync(() =>
{
activeUIDoc.Selection.SetElementIds(objectIds);
activeUIDoc.ShowElements(objectIds);
})
.ConfigureAwait(false);
// activeUIDoc.Selection.SetElementIds(objectIds);
// activeUIDoc.ShowElements(objectIds);
// ;
activeUIDoc.Selection.SetElementIds(objectIds);
activeUIDoc.ShowElements(objectIds);
;
}
}

Some files were not shown because too many files have changed in this diff Show More