Compare commits

...

120 Commits

Author SHA1 Message Date
Jedd Morgan 00d59913c2 fix(ci): Add Navisworks 2026 to the build consts (#742)
.NET Build and Publish / build-windows (push) Has been cancelled
.NET Build and Publish / build-linux (push) Has been cancelled
.NET Build and Publish / deploy-installers (push) Has been cancelled
2025-04-08 16:22:26 +01:00
Oğuzhan Koral 373b0e5397 Merge pull request #741 from specklesystems/dev
Update dev into main
2025-04-08 17:47:36 +03:00
Jedd Morgan e9ebe65775 Reworded error message for DataObjects that have no displayValue (#718) 2025-04-08 13:58:23 +00:00
Claire Kuang 249fc40105 feat(rhino): receives properties as user strings (#726)
* adds receiving properties as user strings

* skips props that ends with noisy strings

---------

Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-04-08 13:44:55 +00:00
Jonathon Broughton a81261a0e3 feat(Navisworks): CNX-1582 - Add 2026 support (#731)
* Adds Navisworks 2026 connector

Introduces a new connector for Navisworks 2026, enabling Speckle to interact with the latest version of the software.

This includes project files, dependency configurations, and plugin manifest updates.

* Adds support for unreleased Navisworks version

Adds provisional support for a newer, unreleased version of Navisworks.

Uses a temporary workaround to handle the version number until the official SDK is available.

* Updates Speckle dependencies

Updates the Speckle.Objects, Speckle.Sdk, and Speckle.Sdk.Dependencies packages to version 3.1.8 in the Navisworks connector.

This ensures compatibility and incorporates the latest features and fixes from the Speckle ecosystem.

* Updates Navisworks 2026 support

Uses the correct enum value for the 2026 Navisworks version.

This ensures that the application correctly identifies and supports the
specified version when it becomes available in the SDK.

* Updates WebView2 and adds System.Reactive

Updates the WebView2 package to the latest version.

Adds the System.Reactive package.

* Also lock the converters dependency

* Fix local.sln

---------

Co-authored-by: Adam Hathcock <adam@hathcock.uk>
2025-04-08 13:36:15 +00:00
Björn Steinhagen 6e4894d3bc fix(revit): Enable view-based filtering for multiple linked model instances (#727)
* feat: poc for independant view returns for instance

- next commit will optimise unnecesarry / redundant for loops

* refactor: earlier exit in FindLinkInstanceForDocument

- early exit in FindLinkInstanceForDocument in no transform
- linq expression for matching transform hash
- some docs

---------

Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-04-08 13:14:39 +00:00
kekesidavid e4f1ef8564 Feat(rhino): send filter for layers (#728)
* rhino layers filter implemented

* removed commented out code

* Correct the id and add type as select

* Refresh send filters whenever layer has changed

---------

Co-authored-by: KatKatKateryna <89912278+KatKatKateryna@users.noreply.github.com>
Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
Co-authored-by: oguzhankoral <oguzhankoral@gmail.com>
2025-04-08 08:43:22 +00:00
Dogukan Karatas 2cd7f4f905 applies scale factor (#738) 2025-04-08 07:58:47 +00:00
Claire Kuang c6d06fbda1 feat(rhino): add brep, extursion, subd support to data object to host conversion (#735)
* Update DataObjectConverter.cs

* Update DataObjectConverter.cs
2025-04-07 14:55:24 +00:00
Oğuzhan Koral 6337a9e220 Add type for send filter (#729) 2025-04-07 14:27:41 +00:00
Adam Hathcock 65f97b4f4a Update to SDK 3.1.8 (#734) 2025-04-07 11:15:05 +00:00
KatKatKateryna cf570342d2 feat (revit): receive Region as native FilledRegion (#696)
* regions with failed viewId

* render stuff in the first found suitable view

* use native or fallback conversion depending on the view

* better comments

* implement conditional conversion

* remove comment

* comment

* unload Root Host converter

* fix highlighting the model

* inject PlanView converter

* specify views in which receive is supported

* throw unsupported views in advance

* remove redundant check

* ViewManager added; View check is moved to the beginning of receive operation (to throw once and not for every object)

* simplify and remove unused

---------

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-04-07 04:58:15 +08:00
KatKatKateryna 33e4008e4b fix autocad send region polycurve (#732) 2025-04-04 19:03:56 +08:00
KatKatKateryna bcefe3b4c4 feat (autocad): region and hatches conversions (#681)
* clean send (except closed circular arcs)

* split functions

* include inner loops for complex regions

* reorient only polycurves with arcs

* regions to host

* merge conflict

* substract regions on receive

* optimize

* add checks

* fix icurve, receive hatches

* hatch receive

* reduce dataObject conversions

* finally hatches are recorded in a database

* regrouped

* simplify

* rename

* send hatch (only the first)

* remove hatches for now

* comment

* fixed icurve converter and reference in DataObject converter

* reformat

* hatch to speckle

* hatch to host

* hatch receive works

* set solid pattern on receive

* send properly and throw if complex hacth

* calculate mesh area from region

* prevent Autocad crash by catching exceptions in the middle of transaction

* sending both polylines and curves for hatches

* boolean operation for sending hatches

* turned 2d Hatch curves into 3d - now Brep creation doesn't fail!

* circles handled

* construct both polyline and vertices in parallel

* handling splines on receive

* comments

* don't reverse proper segments

* basic comment fixes

* open block table for write more concise

* use top-level transaction

---------

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-04-01 18:36:04 +08:00
Jedd Morgan 13f3bb8ae5 Merge pull request #723 from specklesystems/jrm/main-dev-merge
Main -> Dev
2025-03-28 14:49:47 +00:00
Jedd Morgan d31cb47a85 Merge branch 'dev' into jrm/main-dev-merge 2025-03-28 14:40:55 +00:00
Björn Steinhagen 378438f1bc fix(revit): respect view visibility in linked models when sending (#716)
* fix(revit): sening via views with correct visibility to linked models

* handle not null

* pass path name to function instead full doc

* refactor: move common code outside

* docs: commenting on known limitations

* refactor: preprocessor directive specific stuff back in place

* refactor: oversight on common code

* fix: method name

* docs: cleanup

---------

Co-authored-by: oguzhankoral <oguzhankoral@gmail.com>
2025-03-27 14:44:11 +03:00
Jedd Morgan b485a4ff6f Don't build everything when zero changes (#715)
.NET Build and Publish / build-windows (push) Has been cancelled
.NET Build and Publish / build-linux (push) Has been cancelled
.NET Build and Publish / deploy-installers (push) Has been cancelled
2025-03-26 15:21:12 +00:00
Jedd Morgan 5697afc292 fix(ifc): Fixed regression with IFC Site geometry not being converted (#712)
* IFC spatial elements now attach geometry as separate data object

* removed unnecessary attribute

* Updated tester for faster testing
2025-03-26 14:57:50 +00:00
Adam Hathcock 07a681eda7 Avoid multiple enumeration issues when saving if we copy the list first (#713) 2025-03-26 13:14:10 +00:00
Adam Hathcock 4ec45d3cd5 Merge pull request #709 from specklesystems/dev
.NET Build and Publish / build-windows (push) Has been cancelled
.NET Build and Publish / build-linux (push) Has been cancelled
.NET Build and Publish / deploy-installers (push) Has been cancelled
Bump sdk to 3.1.7 (#708)
2025-03-25 12:14:05 +00:00
Oğuzhan Koral 939c710bf2 Bump sdk to 3.1.7 (#708)
* Bump sdk to 3.1.7

* missing lock file changes

---------

Co-authored-by: Adam Hathcock <adam@hathcock.uk>
2025-03-25 12:05:00 +00:00
Jedd Morgan ac1345bbaf Merge pull request #703 from specklesystems/dev
Update dev into main
2025-03-25 11:54:03 +00:00
Jedd Morgan 95a7bdb81f Merge pull request #707 from specklesystems/main
Main to dev
2025-03-25 11:46:27 +00:00
Jedd Morgan b1a5824bcd Update pr.yml (#706) 2025-03-25 11:44:08 +00:00
Dimitrie Stefanescu 09f9b1ee51 Revit linked models (#699)
* Bjorn/cnx 1359 have a setting in UI whether include or not (#646)

* feat(revit): linked model settings

* docs: cache invalidation note

* Feat(revit): linked models POC (#656)

* cleanup on RefreshElementsIdsOnSender

* POC for multiple and copied linked models

* fix render materials for copied linked models

* comment

* comment

* split linked models with collections

* style: ci potential null on key

* style: not null

---------

Co-authored-by: Björn <steinhagen.bjoern@gmail.com>

* feat(revit): sending linked model poc round two (#657)

* Added IFC app name (#648)

* test: add tests for threadcontext (#651)

* add tests for threadcontext

* add test for extensions

* remove needed usage

* fix for looking for model store (#654)

Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>

* test: Send Operation tests (#652)

* add tests for threadcontext

* add test for extensions

* remove needed usage

* move cancellation

* Only add send operation tests

---------

Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>

* chore (autocad/civil): add regen after receive (#650)

* regenerates doc

* moves regen to receive base binding

* Update AutocadReceiveBaseBinding.cs

* feat: linked model send responsive to ui

- current throw just a placeholder
- small variable name refactor

* fix: object reference not set to an instance of an object

* fix: display value extractor

* refactor: converterSettings as readonly field

* feat: warning in response to ui setting not enabled

* docs: todos etc.

* Revert "Merge branch 'dev' into bjorn/cnx-1360-get-linked-models-on-send-function-according-to-setting"

This reverts commit 7202058a98, reversing
changes made to 4bc9ec2352.

---------

Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>
Co-authored-by: Adam Hathcock <adamhathcock@users.noreply.github.com>
Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
Co-authored-by: Claire Kuang <kuang.claire@gmail.com>

* fix: transform needed to be inversed (#659)

* feat(revit): linked models send by category (#666)

* docs: notes on collection filtering

* feature: RevitCategoriesFilter with linked models too

poc

* docs: notes

* feat(revit): commit structure (#675)

* feat: collection structure switch

- poc
- if linked models, send nested
- if not linked, send flat

* docs: comments on updates

* docs: comment on exception swallowing

* fix: nullability

* refactor: linked model helper class and refactor (#682)

* fix: premature processing of linked models

- add early check for linked models setting
- skips expensive element collection for linked models when disabled
- add empty document contexts for linked models when disabled to maintain warning generation (HACK)
- improve code readability with clearer variable names and comments

* refactor: category ids outside of linked model processing

- inefficient to repeat for every document

* fix: improve separation of concerns for linked model handling

- extract linked model processing to a dedicated method
- add IsLinkedDocument flag to DocumentToConvert class
- move linked model warning generation to RevitRootObjectBuilder
- make RevitSendBinding responsible only for element collection

* refactor: dedicated LinkedModelHandler class for linked model processing

- extract linked model element collection logic to a separate class
- improve separation of concerns between flow control and element collection
- add clear documentation explaining the responsibility boundaries

* fix: duplicate if check still floating around

* docs: over-explaining myself

* Fix(revit): do not use converter settings in element unpacker (#687)

* fix resetting the selected object ids after collecting the elements

* Pass document to element unpacker for the sake of linked models

* fix: send by categories mode

---------

Co-authored-by: Björn <steinhagen.bjoern@gmail.com>

* fix(revit): handle multiple linked model instances with transform hashing (#688)

* feat: linked model transform caching in RevitRootObjectBuilder

Add transform-specific hashing to properly handle multiple instances of the same linked model. Uses transform properties to create a unique suffix for the applicationId, preventing cached objects from being incorrectly reused across different transform contexts.

* more comments

---------

Co-authored-by: oguzhankoral <oguzhankoral@gmail.com>

* fix: handle null elements when unpacking linked model groups

- add null element check before GroupBy in ElementUnpacker to prevent NullReferenceException
- improve robustness when processing groups in linked models
- add documentation explaining linked model element handling throughout UnpackElements method
- edge case where group member elements might not resolve properly in linked contexts

* make linked model setting true by default

* Fix(revit): illegal attempt to modify document (#700)

* Run refresh object ids in revit task

* Proper not null

* await instead .result

* feat(revit): collection structure for multiple linked model instances  (#701)

* feat: suffix for instances of linked model

* Extract out GetIdFromDocumentToConvert

---------

Co-authored-by: oguzhankoral <oguzhankoral@gmail.com>

* Correct receive default setting for linked models even if irrevelant

* Fix post conflict

* Cleanup the code

* Add comment

---------

Co-authored-by: Björn Steinhagen <steinhagen.bjoern@gmail.com>
Co-authored-by: oguzhankoral <oguzhankoral@gmail.com>
Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>
Co-authored-by: Adam Hathcock <adamhathcock@users.noreply.github.com>
Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-03-25 11:02:29 +00:00
KatKatKateryna 1a687fb188 ignore helper objects on selection (#689) 2025-03-25 00:02:14 +08:00
Dimitrie Stefanescu 30e050fff2 Merge pull request #698 from specklesystems/dimitrie/cnx-614-rhino-8-to-rhino-8-breps-not-working
fix: filter out elems with null geometry
2025-03-24 12:37:57 +00:00
Dimitrie Stefanescu 30ab3b108e fix: filter out elems with null geometry
this is a blind fix: works on bilal's computer, i could not reproduce
2025-03-24 12:29:33 +00:00
Adam Hathcock 1f3ac7a5ad Exclude library assets for all host applications for connectors/converters (#697)
* Exclude runtime assets from autocad 2022-2025

* add exclude to navisworks too

* exclude from remaining csprojs
2025-03-24 11:02:07 +00:00
KatKatKateryna 33e515efb6 feat(rhino): sending region display values as meshes (#685)
* send meshes

* comment

* refactor displayMeshExtractor

* comment

* error message

* comments

* Update HatchToSpeckleConverter.cs

---------

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-03-22 09:21:15 +00:00
jhdempsey86 4a5c91231d Caught error with SpiralDirection (#692)
Caught error with SpiralDirection

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-03-21 09:04:41 +00:00
KatKatKateryna 97a8df93d9 Arcgis send regions (#678)
* send regions

* send meshes

* comment

* typo

* adjust jsons

---------

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-03-19 23:09:55 +08:00
Adam Hathcock 0106befa7d Caches visibility for the lifetime of the send (#672)
* Add selection progress and try/finally for exceptions

* format

* Caches visibility for the lifetime of the send

* clean up
2025-03-18 08:37:46 +00:00
KatKatKateryna ef87d5838b Rhino region conversions (#643)
* rhino hatch; autocad regions

* rhino: attempting to extract mesh

* stick to curves

* POC sending hatches

* receive region

* add tolerance

* change displayValue to curves

* revert autocad changes

* switch to curveConverter, add bbox

* lock files

* remove unused converter

* Revert "lock files"

This reverts commit 9ff42c00fe.

* comment

* remove checks, fix displayValue

* address comments

* remove displayValue

* bbox not required

* update nuget

* Revert "update nuget"

This reverts commit 28e6c30b2c.

* upgraded nuget

* convert Regions from DataObjects on Receive

* small fixes

* check result hatches

* json update

---------

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-03-17 17:16:10 +00:00
Oğuzhan Koral 295162127a Merge pull request #684 from specklesystems/dev
.NET Build and Publish / build-windows (push) Has been cancelled
.NET Build and Publish / build-linux (push) Has been cancelled
.NET Build and Publish / deploy-installers (push) Has been cancelled
Merge dev into main
2025-03-17 17:41:55 +03:00
jhdempsey86 6d336fbac4 fix(Civil3D): Update CorridorDisplayValueExtractor.cs to fix PropertySetDefinitionName error (#669)
* Update CorridorDisplayValueExtractor.cs

For unknown reasons, sometimes trying to get the PropertySetDefinitionName throws an exception.
Updated to catch this, ignore that propery set, and move to the next one. It is never the "Corridor Identity" property set that has this issue, so there should be no missing data.

* .

---------

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-03-17 14:04:36 +00:00
Adam Hathcock 6b2078fadb (feat/fix) Navisworks: Add selection progress and try/finally for exceptions (#671)
* Add selection progress and try/finally for exceptions

* format

---------

Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-03-17 13:53:08 +00:00
Adam Hathcock bfd465449a Bump SDK to 3.1.4 (#683) 2025-03-17 13:00:08 +00:00
Adam Hathcock a9a4893bdb test: Send/Receive Progress tests (#662)
* add tests for receive progress

* add send progress tests

* fmt
2025-03-17 15:09:04 +03:00
Adam Hathcock 21066eebbb Add tests for send caching (#660) 2025-03-17 11:51:07 +00:00
Claire Kuang 9d5ff85cff feat(revit): adds level extractor and levels to revit objects (#679)
* adds level extractor and levels to revit objects

* changes return to null when no level

* bumps sdk
2025-03-17 14:43:30 +03:00
Adam Hathcock 64befa758d fix(Revit) improving revit selection perf (#623)
* Revit allocation improvements

* fmt

* Don't use concurrent bag
2025-03-17 14:31:44 +03:00
Adam Hathcock d9a0cbb4bf Build everything always, only zip affected groups (#677)
* Build everything always, only zip affected groups

* get the dependencies right

* try dependencies again

* can't use affected in enums
2025-03-17 11:02:44 +00:00
Oğuzhan Koral 50807b1e88 Feat(accounts): Add remove account to binding (#680)
* Add remove account to binding

* Remove models as batch
2025-03-15 21:29:36 +03:00
Oğuzhan Koral 7780071073 Fix(autocad): Remove circular dependency (#676)
* Remove circular dependency

* removes polycurve to spline raw converter

---------

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-03-14 20:02:45 +03:00
Jedd Morgan be63b4ab55 public release on tag (#674)
.NET Build and Publish / build-windows (push) Has been cancelled
.NET Build and Publish / build-linux (push) Has been cancelled
.NET Build and Publish / deploy-installers (push) Has been cancelled
* public release on tag

* and nuget
2025-03-14 13:36:32 +00:00
Jedd Morgan 63c5bb26cb Added quotes escape in build (#673) 2025-03-14 13:29:57 +00:00
Adam Hathcock f7a1d98d8a feat: building/publish only affected projects (#665)
.NET Build and Publish / build-windows (push) Has been cancelled
.NET Build and Publish / build-linux (push) Has been cancelled
.NET Build and Publish / deploy-installers (push) Has been cancelled
* Add affected usage with tag math

* use this branch as a test branch

* adjust test

* fix github action

* build refactor to get affected work

* Lazy affected

* put if statement on job

* add conditions around build and publish for linux

* affected tests and small refactor

* fmt

* verbose

* full checkout

* more testing and made things more clear

* adjust installer test branch

* add comments

* use zip on release

* detect main release

* use right trigger for release

* fix build

* maybe fix if statement...version env var don't work

* use current branch, not target branch

* test installer should be stored

* write to github action env vars

* use the env var correctly

* format

* set the output version as before

---------

Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>
2025-03-14 12:37:49 +00:00
Jedd Morgan a14de5bdde File import service now creates branch if one doesn't already exist (#670) 2025-03-14 12:03:11 +00:00
Jedd Morgan a89407ae3c Ignore null properties and empty psets (#668) 2025-03-12 17:51:57 +00:00
Jedd Morgan a3285a4f67 Use 3 instead of 0 for cardinality indicator of triangle faces (#667) 2025-03-12 14:28:49 +00:00
Jedd Morgan ae4b1b0ab5 Merge pull request #655 from specklesystems/jrm/ifc-collections-data-objects
Send IfcProjects, IfcSites, IfcBuildings, and IfcStoreys as Collections
2025-03-12 08:32:30 +00:00
Jedd Morgan ed9d81d206 Better exception messages for breps that fail to meshify (#634) 2025-03-11 16:08:05 +00:00
Adam Hathcock a2fc846613 Remove stack usage to hash (#663) 2025-03-11 12:26:38 +00:00
Adam Hathcock 184953f5f0 Update to SDK 3.1.1 (#658) 2025-03-10 12:52:44 +03:00
Adam Hathcock d71b36c2f7 Sped up Rhino receive hot spots (#596)
* Sped up Rhino receive hot spots

* formatting

---------

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-03-09 17:42:22 +00:00
Claire Kuang f152cff619 chore (autocad/civil): add regen after receive (#650)
* regenerates doc

* moves regen to receive base binding

* Update AutocadReceiveBaseBinding.cs
2025-03-07 14:33:15 +00:00
Adam Hathcock 4aed602089 test: Send Operation tests (#652)
* add tests for threadcontext

* add test for extensions

* remove needed usage

* move cancellation

* Only add send operation tests

---------

Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-03-07 16:44:21 +03:00
Adam Hathcock 63c4d31467 fix for looking for model store (#654)
Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-03-07 13:32:28 +00:00
Adam Hathcock b807be35ff test: add tests for threadcontext (#651)
* add tests for threadcontext

* add test for extensions

* remove needed usage
2025-03-07 16:27:58 +03:00
Jedd Morgan 32ea041c5e Added IFC app name (#648) 2025-03-06 16:22:47 +00:00
Adam Hathcock 950c8373d9 fix: Autocad perf - Adds early exit to idle manager to shortcut call check (#609)
* Refactors idle manager to shortcut call check

* fix tests

* Match the id of idle action with the function name

it is more safe with this way bc we might accidentially skip some deferred actions if we use class name

---------

Co-authored-by: oguzhankoral <oguzhankoral@gmail.com>
2025-03-06 15:10:24 +03:00
Adam Hathcock 9d5faa92e8 feat: Perf testing helpers for Jetbrains (#635)
* add perf project

* formatting

* add perf project to local
2025-03-06 11:04:14 +00:00
KatKatKateryna fd88fc2eeb stop color unpacking (#638)
Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-03-05 20:31:02 +00:00
Jonathon Broughton 9d2ae1ca55 Fix(Navisworks): CNX-1329 - Fix Saved Sets Filter to Properly Handle Nested Folders (#631)
* Improve error messages for object conversion

- Updated exception messages to be more informative based on visibility settings.
- Simplified the logic for throwing exceptions when no model items are found.

* Refactor saved sets filter logic

- Introduced new methods for collecting saved sets and building hierarchical names.
- Simplified selection set resolution with a more concise approach.
- Updated initialisation of items to use arrays instead of lists.
- Improved error handling when resolving GUIDs for selection sets.
2025-03-05 20:25:35 +00:00
Claire Kuang 670a562d48 feat(civil3d): add civil3d receive (#644)
* adds receive to civil3d

* Update AutocadReceiveBaseBinding.cs

* remove usings

* Update Civil3dReceiveBinding.cs
2025-03-05 15:08:46 +00:00
Adam Hathcock e6d983302c Do some stack work to speed up Rhino hotspots (#590)
Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-03-05 14:34:39 +00:00
Jedd Morgan fe5b77e766 Nuget publish only on release (#647) 2025-03-05 12:46:30 +00:00
Björn Steinhagen 663fe445bf Revert "feat(revit): linked model settings (#641)" (#645)
This reverts commit 74d2d2860c.
2025-03-05 15:03:59 +03:00
Björn Steinhagen 74d2d2860c feat(revit): linked model settings (#641)
* feat(revit): linked model settings

* docs: cache invalidation note
2025-03-04 16:35:22 +01:00
Jedd Morgan 2e405b2f28 Don't skip server from IFC importer (#640) 2025-03-04 13:54:50 +00:00
Adam Hathcock 331c631b35 fix: Update SDK to 276 (#637)
* Update SDK to 247

* update to SDK 276
2025-03-04 08:44:23 +00:00
Adam Hathcock ddd6039722 Change targets of common assemblies from NET Standard to platform specific. (#597)
* Update SDK to 257

* remove netstandard2 target from (most) things.  Target net48, net6, and net8

* update to SDK 267

* adjust ifc tester

* Update to SDK 268

* merge fixes
2025-02-27 15:46:15 +00:00
Jedd Morgan 835e3ba005 No files, no success (#608) 2025-02-27 15:04:35 +00:00
Jedd Morgan af548ba626 Fixed duplicate elements (#604)
Co-authored-by: Adam Hathcock <adamhathcock@users.noreply.github.com>
2025-02-27 14:08:10 +00:00
Jedd Morgan 3ff40757e0 Corrected tekla structures slug (#632) 2025-02-27 10:52:55 +00:00
Claire Kuang a8571fdd61 detaches featurelines so they are queryable (#627) 2025-02-27 13:41:59 +03:00
Oğuzhan Koral f8a6d27c6d revert revit task back for highlight view (#629) 2025-02-26 18:29:56 +00:00
Dogukan Karatas 4e1604f77e updates after build (#628) 2025-02-26 18:17:44 +00:00
Adam Hathcock 00af4ad338 fix: Use a concurrent dictionary to cache types since the converter is effectively a singleton (#624)
* Use a concurrent dictionary to cache types since the converter is effectively a singleton

* Don't modify the collection in the getter

---------

Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-02-26 20:34:06 +03:00
Jonathon Broughton 7fed9e03e9 enhancement(Navisworks): CNX-972 - less aggressive object merging (#622)
* Remove unused path constants and update namespace

Deleted an unnecessary file for path constants. Updated the namespace in the remaining file to better reflect its purpose and added a new constant for material separation.

* Remove unused send filters

- Deleted the send filters list and related parameters from the constructor.
- Cleaned up code to streamline the binding process.
- Updated comments for clarity on behaviour expectations.

* Update Navisworks object creation logic

- Added extraction of parent path from the group key.
- Changed applicationId to use the parent path instead of the group key.

* Add path cleaning method and simplify geometry resolution

- Introduced `GetCleanPath` to remove material signatures from paths.
- Updated `ResolveIndexPathToModelItem` to use the new path cleaning method.
- Simplified `ResolveGeometryLeafNodes` to use expression-bodied member syntax.

* Improve geometry node grouping logic

- Added material signature handling for merging nodes.
- Enhanced grouping to only include anonymous geometry nodes.
- Introduced a method to create material signatures based on properties.
- Updated the parent path extraction from composite keys.

* Added an extendable signature generation pattern

- Simplified the grouping of anonymous geometry nodes.
- Replaced material signature generation with a new method for better clarity.
- Added functionality to include additional material properties in the signature.
- Improved hash generation for consistent property representation.

* Update material separator in path constants

Changed the material separator from "::MATERIAL::" to "::". This simplifies the constant and may improve compatibility with other components.

* Changed how the parent path is derived from the group key.

- Introduced a cleaner method to get the parent path.
- Updated applicationId to use the full composite key for uniqueness.

* Updated node path retrieval to use a more concise method.

- Simplified the creation of `mergedIds` by using a single variable for group keys.
- Removed unnecessary comments and whitespace for cleaner code.

* Add missing import for Navisworks constants

Included the Navisworks constants import to ensure proper functionality.

* Replaced custom hash function with MD5, suppressing related warnings.
2025-02-26 14:25:09 +00:00
KatKatKateryna e9c2c85a7f Arcgis detailed progress and cancellation (#614)
* pass cancellation token to individual features

* move count to a separate function

* remove per-layer progress report

* fix count

* reorder

* count layers only once

* move count to "unpacking selection" activityFactory

* remove outdated comment
2025-02-26 18:16:00 +08:00
Jonathon Broughton 82c7877425 Refine property handling logic (#621)
- Excluded "Transform" category from processing.
- Added a list of excluded properties: "Hidden", "Required", "Internal_Type".
- Improved handling for the "Item" category to add non-excluded properties directly to root level.
- Ensured only non-empty property dictionaries are processed.
2025-02-25 14:52:48 +00:00
Jonathon Broughton 2338be46c2 feat(Navisworks): CNX-1065 Enable optional full hierarchy mode (#616)
* Add preserve model hierarchy feature

- Introduced PreserveModelHierarchySetting to manage hierarchy preservation.
- Updated NavisworksSendBinding to include new setting.
- Added HierarchyBuilder class for future functionality.
- Enhanced ToSpeckleSettingsManagerNavisworks with caching for the new setting.
- Modified conversion settings to support model hierarchy preservation.

* Add Navisworks hierarchy builder class

Implemented a new class to rebuild the Navisworks document hierarchy from geometry leaves, maintaining parent-child relationships. Key updates include:
- Added constructor and private fields for managing geometry and conversion services.
- Developed a method to build the hierarchical structure of Speckle objects.
- Implemented logic for climbing up the document structure to resolve missing ancestors.
- Introduced methods for converting model items and pruning empty collections.

* Refactor hierarchy handling in object builder

- Added support for preserving model hierarchy.
- Introduced a new hierarchy builder for nested structures.
- Adjusted flow to handle flat mode when hierarchy is not needed.

* Refactor model item conversion logic

- Simplified the conversion method for Navisworks ModelItem.
- Consolidated geometry and non-geometry object creation into single methods.
- Added parameter for property handler to streamline property retrieval.
- Improved clarity by reducing redundancy in code structure.

* Refactor hierarchy builder for cleaner conversion

- Replaced custom conversion method with a direct call to the converter.
- Removed redundant code related to converting ModelItem to Speckle Collection.
- Streamlined the process of handling model items in the hierarchy.

* Remove unnecessary comment in hierarchy builder

Cleaned up the code by deleting a redundant comment about resolving ModelItem from a path string. This helps improve readability without losing any functionality.
2025-02-25 14:40:52 +00:00
Adam Hathcock 8f72eb35d3 fix(Revit): Catch exceptions and reprocess them around RevitTask (#617)
* Catch exceptions and reprocess them around RevitTask

* Added SpeckleRevitTaskException to know when exceptions are jumping over revit task to handle the UI

* add comments

* Add fatch when

---------

Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-02-25 16:54:10 +03:00
Oğuzhan Koral a3f7069c37 Feat(navis): send filter dropdown navis poc (#619)
* Add Saved Sets Filter

* formatting

* !!!

* fml

* Unclear why formatting rules are not being applied

* !!!

* !

* fixed?

* Add new filter for saved sets in Navisworks

- Included a new file for NavisworksSavedSetsFilter.

* POC ISendFilterSelect

* Align saved sets filtler with ISendFilterSelect

* No DI for send filters

* reverse condition

* Remove ISendFilterSelect from revit views

* Add notes

* Improve object selection error handling

- Updated logic for retrieving model items to use selected paths.
- Enhanced error messages based on visibility settings of objects.
- Simplified null checks for selected items in filters.

---------

Co-authored-by: Jonathon Broughton <jonathon@stardotbmp.com>
2025-02-25 12:56:38 +00:00
Dogukan Karatas 3842e109b6 feat(tekla): speckle ribbon (#612)
* adds a ribbon

* updates speckle.svg

* updates logo

---------

Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-02-25 08:14:17 +01:00
Claire Kuang 4ae2106608 fixes pointcloud plane bug (#615) 2025-02-21 17:30:25 +00:00
Claire Kuang 3656587081 fix(autocad/Rhino): add support for receiving any convertible geometry in dataobject display values (#599)
* adds additional geometry conversions to autocad and rhino

* removes unused converters

* fixes zip bug

---------

Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-02-21 19:17:23 +03:00
Claire Kuang b315cebf3a fix(revit): missing directshape geo and other geometry fixes (#611)
* Claire/revit areas curves fix (#610)

* fixes display values for get_geometry method, and changes modelcurves to be sent as revitobject

also removes `level` prop in objects and adds the units and elevation to the level collection instead

* Update Speckle.Converters.RevitShared.projitems

* removes top level pointcloud converter

* Update RevitElementTopLevelConverterToSpeckle.cs
2025-02-21 18:18:07 +03:00
Oğuzhan Koral fb18466aba Source application should be app name and version (#613) 2025-02-20 21:30:23 +03:00
Jonathon Broughton b721c2fb31 fix(Navisworks): CNX-1299 Navisworks properties cleanup and NavisworksObject adoption (#607)
* Update property handling interface

Changed method to retrieve properties from Navisworks model items. Updated the method signature for clarity and improved functionality.

* Add property retrieval method to handler

Implemented a new method for getting properties from model items. It processes property sets and returns a dictionary of category values, enhancing the functionality of the property handler.

* Fix namespace formatting and improve property handling

- Cleaned up the namespace declaration.
- Added a check to ensure properties are a dictionary before processing.
- Streamlined property validation logic for better clarity.

* Simplified the `AddModelProperties` method signature by reducing parameters.

* Refactor property handling in base class

- Added a new method to retrieve properties from model items.
- Simplified the structure of processed property sets by removing nested dictionaries.

* Add hierarchical property retrieval method

Implemented a new method to get properties from model items.
- Introduced `GetProperties` to collect and filter hierarchical properties.
- Enhanced data handling with improved dictionary management for properties.

* Fix namespace formatting issues

Updated the namespace declarations in property handler files to ensure proper formatting.

* Refactor model item conversion logic

- Updated the method for converting Navisworks ModelItems.
- Simplified the creation of non-geometry objects.
- Removed unnecessary property handling code.
- Enhanced clarity by restructuring return values.

* Refactor model item conversion logic

- Simplified the conversion method for model items.
- Added a new method to handle geometry objects.
- Introduced property handling based on user settings.
- Improved clarity and maintainability of the code.

* Refactor geometry property handling

- Updated comments to clarify property merging rules.
- Removed unused methods for creating geometry and non-geometry objects.
- Simplified code structure for better readability.

* Refactor conversion method for brevity

Streamlined the `Convert` method to use an expression-bodied member. Removed unnecessary null check block and simplified the logic for better readability.

* Fix import statement formatting

Updated the import statement for consistency by removing an invisible character.

* Add class properties handling to property dictionaries

- Integrated class properties extraction into both property handlers.
- Updated logic to add or update entries in the property dictionaries based on extracted class properties.
- Ensured null checks for class properties before processing.

* Refactor property handling methods

- Removed the AssignPropertySets method for simplification.
- Streamlined GetProperties to directly return processed property sets.
- Cleaned up unnecessary checks and loops for better readability.

* Add ClassPropertiesExtractor to service registration

- Registered a new ClassPropertiesExtractor for better property handling.
- Kept existing property handlers and settings management intact.

* Refactor HierarchicalPropertyHandler for clarity

- Removed redundant property assignment logic.
- Integrated class properties extraction directly into the main method.
- Simplified error handling by eliminating unnecessary checks.

* Refactor property assignment methods

Removed the AssignProperties and AssignClassProperties methods to streamline property handling. Kept the abstract method for getting properties while maintaining the overall structure of the class.

* Refactor ClassPropertiesExtractor to instance method

Changed ClassPropertiesExtractor from static to instance class. Updated GetClassProperties method to be an instance method, allowing for better flexibility and potential state management in the future.
2025-02-20 09:52:30 +00:00
Claire Kuang 76aa953210 moves class properties to top level of properties dictionary (#606) 2025-02-19 17:05:38 +00:00
Jedd Morgan 52d15dc827 add support for vertex normals in rhino (#605) 2025-02-19 12:11:06 +00:00
Björn Steinhagen dbbc4f7fcd fix(revit): use correct unit-specific scaling for material quantities (#602) 2025-02-19 08:21:19 +00:00
Oğuzhan Koral 85b4a88407 Merge pull request #600 from specklesystems/dogukan/tekla-runtime-fix
fix(tekla): remove runtime identifier
2025-02-19 03:04:59 +03:00
Dogukan Karatas 65a2e674bb removes runtime identifier 2025-02-19 00:58:30 +01:00
Dimitrie Stefanescu 9a84e4469e Merge pull request #598 from specklesystems/dimitrie/cnx-1186-revit-rooms-not-visible-in-the-viewer
feat: moving back to translucid rooms.
2025-02-18 17:07:42 +00:00
Dimitrie Stefanescu b8a49d5fed feat: moving back to translucid rooms.
now people will be angry they cannot select furniture in some cases.
2025-02-18 17:01:36 +00:00
Dogukan Karatas 12dcf471d3 fix (tekla): updates the vebview2 dependency (#562)
* updates webview dependencies

* updates csproj

---------

Co-authored-by: Adam Hathcock <adamhathcock@users.noreply.github.com>
Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-02-18 19:08:26 +03:00
Claire Kuang 42e45affbd refactor(civil3d): properties cleanup (#588)
* Cleans civil3d props

also removes catchment and network proxies. this info is now captured in assignments

* Update ClassPropertiesExtractor.cs

* some bug fixes

* Update PartDataExtractor.cs

* adds parcel areas and excludes labels
2025-02-18 16:38:20 +01:00
Dimitrie Stefanescu fcce4e3f63 feat: adds support for formulas in user strings (#594)
Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-02-18 15:15:08 +00:00
Claire Kuang 370c5b2064 adds area boundary segments to display value of area (#592) 2025-02-18 15:06:54 +00:00
Claire Kuang 39dfb0f426 removes assignment of bearing to z (#593) 2025-02-18 14:53:58 +00:00
Adam Hathcock 1c62fbbe99 Update SDK to 268 (#567)
* Update SDK to 257

* update to SDK 267

* adjust ifc tester

* Update to SDK 268

* update SDK version to 270
2025-02-18 10:14:55 +00:00
Jedd Morgan 6f03aa8678 Jedd's IFC improvements (#510)
* ifc safe

* reverted LibraryImport as it would need more testing

* IFC app ids
2025-02-17 16:35:26 +00:00
Björn Steinhagen f882b0f5bd fix(etabs): ensure csi operations run on main thread to prevent etabs exceptions (#589)
* fix: ensure operations run on main thread to prevent etabsexceptions

* pr comments

* fix: ensure consistent exception handler usage in selection binding
2025-02-17 11:53:21 +01:00
Björn Steinhagen 4ffe9fe4b0 feat(revit): extract material type enum on structural asset (#586)
* feat: material type distinction

* refactor: mixed concerns

Some structural asset stuff was in the MaterialQuantitiesToSpeckle.cs

---------

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-02-14 11:24:24 +00:00
Claire Kuang d50b095683 refactor(revit): properties cleanup (#581)
* clean properties in revit

also adds properties to non-dataobjects and changes grids to have a curve display value after removing curve prop on grids

* removes number from room since this is included in params

* refactors supported categories and throws when all selected objects are unsupported categories

* stupid typos

---------

Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
2025-02-14 09:49:51 +00:00
Dimitrie Stefanescu daebbbef1c Merge pull request #587 from specklesystems/adam/cnx-1238-rhino-8-restarting-during-an-operation-throws-with-key-not
fix: (cancellation manager should return cancelled token instead of throwing exception)
2025-02-13 12:18:05 +00:00
Adam Hathcock b43631e46b fix and add tests 2025-02-13 10:54:49 +00:00
Adam Hathcock ea9768b1f2 check tokens more aggressively when doing operations 2025-02-13 10:50:12 +00:00
Adam Hathcock 2756555eb9 Cancellation manager shouldn't throw on get 2025-02-13 10:49:15 +00:00
Adam Hathcock 1f1422900e Adam/cnx 1217 arcgis toc not unblocked after cancellation during (#580)
* Send with QueuedTask

* more QueuedTask usage and format

* Fix highlight/selection changes
2025-02-13 09:32:10 +00:00
Dimitrie Stefanescu 45a76eada4 Dimitrie/cnx 1240 receiving materials in rhino 8 broken for layers (#585)
* reverts previous fix

* fix: applies the minimal fix

* chore: adds comment for future

---------

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
2025-02-12 18:54:16 +00:00
Björn Steinhagen 0e65b6aa57 feat(etabs): geometric properties through new cDatabaseTable extractor (#584)
* feature: database table extractor

* feature: frame length extraction

* feat: shell area extraction

* feat: frame length extraction

* feat: shell area extraction

* docs: cleaned up object extractors

* refactor: extensible database table extraction

* flexible indexing (can be defined by user, defaults to typical use-case of "UniqueName")
* better variable naming and more descriptive (better than csi's api)
* some fail safes e.g. when forgetting to put indexingColumn in array of columns to fetch

* refactor: using DatabaseTableExtractor for material name lookup

* lookup for material name of a shell can use the database table extractor and simplifies EtabsShellPropertiesExtractor a lot

* fix: openings shouldn't look for material assignments

Frustrating way Etabs handles openings - they shouldn't be a SHELL. Anyways. Rant over

* refactor: database table extractor handles dictionary lookups
2025-02-12 18:43:44 +00:00
Dimitrie Stefanescu 5c2c0ff303 Merge pull request #582 from specklesystems/dimitrie/cnx-1239-rhino-fix-the-documentisinit-post-copy-paste
Rhino: fixes change detection post copy paste events
2025-02-12 15:00:32 +00:00
Dimitrie Stefanescu a6fd4547ea feat: adds previous dix 2025-02-12 14:38:47 +00:00
Adam Hathcock 0d27eadfeb add deep clean local docs (#579) 2025-02-11 14:06:12 +00:00
364 changed files with 12696 additions and 4509 deletions
+3 -3
View File
@@ -9,10 +9,10 @@
],
"rollForward": false
},
"gitversion.tool": {
"version": "6.0.2",
"dotnet-affected": {
"version": "5.0.0",
"commands": [
"dotnet-gitversion"
"dotnet-affected"
],
"rollForward": false
}
+3 -3
View File
@@ -1,9 +1,7 @@
name: .NET Build
on:
pull_request: # Run build on every pull request that is not to main
branches-ignore:
- main
pull_request
jobs:
build:
@@ -34,6 +32,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
+13 -16
View File
@@ -2,12 +2,14 @@ name: .NET Build and Publish
on:
push:
branches: ["main", "dev", "release/*"] # Continuous delivery on every long-lived branch
branches: ["main", "installer-test/**"]
tags: ["v3.*"] # Manual delivery on every 3.x tag
jobs:
build-windows:
runs-on: windows-latest
env:
SPECKLE_VERSION: "unset"
outputs:
version: ${{ steps.set-version.outputs.version }}
steps:
@@ -27,38 +29,35 @@ jobs:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
- name: ⚒️ Run GitVersion on Windows
run: ./build.ps1 build-server-version
- name: ⚒️ Run build on Windows
run: ./build.ps1
run: ./build.ps1 zip
- name: ⬆️ Upload artifacts
uses: actions/upload-artifact@v4
with:
name: output-${{ env.GitVersion_FullSemVer }}
name: output-${{ env.SPECKLE_VERSION }}
path: output/*.*
compression-level: 0 # no compression
if-no-files-found: error
retention-days: 1
compression-level: 0 # no compression
- id: set-version
name: Set version to output
run: echo "version=${{ env.GitVersion_FullSemVer }}" >> "$Env:GITHUB_OUTPUT"
run: echo "version=${{ env.SPECKLE_VERSION }}" >> "$Env:GITHUB_OUTPUT"
deploy-installers:
runs-on: ubuntu-latest
needs: build-windows
env:
IS_TAG_BUILD: ${{ github.ref_type == 'tag' }}
IS_RELEASE_BRANCH: ${{ startsWith(github.ref_name, 'release/') || github.ref_name == 'main'}}
IS_PUBLIC_RELEASE: ${{ github.ref_type == 'tag' }}
IS_TEST_INSTALLER: ${{ github.ref_type != 'tag' }}
steps:
- name: 🔫 Trigger Build Installers
uses: ALEEF02/workflow-dispatch@v3.0.0
continue-on-error: true
with:
workflow: Build Installers
repo: specklesystems/connector-installers
token: ${{ secrets.CONNECTORS_GH_TOKEN }}
inputs: '{ "run_id": "${{ github.run_id }}", "version": "${{ needs.build-windows.outputs.version }}", "public_release": ${{ env.IS_TAG_BUILD }}, "store_artifacts": ${{ env.IS_RELEASE_BRANCH }} }'
inputs: '{ "run_id": "${{ github.run_id }}", "version": "${{ needs.build-windows.outputs.version }}", "public_release": ${{ env.IS_PUBLIC_RELEASE }}, "store_artifacts": ${{ env.IS_TEST_INSTALLER }} }'
ref: main
wait-for-completion: true
wait-for-completion-interval: 10s
@@ -89,9 +88,6 @@ jobs:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
- name: ⚒️ Run GitVersion on Linux
run: ./build.sh build-server-version
- name: ⚒️ Run tests on Linux
run: ./build.sh test-only
@@ -105,4 +101,5 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Push to nuget.org
if: (github.ref_type == 'tag')
run: dotnet nuget push output/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{secrets.CONNECTORS_NUGET_TOKEN }} --skip-duplicate
+116
View File
@@ -0,0 +1,116 @@
using GlobExpressions;
using Microsoft.Build.Construction;
using static SimpleExec.Command;
namespace Build;
public static class Affected
{
public static readonly string Root = Environment.CurrentDirectory;
public const string AFFECTED_PROJECT = "affected.proj";
private static IEnumerable<string> GetAffectedProjects()
{
var projFile = Path.Combine(Root, AFFECTED_PROJECT);
Console.WriteLine("Affected project file: " + projFile);
var project = ProjectRootElement.Open(projFile) ?? throw new InvalidOperationException();
var references = project.ItemGroups.SelectMany(x => x.Items).Where(x => x.ItemType == "ProjectReference");
foreach (var refe in references)
{
var referencePath = refe.Include[(Root.Length + 1)..];
referencePath = Path.GetDirectoryName(referencePath) ?? throw new InvalidOperationException();
if (Path.DirectorySeparatorChar != '/')
{
referencePath = referencePath.Replace(Path.DirectorySeparatorChar, '/');
}
yield return referencePath;
}
}
public static async Task<IEnumerable<string>> GetTestProjects()
{
await ComputeAffected();
var projFile = Path.Combine(Root, AFFECTED_PROJECT);
if (File.Exists(projFile))
{
var references = GetAffectedProjects();
return references.Where(x => x.Contains("Tests"));
}
return Glob.Files(Root, "**/*.Tests.csproj");
}
public static async Task<ProjectGroup[]> GetAffectedProjectGroups()
{
await ComputeAffected();
var projFile = Path.Combine(Root, AFFECTED_PROJECT);
if (File.Exists(projFile))
{
var references = GetAffectedProjects().ToList();
var groups = new List<ProjectGroup>();
foreach (var projectGroup in Consts.ProjectGroups)
{
foreach (var referencePath in references)
{
if (projectGroup.Projects.Any(x => x.ProjectPath.Contains(referencePath)))
{
groups.Add(projectGroup);
break;
}
}
}
foreach (var group in groups)
{
Console.WriteLine("Affected project group being built: " + group.HostAppSlug);
}
return groups.ToArray();
}
Console.WriteLine("Using all project groups: " + string.Join(',', Consts.ProjectGroups));
return Consts.ProjectGroups;
}
private static bool s_affectedComputed;
public static async Task ComputeAffected()
{
if (s_affectedComputed)
{
return;
}
var currentTag = await Versions.GetCurrentTag();
var currentVersion = await Versions.ComputeVersion();
var lastTag = await Versions.GetPreviousTag(currentTag);
var lastVersion = await Versions.ComputePreviousVersion(currentTag);
Console.WriteLine($"Last tag: {lastTag}, Current tag: {currentTag}");
Console.WriteLine($"Last parsed version: {lastVersion}, Current parsed version: {currentVersion}");
var sort = currentVersion.CompareSortOrderTo(lastVersion);
if (sort == -1)
{
Console.WriteLine($"Current version {currentVersion} is less than: {lastVersion}");
s_affectedComputed = true;
return;
}
var majorEquals = currentVersion.Major == lastVersion.Major;
if (!majorEquals)
{
Console.WriteLine($"Current version {currentVersion} is not matching major version: {lastVersion}");
s_affectedComputed = true;
return;
}
//use tags no matter the version if major versions match
var (currentCommit, _) = await ReadAsync("git", $"rev-list -n 1 {currentTag}");
var (lastCommit, _) = await ReadAsync("git", $"rev-list -n 1 {lastTag}");
await RunAsync("dotnet", $"affected -v --from {currentCommit.Trim()} --to {lastCommit.Trim()}", Root);
s_affectedComputed = true;
}
}
+1
View File
@@ -10,6 +10,7 @@
<PackageReference Include="Bullseye" />
<PackageReference Include="Glob" />
<PackageReference Include="Microsoft.Build" />
<PackageReference Include="Semver" />
<PackageReference Include="SimpleExec" />
</ItemGroup>
</Project>
+5 -4
View File
@@ -4,7 +4,7 @@ public static class Consts
{
public static readonly string[] Solutions = ["Speckle.Connectors.sln"];
public static readonly InstallerProject[] InstallerManifests =
public static readonly ProjectGroup[] ProjectGroups =
{
new("arcgis", [new("Connectors/ArcGIS/Speckle.Connectors.ArcGIS3", "net6.0-windows")]),
new(
@@ -49,11 +49,12 @@ public static class Consts
new("Connectors/Navisworks/Speckle.Connectors.Navisworks2022", "net48"),
new("Connectors/Navisworks/Speckle.Connectors.Navisworks2023", "net48"),
new("Connectors/Navisworks/Speckle.Connectors.Navisworks2024", "net48"),
new("Connectors/Navisworks/Speckle.Connectors.Navisworks2025", "net48")
new("Connectors/Navisworks/Speckle.Connectors.Navisworks2025", "net48"),
new("Connectors/Navisworks/Speckle.Connectors.Navisworks2026", "net48")
]
),
new(
"tekla-structures",
"teklastructures",
[
new("Connectors/Tekla/Speckle.Connector.Tekla2023", "net48"),
new("Connectors/Tekla/Speckle.Connector.Tekla2024", "net48")
@@ -69,7 +70,7 @@ public static class Consts
};
}
public readonly record struct InstallerProject(string HostAppSlug, IReadOnlyList<InstallerAsset> Projects)
public readonly record struct ProjectGroup(string HostAppSlug, IReadOnlyList<InstallerAsset> Projects)
{
public override string ToString() => $"{HostAppSlug}";
}
+82 -78
View File
@@ -12,13 +12,12 @@ const string TEST = "test";
const string TEST_ONLY = "test-only";
const string FORMAT = "format";
const string ZIP = "zip";
const string VERSION = "version";
const string RESTORE_TOOLS = "restore-tools";
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";
const string DETECT_AFFECTED = "detect-affected";
//need to pass arguments
/*var arguments = new List<string>();
@@ -34,14 +33,14 @@ void Build(string solution, string configuration)
Console.WriteLine();
Console.WriteLine($"Building solution '{solution}' as '{configuration}'");
Console.WriteLine();
Run("dotnet", $"build .\\{solution} --configuration {configuration} --no-restore");
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");
Run("dotnet", $"restore \".\\{solution}\" --no-cache");
}
void DeleteFiles(string pattern)
{
@@ -125,17 +124,6 @@ Target(
}
);
Target(
VERSION,
async () =>
{
var (output, _) = await ReadAsync("dotnet", "minver -v w");
output = output.Trim();
Console.WriteLine($"Version: {output}");
Run("echo", $"\"version={output}\" >> $GITHUB_OUTPUT");
}
);
Target(
RESTORE_TOOLS,
() =>
@@ -144,6 +132,18 @@ Target(
}
);
Target(
DETECT_AFFECTED,
DependsOn(RESTORE_TOOLS),
async () =>
{
foreach (var group in await Affected.GetAffectedProjectGroups())
{
Console.WriteLine("Affected project group being built: " + group.HostAppSlug);
}
}
);
Target(
FORMAT,
DependsOn(RESTORE_TOOLS),
@@ -155,20 +155,14 @@ Target(
Target(
RESTORE,
DependsOn(FORMAT),
DependsOn(FORMAT, DETECT_AFFECTED),
Consts.Solutions,
s =>
async s =>
{
Run("dotnet", $"restore {s} --locked-mode");
}
);
Target(
BUILD_SERVER_VERSION,
DependsOn(RESTORE_TOOLS),
() =>
{
Run("dotnet", "tool run dotnet-gitversion /output json /output buildserver");
var version = await Versions.ComputeVersion();
var fileVersion = await Versions.ComputeFileVersion();
Console.WriteLine($"Restoring: {s} - Version: {version} & {fileVersion}");
await RunAsync("dotnet", $"restore \"{s}\" --locked-mode");
}
);
@@ -176,14 +170,14 @@ Target(
BUILD,
DependsOn(RESTORE),
Consts.Solutions,
s =>
async s =>
{
var version = Environment.GetEnvironmentVariable("GitVersion_FullSemVer") ?? "3.0.0-localBuild";
var fileVersion = Environment.GetEnvironmentVariable("GitVersion_AssemblySemFileVer") ?? "3.0.0.0";
Console.WriteLine($"Version: {version} & {fileVersion}");
Run(
var version = await Versions.ComputeVersion();
var fileVersion = await Versions.ComputeFileVersion();
Console.WriteLine($"Restoring: {s} - Version: {version} & {fileVersion}");
await RunAsync(
"dotnet",
$"build {s} -c Release --no-restore -warnaserror -p:Version={version} -p:FileVersion={fileVersion} -v:m"
$"build \"{s}\" -c Release --no-restore -warnaserror -p:Version={version} -p:FileVersion={fileVersion} -v:m"
);
}
);
@@ -193,23 +187,26 @@ Target(CHECK_SOLUTIONS, Solutions.CompareConnectorsToLocal);
Target(
TEST,
DependsOn(BUILD, CHECK_SOLUTIONS),
Glob.Files(".", "**/*.Tests.csproj"),
file =>
async () =>
{
Run("dotnet", $"test {file} -c Release --no-build --no-restore --verbosity=minimal");
foreach (var s in await Affected.GetTestProjects())
{
await RunAsync("dotnet", $"test \"{s}\" -c Release --no-build --no-restore --verbosity=minimal");
}
}
);
//all tests on purpose
Target(
TEST_ONLY,
DependsOn(FORMAT),
Glob.Files(".", "**/*.Tests.csproj"),
file =>
{
Run("dotnet", $"build {file} -c Release --no-incremental");
Run("dotnet", $"build \"{file}\" -c Release --no-incremental");
Run(
"dotnet",
$"test {file} -c Release --no-build --verbosity=minimal /p:AltCover=true /p:AltCoverAttributeFilter=ExcludeFromCodeCoverage /p:AltCoverVerbosity=Warning"
$"test \"{file}\" -c Release --no-build --verbosity=minimal /p:AltCover=true /p:AltCoverAttributeFilter=ExcludeFromCodeCoverage /p:AltCoverVerbosity=Warning"
);
}
);
@@ -218,20 +215,20 @@ Target(
BUILD_LINUX,
DependsOn(FORMAT),
Glob.Files(".", "**/Speckle.Importers.Ifc.csproj"),
file =>
async file =>
{
Run("dotnet", $"restore {file} --locked-mode");
var version = Environment.GetEnvironmentVariable("GitVersion_FullSemVer") ?? "3.0.0-localBuild";
var fileVersion = Environment.GetEnvironmentVariable("GitVersion_AssemblySemFileVer") ?? "3.0.0.0";
await RunAsync("dotnet", $"restore \"{file}\" --locked-mode");
var version = await Versions.ComputeVersion();
var fileVersion = await Versions.ComputeFileVersion();
Console.WriteLine($"Version: {version} & {fileVersion}");
Run(
await RunAsync(
"dotnet",
$"build {file} -c Release --no-restore -warnaserror -p:Version={version} -p:FileVersion={fileVersion} -v:m"
$"build \"{file}\" -c Release --no-restore -warnaserror -p:Version={version} -p:FileVersion={fileVersion} -v:m"
);
RunAsync(
await RunAsync(
"dotnet",
$"pack {file} -c Release -o output --no-build -p:Version={version} -p:FileVersion={fileVersion} -v:m"
$"pack \"{file}\" -c Release -o output --no-build -p:Version={version} -p:FileVersion={fileVersion} -v:m"
);
}
);
@@ -239,47 +236,54 @@ Target(
Target(
ZIP,
DependsOn(TEST),
Consts.InstallerManifests,
x =>
async () =>
{
var outputDir = Path.Combine(".", "output");
var slugDir = Path.Combine(outputDir, x.HostAppSlug);
Directory.CreateDirectory(outputDir);
Directory.CreateDirectory(slugDir);
foreach (var asset in x.Projects)
var version = await Versions.ComputeVersion();
foreach (var group in await Affected.GetAffectedProjectGroups())
{
var fullPath = Path.Combine(".", asset.ProjectPath, "bin", "Release", asset.TargetName);
if (!Directory.Exists(fullPath))
Console.WriteLine($"Zipping: {group.HostAppSlug} as {version}");
var outputDir = Path.Combine(".", "output");
var slugDir = Path.Combine(outputDir, group.HostAppSlug);
Directory.CreateDirectory(outputDir);
Directory.CreateDirectory(slugDir);
foreach (var asset in group.Projects)
{
throw new InvalidOperationException("Could not find: " + fullPath);
var fullPath = Path.Combine(".", asset.ProjectPath, "bin", "Release", asset.TargetName);
if (!Directory.Exists(fullPath))
{
throw new InvalidOperationException("Could not find: " + fullPath);
}
var assetName = Path.GetFileName(asset.ProjectPath);
var connectorDir = Path.Combine(slugDir, assetName);
Directory.CreateDirectory(connectorDir);
foreach (var directory in Directory.EnumerateDirectories(fullPath, "*", SearchOption.AllDirectories))
{
Directory.CreateDirectory(directory.Replace(fullPath, connectorDir));
}
foreach (var file in Directory.EnumerateFiles(fullPath, "*", SearchOption.AllDirectories))
{
Console.WriteLine(file);
File.Copy(file, file.Replace(fullPath, connectorDir), true);
}
}
var assetName = Path.GetFileName(asset.ProjectPath);
var connectorDir = Path.Combine(slugDir, assetName);
Directory.CreateDirectory(connectorDir);
foreach (var directory in Directory.EnumerateDirectories(fullPath, "*", SearchOption.AllDirectories))
{
Directory.CreateDirectory(directory.Replace(fullPath, connectorDir));
}
foreach (var file in Directory.EnumerateFiles(fullPath, "*", SearchOption.AllDirectories))
{
Console.WriteLine(file);
File.Copy(file, file.Replace(fullPath, connectorDir), true);
}
var outputPath = Path.Combine(outputDir, $"{group.HostAppSlug}.zip");
File.Delete(outputPath);
Console.WriteLine($"Zipping: '{slugDir}' to '{outputPath}'");
ZipFile.CreateFromDirectory(slugDir, outputPath);
}
var outputPath = Path.Combine(outputDir, $"{x.HostAppSlug}.zip");
File.Delete(outputPath);
Console.WriteLine($"Zipping: '{slugDir}' to '{outputPath}'");
ZipFile.CreateFromDirectory(slugDir, outputPath);
// Directory.Delete(slugDir, true);
string githubEnv = Environment.GetEnvironmentVariable("GITHUB_ENV") ?? "Unset";
Console.WriteLine($"GITHUB_ENV: {githubEnv}");
File.AppendAllText(githubEnv, $"SPECKLE_VERSION={version}{Environment.NewLine}");
}
);
Target("default", DependsOn(FORMAT, ZIP), () => Console.WriteLine("Done!"));
Target("default", DependsOn(TEST), () => Console.WriteLine("Done!"));
await RunTargetsAndExitAsync(args).ConfigureAwait(true);
+79
View File
@@ -0,0 +1,79 @@
using Semver;
using static SimpleExec.Command;
namespace Build;
public static class Versions
{
private static string? s_currentTag;
private static SemVersion? s_currentVersion;
public static async Task<string> GetCurrentTag()
{
if (s_currentTag is not null)
{
return s_currentTag;
}
//finds current tag or makes one
var (currentTag, _) = await ReadAsync("git", "describe --tags");
currentTag = currentTag.Trim();
s_currentTag = currentTag;
return s_currentTag;
}
public static async Task<SemVersion> ComputeVersion()
{
if (s_currentVersion is not null)
{
return s_currentVersion;
}
var currentTag = await GetCurrentTag();
if (!SemVersion.TryParse(currentTag, SemVersionStyles.AllowLowerV, out var currentVersion))
{
throw new InvalidOperationException($"Could not parse version: '{currentTag}'");
}
s_currentVersion = currentVersion;
return s_currentVersion;
}
private static string? s_currentFileVersion;
public static async Task<string> ComputeFileVersion()
{
if (s_currentFileVersion is not null)
{
return s_currentFileVersion;
}
var currentVersion = await ComputeVersion();
s_currentFileVersion = currentVersion.WithoutPrereleaseOrMetadata() + ".0";
return s_currentFileVersion;
}
public static async Task<string> GetPreviousTag(string currentTag)
{
//finds a tag starting with current tag and adds no abbrevation
var (lastTag, _) = await ReadAsync("git", $"describe --abbrev=0 --tags {currentTag}^");
lastTag = lastTag.Trim();
return lastTag;
}
private static SemVersion? s_previousVersion;
public static async Task<SemVersion> ComputePreviousVersion(string currentTag)
{
if (s_previousVersion is not null)
{
return s_previousVersion;
}
var lastTag = await GetPreviousTag(currentTag);
if (!SemVersion.TryParse(lastTag, SemVersionStyles.AllowLowerV, out var lastVersion))
{
throw new InvalidOperationException($"Could not parse version: '{lastTag}'");
}
s_previousVersion = lastVersion;
return s_previousVersion;
}
}
+14
View File
@@ -53,6 +53,15 @@
"resolved": "1.14.1",
"contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ=="
},
"Semver": {
"type": "Direct",
"requested": "[3.0.0, )",
"resolved": "3.0.0",
"contentHash": "9jZCicsVgTebqkAujRWtC9J1A5EQVlu0TVKHcgoCuv345ve5DYf4D1MjhKEnQjdRZo6x/vdv6QQrYFs7ilGzLA==",
"dependencies": {
"Microsoft.Extensions.Primitives": "5.0.1"
}
},
"SimpleExec": {
"type": "Direct",
"requested": "[12.0.0, )",
@@ -75,6 +84,11 @@
"resolved": "8.0.0",
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
},
"Microsoft.Extensions.Primitives": {
"type": "Transitive",
"resolved": "5.0.1",
"contentHash": "5WPSmL4YeP7eW+Vc8XZ4DwjYWBAiSwDV9Hm63JJWcz1Ie3Xjv4KuJXzgCstj48LkLfVCYa7mLcx7y+q6yqVvtw=="
},
"Microsoft.NET.StringTools": {
"type": "Transitive",
"resolved": "17.11.4",
@@ -3,6 +3,7 @@ using System.Diagnostics.CodeAnalysis;
using ArcGIS.Core.Data;
using ArcGIS.Desktop.Core;
using ArcGIS.Desktop.Editing.Events;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Mapping;
using ArcGIS.Desktop.Mapping.Events;
using Microsoft.Extensions.DependencyInjection;
@@ -45,6 +46,7 @@ public sealed class ArcGISSendBinding : ISendBinding
private readonly ITopLevelExceptionHandler _topLevelExceptionHandler;
private readonly IArcGISConversionSettingsFactory _arcGISConversionSettingsFactory;
private readonly IThreadContext _threadContext;
private readonly ISpeckleApplication _speckleApplication;
/// <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:
@@ -70,6 +72,7 @@ public sealed class ArcGISSendBinding : ISendBinding
IArcGISConversionSettingsFactory arcGisConversionSettingsFactory,
MapMembersUtils mapMemberUtils,
IThreadContext threadContext,
ISpeckleApplication speckleApplication,
ITopLevelExceptionHandler topLevelExceptionHandler
)
{
@@ -84,6 +87,7 @@ public sealed class ArcGISSendBinding : ISendBinding
_arcGISConversionSettingsFactory = arcGisConversionSettingsFactory;
_mapMemberUtils = mapMemberUtils;
_threadContext = threadContext;
_speckleApplication = speckleApplication;
Parent = parent;
Commands = new SendBindingUICommands(parent);
@@ -101,7 +105,7 @@ public sealed class ArcGISSendBinding : ISendBinding
LayersRemovedEvent.Subscribe(
a =>
_topLevelExceptionHandler.FireAndForget(
async () => await _threadContext.RunOnWorkerAsync(async () => await GetIdsForLayersRemovedEvent(a))
async () => await QueuedTask.Run(async () => await GetIdsForLayersRemovedEvent(a))
),
true
);
@@ -109,7 +113,7 @@ public sealed class ArcGISSendBinding : ISendBinding
StandaloneTablesRemovedEvent.Subscribe(
a =>
_topLevelExceptionHandler.FireAndForget(
async () => await _threadContext.RunOnWorkerAsync(async () => await GetIdsForStandaloneTablesRemovedEvent(a))
async () => await QueuedTask.Run(async () => await GetIdsForStandaloneTablesRemovedEvent(a))
),
true
);
@@ -117,7 +121,7 @@ public sealed class ArcGISSendBinding : ISendBinding
MapPropertyChangedEvent.Subscribe(
a =>
_topLevelExceptionHandler.FireAndForget(
async () => await _threadContext.RunOnWorkerAsync(async () => await GetIdsForMapPropertyChangedEvent(a))
async () => await QueuedTask.Run(async () => await GetIdsForMapPropertyChangedEvent(a))
),
true
); // Map units, CRS etc.
@@ -125,8 +129,7 @@ public sealed class ArcGISSendBinding : ISendBinding
MapMemberPropertiesChangedEvent.Subscribe(
a =>
_topLevelExceptionHandler.FireAndForget(
async () =>
await _threadContext.RunOnWorkerAsync(async () => await GetIdsForMapMemberPropertiesChangedEvent(a))
async () => await QueuedTask.Run(async () => await GetIdsForMapMemberPropertiesChangedEvent(a))
),
true
); // e.g. Layer name
@@ -135,7 +138,7 @@ public sealed class ArcGISSendBinding : ISendBinding
_ =>
_topLevelExceptionHandler.FireAndForget(async () =>
{
await _threadContext.RunOnWorker(SubscribeToMapMembersDataSourceChange);
await QueuedTask.Run(SubscribeToMapMembersDataSourceChange);
}),
true
);
@@ -376,21 +379,25 @@ public sealed class ArcGISSendBinding : ISendBinding
using var cancellationItem = _cancellationManager.GetCancellationItem(modelCardId);
using var scope = _serviceProvider.CreateScope();
scope
.ServiceProvider.GetRequiredService<IConverterSettingsStore<ArcGISConversionSettings>>()
.Initialize(
_arcGISConversionSettingsFactory.Create(
Project.Current,
MapView.Active.Map,
new CRSoffsetRotation(MapView.Active.Map)
)
);
List<MapMember> mapMembers = modelCard
.SendFilter.NotNull()
.RefreshObjectIds()
.Select(id => (MapMember)MapView.Active.Map.FindLayer(id) ?? MapView.Active.Map.FindStandaloneTable(id))
.Where(obj => obj != null)
.ToList();
List<MapMember> mapMembers = await QueuedTask.Run(() =>
{
scope
.ServiceProvider.GetRequiredService<IConverterSettingsStore<ArcGISConversionSettings>>()
.Initialize(
_arcGISConversionSettingsFactory.Create(
Project.Current,
MapView.Active.Map,
new CRSoffsetRotation(MapView.Active.Map)
)
);
return modelCard
.SendFilter.NotNull()
.RefreshObjectIds()
.Select(id => (MapMember)MapView.Active.Map.FindLayer(id) ?? MapView.Active.Map.FindStandaloneTable(id))
.Where(obj => obj != null)
.ToList();
});
if (mapMembers.Count == 0)
{
@@ -398,24 +405,27 @@ public sealed class ArcGISSendBinding : ISendBinding
throw new SpeckleSendFilterException("No objects were found to convert. Please update your publish filter!");
}
// subscribe to the selected layer events
foreach (MapMember mapMember in mapMembers)
await QueuedTask.Run(() =>
{
if (mapMember is FeatureLayer featureLayer)
// subscribe to the selected layer events
foreach (MapMember mapMember in mapMembers)
{
SubscribeToFeatureLayerDataSourceChange(featureLayer);
if (mapMember is FeatureLayer featureLayer)
{
SubscribeToFeatureLayerDataSourceChange(featureLayer);
}
else if (mapMember is StandaloneTable table)
{
SubscribeToTableDataSourceChange(table);
}
}
else if (mapMember is StandaloneTable table)
{
SubscribeToTableDataSourceChange(table);
}
}
});
var sendResult = await scope
.ServiceProvider.GetRequiredService<SendOperation<MapMember>>()
.Execute(
mapMembers,
modelCard.GetSendInfo("ArcGIS"), // POC: get host app name from settings? same for GetReceiveInfo
modelCard.GetSendInfo(_speckleApplication.ApplicationAndVersion),
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
cancellationItem.Token
);
@@ -1,4 +1,5 @@
using ArcGIS.Core.Data;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Mapping;
using Speckle.Connectors.ArcGIS.Utils;
using Speckle.Connectors.DUI.Bindings;
@@ -66,19 +67,20 @@ public class BasicConnectorBinding : IBasicConnectorBinding
public void RemoveModel(ModelCard model) => _store.RemoveModel(model);
public Task HighlightObjects(IReadOnlyList<string> objectIds)
public void RemoveModels(List<ModelCard> models) => _store.RemoveModels(models);
public async Task HighlightObjects(IReadOnlyList<string> objectIds)
{
HighlightObjectsOnView(objectIds.Select(x => new ObjectID(x)).ToList());
return Task.CompletedTask;
await HighlightObjectsOnView(objectIds.Select(x => new ObjectID(x)).ToList());
}
public Task HighlightModel(string modelCardId)
public async Task HighlightModel(string modelCardId)
{
var model = _store.GetModelById(modelCardId);
if (model is null)
{
return Task.CompletedTask;
return;
}
var objectIds = new List<ObjectID>();
@@ -95,22 +97,24 @@ public class BasicConnectorBinding : IBasicConnectorBinding
if (objectIds is null)
{
return Task.CompletedTask;
return;
}
HighlightObjectsOnView(objectIds);
return Task.CompletedTask;
await HighlightObjectsOnView(objectIds);
}
private void HighlightObjectsOnView(IReadOnlyList<ObjectID> objectIds)
private async Task HighlightObjectsOnView(IReadOnlyList<ObjectID> objectIds)
{
MapView mapView = MapView.Active;
await QueuedTask.Run(() =>
{
MapView mapView = MapView.Active;
List<MapMemberFeature> mapMembersFeatures = GetMapMembers(objectIds, mapView);
ClearSelectionInTOC();
ClearSelection();
SelectMapMembersInTOC(mapMembersFeatures);
SelectMapMembersAndFeatures(mapMembersFeatures);
mapView.ZoomToSelected();
List<MapMemberFeature> mapMembersFeatures = GetMapMembers(objectIds, mapView);
ClearSelectionInTOC();
ClearSelection();
SelectMapMembersInTOC(mapMembersFeatures);
SelectMapMembersAndFeatures(mapMembersFeatures);
mapView.ZoomToSelected();
});
}
private List<MapMemberFeature> GetMapMembers(IReadOnlyList<ObjectID> objectIds, MapView mapView)
@@ -10,6 +10,7 @@ using Speckle.Connectors.Common;
using Speckle.Connectors.Common.Builders;
using Speckle.Connectors.Common.Caching;
using Speckle.Connectors.Common.Operations;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Models.Card.SendFilter;
@@ -27,7 +28,7 @@ public static class ArcGISConnectorModule
public static void AddArcGIS(this IServiceCollection serviceCollection)
{
serviceCollection.AddConnectorUtils();
serviceCollection.AddDUI<ArcGISThreadContext, ArcGISDocumentStore>();
serviceCollection.AddDUI<DefaultThreadContext, ArcGISDocumentStore>();
serviceCollection.AddDUIView();
// Register bindings
@@ -184,6 +184,7 @@ public class ArcGISColorUnpacker
if (StoredColor is int existingColorProxyId)
{
AddObjectIdToColorProxyCache(rowApplicationId, existingColorProxyId);
return;
}
// get the color from the renderer and row
@@ -1,6 +1,7 @@
using System.Diagnostics.Contracts;
using ArcGIS.Core.CIM;
using ArcGIS.Core.Geometry;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Mapping;
using Speckle.Connectors.ArcGIS.HostApp;
using Speckle.Connectors.ArcGIS.Utils;
@@ -60,6 +61,19 @@ public class ArcGISHostObjectBuilder : IHostObjectBuilder
IProgress<CardProgress> onOperationProgressed,
CancellationToken cancellationToken
)
{
return QueuedTask.Run(
() => BuildInternal(rootObject, projectName, modelName, onOperationProgressed, cancellationToken)
);
}
private HostObjectBuilderResult BuildInternal(
Base rootObject,
string projectName,
string modelName,
IProgress<CardProgress> onOperationProgressed,
CancellationToken cancellationToken
)
{
// TODO get spatialRef and offsets & rotation from ProjectInfo in CommitObject
// ATM, GIS commit CRS is stored per layer (in FeatureClass converter), but should be moved to the Root level too
@@ -226,7 +240,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 HostObjectBuilderResult(bakedObjectIds, results);
}
private IReadOnlyCollection<LocalToGlobalMap> GetObjectsToConvert(Base rootObject)
@@ -1,5 +1,6 @@
using ArcGIS.Core.Data.Raster;
using ArcGIS.Core.Geometry;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Speckle.Connectors.ArcGIS.HostApp;
using Speckle.Connectors.ArcGIS.HostApp.Extensions;
@@ -49,7 +50,14 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<ADM.MapMember>
_mapMemberUtils = mapMemberUtils;
}
public async Task<RootObjectBuilderResult> Build(
public Task<RootObjectBuilderResult> Build(
IReadOnlyList<ADM.MapMember> layers,
SendInfo __,
IProgress<CardProgress> onOperationProgressed,
CancellationToken cancellationToken
) => QueuedTask.Run(() => BuildInternal(layers, __, onOperationProgressed, cancellationToken));
private async Task<RootObjectBuilderResult> BuildInternal(
IReadOnlyList<ADM.MapMember> layers,
SendInfo __,
IProgress<CardProgress> onOperationProgressed,
@@ -94,19 +102,26 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<ADM.MapMember>
// We need to unpack the selected mapmembers into all leaf-level mapmembers (containing just objects) and build the root collection structure during unpacking.
// Mapmember dynamically attached properties are also added at this step.
List<ADM.MapMember> unpackedLayers;
Dictionary<ADM.MapMember, long> layersWithFeatureCount;
long allFeaturesCount;
ADM.Map map = ADM.MapView.Active.Map;
IEnumerable<ADM.MapMember> layersOrdered = _mapMemberUtils.GetMapMembersInOrder(map, layers);
using (var _ = _activityFactory.Start("Unpacking selection"))
{
unpackedLayers = _layerUnpacker.UnpackSelection(layersOrdered, rootCollection);
// count number of features to convert. Raster layers are counter as 1 feature for now (not ideal)
layersWithFeatureCount = CountAllFeaturesInLayers(unpackedLayers);
allFeaturesCount = layersWithFeatureCount.Values.Sum();
}
List<SendConversionResult> results = new(unpackedLayers.Count);
onOperationProgressed.Report(new("Converting", null));
using (var convertingActivity = _activityFactory.Start("Converting objects"))
{
int count = 0;
foreach (ADM.MapMember layer in unpackedLayers)
long count = 0;
foreach (var (layer, layerFeatureCount) in layersWithFeatureCount)
{
cancellationToken.ThrowIfCancellationRequested();
string layerApplicationId = layer.GetSpeckleApplicationId();
@@ -134,15 +149,33 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<ADM.MapMember>
switch (layer)
{
case ADM.FeatureLayer featureLayer:
List<Base> convertedFeatureLayerObjects = ConvertFeatureLayerObjects(featureLayer);
List<Base> convertedFeatureLayerObjects = ConvertFeatureLayerObjects(
featureLayer,
count,
allFeaturesCount,
onOperationProgressed,
cancellationToken
);
layerCollection.elements.AddRange(convertedFeatureLayerObjects);
break;
case ADM.RasterLayer rasterLayer:
List<Base> convertedRasterLayerObjects = ConvertRasterLayerObjects(rasterLayer);
List<Base> convertedRasterLayerObjects = ConvertRasterLayerObjects(
rasterLayer,
count,
allFeaturesCount,
onOperationProgressed,
cancellationToken
);
layerCollection.elements.AddRange(convertedRasterLayerObjects);
break;
case ADM.LasDatasetLayer lasDatasetLayer:
List<Base> convertedLasDatasetObjects = ConvertLasDatasetLayerObjects(lasDatasetLayer);
List<Base> convertedLasDatasetObjects = ConvertLasDatasetLayerObjects(
lasDatasetLayer,
count,
allFeaturesCount,
onOperationProgressed,
cancellationToken
);
layerCollection.elements.AddRange(convertedLasDatasetObjects);
break;
default:
@@ -150,6 +183,8 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<ADM.MapMember>
sdkStatus = SdkActivityStatusCode.Error;
break;
}
count += layerFeatureCount;
results.Add(new(status, layerApplicationId, layer.GetType().Name, layerCollection));
convertingActivity?.SetStatus(sdkStatus);
}
@@ -166,7 +201,6 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<ADM.MapMember>
convertingActivity?.RecordException(ex);
}
onOperationProgressed.Report(new("Converting", (double)++count / layers.Count));
await Task.Yield();
}
}
@@ -182,7 +216,41 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<ADM.MapMember>
return new RootObjectBuilderResult(rootCollection, results);
}
private List<Base> ConvertFeatureLayerObjects(ADM.FeatureLayer featureLayer)
private Dictionary<ADM.MapMember, long> CountAllFeaturesInLayers(List<ADM.MapMember> unpackedLayers)
{
Dictionary<ADM.MapMember, long> layersFeatureCount = new();
foreach (ADM.MapMember layer in unpackedLayers)
{
switch (layer)
{
case ADM.FeatureLayer featureLayer:
layersFeatureCount.Add(featureLayer, featureLayer.GetFeatureClass().GetCount());
break;
case ADM.RasterLayer rasterLayer:
// count Raster layer as 1 feature: not optimal but this is the approach for now
layersFeatureCount.Add(rasterLayer, 1);
break;
case ADM.LasDatasetLayer lasDatasetLayer:
var dataset = lasDatasetLayer.GetLasDataset();
// simple dataset.GetPointCount() keeps returning null, so switched to EstimatePointCount
layersFeatureCount.Add(
lasDatasetLayer,
(long)dataset.EstimatePointCount(dataset.GetDefinition().GetExtent())
);
break;
}
}
return layersFeatureCount;
}
private List<Base> ConvertFeatureLayerObjects(
ADM.FeatureLayer featureLayer,
long count,
long allFeaturesCount,
IProgress<CardProgress> onOperationProgressed,
CancellationToken cancellationToken
)
{
string layerApplicationId = featureLayer.GetSpeckleApplicationId();
List<Base> convertedObjects = new();
@@ -196,6 +264,9 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<ADM.MapMember>
{
while (rowCursor.MoveNext())
{
// allow cancellation before every feature
cancellationToken.ThrowIfCancellationRequested();
// Same IDisposable issue appears to happen on Row class too. Docs say it should always be disposed of manually by the caller.
using (ACD.Row row = rowCursor.Current)
{
@@ -209,6 +280,8 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<ADM.MapMember>
// process the object color
_colorUnpacker.ProcessFeatureLayerColor(row, applicationId);
}
// update report
onOperationProgressed.Report(new("Converting", (double)++count / allFeaturesCount));
}
}
@@ -216,19 +289,38 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<ADM.MapMember>
}
// POC: raster colors are stored as mesh vertex colors in RasterToSpeckleConverter. Should probably move to color unpacker.
private List<Base> ConvertRasterLayerObjects(ADM.RasterLayer rasterLayer)
private List<Base> ConvertRasterLayerObjects(
ADM.RasterLayer rasterLayer,
long count,
long allFeaturesCount,
IProgress<CardProgress> onOperationProgressed,
CancellationToken cancellationToken
)
{
string layerApplicationId = rasterLayer.GetSpeckleApplicationId();
List<Base> convertedObjects = new();
Raster raster = rasterLayer.GetRaster();
// check cancellation token before conversion
cancellationToken.ThrowIfCancellationRequested();
Base converted = _rootToSpeckleConverter.Convert(raster);
string applicationId = raster.GetSpeckleApplicationId(layerApplicationId);
converted.applicationId = applicationId;
convertedObjects.Add(converted);
// update report
onOperationProgressed.Report(new("Converting", (double)++count / allFeaturesCount));
return convertedObjects;
}
private List<Base> ConvertLasDatasetLayerObjects(ADM.LasDatasetLayer lasDatasetLayer)
private List<Base> ConvertLasDatasetLayerObjects(
ADM.LasDatasetLayer lasDatasetLayer,
long count,
long allFeaturesCount,
IProgress<CardProgress> onOperationProgressed,
CancellationToken cancellationToken
)
{
string layerApplicationId = lasDatasetLayer.GetSpeckleApplicationId();
List<Base> convertedObjects = new();
@@ -242,6 +334,9 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<ADM.MapMember>
{
while (ptCursor.MoveNext())
{
// allow cancellation before every point
cancellationToken.ThrowIfCancellationRequested();
using (ACD.Analyst3D.LasPoint pt = ptCursor.Current)
{
Base converted = _rootToSpeckleConverter.Convert(pt);
@@ -252,6 +347,8 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<ADM.MapMember>
// process the object color
_colorUnpacker.ProcessLasLayerColor(pt, applicationId);
}
// update report
onOperationProgressed.Report(new("Converting", (double)++count / allFeaturesCount));
}
}
}
@@ -1,36 +0,0 @@
using ArcGIS.Desktop.Framework.Threading.Tasks;
using Speckle.Connectors.Common.Threading;
namespace Speckle.Connectors.ArcGIS.Utils;
//don't check for GUI as it's the same check we do in ThreadContext
public class ArcGISThreadContext : ThreadContext
{
protected override Task<T> MainToWorkerAsync<T>(Func<Task<T>> action)
{
if (QueuedTask.OnWorker)
{
return action();
}
else
{
return QueuedTask.Run(async () => await action());
}
}
protected override Task<T> WorkerToMainAsync<T>(Func<Task<T>> action) => QueuedTask.Run(async () => await action());
protected override Task<T> MainToWorker<T>(Func<T> action)
{
if (QueuedTask.OnWorker)
{
return Task.FromResult(action());
}
else
{
return QueuedTask.Run(action);
}
}
protected override Task<T> WorkerToMain<T>(Func<T> action) => QueuedTask.Run(action);
}
@@ -1,5 +1,6 @@
using System.Xml.Linq;
using ArcGIS.Desktop.Core.Events;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Mapping;
using ArcGIS.Desktop.Mapping.Events;
using Speckle.Connectors.Common.Threading;
@@ -82,8 +83,8 @@ public class ArcGISDocumentStore : DocumentModelStore
}
protected override void HostAppSaveState(string modelCardState) =>
_threadContext
.RunOnWorker(() =>
QueuedTask
.Run(() =>
{
Map map = MapView.Active.Map;
// Read existing metadata - To prevent messing existing metadata. 🤞 Hope other add-in developers will do same :D
@@ -112,8 +113,8 @@ public class ArcGISDocumentStore : DocumentModelStore
.FireAndForget();
protected override void LoadState() =>
_threadContext
.RunOnWorker(() =>
QueuedTask
.Run(() =>
{
Map map = MapView.Active.Map;
var metadata = map.GetMetadata();
@@ -221,14 +221,21 @@
"resolved": "4.5.1",
"contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw=="
},
"speckle.common.meshtriangulation": {
"type": "Project",
"dependencies": {
"LibTessDotNet": "[1.1.15, )",
"Speckle.DoubleNumerics": "[4.1.0, )"
}
},
"speckle.connectors.common": {
"type": "Project",
"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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -236,8 +243,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -254,6 +261,7 @@
"type": "Project",
"dependencies": {
"Esri.ArcGISPro.Extensions30": "[3.2.0.49743, )",
"Speckle.Common.MeshTriangulation": "[1.0.0, )",
"Speckle.Converters.Common": "[1.0.0, )"
}
},
@@ -261,9 +269,15 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"LibTessDotNet": {
"type": "CentralTransitive",
"requested": "[1.1.15, )",
"resolved": "1.1.15",
"contentHash": "KuA7N3Nv/lIeawJdQBQJR6oqWD9KETHLbWzBqapwFs+Tby+R5I4crkKujKMm5bXcSuFZ8LNtflFQVadsWCbBjg=="
},
"Microsoft.Extensions.DependencyInjection": {
"type": "CentralTransitive",
"requested": "[2.2.0, )",
@@ -294,40 +308,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
},
"net6.0-windows7.0/win-x64": {
@@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2022.0.2" />
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2022.0.2" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -259,9 +259,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +269,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -294,7 +294,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -333,40 +333,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
}
}
@@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2023.0.0" />
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2023.0.0" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -259,9 +259,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +269,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -294,7 +294,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -333,40 +333,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
}
}
@@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2024.0.0" />
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2024.0.0" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -259,9 +259,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +269,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -295,7 +295,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -334,40 +334,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
}
}
@@ -13,8 +13,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2025.0.0" />
<FrameworkReference Include="Microsoft.WindowsDesktop.App"/>
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2025.0.0" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -215,9 +215,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -225,8 +225,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -251,7 +251,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -290,39 +290,39 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
},
"net8.0-windows7.0/win-x64": {
@@ -79,6 +79,8 @@ public class AutocadBasicConnectorBinding : IBasicConnectorBinding
public void RemoveModel(ModelCard model) => _store.RemoveModel(model);
public void RemoveModels(List<ModelCard> models) => _store.RemoveModels(models);
public async Task HighlightObjects(IReadOnlyList<string> objectIds)
{
// POC: Will be addressed to move it into AutocadContext!
@@ -0,0 +1,119 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Speckle.Connectors.Common.Cancellation;
using Speckle.Connectors.Common.Operations;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Logging;
using Speckle.Connectors.DUI.Models;
using Speckle.Connectors.DUI.Models.Card;
using Speckle.Sdk;
namespace Speckle.Connectors.Autocad.Bindings;
public abstract class AutocadReceiveBaseBinding : IReceiveBinding
{
public string Name => "receiveBinding";
public IBrowserBridge Parent { get; }
private readonly DocumentModelStore _store;
private readonly ICancellationManager _cancellationManager;
private readonly IServiceProvider _serviceProvider;
private readonly IOperationProgressManager _operationProgressManager;
private readonly ILogger<AutocadReceiveBinding> _logger;
private readonly ISpeckleApplication _speckleApplication;
private readonly IThreadContext _threadContext;
private ReceiveBindingUICommands Commands { get; }
protected AutocadReceiveBaseBinding(
DocumentModelStore store,
IBrowserBridge parent,
ICancellationManager cancellationManager,
IServiceProvider serviceProvider,
IOperationProgressManager operationProgressManager,
ILogger<AutocadReceiveBinding> logger,
ISpeckleApplication speckleApplication,
IThreadContext threadContext
)
{
_store = store;
_cancellationManager = cancellationManager;
_serviceProvider = serviceProvider;
_operationProgressManager = operationProgressManager;
_logger = logger;
_speckleApplication = speckleApplication;
_threadContext = threadContext;
Parent = parent;
Commands = new ReceiveBindingUICommands(parent);
}
protected abstract void InitializeSettings(IServiceProvider serviceProvider);
public void CancelReceive(string modelCardId) => _cancellationManager.CancelOperation(modelCardId);
public async Task Receive(string modelCardId) =>
await _threadContext.RunOnMainAsync(async () => await ReceiveInternal(modelCardId));
private async Task ReceiveInternal(string modelCardId)
{
using var scope = _serviceProvider.CreateScope();
InitializeSettings(scope.ServiceProvider);
try
{
// Get receiver card
if (_store.GetModelById(modelCardId) is not ReceiverModelCard modelCard)
{
// Handle as GLOBAL ERROR at BrowserBridge
throw new InvalidOperationException("No download model card was found.");
}
using var cancellationItem = _cancellationManager.GetCancellationItem(modelCardId);
// Disable document activation (document creation and document switch)
// Not disabling results in DUI model card being out of sync with the active document
// The DocumentActivated event isn't usable probably because it is pushed to back of main thread queue
Application.DocumentManager.DocumentActivationEnabled = false;
// Receive host objects
var operationResults = await scope
.ServiceProvider.GetRequiredService<ReceiveOperation>()
.Execute(
modelCard.GetReceiveInfo(_speckleApplication.Slug),
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
cancellationItem.Token
);
await Commands.SetModelReceiveResult(
modelCardId,
operationResults.BakedObjectIds,
operationResults.ConversionResults
);
}
catch (OperationCanceledException)
{
// SWALLOW -> UI handles it immediately, so we do not need to handle anything for now!
// Idea for later -> when cancel called, create promise from UI to solve it later with this catch block.
// So have 3 state on UI -> Cancellation clicked -> Cancelling -> Cancelled
return;
}
catch (Exception ex) when (!ex.IsFatal()) // UX reasons - we will report operation exceptions as model card error. We may change this later when we have more exception documentation
{
_logger.LogModelCardHandledError(ex);
await Commands.SetModelError(modelCardId, ex);
}
finally
{
// reenable document activation
Application.DocumentManager.DocumentActivationEnabled = true;
// regenerate doc to flush graphics, sometimes some objects (ellipses, nurbs curves) do not appear fully visible after receive.
// Adding a regen (must be run on main thread) here, but it doesn't seem to work:
// it's run on main thread, tried sending the "regen" string to execute, also tried regen after every object bake, but still can't fix.
// the objects should appear visible if you manually call the "regen" command after the operation finishes, or click on a view on the view cube which also calls regen.
Application.DocumentManager.CurrentDocument.Editor.Regen();
}
}
}
@@ -1,34 +1,19 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Speckle.Connectors.Common.Cancellation;
using Speckle.Connectors.Common.Operations;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Logging;
using Speckle.Connectors.DUI.Models;
using Speckle.Connectors.DUI.Models.Card;
using Speckle.Converters.Autocad;
using Speckle.Converters.Common;
using Speckle.Sdk;
namespace Speckle.Connectors.Autocad.Bindings;
public sealed class AutocadReceiveBinding : IReceiveBinding
public sealed class AutocadReceiveBinding : AutocadReceiveBaseBinding
{
public string Name => "receiveBinding";
public IBrowserBridge Parent { get; }
private readonly DocumentModelStore _store;
private readonly ICancellationManager _cancellationManager;
private readonly IServiceProvider _serviceProvider;
private readonly IOperationProgressManager _operationProgressManager;
private readonly ILogger<AutocadReceiveBinding> _logger;
private readonly IAutocadConversionSettingsFactory _autocadConversionSettingsFactory;
private readonly ISpeckleApplication _speckleApplication;
private readonly IThreadContext _threadContext;
private ReceiveBindingUICommands Commands { get; }
public AutocadReceiveBinding(
DocumentModelStore store,
@@ -41,77 +26,24 @@ public sealed class AutocadReceiveBinding : IReceiveBinding
ISpeckleApplication speckleApplication,
IThreadContext threadContext
)
: base(
store,
parent,
cancellationManager,
serviceProvider,
operationProgressManager,
logger,
speckleApplication,
threadContext
)
{
_store = store;
_cancellationManager = cancellationManager;
_serviceProvider = serviceProvider;
_operationProgressManager = operationProgressManager;
_logger = logger;
_autocadConversionSettingsFactory = autocadConversionSettingsFactory;
_speckleApplication = speckleApplication;
_threadContext = threadContext;
Parent = parent;
Commands = new ReceiveBindingUICommands(parent);
}
public void CancelReceive(string modelCardId) => _cancellationManager.CancelOperation(modelCardId);
public async Task Receive(string modelCardId) =>
await _threadContext.RunOnMainAsync(async () => await ReceiveInternal(modelCardId));
public async Task ReceiveInternal(string modelCardId)
protected override void InitializeSettings(IServiceProvider serviceProvider)
{
using var scope = _serviceProvider.CreateScope();
scope
.ServiceProvider.GetRequiredService<IConverterSettingsStore<AutocadConversionSettings>>()
serviceProvider
.GetRequiredService<IConverterSettingsStore<AutocadConversionSettings>>()
.Initialize(_autocadConversionSettingsFactory.Create(Application.DocumentManager.CurrentDocument));
try
{
// Get receiver card
if (_store.GetModelById(modelCardId) is not ReceiverModelCard modelCard)
{
// Handle as GLOBAL ERROR at BrowserBridge
throw new InvalidOperationException("No download model card was found.");
}
using var cancellationItem = _cancellationManager.GetCancellationItem(modelCardId);
// Disable document activation (document creation and document switch)
// Not disabling results in DUI model card being out of sync with the active document
// The DocumentActivated event isn't usable probably because it is pushed to back of main thread queue
Application.DocumentManager.DocumentActivationEnabled = false;
// Receive host objects
var operationResults = await scope
.ServiceProvider.GetRequiredService<ReceiveOperation>()
.Execute(
modelCard.GetReceiveInfo(_speckleApplication.Slug),
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
cancellationItem.Token
);
await Commands.SetModelReceiveResult(
modelCardId,
operationResults.BakedObjectIds,
operationResults.ConversionResults
);
}
catch (OperationCanceledException)
{
// SWALLOW -> UI handles it immediately, so we do not need to handle anything for now!
// Idea for later -> when cancel called, create promise from UI to solve it later with this catch block.
// So have 3 state on UI -> Cancellation clicked -> Cancelling -> Cancelled
return;
}
catch (Exception ex) when (!ex.IsFatal()) // UX reasons - we will report operation exceptions as model card error. We may change this later when we have more exception documentation
{
_logger.LogModelCardHandledError(ex);
await Commands.SetModelError(modelCardId, ex);
}
finally
{
// reenable document activation
Application.DocumentManager.DocumentActivationEnabled = true;
}
}
}
@@ -48,7 +48,7 @@ public abstract class AutocadSendBaseBinding : ISendBinding
/// As to why a concurrent dictionary, it's because it's the cheapest/easiest way to do so.
/// https://stackoverflow.com/questions/18922985/concurrent-hashsett-in-net-framework
/// </summary>
private ConcurrentDictionary<string, byte> ChangedObjectIds { get; set; } = new();
private ConcurrentBag<string> ChangedObjectIds { get; set; } = new();
protected AutocadSendBaseBinding(
DocumentModelStore store,
@@ -114,21 +114,20 @@ public abstract class AutocadSendBaseBinding : ISendBinding
private void OnChangeChangedObjectIds(DBObject dBObject)
{
ChangedObjectIds[dBObject.GetSpeckleApplicationId()] = 1;
_idleManager.SubscribeToIdle(nameof(AutocadSendBinding), async () => await RunExpirationChecks());
ChangedObjectIds.Add(dBObject.GetSpeckleApplicationId());
_idleManager.SubscribeToIdle(nameof(RunExpirationChecks), async () => await RunExpirationChecks());
}
private async Task RunExpirationChecks()
{
var senders = _store.GetSenders();
string[] objectIdsList = ChangedObjectIds.Keys.ToArray();
List<string> expiredSenderIds = new();
_sendConversionCache.EvictObjects(objectIdsList);
_sendConversionCache.EvictObjects(ChangedObjectIds);
foreach (SenderModelCard modelCard in senders)
{
var intersection = modelCard.SendFilter.NotNull().RefreshObjectIds().Intersect(objectIdsList).ToList();
var intersection = modelCard.SendFilter.NotNull().RefreshObjectIds().Intersect(ChangedObjectIds).ToList();
bool isExpired = intersection.Count != 0;
if (isExpired)
{
@@ -184,7 +183,7 @@ public abstract class AutocadSendBaseBinding : ISendBinding
.ServiceProvider.GetRequiredService<SendOperation<AutocadRootObject>>()
.Execute(
autocadObjects,
modelCard.GetSendInfo(_speckleApplication.Slug),
modelCard.GetSendInfo(_speckleApplication.ApplicationAndVersion),
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
cancellationItem.Token
);
@@ -83,7 +83,7 @@ public class AutocadHostObjectBuilder(
colorBaker.ParseColors(unpackedRoot.ColorProxies, onOperationProgressed);
}
// 5 - Convert atomic objects
// 4 - Convert atomic objects
HashSet<ReceiveConversionResult> results = new();
HashSet<string> bakedObjectIds = new();
Dictionary<string, IReadOnlyCollection<Entity>> applicationIdMap = new();
@@ -116,7 +116,7 @@ public class AutocadHostObjectBuilder(
}
}
// 6 - Convert instances
// 5 - Convert instances
var (createdInstanceIds, consumedObjectIds, instanceConversionResults) = instanceBaker.BakeInstances(
instanceComponentsWithPath,
applicationIdMap,
@@ -129,7 +129,7 @@ public class AutocadHostObjectBuilder(
results.RemoveWhere(result => result.ResultId != null && consumedObjectIds.Contains(result.ResultId));
results.UnionWith(instanceConversionResults);
// 7 - Create groups
// 6 - Create groups
if (unpackedRoot.GroupProxies != null)
{
IReadOnlyCollection<ReceiveConversionResult> groupResults = groupBaker.CreateGroups(
@@ -167,7 +167,7 @@ public class AutocadHostObjectBuilder(
convertedEntities.Add(bakedEntity);
break;
case List<(Entity, Base)> listConversionResult: // this is from fallback conversion for brep/brepx/subdx/extrusionx
case List<(Entity, Base)> listConversionResult: // this is from fallback conversion for brep/brepx/subdx/extrusionx/polycurve
var bakedFallbackEntities = BakeObjectsAsGroup(listConversionResult, obj, layerName, baseLayerNamePrefix);
convertedEntities.UnionWith(bakedFallbackEntities);
break;
@@ -9,6 +9,7 @@
<Import_RootNamespace>Speckle.Connectors.AutocadShared</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Bindings\AutocadReceiveBaseBinding.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bindings\AutocadSelectionBinding.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bindings\AutocadReceiveBinding.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bindings\AutocadSendBinding.cs" />
@@ -10,8 +10,8 @@
<StartProgram>$(ProgramW6432)\Autodesk\AutoCAD $(Civil3DVersion)\acad.exe</StartProgram>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Speckle.AutoCAD.API" />
<PackageReference Include="Speckle.Civil3D.API" />
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2022.0.2" ExcludeAssets="runtime"/>
<PackageReference Include="Speckle.Civil3D.API" VersionOverride="2022.0.2" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -268,9 +268,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -278,8 +278,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -304,7 +304,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -343,40 +343,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
}
}
@@ -11,8 +11,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2023.0.0" />
<PackageReference Include="Speckle.Civil3D.API" VersionOverride="2023.0.0" />
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2023.0.0" ExcludeAssets="runtime"/>
<PackageReference Include="Speckle.Civil3D.API" VersionOverride="2023.0.0" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -268,9 +268,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -278,8 +278,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -304,7 +304,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -343,40 +343,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
}
}
@@ -11,8 +11,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2024.0.0" />
<PackageReference Include="Speckle.Civil3D.API" VersionOverride="2024.0.0" />
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2024.0.0" ExcludeAssets="runtime"/>
<PackageReference Include="Speckle.Civil3D.API" VersionOverride="2024.0.0" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -268,9 +268,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -278,8 +278,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -304,7 +304,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -343,40 +343,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
}
}
@@ -13,9 +13,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2025.0.0" />
<PackageReference Include="Speckle.Civil3d.API" VersionOverride="2025.0.0" />
<FrameworkReference Include="Microsoft.WindowsDesktop.App" />
<PackageReference Include="Speckle.AutoCAD.API" VersionOverride="2025.0.0" ExcludeAssets="runtime"/>
<PackageReference Include="Speckle.Civil3d.API" VersionOverride="2025.0.0" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -224,9 +224,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -234,8 +234,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -261,7 +261,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
@@ -300,39 +300,39 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
},
"net8.0-windows7.0/win-x64": {
@@ -0,0 +1,60 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Speckle.Connectors.Autocad.Bindings;
using Speckle.Connectors.Common.Cancellation;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Models;
using Speckle.Converters.Autocad;
using Speckle.Converters.Civil3dShared;
using Speckle.Converters.Common;
using Speckle.Sdk;
namespace Speckle.Connectors.Civil3dShared.Bindings;
public sealed class Civil3dReceiveBinding : AutocadReceiveBaseBinding
{
private readonly ICivil3dConversionSettingsFactory _civil3dConversionSettingsFactory;
private readonly IAutocadConversionSettingsFactory _autocadConversionSettingsFactory;
public Civil3dReceiveBinding(
DocumentModelStore store,
IBrowserBridge parent,
ICancellationManager cancellationManager,
IServiceProvider serviceProvider,
IOperationProgressManager operationProgressManager,
ILogger<AutocadReceiveBinding> logger,
ICivil3dConversionSettingsFactory civil3dConversionSettingsFactory,
IAutocadConversionSettingsFactory autocadConversionSettingsFactory,
ISpeckleApplication speckleApplication,
IThreadContext threadContext
)
: base(
store,
parent,
cancellationManager,
serviceProvider,
operationProgressManager,
logger,
speckleApplication,
threadContext
)
{
_civil3dConversionSettingsFactory = civil3dConversionSettingsFactory;
_autocadConversionSettingsFactory = autocadConversionSettingsFactory;
}
// POC: we're registering the conversion settings for autocad here because we need the autocad conversion settings to be able to use the autocad typed converters.
// POC: We need a separate receive binding for civil3d due to using a different unit converter (needed for conversion settings construction)
protected override void InitializeSettings(IServiceProvider serviceProvider)
{
serviceProvider
.GetRequiredService<IConverterSettingsStore<Civil3dConversionSettings>>()
.Initialize(_civil3dConversionSettingsFactory.Create(Application.DocumentManager.CurrentDocument));
serviceProvider
.GetRequiredService<IConverterSettingsStore<AutocadConversionSettings>>()
.Initialize(_autocadConversionSettingsFactory.Create(Application.DocumentManager.CurrentDocument));
}
}
@@ -6,7 +6,6 @@ using Speckle.Connectors.Civil3dShared.Bindings;
using Speckle.Connectors.Civil3dShared.Operations.Send;
using Speckle.Connectors.Common.Builders;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Converters.Civil3dShared.Helpers;
using Speckle.Converters.Civil3dShared.ToSpeckle;
using Speckle.Sdk;
@@ -17,18 +16,20 @@ public static class Civil3dConnectorModule
public static void AddCivil3d(this IServiceCollection serviceCollection)
{
serviceCollection.AddAutocadBase();
serviceCollection.LoadSend();
// register civil specific send classes
// add send
serviceCollection.LoadSend();
serviceCollection.AddScoped<IRootObjectBuilder<AutocadRootObject>, Civil3dRootObjectBuilder>();
serviceCollection.AddSingleton<IBinding, Civil3dSendBinding>();
// automatically detects the Class:IClass interface pattern to register all generated interfaces
serviceCollection.AddMatchingInterfacesAsTransient(Assembly.GetExecutingAssembly());
// add receive
serviceCollection.LoadReceive();
serviceCollection.AddSingleton<IBinding, Civil3dReceiveBinding>();
// additional classes
serviceCollection.AddScoped<PropertySetDefinitionHandler>();
serviceCollection.AddScoped<CatchmentGroupHandler>();
serviceCollection.AddScoped<PipeNetworkHandler>();
// automatically detects the Class:IClass interface pattern to register all generated interfaces
serviceCollection.AddMatchingInterfacesAsTransient(Assembly.GetExecutingAssembly());
}
}
@@ -4,7 +4,6 @@ using Speckle.Connectors.Autocad.HostApp;
using Speckle.Connectors.Autocad.Operations.Send;
using Speckle.Connectors.Common.Caching;
using Speckle.Connectors.Common.Operations;
using Speckle.Converters.Civil3dShared.Helpers;
using Speckle.Converters.Civil3dShared.ToSpeckle;
using Speckle.Converters.Common;
using Speckle.Sdk.Logging;
@@ -16,14 +15,10 @@ public sealed class Civil3dRootObjectBuilder : AutocadRootObjectBaseBuilder
{
private readonly AutocadLayerUnpacker _layerUnpacker;
private readonly PropertySetDefinitionHandler _propertySetDefinitionHandler;
private readonly CatchmentGroupHandler _catchmentGroupHandler;
private readonly PipeNetworkHandler _pipeNetworkHandler;
public Civil3dRootObjectBuilder(
AutocadLayerUnpacker layerUnpacker,
PropertySetDefinitionHandler propertySetDefinitionHandler,
CatchmentGroupHandler catchmentGroupHandler,
PipeNetworkHandler pipeNetworkHandler,
IRootToSpeckleConverter converter,
ISendConversionCache sendConversionCache,
AutocadInstanceUnpacker instanceObjectManager,
@@ -46,8 +41,6 @@ public sealed class Civil3dRootObjectBuilder : AutocadRootObjectBaseBuilder
{
_layerUnpacker = layerUnpacker;
_propertySetDefinitionHandler = propertySetDefinitionHandler;
_catchmentGroupHandler = catchmentGroupHandler;
_pipeNetworkHandler = pipeNetworkHandler;
}
public override (Collection, LayerTableRecord?) CreateObjectCollection(Entity entity, Transaction tr)
@@ -57,11 +50,8 @@ public sealed class Civil3dRootObjectBuilder : AutocadRootObjectBaseBuilder
return (layer, autocadLayer);
}
// POC: probably will need to add Network proxies as well
public override void AddAdditionalProxiesToRoot(Collection rootObject)
{
rootObject[ProxyKeys.PROPERTYSET_DEFINITIONS] = _propertySetDefinitionHandler.Definitions;
rootObject["catchmentGroupProxies"] = _catchmentGroupHandler.CatchmentGroupProxiesCache.Values.ToList();
rootObject["pipeNetworkProxies"] = _pipeNetworkHandler.PipeNetworkProxiesCache.Values.ToList();
}
}
@@ -9,13 +9,13 @@
<Import_RootNamespace>Speckle.Connectors.Civil3dShared</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Bindings\Civil3dReceiveBinding.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DependencyInjection\Civil3dConnectorModule.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\Civil3dRootObjectBuilder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bindings\Civil3dSendBinding.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)DependencyInjection\" />
<Folder Include="$(MSBuildThisFileDirectory)Bindings\" />
<Folder Include="$(MSBuildThisFileDirectory)Operations\Send\" />
</ItemGroup>
</Project>
@@ -1,4 +1,5 @@
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Models;
using Speckle.Connectors.DUI.Models.Card;
@@ -11,6 +12,7 @@ public class CsiSharedBasicConnectorBinding : IBasicConnectorBinding
private readonly ISpeckleApplication _speckleApplication;
private readonly DocumentModelStore _store;
private readonly ITopLevelExceptionHandler _topLevelExceptionHandler;
private readonly IThreadContext _threadContext;
public string Name => "baseBinding";
public IBrowserBridge Parent { get; }
public BasicConnectorBindingCommands Commands { get; }
@@ -19,9 +21,11 @@ public class CsiSharedBasicConnectorBinding : IBasicConnectorBinding
IBrowserBridge parent,
ISpeckleApplication speckleApplication,
DocumentModelStore store,
ITopLevelExceptionHandler topLevelExceptionHandler
ITopLevelExceptionHandler topLevelExceptionHandler,
IThreadContext threadContext
)
{
_threadContext = threadContext;
Parent = parent;
_speckleApplication = speckleApplication;
_store = store;
@@ -31,7 +35,11 @@ public class CsiSharedBasicConnectorBinding : IBasicConnectorBinding
_store.DocumentChanged += (_, _) =>
_topLevelExceptionHandler.FireAndForget(async () =>
{
await Commands.NotifyDocumentChanged();
// enforce main thread
await _threadContext.RunOnMainAsync(async () =>
{
await Commands.NotifyDocumentChanged();
});
});
}
@@ -45,11 +53,20 @@ public class CsiSharedBasicConnectorBinding : IBasicConnectorBinding
public DocumentModelStore GetDocumentState() => _store;
public void AddModel(ModelCard model) => _store.AddModel(model);
/// <remarks>Operations must run on the main thread for ETABS and SAP 2000</remarks>
public void AddModel(ModelCard model) =>
_topLevelExceptionHandler.CatchUnhandled(() => _threadContext.RunOnThread(() => _store.AddModel(model), true));
public void UpdateModel(ModelCard model) => _store.UpdateModel(model);
/// <remarks>Operations must run on the main thread for ETABS and SAP 2000</remarks>
public void UpdateModel(ModelCard model) =>
_topLevelExceptionHandler.CatchUnhandled(() => _threadContext.RunOnThread(() => _store.UpdateModel(model), true));
public void RemoveModel(ModelCard model) => _store.RemoveModel(model);
/// <remarks>Operations must run on the main thread for ETABS and SAP 2000</remarks>
public void RemoveModel(ModelCard model) =>
_topLevelExceptionHandler.CatchUnhandled(() => _threadContext.RunOnThread(() => _store.RemoveModel(model), true));
public void RemoveModels(List<ModelCard> models) =>
_topLevelExceptionHandler.CatchUnhandled(() => _threadContext.RunOnThread(() => _store.RemoveModels(models), true));
public Task HighlightModel(string modelCardId) => Task.CompletedTask;
@@ -1,4 +1,5 @@
using Speckle.Connectors.CSiShared.HostApp;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.CSiShared.HostApp;
using Speckle.Connectors.CSiShared.Utils;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
@@ -12,7 +13,9 @@ public class CsiSharedSelectionBinding : ISelectionBinding, IDisposable
private bool _disposed;
private readonly Timer _selectionTimer;
private readonly ICsiApplicationService _csiApplicationService;
private readonly IThreadContext _threadContext;
private HashSet<string> _lastSelection = new();
private readonly ITopLevelExceptionHandler _topLevelExceptionHandler;
public IBrowserBridge Parent { get; }
public string Name => "selectionBinding";
@@ -20,26 +23,37 @@ public class CsiSharedSelectionBinding : ISelectionBinding, IDisposable
public CsiSharedSelectionBinding(
IBrowserBridge parent,
ICsiApplicationService csiApplicationService,
ITopLevelExceptionHandler topLevelExceptionHandler
ITopLevelExceptionHandler topLevelExceptionHandler,
IThreadContext threadContext
)
{
_threadContext = threadContext;
Parent = parent;
_csiApplicationService = csiApplicationService;
_topLevelExceptionHandler = topLevelExceptionHandler;
_selectionTimer = new Timer(1000);
_selectionTimer.Elapsed += (_, _) => topLevelExceptionHandler.CatchUnhandled(CheckSelectionChanged);
_selectionTimer.Elapsed += (_, _) =>
_topLevelExceptionHandler.CatchUnhandled(() => _threadContext.RunOnMain(CheckSelectionChanged));
_selectionTimer.Start();
}
private void CheckSelectionChanged()
{
// timer callbacks are on a background thread, but CSI API calls must be on main thread
var currentSelection = GetSelection();
var currentIds = new HashSet<string>(currentSelection.SelectedObjectIds);
if (!_lastSelection.SetEquals(currentIds))
{
_lastSelection = currentIds;
Parent.Send(SelectionBindingEvents.SET_SELECTION, currentSelection);
// ensure UI updates also run on main thread
_threadContext.RunOnMain(
() =>
_topLevelExceptionHandler.CatchUnhandled(
() => Parent.Send(SelectionBindingEvents.SET_SELECTION, currentSelection)
)
);
}
}
@@ -101,7 +101,7 @@ public sealed class CsiSharedSendBinding : ISendBinding
.ServiceProvider.GetRequiredService<SendOperation<ICsiWrapper>>()
.Execute(
wrappers,
modelCard.GetSendInfo(_speckleApplication.Slug),
modelCard.GetSendInfo(_speckleApplication.ApplicationAndVersion),
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
cancellationItem.Token
);
@@ -1,5 +1,6 @@
using System.IO;
using Microsoft.Extensions.Logging;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Models;
using Speckle.Connectors.DUI.Utils;
@@ -16,6 +17,7 @@ public class CsiDocumentModelStore : DocumentModelStore, IDisposable
private readonly ILogger<CsiDocumentModelStore> _logger;
private readonly ICsiApplicationService _csiApplicationService;
private readonly ITopLevelExceptionHandler _topLevelExceptionHandler;
private readonly IThreadContext _threadContext;
private readonly Timer _modelCheckTimer;
private string _lastModelFilename = string.Empty;
private bool _disposed;
@@ -28,10 +30,12 @@ public class CsiDocumentModelStore : DocumentModelStore, IDisposable
ISpeckleApplication speckleApplication,
ILogger<CsiDocumentModelStore> logger,
ICsiApplicationService csiApplicationService,
ITopLevelExceptionHandler topLevelExceptionHandler
ITopLevelExceptionHandler topLevelExceptionHandler,
IThreadContext threadContext
)
: base(jsonSerializer)
{
_threadContext = threadContext;
_speckleApplication = speckleApplication;
_logger = logger;
_csiApplicationService = csiApplicationService;
@@ -39,7 +43,10 @@ public class CsiDocumentModelStore : DocumentModelStore, IDisposable
// initialize timer to check for model changes
_modelCheckTimer = new Timer(1000);
_modelCheckTimer.Elapsed += (_, _) => _topLevelExceptionHandler.CatchUnhandled(CheckModelChanges);
// timer runs on background thread but model checks must be on main thread
_modelCheckTimer.Elapsed += (_, _) =>
_topLevelExceptionHandler.CatchUnhandled(() => _threadContext.RunOnMain(CheckModelChanges));
_modelCheckTimer.Start();
}
@@ -259,9 +259,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +269,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -287,7 +287,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.etabs21": {
@@ -332,40 +332,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
}
}
@@ -215,9 +215,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -225,8 +225,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -243,7 +243,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.etabs22": {
@@ -288,39 +288,39 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
}
}
@@ -16,7 +16,7 @@
<ItemGroup>
<Reference Include="WindowsFormsIntegration"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2020.0.0"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2020.0.0" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -259,9 +259,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +269,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -287,7 +287,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.navisworks2020": {
@@ -334,40 +334,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
},
".NETFramework,Version=v4.8/win-x64": {
@@ -16,7 +16,7 @@
<ItemGroup>
<Reference Include="WindowsFormsIntegration"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2021.0.0"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2021.0.0" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -259,9 +259,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +269,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -287,7 +287,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.navisworks2021": {
@@ -334,40 +334,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
},
".NETFramework,Version=v4.8/win-x64": {
@@ -16,7 +16,7 @@
<ItemGroup>
<Reference Include="WindowsFormsIntegration"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2022.0.0"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2022.0.0" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -259,9 +259,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +269,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -287,7 +287,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.navisworks2022": {
@@ -334,40 +334,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
},
".NETFramework,Version=v4.8/win-x64": {
@@ -16,7 +16,7 @@
<ItemGroup>
<Reference Include="WindowsFormsIntegration"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2023.0.0"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2023.0.0" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -259,9 +259,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +269,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -287,7 +287,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.navisworks2023": {
@@ -334,40 +334,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
},
".NETFramework,Version=v4.8/win-x64": {
@@ -16,7 +16,7 @@
<ItemGroup>
<Reference Include="WindowsFormsIntegration"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2024.0.0"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2024.0.0" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
@@ -259,9 +259,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -269,8 +269,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -287,7 +287,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.navisworks2024": {
@@ -334,40 +334,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
},
".NETFramework,Version=v4.8/win-x64": {
@@ -16,7 +16,7 @@
<ItemGroup>
<Reference Include="WindowsFormsIntegration"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2025.0.0"/>
<PackageReference Include="Speckle.Navisworks.API" VersionOverride="2025.0.0" ExcludeAssets="runtime"/>
<PackageReference Include="Microsoft.Web.WebView2" VersionOverride="1.0.2045.28" />
</ItemGroup>
@@ -265,9 +265,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -275,8 +275,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
@@ -293,7 +293,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.navisworks2025": {
@@ -334,40 +334,40 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
},
".NETFramework,Version=v4.8/win-x64": {
@@ -0,0 +1,9 @@
{
"profiles": {
"Speckle.Connector.Navisworks2026": {
"commandName": "Executable",
"executablePath": "C:\\Program Files\\Autodesk\\Navisworks Manage 2026\\Roamer.exe",
"commandLineArgs": " -licensing AdLM"
}
}
}
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<FileAlignment>512</FileAlignment>
<NavisworksBuildNumber>v23</NavisworksBuildNumber>
<NavisworksVersion>2026</NavisworksVersion>
<DefineConstants>$(DefineConstants);TRACE;NAVIS2026;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.Navisworks.API" VersionOverride="2026.0.1" ExcludeAssets="runtime"/>
<PackageReference Include="Microsoft.Web.WebView2" VersionOverride="1.0.2365.46" />
<PackageReference Include="System.Reactive" VersionOverride="6.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Converters\Navisworks\Speckle.Converters.Navisworks2026\Speckle.Converters.Navisworks2026.csproj" />
<ProjectReference Include="..\..\..\Sdk\Speckle.Connectors.Common\Speckle.Connectors.Common.csproj"/>
<ProjectReference Include="..\..\..\DUI3\Speckle.Connectors.DUI.WebView\Speckle.Connectors.DUI.WebView.csproj"/>
</ItemGroup>
</Project>
@@ -0,0 +1,389 @@
{
"version": 2,
"dependencies": {
".NETFramework,Version=v4.8": {
"Microsoft.NETFramework.ReferenceAssemblies": {
"type": "Direct",
"requested": "[1.0.3, )",
"resolved": "1.0.3",
"contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==",
"dependencies": {
"Microsoft.NETFramework.ReferenceAssemblies.net48": "1.0.3"
}
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
"requested": "[8.0.0, )",
"resolved": "8.0.0",
"contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "8.0.0",
"Microsoft.SourceLink.Common": "8.0.0"
}
},
"Microsoft.Web.WebView2": {
"type": "Direct",
"requested": "[1.0.2365.46, )",
"resolved": "1.0.2365.46",
"contentHash": "8L/Wv1r6NRSYpaaywBE/zcjDShTlTCEqBgsrB0xPQ11umziTtSNTu/rcLVazoQhHfVnQvX/fruMtdJCiPTDuyQ=="
},
"PolySharp": {
"type": "Direct",
"requested": "[1.14.1, )",
"resolved": "1.14.1",
"contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ=="
},
"Speckle.InterfaceGenerator": {
"type": "Direct",
"requested": "[0.9.6, )",
"resolved": "0.9.6",
"contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w=="
},
"Speckle.Navisworks.API": {
"type": "Direct",
"requested": "[2026.0.1, )",
"resolved": "2026.0.1",
"contentHash": "IjIxv+EGmEVYquljXMCNxdBY7kGBeMxEecIdXvyzBj3dLLhJjqpmyfA2Yheq4pfK4AmE6LWZ5mQyD+39onApRw=="
},
"System.Reactive": {
"type": "Direct",
"requested": "[6.0.0, )",
"resolved": "6.0.0",
"contentHash": "31kfaW4ZupZzPsI5PVe77VhnvFF55qgma7KZr/E0iFTs6fmdhhG8j0mgEx620iLTey1EynOkEfnyTjtNEpJzGw==",
"dependencies": {
"System.Threading.Tasks.Extensions": "4.5.4"
}
},
"GraphQL.Client": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "8yPNBbuVBpTptivyAlak4GZvbwbUcjeQTL4vN1HKHRuOykZ4r7l5fcLS6vpyPyLn0x8FsL31xbOIKyxbmR9rbA==",
"dependencies": {
"GraphQL.Client.Abstractions": "6.0.0",
"GraphQL.Client.Abstractions.Websocket": "6.0.0",
"System.Net.WebSockets.Client.Managed": "1.0.22",
"System.Reactive": "5.0.0"
}
},
"GraphQL.Client.Abstractions": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "h7uzWFORHZ+CCjwr/ThAyXMr0DPpzEANDa4Uo54wqCQ+j7qUKwqYTgOrb1W40sqbvNaZm9v/X7It31SUw0maHA==",
"dependencies": {
"GraphQL.Primitives": "6.0.0"
}
},
"GraphQL.Client.Abstractions.Websocket": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "Nr9bPf8gIOvLuXpqEpqr9z9jslYFJOvd0feHth3/kPqeR3uMbjF5pjiwh4jxyMcxHdr8Pb6QiXkV3hsSyt0v7A==",
"dependencies": {
"GraphQL.Client.Abstractions": "6.0.0"
}
},
"GraphQL.Primitives": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA=="
},
"Microsoft.Bcl.AsyncInterfaces": {
"type": "Transitive",
"resolved": "5.0.0",
"contentHash": "W8DPQjkMScOMTtJbPwmPyj9c3zYSFGawDW3jwlBOOsnY+EzZFLgNQ/UMkK35JmkNOVPdCyPr2Tw7Vv9N+KA3ZQ==",
"dependencies": {
"System.Threading.Tasks.Extensions": "4.5.4"
}
},
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
},
"Microsoft.CSharp": {
"type": "Transitive",
"resolved": "4.7.0",
"contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA=="
},
"Microsoft.Data.Sqlite": {
"type": "Transitive",
"resolved": "7.0.5",
"contentHash": "KGxbPeWsQMnmQy43DSBxAFtHz3l2JX8EWBSGUCvT3CuZ8KsuzbkqMIJMDOxWtG8eZSoCDI04aiVQjWuuV8HmSw==",
"dependencies": {
"Microsoft.Data.Sqlite.Core": "7.0.5",
"SQLitePCLRaw.bundle_e_sqlite3": "2.1.4"
}
},
"Microsoft.Data.Sqlite.Core": {
"type": "Transitive",
"resolved": "7.0.5",
"contentHash": "FTerRmQPqHrCrnoUzhBu+E+1DNGwyrAMLqHkAqOOOu5pGfyMOj8qQUBxI/gDtWtG11p49UxSfWmBzRNlwZqfUg==",
"dependencies": {
"SQLitePCLRaw.core": "2.1.4"
}
},
"Microsoft.Extensions.Configuration": {
"type": "Transitive",
"resolved": "2.2.0",
"contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==",
"dependencies": {
"Microsoft.Extensions.Configuration.Abstractions": "2.2.0"
}
},
"Microsoft.Extensions.Configuration.Abstractions": {
"type": "Transitive",
"resolved": "2.2.0",
"contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==",
"dependencies": {
"Microsoft.Extensions.Primitives": "2.2.0"
}
},
"Microsoft.Extensions.Configuration.Binder": {
"type": "Transitive",
"resolved": "2.2.0",
"contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==",
"dependencies": {
"Microsoft.Extensions.Configuration": "2.2.0"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "2.2.0",
"contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw=="
},
"Microsoft.Extensions.Options": {
"type": "Transitive",
"resolved": "2.2.0",
"contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Primitives": "2.2.0",
"System.ComponentModel.Annotations": "4.5.0"
}
},
"Microsoft.Extensions.Primitives": {
"type": "Transitive",
"resolved": "2.2.0",
"contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==",
"dependencies": {
"System.Memory": "4.5.1",
"System.Runtime.CompilerServices.Unsafe": "4.5.1"
}
},
"Microsoft.NETFramework.ReferenceAssemblies.net48": {
"type": "Transitive",
"resolved": "1.0.3",
"contentHash": "zMk4D+9zyiEWByyQ7oPImPN/Jhpj166Ky0Nlla4eXlNL8hI/BtSJsgR8Inldd4NNpIAH3oh8yym0W2DrhXdSLQ=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Speckle.Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.2",
"contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA=="
},
"SQLitePCLRaw.bundle_e_sqlite3": {
"type": "Transitive",
"resolved": "2.1.4",
"contentHash": "EWI1olKDjFEBMJu0+3wuxwziIAdWDVMYLhuZ3Qs84rrz+DHwD00RzWPZCa+bLnHCf3oJwuFZIRsHT5p236QXww==",
"dependencies": {
"SQLitePCLRaw.lib.e_sqlite3": "2.1.4",
"SQLitePCLRaw.provider.dynamic_cdecl": "2.1.4"
}
},
"SQLitePCLRaw.core": {
"type": "Transitive",
"resolved": "2.1.4",
"contentHash": "inBjvSHo9UDKneGNzfUfDjK08JzlcIhn1+SP5Y3m6cgXpCxXKCJDy6Mka7LpgSV+UZmKSnC8rTwB0SQ0xKu5pA==",
"dependencies": {
"System.Memory": "4.5.3"
}
},
"SQLitePCLRaw.lib.e_sqlite3": {
"type": "Transitive",
"resolved": "2.1.4",
"contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg=="
},
"SQLitePCLRaw.provider.dynamic_cdecl": {
"type": "Transitive",
"resolved": "2.1.4",
"contentHash": "ZsaKKhgYF9B1fvcnOGKl3EycNAwd9CRWX7v0rEfuPWhQQ5Jjpvf2VEHahiLIGHio3hxi3EIKFJw9KvyowWOUAw==",
"dependencies": {
"SQLitePCLRaw.core": "2.1.4"
}
},
"System.Buffers": {
"type": "Transitive",
"resolved": "4.4.0",
"contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw=="
},
"System.ComponentModel.Annotations": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg=="
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.3",
"contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==",
"dependencies": {
"System.Buffers": "4.4.0",
"System.Numerics.Vectors": "4.4.0",
"System.Runtime.CompilerServices.Unsafe": "4.5.2"
}
},
"System.Net.WebSockets.Client.Managed": {
"type": "Transitive",
"resolved": "1.0.22",
"contentHash": "WqEOxPlXjuZrIjUtXNE9NxEfU/n5E35iV2PtoZdJSUC4tlrqwHnTee+wvMIM4OUaJWmwrymeqcgYrE0IkGAgLA==",
"dependencies": {
"System.Buffers": "4.4.0",
"System.Numerics.Vectors": "4.4.0"
}
},
"System.Numerics.Vectors": {
"type": "Transitive",
"resolved": "4.4.0",
"contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ=="
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "4.5.3",
"contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw=="
},
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
"resolved": "4.5.4",
"contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "4.5.3"
}
},
"speckle.connectors.common": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Connectors.Common": "[1.0.0, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui.webview": {
"type": "Project",
"dependencies": {
"Microsoft.Web.WebView2": "[1.0.1938.49, )",
"Speckle.Connectors.DUI": "[1.0.0, )"
}
},
"speckle.connectors.logging": {
"type": "Project"
},
"speckle.converters.common": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.navisworks2026": {
"type": "Project",
"dependencies": {
"Speckle.Connectors.DUI": "[1.0.0, )",
"Speckle.Converters.Common": "[1.0.0, )",
"Speckle.Navisworks.API": "[2026.0.1, )",
"System.Reactive": "[6.0.0, )"
}
},
"Microsoft.Extensions.DependencyInjection": {
"type": "CentralTransitive",
"requested": "[2.2.0, )",
"resolved": "2.2.0",
"contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0"
}
},
"Microsoft.Extensions.Logging": {
"type": "CentralTransitive",
"requested": "[2.2.0, )",
"resolved": "2.2.0",
"contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==",
"dependencies": {
"Microsoft.Extensions.Configuration.Binder": "2.2.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging.Abstractions": "2.2.0",
"Microsoft.Extensions.Options": "2.2.0"
}
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "CentralTransitive",
"requested": "[2.2.0, )",
"resolved": "2.2.0",
"contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A=="
},
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"Speckle.Sdk.Dependencies": {
"type": "CentralTransitive",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
},
".NETFramework,Version=v4.8/win-x64": {
"Microsoft.Web.WebView2": {
"type": "Direct",
"requested": "[1.0.2365.46, )",
"resolved": "1.0.2365.46",
"contentHash": "8L/Wv1r6NRSYpaaywBE/zcjDShTlTCEqBgsrB0xPQ11umziTtSNTu/rcLVazoQhHfVnQvX/fruMtdJCiPTDuyQ=="
},
"SQLitePCLRaw.lib.e_sqlite3": {
"type": "Transitive",
"resolved": "2.1.4",
"contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg=="
}
}
}
}
@@ -50,6 +50,8 @@ public class NavisworksBasicConnectorBinding : IBasicConnectorBinding
public void RemoveModel(ModelCard model) => _store.RemoveModel(model);
public void RemoveModels(List<ModelCard> models) => _store.RemoveModels(models);
public Task HighlightModel(string modelCardId) => Task.CompletedTask;
public async Task HighlightObjects(IReadOnlyList<string> objectIds) =>
@@ -26,7 +26,7 @@ public class NavisworksSelectionBinding : ISelectionBinding
}
private void OnSelectionChange(object? o, EventArgs eventArgs) =>
_idleManager.SubscribeToIdle(nameof(NavisworksSelectionBinding), async () => await UpdateSelectionAsync());
_idleManager.SubscribeToIdle(nameof(UpdateSelectionAsync), async () => await UpdateSelectionAsync());
private async Task UpdateSelectionAsync()
{
@@ -38,7 +38,8 @@ public class NavisworksSelectionBinding : ISelectionBinding
{
// Ensure there is an active document and a valid selection
var activeDocument = NavisworksApp.ActiveDocument;
if (activeDocument == null || activeDocument.CurrentSelection.SelectedItems.IsEmpty)
var selection = activeDocument?.CurrentSelection?.SelectedItems ?? [];
if (selection.Count == 0)
{
// Return an empty list if no valid selection exists
return new SelectionInfo([], "No selection available");
@@ -46,8 +47,8 @@ public class NavisworksSelectionBinding : ISelectionBinding
// Ensure only visible elements are processed by filtering using IsElementVisible
var selectedObjectsIds = new HashSet<string>(
activeDocument
.CurrentSelection.SelectedItems.Where(_selectionService.IsVisible) // Exclude hidden elements
selection
.Where(_selectionService.IsVisible) // Exclude hidden elements
.Select(_selectionService.GetModelItemPath) // Resolve to index paths
);
@@ -1,5 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Speckle.Connector.Navisworks.Operations.Send.Filters;
using Speckle.Connector.Navisworks.Operations.Send.Settings;
using Speckle.Connector.Navisworks.Services;
using Speckle.Connectors.Common.Cancellation;
@@ -30,7 +31,6 @@ public class NavisworksSendBinding : ISendBinding
private readonly DocumentModelStore _store;
private readonly IServiceProvider _serviceProvider;
private readonly List<ISendFilter> _sendFilters;
private readonly ICancellationManager _cancellationManager;
private readonly IOperationProgressManager _operationProgressManager;
private readonly ILogger<NavisworksSendBinding> _logger;
@@ -44,7 +44,6 @@ public class NavisworksSendBinding : ISendBinding
public NavisworksSendBinding(
DocumentModelStore store,
IBrowserBridge parent,
IEnumerable<ISendFilter> sendFilters,
IServiceProvider serviceProvider,
ICancellationManager cancellationManager,
IOperationProgressManager operationProgressManager,
@@ -61,7 +60,6 @@ public class NavisworksSendBinding : ISendBinding
Commands = new SendBindingUICommands(parent);
_store = store;
_serviceProvider = serviceProvider;
_sendFilters = sendFilters.ToList();
_cancellationManager = cancellationManager;
_operationProgressManager = operationProgressManager;
_logger = logger;
@@ -76,7 +74,12 @@ public class NavisworksSendBinding : ISendBinding
private static void SubscribeToNavisworksEvents() { }
public List<ISendFilter> GetSendFilters() => _sendFilters;
// Do not change the behavior/scope of this class on send binding unless make sure the behavior is same. Otherwise, we might not be able to update list of saved sets.
public List<ISendFilter> GetSendFilters() =>
[
new NavisworksSelectionFilter() { IsDefault = true },
new NavisworksSavedSetsFilter(new ElementSelectionService())
];
public List<ICardSetting> GetSendSettings() =>
[
@@ -84,6 +87,7 @@ public class NavisworksSendBinding : ISendBinding
new OriginModeSetting(OriginMode.ModelOrigin),
new IncludeInternalPropertiesSetting(false),
new ConvertHiddenElementsSetting(false),
new PreserveModelHierarchySetting(false),
];
public async Task Send(string modelCardId) =>
@@ -102,9 +106,21 @@ public class NavisworksSendBinding : ISendBinding
using var cancellationItem = _cancellationManager.GetCancellationItem(modelCardId);
var navisworksModelItems = GetNavisworksModelItems(modelCard);
var progress = _operationProgressManager.CreateOperationProgressEventHandler(
Parent,
modelCard.ModelCardId.NotNull(),
cancellationItem.Token
);
var sendResult = await ExecuteSendOperation(scope, modelCard, navisworksModelItems, cancellationItem.Token);
var navisworksModelItems = await GetNavisworksModelItems(modelCard, progress);
var sendResult = await ExecuteSendOperation(
scope,
modelCard,
navisworksModelItems,
progress,
cancellationItem.Token
);
await Commands.SetModelSendResult(modelCardId, sendResult.RootObjId, sendResult.ConversionResults);
}
@@ -119,12 +135,16 @@ public class NavisworksSendBinding : ISendBinding
_logger.LogModelCardHandledError(ex);
await Commands.SetModelError(modelCardId, ex);
}
finally
{
// otherwise the id of the operation persists on the cancellation manager and triggers 'Operations cancelled because of document swap!' message to UI.
_cancellationManager.CancelOperation(modelCardId);
}
}
private SenderModelCard GetModelCard(string modelCardId) =>
_store.GetModelById(modelCardId) is not SenderModelCard modelCard
? throw new InvalidOperationException("No publish model card was found.")
: modelCard;
_store.GetModelById(modelCardId) as SenderModelCard
?? throw new InvalidOperationException("No publish model card was found.");
private void InitializeConverterSettings(IServiceScope scope, SenderModelCard modelCard) =>
scope
@@ -134,43 +154,56 @@ public class NavisworksSendBinding : ISendBinding
originMode: _toSpeckleSettingsManagerNavisworks.GetOriginMode(modelCard),
visualRepresentationMode: _toSpeckleSettingsManagerNavisworks.GetVisualRepresentationMode(modelCard),
convertHiddenElements: _toSpeckleSettingsManagerNavisworks.GetConvertHiddenElements(modelCard),
includeInternalProperties: _toSpeckleSettingsManagerNavisworks.GetIncludeInternalProperties(modelCard)
includeInternalProperties: _toSpeckleSettingsManagerNavisworks.GetIncludeInternalProperties(modelCard),
preserveModelHierarchy: _toSpeckleSettingsManagerNavisworks.GetPreserveModelHierarchy(modelCard)
)
);
private List<NAV.ModelItem> GetNavisworksModelItems(SenderModelCard modelCard)
private async Task<List<NAV.ModelItem>> GetNavisworksModelItems(
SenderModelCard modelCard,
IProgress<CardProgress> onOperationProgressed
)
{
var selectedPaths = modelCard.SendFilter.NotNull().RefreshObjectIds();
var convertHiddenElementsSetting =
modelCard.Settings!.FirstOrDefault(s => s.Id == "convertHiddenElements")?.Value as bool? ?? false;
var message = convertHiddenElementsSetting
? "No visible objects were found to convert. Please update your publish filter!"
: "No objects were found to convert. Please update your publish filter, or check items are visible!";
if (selectedPaths.Count == 0)
{
throw new SpeckleSendFilterException("No objects were found to convert. Please update your publish filter!");
throw new SpeckleSendFilterException(message);
}
onOperationProgressed.Report(new CardProgress("Getting selection...", null));
await Task.CompletedTask;
var modelItems = modelCard
.SendFilter.NotNull()
.RefreshObjectIds()
.Select(_selectionService.GetModelItemFromPath)
.SelectMany(_selectionService.GetGeometryNodes)
.Where(_selectionService.IsVisible)
.ToList();
return modelItems.Count == 0
? throw new SpeckleSendFilterException("No objects were found to convert. Please update your publish filter!")
: modelItems;
var modelItems = new List<NAV.ModelItem>();
double count = 0;
foreach (var path in selectedPaths)
{
onOperationProgressed.Report(new CardProgress("Getting selection...", count / selectedPaths.Count));
await Task.CompletedTask;
var modelItem = _selectionService.GetModelItemFromPath(path);
modelItems.AddRange(_selectionService.GetGeometryNodes(modelItem).Where(_selectionService.IsVisible));
count++;
}
return modelItems.Count == 0 ? throw new SpeckleSendFilterException(message) : modelItems;
}
private async Task<SendOperationResult> ExecuteSendOperation(
IServiceScope scope,
SenderModelCard modelCard,
List<NAV.ModelItem> navisworksModelItems,
IProgress<CardProgress> onOperationProgressed,
CancellationToken token
) =>
await scope
.ServiceProvider.GetRequiredService<SendOperation<NAV.ModelItem>>()
.Execute(
navisworksModelItems,
modelCard.GetSendInfo(_speckleApplication.Slug),
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCard.ModelCardId.NotNull(), token),
modelCard.GetSendInfo(_speckleApplication.ApplicationAndVersion),
onOperationProgressed,
token
);
@@ -67,6 +67,7 @@ public static class NavisworksConnectorServiceRegistration
// register filters
serviceCollection.AddScoped<ISendFilter, NavisworksSelectionFilter>();
serviceCollection.AddScoped<ISendFilter, NavisworksSavedSetsFilter>();
serviceCollection.AddScoped<IElementSelectionService, ElementSelectionService>();
}
}
@@ -1,23 +1,31 @@
using static Speckle.Converter.Navisworks.Helpers.ElementSelectionHelper;
using Speckle.InterfaceGenerator;
using static Speckle.Converter.Navisworks.Helpers.ElementSelectionHelper;
namespace Speckle.Connector.Navisworks.Services;
public interface IElementSelectionService
{
string GetModelItemPath(NAV.ModelItem modelItem);
NAV.ModelItem GetModelItemFromPath(string path);
bool IsVisible(NAV.ModelItem modelItem);
IReadOnlyCollection<NAV.ModelItem> GetGeometryNodes(NAV.ModelItem modelItem);
}
[GenerateAutoInterface]
public class ElementSelectionService : IElementSelectionService
{
private readonly Dictionary<Guid, bool> _visibleCache = new();
public string GetModelItemPath(NAV.ModelItem modelItem) => ResolveModelItemToIndexPath(modelItem);
public NAV.ModelItem GetModelItemFromPath(string path) => ResolveIndexPathToModelItem(path);
public bool IsVisible(NAV.ModelItem modelItem) => IsElementVisible(modelItem);
public bool IsVisible(NAV.ModelItem modelItem)
{
var key = modelItem.InstanceGuid;
if (_visibleCache.TryGetValue(key, out var isVisible))
{
return isVisible;
}
//same as ElementSelectionHelper.IsElementVisible
foreach (var item in modelItem.AncestorsAndSelf)
{
_visibleCache[item.InstanceGuid] = !item.IsHidden;
}
return _visibleCache[key];
}
public IReadOnlyCollection<NAV.ModelItem> GetGeometryNodes(NAV.ModelItem modelItem) =>
ResolveGeometryLeafNodes(modelItem);
public IEnumerable<NAV.ModelItem> GetGeometryNodes(NAV.ModelItem modelItem) => ResolveGeometryLeafNodes(modelItem);
}
@@ -43,12 +43,13 @@ public class NavisworksColorUnpacker(
Dictionary<string, ColorProxy> colorProxies = [];
Dictionary<string, string> mergedIds = [];
// Build mergedIds map once
foreach (var group in groupedNodes)
{
foreach (var node in group.Value)
string groupKey = group.Key;
foreach (var nodePath in group.Value.Select(selectionService.GetModelItemPath))
{
mergedIds[selectionService.GetModelItemPath(node)] = group.Key;
mergedIds[nodePath] = groupKey;
}
}
@@ -56,13 +57,13 @@ public class NavisworksColorUnpacker(
{
try
{
// Skip non-2D elements
if (!Is2DElement(navisworksObject))
{
continue;
}
var navisworksObjectId = selectionService.GetModelItemPath(navisworksObject);
var finalId = mergedIds.TryGetValue(navisworksObjectId, out var mergedId) ? mergedId : navisworksObjectId;
var geometry = navisworksObject.Geometry;
@@ -77,7 +78,6 @@ public class NavisworksColorUnpacker(
geometry.OriginalColor,
defaultColor
);
var colorId = Select(
mode,
$"{geometry.ActiveColor.GetHashCode()}_{geometry.ActiveTransparency}".GetHashCode(),
@@ -77,7 +77,10 @@ public sealed class NavisworksDocumentEvents
_topLevelExceptionHandler.CatchUnhandled(
() =>
_idleManager.SubscribeToIdle(nameof(NavisworksDocumentEvents), async () => await ProcessModelStateChangeAsync())
_idleManager.SubscribeToIdle(
nameof(ProcessModelStateChangeAsync),
async () => await ProcessModelStateChangeAsync()
)
);
}
@@ -43,12 +43,13 @@ public class NavisworksMaterialUnpacker(
Dictionary<string, RenderMaterialProxy> renderMaterialProxies = [];
Dictionary<string, string> mergedIds = [];
// Build mergedIds map once
foreach (var group in groupedNodes)
{
foreach (var node in group.Value)
string groupKey = group.Key;
foreach (var nodePath in group.Value.Select(selectionService.GetModelItemPath))
{
mergedIds[selectionService.GetModelItemPath(node)] = group.Key;
mergedIds[nodePath] = groupKey;
}
}
@@ -63,7 +64,6 @@ public class NavisworksMaterialUnpacker(
var navisworksObjectId = selectionService.GetModelItemPath(navisworksObject);
var finalId = mergedIds.TryGetValue(navisworksObjectId, out var mergedId) ? mergedId : navisworksObjectId;
var geometry = navisworksObject.Geometry;
var mode = converterSettings.Current.User.VisualRepresentationMode;
@@ -76,7 +76,6 @@ public class NavisworksMaterialUnpacker(
geometry.OriginalColor,
defaultColor
);
var renderTransparency = Select(
mode,
geometry.ActiveTransparency,
@@ -84,7 +83,6 @@ public class NavisworksMaterialUnpacker(
geometry.OriginalTransparency,
0.0
);
var renderMaterialId = Select(
mode,
$"{geometry.ActiveColor.GetHashCode()}_{geometry.ActiveTransparency}".GetHashCode(),
@@ -0,0 +1,132 @@
using Speckle.Connector.Navisworks.Services;
using Speckle.Connectors.DUI.Exceptions;
using Speckle.Connectors.DUI.Models.Card.SendFilter;
using Speckle.Connectors.DUI.Utils;
using Speckle.Converter.Navisworks.Constants;
namespace Speckle.Connector.Navisworks.Operations.Send.Filters;
public class NavisworksSavedSetsFilter : DiscriminatedObject, ISendFilterSelect
{
private readonly IElementSelectionService _selectionService;
public NavisworksSavedSetsFilter(IElementSelectionService selectionService)
{
_selectionService = selectionService;
Items = [];
SelectedItems = [];
GetSavedSets();
}
public string Id { get; set; } = "navisworksSavedSets";
public string Name { get; set; } = "Saved Sets";
public string Type { get; set; } = "Select";
public string? Summary { get; set; }
public bool IsDefault { get; set; }
public List<string> SelectedObjectIds { get; set; } = [];
public Dictionary<string, string>? IdMap { get; set; }
public bool IsMultiSelectable { get; set; } = true;
public List<SendFilterSelectItem> SelectedItems { get; set; }
public List<SendFilterSelectItem> Items { get; set; }
public List<string> RefreshObjectIds()
{
List<string> objectIds = [];
if (SelectedItems.Count == 0)
{
return objectIds;
}
var selectionSets = NavisworksApp.ActiveDocument.SelectionSets;
foreach (var selectedSetGuid in SelectedItems)
{
var guid = new Guid(selectedSetGuid.Id);
var selectionSetItem =
selectionSets.ResolveGuid(guid)
?? throw new SpeckleSendFilterException($"Selection set with GUID {guid} not found.");
var selectionSet = (NAV.SelectionSet)selectionSetItem;
if (selectionSet.HasSearch)
{
objectIds.AddRange(ResolveSearchSet(selectionSet.Search));
}
if (selectionSet.HasExplicitModelItems)
{
objectIds.AddRange(ResolveSelectionSet(selectionSet.ExplicitModelItems));
}
}
return objectIds;
}
private IEnumerable<string> ResolveSelectionSet(NAV.ModelItemCollection selectionSetExplicitModelItems) =>
selectionSetExplicitModelItems
.Where(_selectionService.IsVisible) // Exclude hidden elements
.Select(_selectionService.GetModelItemPath) // Resolve to index paths
.ToList();
private IEnumerable<string> ResolveSearchSet(NAV.Search selectionSetSearch) =>
selectionSetSearch
.FindAll(NavisworksApp.ActiveDocument, false)
.Where(_selectionService.IsVisible)
.Select(_selectionService.GetModelItemPath)
.ToList();
/// <summary>
/// Since it is called from constructor, it is re-called whenever UI calls SendBinding.GetSendFilters() on SendFilter dialog.
/// Do not change the behavior/scope of this class on send binding unless make sure the behavior is same. Otherwise, we might not be able to update list of saved sets.
/// </summary>
private void GetSavedSets()
{
List<NAV.SelectionSet> savedSetRecords = [];
CollectSavedSets(NavisworksApp.ActiveDocument.SelectionSets.RootItem, savedSetRecords);
Items = savedSetRecords
.Select(setRecord =>
{
string hierarchicalName = BuildHierarchicalName(setRecord);
return new SendFilterSelectItem(setRecord.Guid.ToString(), hierarchicalName);
})
.ToList();
}
private static void CollectSavedSets(NAV.SavedItem parentItem, List<NAV.SelectionSet> collectedSets)
{
if (!parentItem.IsGroup)
{
return;
}
foreach (NAV.SavedItem item in ((NAV.FolderItem)parentItem).Children)
{
if (item.IsGroup)
{
CollectSavedSets(item, collectedSets);
}
else
{
collectedSets.Add((NAV.SelectionSet)item);
}
}
}
private static string BuildHierarchicalName(NAV.SavedItem item)
{
var pathParts = new List<string> { item.DisplayName };
var current = item.Parent;
while (current != null && current != NavisworksApp.ActiveDocument.SelectionSets.RootItem)
{
pathParts.Insert(0, current.DisplayName);
current = current.Parent;
}
return string.Join(PathConstants.SET_SEPARATOR, pathParts);
}
}
@@ -1,4 +1,5 @@
using Speckle.Connector.Navisworks.Services;
using Speckle.Converter.Navisworks.Constants;
namespace Speckle.Connector.Navisworks.Operations.Send;
@@ -7,16 +8,158 @@ namespace Speckle.Connector.Navisworks.Operations.Send;
/// </summary>
public static class GeometryNodeMerger
{
public static Dictionary<string, List<NAV.ModelItem>> GroupSiblingGeometryNodes(IReadOnlyList<NAV.ModelItem> nodes) =>
nodes
/// <summary>
/// Groups sibling geometry nodes based on material properties for merging.
/// Only merges nodes that share the same parent and have identical material properties.
/// </summary>
/// <param name="nodes">The collection of ModelItems to process</param>
/// <returns>Dictionary mapping parent paths (with material signature suffix) to their mergeable child nodes</returns>
public static Dictionary<string, List<NAV.ModelItem>> GroupSiblingGeometryNodes(IReadOnlyList<NAV.ModelItem> nodes)
{
var selectionService = new ElementSelectionService();
// Group nameless geometry nodes by parent path and material signature
var mergeableGroups = nodes
.Where(node => node.HasGeometry && string.IsNullOrEmpty(node.DisplayName)) // Only anonymous geometry nodes
.GroupBy(node =>
{
var service = new ElementSelectionService();
var path = service.GetModelItemPath(node);
// Get parent path
var path = selectionService.GetModelItemPath(node);
var lastSeparatorIndex = path.LastIndexOf(PathConstants.SEPARATOR);
return lastSeparatorIndex == -1 ? path : path[..lastSeparatorIndex];
var parentPath = lastSeparatorIndex == -1 ? path : path[..lastSeparatorIndex];
// Generate material signature
string signature = GenerateSignature(node);
// Combine parent path with signature
return $"{parentPath}{PathConstants.MATERIAL_SEPARATOR}{signature}";
})
.Where(group => group.Count() > 1) // Only group multiples
.Where(group => group.Count() > 1) // Only include groups with multiple children
.ToDictionary(group => group.Key, group => group.ToList());
return mergeableGroups;
}
/// <summary>
/// Generates a signature for a node based on material properties
/// </summary>
private static string GenerateSignature(NAV.ModelItem node)
{
var signatureProperties = new Dictionary<string, object>();
// We can as many signature defining methods as we want here
AddMaterialProperties(node, signatureProperties);
// When we are done adding properties, we can generate the signature
return GetSignature(signatureProperties);
}
/// <summary>
/// Adds material-related properties to the properties dictionary
/// </summary>
private static void AddMaterialProperties(NAV.ModelItem node, Dictionary<string, object> properties)
{
if (!node.HasGeometry || node.Geometry == null)
{
return;
}
var geometry = node.Geometry;
if (geometry.ActiveColor != null)
{
properties["ActiveColor"] = (geometry.ActiveColor.R, geometry.ActiveColor.G, geometry.ActiveColor.B);
properties["ActiveTransparency"] = geometry.ActiveTransparency;
}
// Add material name if available
var materialName = GetMaterialName(node);
if (!string.IsNullOrEmpty(materialName))
{
properties["MaterialName"] = materialName;
}
}
/// <summary>
/// Creates a hash-based signature from a dictionary of properties.
/// </summary>
/// <param name="properties">Dictionary containing property name/value pairs to include in the signature</param>
/// <param name="hashLength">Length of the returned hash string (default: 8 characters)</param>
/// <returns>A hash string representing the combined properties</returns>
private static string GetSignature(Dictionary<string, object> properties, int hashLength = 8)
{
if (properties.Count == 0)
{
return "empty";
}
// Build a consistent string representation of all properties
var hashInput = new System.Text.StringBuilder();
// Sort keys to ensure consistent order
var sortedKeys = properties.Keys.OrderBy(k => k).ToList();
foreach (var key in sortedKeys)
{
var value = properties[key];
switch (value)
{
case null:
continue;
// Format numbers with fixed precision to avoid floating point inconsistencies
case double doubleValue:
hashInput.Append($"{key}:{Math.Round(doubleValue, 6)}_");
break;
case float floatValue:
hashInput.Append($"{key}:{Math.Round(floatValue, 6)}_");
break;
default:
hashInput.Append($"{key}:{value.GetHashCode()}_");
break;
}
}
if (hashInput.Length == 0)
{
return "empty";
}
// Use MD5 hash with warning suppression
#pragma warning disable CA5351 // Do Not Use Broken Cryptographic Algorithms
using var md5 = System.Security.Cryptography.MD5.Create();
var inputBytes = System.Text.Encoding.UTF8.GetBytes(hashInput.ToString());
var hashBytes = md5.ComputeHash(inputBytes);
#pragma warning restore CA5351
var fullHashString = BitConverter.ToString(hashBytes).Replace("-", "");
return fullHashString[..Math.Min(hashLength, fullHashString.Length)];
}
/// <summary>
/// Extracts material name from a node if available.
/// </summary>
private static string GetMaterialName(NAV.ModelItem node)
{
// Check Item category for material name
var itemCategory = node.PropertyCategories.FindCategoryByDisplayName("Item");
if (itemCategory != null)
{
var itemProperties = itemCategory.Properties;
var itemMaterial = itemProperties.FindPropertyByDisplayName("Material");
if (itemMaterial != null && !string.IsNullOrEmpty(itemMaterial.DisplayName))
{
return itemMaterial.Value.ToDisplayString();
}
}
// Check Material category for material name
var materialPropertyCategory = node.PropertyCategories.FindCategoryByDisplayName("Material");
if (materialPropertyCategory == null)
{
return string.Empty;
}
var material = materialPropertyCategory.Properties;
var name = material.FindPropertyByDisplayName("Name");
return name != null && !string.IsNullOrEmpty(name.DisplayName) ? name.Value.ToDisplayString() : string.Empty;
}
}
@@ -0,0 +1,146 @@
using Speckle.Connector.Navisworks.Services;
using Speckle.Converter.Navisworks.Constants;
using Speckle.Converters.Common;
using Speckle.Sdk.Models;
using Speckle.Sdk.Models.Collections;
namespace Speckle.Connector.Navisworks.Operations.Send;
/// <summary>
/// Rebuilds the Navisworks document hierarchy from converted geometry leaves while preserving
/// the parent-child relationships between elements in the original model structure.
/// </summary>
public class NavisworksHierarchyBuilder
{
private readonly Dictionary<string, Base?> _geometryLeaves;
private readonly IRootToSpeckleConverter _converter;
private readonly IElementSelectionService _selectionService;
private readonly Dictionary<string, Base> _allNodes;
/// <summary>
/// Initializes a new instance of the NavisworksHierarchyBuilder.
/// </summary>
/// <param name="geometryLeaves">Dictionary of path-indexed converted geometry elements</param>
/// <param name="converter">Converter to transform Navisworks elements to Speckle objects</param>
/// <param name="selectionService">Service for resolving Navisworks element paths</param>
public NavisworksHierarchyBuilder(
Dictionary<string, Base?> geometryLeaves,
IRootToSpeckleConverter converter,
IElementSelectionService selectionService
)
{
_geometryLeaves = geometryLeaves;
_converter = converter;
_selectionService = selectionService;
_allNodes = new Dictionary<string, Base>();
}
/// <summary>
/// Constructs a hierarchical tree of Speckle objects that mirrors the Navisworks document structure.
/// </summary>
/// <returns>List of root-level Speckle Base objects containing the full hierarchy</returns>
public List<Base> BuildHierarchy()
{
foreach (var kvp in _geometryLeaves)
{
if (kvp.Value != null)
{
_allNodes[kvp.Key] = kvp.Value;
}
}
// For each leaf path, traverse up the document structure converting any missing ancestors
foreach (var nodePath in _allNodes.ToList().Select(kvp => kvp.Key))
{
ClimbUpToRoot(nodePath);
}
var allPaths = _allNodes.Keys.ToList();
allPaths.Sort(
(a, b) =>
{
var depthA = a.Count(c => c == PathConstants.SEPARATOR);
var depthB = b.Count(c => c == PathConstants.SEPARATOR);
return depthB.CompareTo(depthA); // <- Sort in ascending order of path length
}
);
// Link nodes to parents and identify root nodes that have no recognized parent
var rootCandidates = new Dictionary<string, Base>(_allNodes);
foreach (var nodePath in allPaths)
{
if (nodePath == "0")
{
continue;
}
var nodeBase = _allNodes[nodePath];
var parentPath = GetParentPath(nodePath);
if (string.IsNullOrEmpty(parentPath))
{
continue;
}
// Navisworks API: Add child elements to parent collections
if (!_allNodes.TryGetValue(parentPath, out var parentBase) || parentBase is not Collection parentCollection)
{
continue;
}
parentCollection.elements.Add(nodeBase);
rootCandidates.Remove(nodePath);
}
var rootNodes = rootCandidates.Values.ToList();
PruneEmptyCollections(rootNodes);
return rootNodes;
}
private void ClimbUpToRoot(string currentPath)
{
while (!string.IsNullOrEmpty(currentPath) && currentPath != "0")
{
var parentPath = GetParentPath(currentPath);
if (string.IsNullOrEmpty(parentPath))
{
return;
}
if (_allNodes.ContainsKey(parentPath))
{
currentPath = parentPath;
continue;
}
var parentModelItem = _selectionService.GetModelItemFromPath(parentPath);
var parentConverted = _converter.Convert(parentModelItem);
_allNodes[parentPath] = parentConverted;
currentPath = parentPath;
}
}
private static string GetParentPath(string path)
{
var idx = path.LastIndexOf(PathConstants.SEPARATOR);
return idx == -1 ? string.Empty : path[..idx];
}
private static void PruneEmptyCollections(List<Base> nodes)
{
foreach (var node in nodes.ToList())
{
if (node is not Collection collection)
{
continue;
}
PruneEmptyCollections(collection.elements);
collection.elements.RemoveAll(child => child is Collection { elements.Count: 0 });
}
}
}
@@ -144,12 +144,27 @@ public class NavisworksRootObjectBuilder(
Dictionary<string, List<NAV.ModelItem>> groupedNodes
)
{
// First build the grouped nodes as before
var finalElements = new List<Base>();
var processedPaths = new HashSet<string>();
AddGroupedElements(finalElements, convertedBases, groupedNodes, processedPaths);
AddRemainingElements(finalElements, convertedBases, processedPaths);
// If hierarchy mode is enabled, reorganize into proper nested structure
if (converterSettings.Current.User.PreserveModelHierarchy)
{
var hierarchyBuilder = new NavisworksHierarchyBuilder(
convertedBases,
rootToSpeckleConverter,
elementSelectionService
);
var hierarchy = hierarchyBuilder.BuildHierarchy();
return hierarchy;
}
// Otherwise continue with flat mode
AddRemainingElements(finalElements, convertedBases, processedPaths);
return finalElements;
}
@@ -221,7 +236,8 @@ public class NavisworksRootObjectBuilder(
/// </remarks>
private NavisworksObject CreateNavisworksObject(string groupKey, List<Base> siblingBases)
{
(string name, string path) = GetContext(groupKey);
string cleanParentPath = ElementSelectionHelper.GetCleanPath(groupKey);
(string name, string path) = GetContext(cleanParentPath);
return new NavisworksObject
{
@@ -229,7 +245,7 @@ public class NavisworksRootObjectBuilder(
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,
applicationId = groupKey, // Use the full composite key as applicationId to preserve uniqueness
["path"] = path
};
}
@@ -0,0 +1,12 @@
using Speckle.Connectors.DUI.Settings;
namespace Speckle.Connector.Navisworks.Operations.Send.Settings;
public class PreserveModelHierarchySetting(bool value) : ICardSetting
{
public string? Id { get; set; } = "preserveModelHierarchy";
public string? Title { get; set; } = "Preserve Model Hierarchy";
public string? Type { get; set; } = "boolean";
public List<string>? Enum { get; set; }
public object? Value { get; set; } = value;
}
@@ -17,6 +17,7 @@ public class ToSpeckleSettingsManagerNavisworks : IToSpeckleSettingsManagerNavis
private readonly Dictionary<string, OriginMode> _originModeCache = [];
private readonly Dictionary<string, bool?> _convertHiddenElementsCache = [];
private readonly Dictionary<string, bool?> _includeInternalPropertiesCache = [];
private readonly Dictionary<string, bool?> _preserveModelHierarchyCache = [];
public ToSpeckleSettingsManagerNavisworks(ISendConversionCache sendConversionCache)
{
@@ -120,6 +121,23 @@ public class ToSpeckleSettingsManagerNavisworks : IToSpeckleSettingsManagerNavis
return returnValue;
}
public bool GetPreserveModelHierarchy([NotNull] SenderModelCard modelCard)
{
var value = modelCard.Settings?.FirstOrDefault(s => s.Id == "preserveModelHierarchy")?.Value as bool?;
var returnValue = value != null && value.NotNull();
if (_preserveModelHierarchyCache.TryGetValue(modelCard.ModelCardId.NotNull(), out var previousValue))
{
if (previousValue != returnValue)
{
EvictCacheForModelCard(modelCard);
}
}
_preserveModelHierarchyCache[modelCard.ModelCardId] = returnValue;
return returnValue;
}
private void EvictCacheForModelCard(SenderModelCard modelCard)
{
var objectIds = modelCard.SendFilter != null ? modelCard.SendFilter.NotNull().SelectedObjectIds : [];
@@ -1,6 +0,0 @@
namespace Speckle.Connector.Navisworks;
public static class PathConstants
{
public const char SEPARATOR = '/';
}
@@ -3,6 +3,12 @@
<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"/>
<Components>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw23" SeriesMax="Nw23"/>
<ComponentEntry AppName="SpeckleNavisworks" AppType="ManagedPlugin" Version="0.1.0"
ModuleName="./Contents/2026/Speckle.Connectors.Navisworks2026.dll"
AppDescription="Speckle.Connector.Navisworks2026"/>
</Components>
<Components>
<RuntimeRequirements OS="Win64" Platform="NAVMAN|NAVSIM" SeriesMin="Nw22" SeriesMax="Nw22"/>
<ComponentEntry AppName="SpeckleNavisworks" AppType="ManagedPlugin" Version="0.1.0"
@@ -21,14 +21,16 @@
<Compile Include="$(MSBuildThisFileDirectory)HostApp\NavisworksIdleManager.cs" />
<Compile Include="$(MSBuildThisFileDirectory)HostApp\NavisworksMaterialUnpacker.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\GeometryNodeMerger.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Operations\Send\NavisworksHierarchyBuilder.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\PreserveModelHierarchySetting.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)Operations\Send\Filters\NavisworksSavedSetsFilter.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Plugin\BrowserPane.xaml.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Plugin\DockableConnectorPane.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)Plugin\NavisworksRibbon.xaml.cs"/>
@@ -287,9 +287,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -297,8 +297,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.logging": {
@@ -308,7 +308,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.revit2022": {
@@ -348,16 +348,16 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Revit.API": {
@@ -368,26 +368,26 @@
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
}
}
@@ -287,9 +287,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -297,8 +297,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.logging": {
@@ -308,7 +308,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.revit2023": {
@@ -348,16 +348,16 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Revit.API": {
@@ -368,26 +368,26 @@
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
}
}
@@ -287,9 +287,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -297,8 +297,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.logging": {
@@ -308,7 +308,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.revit2024": {
@@ -348,16 +348,16 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Revit.API": {
@@ -368,26 +368,26 @@
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
"Microsoft.Bcl.AsyncInterfaces": "5.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
}
}
@@ -237,9 +237,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.8, )",
"Speckle.Sdk": "[3.1.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.dui": {
@@ -247,8 +247,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.8, )",
"Speckle.Sdk.Dependencies": "[3.1.8, )"
}
},
"speckle.connectors.logging": {
@@ -258,7 +258,7 @@
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
"Speckle.Objects": "[3.1.0-dev.255, )"
"Speckle.Objects": "[3.1.8, )"
}
},
"speckle.converters.revit2025": {
@@ -298,16 +298,16 @@
"Speckle.DoubleNumerics": {
"type": "CentralTransitive",
"requested": "[4.1.0, )",
"resolved": "4.0.1",
"contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w=="
"resolved": "4.1.0",
"contentHash": "20DtS+FsDRsOD9+AU3TwNFZ0qrKo5f6f7B5ZR9wStsIHHHC9k7DpjbCvuNtmnSjx54MD+TJC7wV2f5iyGVPj1A=="
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "0S9YVdu5nx7SYS0y5Gq1nwCbxfYB2UxsUUCskaGmzRAm+QzHGqCLYHgadz7Sw5mNAF3bOTLVrOYMzyLAWFWxJA==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "rM1t+E8NIWFCPC3ndnMAI71B9ONiPFsz6GuIIdc5kth5AggQRGArPCalJBwA33ith2WtbjWOanI+PhHmpGQgGw==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.255"
"Speckle.Sdk": "3.1.8"
}
},
"Speckle.Revit.API": {
@@ -318,25 +318,25 @@
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.255, )",
"resolved": "3.1.0-dev.255",
"contentHash": "TsFpIv8ipvOD/r0se1XmcNPo7t5dWVadwV32Z6vUqoW3s94VIE54/ZTHNkRCEYHFhfOyTcFfbLegiei+0D13bQ==",
"requested": "[3.1.8, )",
"resolved": "3.1.8",
"contentHash": "qIYRiYHO2UkKuy8ZbjYltKCqLesIcJOcCGTEzyTCbyij5aC1x8HnwFjGMeonUCPaeipEKhI/4HidEZ0CwWvnXg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "[7.0.5]",
"Microsoft.Extensions.DependencyInjection.Abstractions": "[2.2.0]",
"Microsoft.Extensions.Logging": "[2.2.0]",
"Speckle.DoubleNumerics": "4.0.1",
"Microsoft.Data.Sqlite": "7.0.5",
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0",
"Microsoft.Extensions.Logging": "2.2.0",
"Speckle.DoubleNumerics": "4.1.0",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Dependencies": "3.1.0-dev.255"
"Speckle.Sdk.Dependencies": "3.1.8"
}
},
"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.8, )",
"resolved": "3.1.8",
"contentHash": "+MWIemub3nlPnDJ7sHl5nDGFDIIfiBU2VxqNmTGKzWNtCjsDi6KYw5zpbvXnaNcIqFoexv3TKCurjvT2ejzyQw=="
}
},
"net8.0-windows7.0/win-x64": {
@@ -82,6 +82,8 @@ internal sealed class BasicConnectorBindingRevit : IBasicConnectorBinding
public void RemoveModel(ModelCard model) => _store.RemoveModel(model);
public void RemoveModels(List<ModelCard> models) => _store.RemoveModels(models);
public async Task HighlightModel(string modelCardId)
{
var model = _store.GetModelById(modelCardId);
@@ -103,7 +105,12 @@ internal sealed class BasicConnectorBindingRevit : IBasicConnectorBinding
var view = revitViewsFilter.GetView();
if (view is not null)
{
_revitContext.UIApplication.ActiveUIDocument.ActiveView = view;
await RevitTask
.RunAsync(() =>
{
_revitContext.UIApplication.ActiveUIDocument.ActiveView = view;
})
.ConfigureAwait(false);
}
return;
}
@@ -8,6 +8,7 @@ using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Logging;
using Speckle.Connectors.DUI.Models;
using Speckle.Connectors.DUI.Models.Card;
using Speckle.Connectors.Revit.Plugin;
using Speckle.Converters.Common;
using Speckle.Converters.RevitShared.Settings;
using Speckle.Sdk;
@@ -71,9 +72,10 @@ internal sealed class RevitReceiveBinding : IReceiveBinding
.ServiceProvider.GetRequiredService<IConverterSettingsStore<RevitConversionSettings>>()
.Initialize(
_revitConversionSettingsFactory.Create(
DetailLevelType.Coarse, //TODO figure out
DetailLevelType.Coarse, // TODO figure out
null,
false
false,
true
)
);
// Receive host objects
@@ -98,6 +100,10 @@ internal sealed class RevitReceiveBinding : IReceiveBinding
// Idea for later -> when cancel called, create promise from UI to solve it later with this catch block.
// So have 3 state on UI -> Cancellation clicked -> Cancelling -> Cancelled
}
catch (SpeckleRevitTaskException ex)
{
await SpeckleRevitTaskException.ProcessException(modelCardId, ex, _logger, Commands);
}
catch (Exception ex) when (!ex.IsFatal()) // UX reasons - we will report operation exceptions as model card error. We may change this later when we have more exception documentation
{
_logger.LogModelCardHandledError(ex);
@@ -1,4 +1,3 @@
using System.Collections.Concurrent;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.ExtensibleStorage;
using Microsoft.Extensions.DependencyInjection;
@@ -6,6 +5,7 @@ using Microsoft.Extensions.Logging;
using Speckle.Connectors.Common.Caching;
using Speckle.Connectors.Common.Cancellation;
using Speckle.Connectors.Common.Operations;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Exceptions;
@@ -16,6 +16,7 @@ using Speckle.Connectors.DUI.Models.Card.SendFilter;
using Speckle.Connectors.DUI.Settings;
using Speckle.Connectors.Revit.HostApp;
using Speckle.Connectors.Revit.Operations.Send.Settings;
using Speckle.Connectors.Revit.Plugin;
using Speckle.Connectors.RevitShared.Operations.Send.Filters;
using Speckle.Converters.Common;
using Speckle.Converters.RevitShared.Helpers;
@@ -40,6 +41,8 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
private readonly IRevitConversionSettingsFactory _revitConversionSettingsFactory;
private readonly ISpeckleApplication _speckleApplication;
private readonly ITopLevelExceptionHandler _topLevelExceptionHandler;
private readonly LinkedModelHandler _linkedModelHandler;
private readonly IThreadContext _threadContext;
/// <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:
@@ -47,7 +50,7 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
/// As to why a concurrent dictionary, it's because it's the cheapest/easiest way to do so.
/// https://stackoverflow.com/questions/18922985/concurrent-hashsett-in-net-framework
/// </summary>
private ConcurrentDictionary<ElementId, byte> ChangedObjectIds { get; set; } = new();
private ConcurrentHashSet<ElementId> ChangedObjectIds { get; set; } = new();
public RevitSendBinding(
IAppIdleManager idleManager,
@@ -63,7 +66,9 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
ElementUnpacker elementUnpacker,
IRevitConversionSettingsFactory revitConversionSettingsFactory,
ISpeckleApplication speckleApplication,
ITopLevelExceptionHandler topLevelExceptionHandler
ITopLevelExceptionHandler topLevelExceptionHandler,
LinkedModelHandler linkedModelHandler,
IThreadContext threadContext
)
: base("sendBinding", bridge)
{
@@ -80,6 +85,8 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
_revitConversionSettingsFactory = revitConversionSettingsFactory;
_speckleApplication = speckleApplication;
_topLevelExceptionHandler = topLevelExceptionHandler;
_linkedModelHandler = linkedModelHandler;
_threadContext = threadContext;
Commands = new SendBindingUICommands(bridge);
// TODO expiry events
@@ -90,8 +97,6 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
_store.DocumentChanged += (_, _) => topLevelExceptionHandler.FireAndForget(async () => await OnDocumentChanged());
}
private async Task OnDocumentStoreChangedEvent(object _) => await Commands.NotifyDocumentChanged();
public List<ISendFilter> GetSendFilters() =>
[
new RevitSelectionFilter() { IsDefault = true },
@@ -103,7 +108,8 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
[
new DetailLevelSetting(DetailLevelType.Medium),
new ReferencePointSetting(ReferencePointType.InternalOrigin),
new SendParameterNullOrEmptyStringsSetting(false)
new SendParameterNullOrEmptyStringsSetting(false),
new LinkedModelsSetting(true)
];
public void CancelSend(string modelCardId) => _cancellationManager.CancelOperation(modelCardId);
@@ -130,24 +136,24 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
_revitConversionSettingsFactory.Create(
_toSpeckleSettingsManager.GetDetailLevelSetting(modelCard),
_toSpeckleSettingsManager.GetReferencePointSetting(modelCard),
_toSpeckleSettingsManager.GetSendParameterNullOrEmptyStringsSetting(modelCard)
_toSpeckleSettingsManager.GetSendParameterNullOrEmptyStringsSetting(modelCard),
_toSpeckleSettingsManager.GetLinkedModelsSetting(modelCard)
)
);
List<Element> elements = await RefreshElementsOnSender(modelCard.NotNull());
List<ElementId> elementIds = elements.Select(el => el.Id).ToList();
var elementsByTransform = await RefreshElementsIdsOnSender(modelCard.NotNull());
if (elementIds.Count == 0)
if (elementsByTransform.Count == 0)
{
// Handle as CARD ERROR in this function
throw new SpeckleSendFilterException("No objects were found to convert. Please update your publish filter!");
}
var sendResult = await scope
.ServiceProvider.GetRequiredService<SendOperation<ElementId>>()
.ServiceProvider.GetRequiredService<SendOperation<DocumentToConvert>>()
.Execute(
elementIds,
modelCard.GetSendInfo(_speckleApplication.Slug),
elementsByTransform,
modelCard.GetSendInfo(_speckleApplication.ApplicationAndVersion),
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
cancellationItem.Token
);
@@ -160,6 +166,10 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
// Idea for later -> when cancel called, create promise from UI to solve it later with this catch block.
// So have 3 state on UI -> Cancellation clicked -> Cancelling -> Cancelled
}
catch (SpeckleRevitTaskException ex)
{
await SpeckleRevitTaskException.ProcessException(modelCardId, ex, _logger, Commands);
}
catch (Exception ex) when (!ex.IsFatal()) // UX reasons - we will report operation exceptions as model card error. We may change this later when we have more exception documentation
{
_logger.LogModelCardHandledError(ex);
@@ -172,28 +182,76 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
}
}
private async Task<List<Element>> RefreshElementsOnSender(SenderModelCard modelCard)
private async Task<List<DocumentToConvert>> RefreshElementsIdsOnSender(SenderModelCard modelCard)
{
var activeUIDoc =
_revitContext.UIApplication.NotNull().ActiveUIDocument
?? throw new SpeckleException("Unable to retrieve active UI document");
if (modelCard.SendFilter is IRevitSendFilter viewFilter)
if (modelCard.SendFilter.NotNull() is IRevitSendFilter viewFilter)
{
viewFilter.SetContext(_revitContext);
}
var selectedObjects = modelCard.SendFilter.NotNull().RefreshObjectIds();
var selectedObjects = await _threadContext.RunOnMainAsync(
() => Task.FromResult(modelCard.SendFilter.NotNull().RefreshObjectIds())
);
List<Element> elements = selectedObjects
var allElements = selectedObjects
.Select(uid => activeUIDoc.Document.GetElement(uid))
.Where(el => el is not null)
.ToList();
// split elements between main model and linked models
var elementsOnMainModel = allElements.Where(el => el is not RevitLinkInstance).ToList();
var linkedModels = allElements.OfType<RevitLinkInstance>().ToList();
// create context for main document elements
List<DocumentToConvert> documentElementContexts = [new(null, activeUIDoc.Document, elementsOnMainModel)];
// get the linked models setting - this decision belongs at this level
bool includeLinkedModels = _toSpeckleSettingsManager.GetLinkedModelsSetting(modelCard);
// ⚠️ process linked models - RevitSendBinding controls the flow based on settings!
// If setting not enabled, we won't unpack (see if-else block)
if (linkedModels.Count > 0)
{
var linkedDocumentContexts = new List<DocumentToConvert>();
foreach (var linkedModel in linkedModels)
{
var linkedDoc = linkedModel.GetLinkDocument();
if (linkedDoc == null)
{
continue;
}
var transform = linkedModel.GetTotalTransform().Inverse;
// decision about whether to process elements is made here, not in the handler
// only collects elements from linked models when the setting is enabled
if (includeLinkedModels)
{
// handler is only responsible for element collection mechanics
var linkedElements = _linkedModelHandler.GetLinkedModelElements(modelCard.SendFilter, linkedDoc, transform);
linkedDocumentContexts.Add(new(transform, linkedDoc, linkedElements));
}
// ⚠️ when disabled, still adds empty contexts to maintain warning generation in RevitRootObjectBuilder
// this approach (to signal that warnings are needed) relies on empty element lists which smells and is a bit of an implicit mechanism
// buuuuut, it works (for now 👀).
else
{
linkedDocumentContexts.Add(new(transform, linkedDoc, new List<Element>()));
}
}
documentElementContexts.AddRange(linkedDocumentContexts);
}
// update ID map
if (modelCard.SendFilter is not null && modelCard.SendFilter.IdMap is not null)
{
var newSelectedObjectIds = new List<string>();
foreach (Element element in elements)
foreach (Element element in allElements)
{
modelCard.SendFilter.IdMap[element.Id.ToString()] = element.UniqueId;
newSelectedObjectIds.Add(element.UniqueId);
@@ -207,7 +265,7 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
);
}
return elements;
return documentElementContexts;
}
/// <summary>
@@ -236,17 +294,17 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
foreach (ElementId elementId in addedElementIds)
{
ChangedObjectIds[elementId] = 1;
ChangedObjectIds.Add(elementId);
}
foreach (ElementId elementId in deletedElementIds)
{
ChangedObjectIds[elementId] = 1;
ChangedObjectIds.Add(elementId);
}
foreach (ElementId elementId in modifiedElementIds)
{
ChangedObjectIds[elementId] = 1;
ChangedObjectIds.Add(elementId);
}
if (addedElementIds.Count > 0)
@@ -267,7 +325,7 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
var selectedObjects = sender.SendFilter.NotNull().SelectedObjectIds;
objectIds.AddRange(selectedObjects);
}
var unpackedObjectIds = _elementUnpacker.GetUnpackedElementIds(objectIds.ToList());
var unpackedObjectIds = _elementUnpacker.GetUnpackedElementIds(objectIds);
_sendConversionCache.EvictObjects(unpackedObjectIds);
}
@@ -313,7 +371,7 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
{
foreach (var sender in _store.GetSenders().ToList())
{
await RefreshElementsOnSender(sender);
await RefreshElementsIdsOnSender(sender);
}
}
@@ -322,7 +380,7 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
/// </summary>
private async Task CheckFilterExpiration()
{
// NOTE: below code seems like more make sense in terms of performance but it causes unmanaged exception on Revit
// NOTE: below code seems like more make sense in terms of performance, but it causes unmanaged exception on Revit
// using var viewCollector = new FilteredElementCollector(RevitContext.UIApplication?.ActiveUIDocument.Document);
// var views = viewCollector.OfClass(typeof(View)).Cast<View>().Select(v => v.Id).ToList();
// var intersection = ChangedObjectIds.Keys.Intersect(views).ToList();
@@ -332,9 +390,7 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
// }
if (
ChangedObjectIds.Keys.Any(e =>
_revitContext.UIApplication.NotNull().ActiveUIDocument.Document.GetElement(e) is View
)
ChangedObjectIds.Any(e => _revitContext.UIApplication.NotNull().ActiveUIDocument.Document.GetElement(e) is View)
)
{
await Commands.RefreshSendFilters();
@@ -353,7 +409,7 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
}
var objUniqueIds = new List<string>();
var changedIds = ChangedObjectIds.Keys.ToList();
var changedIds = ChangedObjectIds.ToList();
// Handling type changes: if an element's type is changed, we need to mark as changed all objects that have that type.
// Step 1: get any changed types
@@ -361,10 +417,10 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding
.Select(e => doc.GetElement(e))
.OfType<ElementType>()
.Select(el => el.Id)
.ToArray();
.ToHashSet(); // ToHashSet() for faster Contains
// Step 2: Find all elements of the changed types, and add them to the changed ids list.
if (elementTypeIdsList.Length != 0)
if (elementTypeIdsList.Count != 0)
{
using var collector = new FilteredElementCollector(doc);
var collectorElements = collector
@@ -35,7 +35,7 @@ internal sealed class SelectionBinding : RevitBaseBinding, ISelectionBinding, ID
#else
_revitContext.UIApplication.NotNull().SelectionChanged += (_, _) =>
_idleManager.SubscribeToIdle(nameof(SelectionBinding), OnSelectionChanged);
_idleManager.SubscribeToIdle(nameof(OnSelectionChanged), OnSelectionChanged);
#endif
}
@@ -56,15 +56,16 @@ internal sealed class SelectionBinding : RevitBaseBinding, ISelectionBinding, ID
}
var activeUIDoc = _revitContext.UIApplication.ActiveUIDocument.NotNull();
var doc = activeUIDoc.Document;
// POC: this was also being called on shutdown
// probably the bridge needs to be able to know if the plugin has been terminated
// also on termination the OnSelectionChanged event needs unwinding
var selectionIds = activeUIDoc
.Selection.GetElementIds()
.Select(eid => activeUIDoc.Document.GetElement(eid).UniqueId.ToString())
.ToList();
return new SelectionInfo(selectionIds, $"{selectionIds.Count} objects selected.");
var selectionIds = activeUIDoc.Selection.GetElementIds();
//reduce allocates by allocating what we need.
var selectionUniqueIds = new List<string>(selectionIds.Count);
selectionUniqueIds.AddRange(selectionIds.Select(eid => doc.GetElement(eid).UniqueId));
return new SelectionInfo(selectionUniqueIds, $"{selectionIds.Count} objects selected.");
}
public void Dispose()
@@ -48,18 +48,20 @@ public static class ServiceRegistration
serviceCollection.AddSingleton<IAppIdleManager, RevitIdleManager>();
// send operation and dependencies
serviceCollection.AddScoped<SendOperation<ElementId>>();
serviceCollection.AddScoped<SendOperation<DocumentToConvert>>();
serviceCollection.AddScoped<ElementUnpacker>();
serviceCollection.AddScoped<SendCollectionManager>();
serviceCollection.AddScoped<IRootObjectBuilder<ElementId>, RevitRootObjectBuilder>();
serviceCollection.AddScoped<IRootObjectBuilder<DocumentToConvert>, RevitRootObjectBuilder>();
serviceCollection.AddSingleton<ISendConversionCache, SendConversionCache>();
serviceCollection.AddSingleton<ToSpeckleSettingsManager>();
serviceCollection.AddSingleton<LinkedModelHandler>();
// receive operation and dependencies
serviceCollection.AddScoped<IHostObjectBuilder, RevitHostObjectBuilder>();
serviceCollection.AddScoped<ITransactionManager, TransactionManager>();
serviceCollection.AddScoped<RevitGroupBaker>();
serviceCollection.AddScoped<RevitMaterialBaker>();
serviceCollection.AddScoped<RevitViewManager>();
serviceCollection.AddSingleton<RevitUtils>();
serviceCollection.AddSingleton<IFailuresPreprocessor, HideWarningsFailuresPreprocessor>();
serviceCollection.AddSingleton(DefaultTraversal.CreateTraversalFunc());
@@ -0,0 +1,5 @@
using Autodesk.Revit.DB;
namespace Speckle.Connectors.Revit.HostApp;
public record DocumentToConvert(Transform? Transform, Document Doc, List<Element> Elements);
@@ -1,6 +1,8 @@
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Architecture;
using Speckle.Converters.Common;
using Speckle.Converters.RevitShared.Helpers;
using Speckle.Converters.RevitShared.Settings;
namespace Speckle.Connectors.Revit.HostApp;
@@ -10,10 +12,12 @@ namespace Speckle.Connectors.Revit.HostApp;
public class ElementUnpacker
{
private readonly RevitContext _revitContext;
private readonly IConverterSettingsStore<RevitConversionSettings> _converterSettings;
public ElementUnpacker(RevitContext revitContext)
public ElementUnpacker(RevitContext revitContext, IConverterSettingsStore<RevitConversionSettings> converterSettings)
{
_revitContext = revitContext;
_converterSettings = converterSettings;
}
/// <summary>
@@ -21,18 +25,21 @@ public class ElementUnpacker
/// This method will also "pack" curtain walls if necessary (ie, if mullions or panels are selected without their parent curtain wall, they are sent independently; if the parent curtain wall is selected, they will be removed out as the curtain wall will include all its children).
/// </summary>
/// <param name="selectionElements"></param>
/// <param name="doc"> We use the nullable document (happiness level 5/10) for the sake of linked models - bc we use this function in 2 different places <br/>
/// 1- RootObjectBuilder with linked model document - otherwise we cannot unpack elements from correct document.<br/>
/// 2- Evicting the cache while introducing the settings</param>
/// <returns></returns>
public IEnumerable<Element> UnpackSelectionForConversion(IEnumerable<Element> selectionElements)
public IEnumerable<Element> UnpackSelectionForConversion(IEnumerable<Element> selectionElements, Document? doc = null)
{
// Note: steps kept separate on purpose.
// Step 1: unpack groups
var atomicObjects = UnpackElements(selectionElements);
var atomicObjects = UnpackElements(selectionElements, doc);
// Step 2: pack curtain wall elements, once we know the full extent of our flattened item list.
// The behaviour we're looking for:
// If parent wall is part of selection, does not select individual elements out. Otherwise, selects individual elements (Panels, Mullions) as atomic objects.
// NOTE: this also conditionally "packs" stacked wall elements if their parent is present. See detailed note inside the function.
return PackCurtainWallElementsAndStackedWalls(atomicObjects);
return PackCurtainWallElementsAndStackedWalls(atomicObjects, doc);
}
/// <summary>
@@ -43,38 +50,52 @@ public class ElementUnpacker
/// <remarks>
/// This is used to invalidate object ids in the send conversion cache when the selected object id is only the parent element id
/// </remarks>
public IEnumerable<string> GetUnpackedElementIds(List<string> objectIds)
public IEnumerable<string> GetUnpackedElementIds(IEnumerable<string> objectIds)
{
var doc = _revitContext.UIApplication?.ActiveUIDocument.Document!;
var docElements = doc.GetElements(objectIds);
return UnpackSelectionForConversion(docElements).Select(o => o.UniqueId).ToList();
}
private List<Element> UnpackElements(IEnumerable<Element> elements)
// We use the nullable document (happiness level 5/10) for the sake of linked models - bc we use this function in 2 different places
// 1- RootObjectBuilder with linked model document - otherwise we cannot unpack elements from correct document.
// 2- Evicting the cache while introducing the settings
private List<Element> UnpackElements(IEnumerable<Element> elements, Document? doc = null)
{
var unpackedElements = new List<Element>(); // note: could be a hashset/map so we prevent duplicates (?)
var doc = _revitContext.UIApplication?.ActiveUIDocument.Document!;
if (doc == null)
{
doc = _revitContext.UIApplication?.ActiveUIDocument.Document!;
}
foreach (var element in elements)
{
// UNPACK: Groups
if (element is Group g)
{
// When a group is from a linked model, GetMemberIds may behave differently
// We add null checks to handle cases where elements can't be properly resolved
// POC: this might screw up generating hosting rel generation here, because nested families in groups get flattened out by GetMemberIds().
var groupElements = g.GetMemberIds().Select(doc.GetElement);
var groupElements = g.GetMemberIds().Select(doc.GetElement).Where(el => el != null);
unpackedElements.AddRange(UnpackElements(groupElements));
}
else if (element is BaseArray baseArray)
{
var arrayElements = baseArray.GetCopiedMemberIds().Select(doc.GetElement);
var originalElements = baseArray.GetOriginalMemberIds().Select(doc.GetElement);
// For arrays, collect both copied and original members with null checks
// This handles cases where some elements might not resolve in linked contexts
var arrayElements = baseArray.GetCopiedMemberIds().Select(doc.GetElement).Where(el => el != null);
var originalElements = baseArray.GetOriginalMemberIds().Select(doc.GetElement).Where(el => el != null);
unpackedElements.AddRange(UnpackElements(arrayElements));
unpackedElements.AddRange(UnpackElements(originalElements));
}
// UNPACK: Family instances (as they potentially have nested families inside)
else if (element is FamilyInstance familyInstance)
{
var familyElements = familyInstance.GetSubComponentIds().Select(doc.GetElement).ToArray();
var familyElements = familyInstance
.GetSubComponentIds()
.Select(doc.GetElement)
.Where(el => el != null)
.ToArray();
if (familyElements.Length != 0)
{
@@ -85,7 +106,7 @@ public class ElementUnpacker
}
else if (element is MultistoryStairs multistoryStairs)
{
var stairs = multistoryStairs.GetAllStairsIds().Select(doc.GetElement);
var stairs = multistoryStairs.GetAllStairsIds().Select(doc.GetElement).Where(el => el != null);
unpackedElements.AddRange(UnpackElements(stairs));
}
else
@@ -95,13 +116,22 @@ public class ElementUnpacker
}
// Why filtering for duplicates? Well, well, well... it's related to the comment above on groups: if a group
// contains a nested family, GetMemberIds() will return... duplicates of the exploded family components.
return unpackedElements.GroupBy(el => el.Id).Select(g => g.First()).ToList(); // no disinctBy in here sadly.
// Add null check before GroupBy to prevent NullReferenceException when processing linked models with groups
// This ensures we don't try to access .Id on any null elements that might have been added during the unpacking process
return unpackedElements.Where(el => el != null).GroupBy(el => el.Id).Select(g => g.First()).ToList(); // no disinctBy in here sadly.
}
private List<Element> PackCurtainWallElementsAndStackedWalls(List<Element> elements)
// We use the nullable document (happiness level 5/10) for the sake of linked models - bc we use this function in 2 different places
// 1- RootObjectBuilder with linked model document - otherwise we cannot unpack elements from correct document.
// 2- Evicting the cache while introducing the settings
private List<Element> PackCurtainWallElementsAndStackedWalls(List<Element> elements, Document? doc = null)
{
var ids = elements.Select(el => el.Id).ToArray();
var doc = _revitContext.UIApplication?.ActiveUIDocument.Document!;
if (doc == null)
{
doc = _revitContext.UIApplication?.ActiveUIDocument.Document!;
}
elements.RemoveAll(element =>
(element is Mullion { Host: not null } m && ids.Contains(m.Host.Id))
|| (element is Panel { Host: not null } p && ids.Contains(p.Host.Id))
@@ -0,0 +1,211 @@
using System.IO;
using Autodesk.Revit.DB;
using Speckle.Connectors.DUI.Models.Card.SendFilter;
using Speckle.Connectors.RevitShared;
using Speckle.Connectors.RevitShared.Operations.Send.Filters;
using Speckle.Converters.RevitShared.Helpers;
using Speckle.Sdk;
using Speckle.Sdk.Common;
namespace Speckle.Connectors.Revit.HostApp;
/// <summary>
/// Handles unpacking elements inside linked models.
/// This class is responsible for the mechanics of retrieving elements from linked documents
/// based on different filter types, but not for making decisions about whether linked models
/// should be processed (which is the responsibility of the calling code)!
/// </summary>
public class LinkedModelHandler
{
private readonly RevitContext _revitContext;
public Dictionary<string, string> LinkedModelDisplayNames { get; } = new();
public LinkedModelHandler(RevitContext revitContext)
{
_revitContext = revitContext;
}
/// <summary>
/// Gets elements from a linked document based on the provided send filter.
/// This method handles the specifics of element collection but doesn't make decisions
/// about whether the linked model should be processed - that's the caller's responsibility.
/// </summary>
public List<Element> GetLinkedModelElements(ISendFilter sendFilter, Document linkedDocument, Transform? transform)
{
// send mode → Categories
if (sendFilter is RevitCategoriesFilter categoryFilter && categoryFilter.SelectedCategories is not null)
{
var categoryIds = categoryFilter
.SelectedCategories.Select(c => ElementIdHelper.GetElementId(c))
.OfType<ElementId>()
.ToList();
if (categoryIds.Count > 0)
{
return GetElementsByCategory(linkedDocument, categoryIds);
}
return new List<Element>();
}
// send mode → Views (taken from the legacy code)
if (sendFilter is RevitViewsFilter viewFilter && viewFilter.GetView() != null)
{
RevitLinkInstance linkInstance = FindLinkInstanceForDocument(
linkedDocument.PathName,
_revitContext.UIApplication.NotNull().ActiveUIDocument.Document,
transform
);
#if REVIT2024_OR_GREATER
// revit 2024 and 2025 we can use the three-parameter constructor to get only visible elements
using var viewCollector = new FilteredElementCollector(
_revitContext.UIApplication.ActiveUIDocument.Document,
viewFilter.GetView().NotNull().Id,
linkInstance.Id
);
return viewCollector.WhereElementIsNotElementType().ToElements().ToList();
#else
// 🚨 LIMITATION: in Revit 2023 and below, we can only check if the entire linked model is visible,
// not individual elements within it. If the linked model is visible, all its elements will be included.
// constructor overload pertaining to searching and filtering visible elements from a revit link only added 2024.
if (linkInstance.IsHidden(viewFilter.GetView().NotNull()))
{
return new List<Element>(); // if the linked model is hidden, return no elements
}
// 💩 fallback to getting all elements if the linked model is visible
return GetAllElementsForLinkedModelSelection(linkedDocument);
#endif
}
// send mode → Selection
return GetAllElementsForLinkedModelSelection(linkedDocument);
}
/// <summary>
/// Prepares display names for linked model documents based on filename
/// </summary>
public void PrepareLinkedModelNames(IReadOnlyList<DocumentToConvert> documentElementContexts)
{
LinkedModelDisplayNames.Clear();
// Group linked models by filename
var linkedModels = documentElementContexts
.Where(ctx => ctx.Doc.IsLinked)
.GroupBy(ctx => Path.GetFileNameWithoutExtension(ctx.Doc.PathName))
.ToDictionary(g => g.Key, g => g.ToList());
// Create a unique key for each instance
foreach (var group in linkedModels)
{
string baseName = group.Key;
var instances = group.Value;
// Single instance - just use the base name
if (instances.Count == 1)
{
string id = GetIdFromDocumentToConvert(instances[0]);
LinkedModelDisplayNames[id] = baseName;
}
// Multiple instances - add numbering
else
{
for (int i = 0; i < instances.Count; i++)
{
string id = GetIdFromDocumentToConvert(instances[i]);
LinkedModelDisplayNames[id] = $"{baseName}_{i + 1}";
}
}
}
}
public string GetIdFromDocumentToConvert(DocumentToConvert documentToConvert) =>
documentToConvert.Doc.GetHashCode() + "-" + (documentToConvert.Transform?.GetHashCode() ?? 0);
/// <summary>
/// Gets elements from a document that belong to the specified categories.
/// </summary>
private List<Element> GetElementsByCategory(Document linkedDoc, List<ElementId> categoryIds)
{
using var multicategoryFilter = new ElementMulticategoryFilter(categoryIds);
using var collector = new FilteredElementCollector(linkedDoc);
return collector
.WhereElementIsNotElementType()
.WhereElementIsViewIndependent()
.WherePasses(multicategoryFilter)
.ToList();
}
// Helper method to generate a simple hash for a transform
// transformedElement.applicationId = ${applicationId}-t{transformHash}
public string GetTransformHash(Transform transform)
{
// create a simplified representation of the transform
string json =
$@"{{
""origin"": [{transform.Origin.X:F2}, {transform.Origin.Y:F2}, {transform.Origin.Z:F2}],
""basis"": [{transform.BasisX.X:F1}, {transform.BasisY.Y:F1}, {transform.BasisZ.Z:F1}]
}}";
byte[] jsonBytes = System.Text.Encoding.UTF8.GetBytes(json);
#pragma warning disable CA1850
using (var sha256 = System.Security.Cryptography.SHA256.Create())
{
byte[] hashBytes = sha256.ComputeHash(jsonBytes);
// keep only the first 8 characters for a short but unique hash
return BitConverter.ToString(hashBytes).Replace("-", "").ToLowerInvariant()[..8];
}
#pragma warning restore CA1850
}
/// <summary>
/// Retrieves all elements from the linked document when using selection filters.
/// When a linked model is selected in the main document, we include all elements
/// from that linked model since the selection is of the entire linked instance.
/// </summary>
private List<Element> GetAllElementsForLinkedModelSelection(Document linkedDoc)
{
using var collector = new FilteredElementCollector(linkedDoc);
return collector.WhereElementIsNotElementType().WhereElementIsViewIndependent().ToList();
}
/// <summary>
/// Finds a specific RevitLinkInstance that corresponds to a linked document with a matching transform.
/// </summary>
/// <param name="linkedDocumentPath">The file path of the linked document</param>
/// <param name="transform">The transform to match (expected to already be an inverse transform).
/// When provided with multiple instances of the same linked document, this is used to find the specific instance.</param>
/// <param name="mainDocument">The main Revit document containing the link instances</param>
/// <returns>The matching RevitLinkInstance, or the first available instance if no match is found</returns>
private RevitLinkInstance FindLinkInstanceForDocument(
string linkedDocumentPath,
Document mainDocument,
Transform? transform
)
{
using var collector = new FilteredElementCollector(mainDocument);
var linkInstances = collector
.OfClass(typeof(RevitLinkInstance))
.Cast<RevitLinkInstance>()
.Where(link => link.GetLinkDocument()?.PathName == linkedDocumentPath)
.ToList();
// if no transform or only one instance, just return the first
if (transform == null || linkInstances.Count <= 1)
{
return linkInstances.FirstOrDefault()
?? throw new SpeckleException($"No link instance found for {linkedDocumentPath}");
}
// a match consists of not only the linked document path name but the transformation too (think linked instances)
// precompute our target hash once
string targetHash = GetTransformHash(transform);
// directly find the matching instance
var matchingInstance = linkInstances.FirstOrDefault(link =>
GetTransformHash(link.GetTotalTransform().Inverse) == targetHash
);
// return matching with a fallback to first (main) instance in case something goes funky with the hash
return matchingInstance ?? linkInstances.First();
}
}
@@ -2,7 +2,7 @@ using Autodesk.Revit.DB;
using Autodesk.Revit.DB.ExtensibleStorage;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Events;
using Revit.Async;
using Speckle.Connectors.Common.Threading;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Models;
using Speckle.Connectors.DUI.Utils;
@@ -22,6 +22,7 @@ internal sealed class RevitDocumentStore : DocumentModelStore
private readonly DocumentModelStorageSchema _documentModelStorageSchema;
private readonly IdStorageSchema _idStorageSchema;
private readonly ITopLevelExceptionHandler _topLevelExceptionHandler;
private readonly IThreadContext _threadContext;
public RevitDocumentStore(
IAppIdleManager idleManager,
@@ -29,7 +30,8 @@ internal sealed class RevitDocumentStore : DocumentModelStore
IJsonSerializer jsonSerializer,
DocumentModelStorageSchema documentModelStorageSchema,
IdStorageSchema idStorageSchema,
ITopLevelExceptionHandler topLevelExceptionHandler
ITopLevelExceptionHandler topLevelExceptionHandler,
IThreadContext threadContext
)
: base(jsonSerializer)
{
@@ -38,6 +40,7 @@ internal sealed class RevitDocumentStore : DocumentModelStore
_documentModelStorageSchema = documentModelStorageSchema;
_idStorageSchema = idStorageSchema;
_topLevelExceptionHandler = topLevelExceptionHandler;
_threadContext = threadContext;
UIApplication uiApplication = _revitContext.UIApplication.NotNull();
@@ -73,7 +76,7 @@ internal sealed class RevitDocumentStore : DocumentModelStore
IsDocumentInit = true;
_idleManager.SubscribeToIdle(
nameof(RevitDocumentStore),
nameof(LoadState) + nameof(OnDocumentChanged),
() =>
{
LoadState();
@@ -91,23 +94,25 @@ internal sealed class RevitDocumentStore : DocumentModelStore
return;
}
RevitTask.RunAsync(() =>
{
using Transaction t = new(doc, "Speckle Write State");
t.Start();
using DataStorage ds = GetSettingsDataStorage(doc) ?? DataStorage.Create(doc);
_threadContext
.RunOnMain(() =>
{
using Transaction t = new(doc, "Speckle Write State");
t.Start();
using DataStorage ds = GetSettingsDataStorage(doc) ?? DataStorage.Create(doc);
using Entity stateEntity = new(_documentModelStorageSchema.GetSchema());
string serializedModels = Serialize();
stateEntity.Set("contents", serializedModels);
using Entity stateEntity = new(_documentModelStorageSchema.GetSchema());
string serializedModels = Serialize();
stateEntity.Set("contents", serializedModels);
using Entity idEntity = new(_idStorageSchema.GetSchema());
idEntity.Set("Id", s_revitDocumentStoreId);
using Entity idEntity = new(_idStorageSchema.GetSchema());
idEntity.Set("Id", s_revitDocumentStoreId);
ds.SetEntity(idEntity);
ds.SetEntity(stateEntity);
t.Commit();
});
ds.SetEntity(idEntity);
ds.SetEntity(stateEntity);
t.Commit();
})
.FireAndForget();
}
protected override void LoadState()
@@ -0,0 +1,32 @@
using Autodesk.Revit.DB;
namespace Speckle.Connectors.Revit.HostApp;
/// <summary>
/// Handles Revit Views per Send/Receive, e.g. determines whether the View is supported for specific operation.
/// </summary>
public class RevitViewManager
{
/// <summary>
/// Determine if the View is supported for Receive operation. Currently only 3d view or horizontal 2d views are supported.
/// Views like Section, Elevation, ViewSheet etc. are not supported
/// </summary>
public bool IsSupportedReceiveView(View activeView)
{
switch (activeView.ViewType)
{
case ViewType.ThreeD:
case ViewType.FloorPlan:
case ViewType.AreaPlan:
case ViewType.CeilingPlan:
return true;
case ViewType.Detail:
return IsHorizontalView(activeView);
default:
return false;
}
}
private bool IsHorizontalView(View activeView) => Math.Abs(activeView.ViewDirection.Z - 1) < 0.00001;
}
@@ -1,6 +1,8 @@
using System.IO;
using Autodesk.Revit.DB;
using Speckle.Converters.Common;
using Speckle.Converters.RevitShared.Settings;
using Speckle.Sdk;
using Speckle.Sdk.Models.Collections;
namespace Speckle.Connectors.Revit.HostApp;
@@ -12,6 +14,9 @@ public class SendCollectionManager
{
private readonly IConverterSettingsStore<RevitConversionSettings> _converterSettings;
private readonly Dictionary<string, Collection> _collectionCache = new();
private readonly Dictionary<ElementId, (string name, Dictionary<string, object?> props)> _levelCache = new(); // stores level id and its properties
private readonly Dictionary<string, Collection> _linkedModelCollections = new(); // cache for linked model collections
private Collection? _mainModelCollection; // collection for main model elements
public SendCollectionManager(IConverterSettingsStore<RevitConversionSettings> converterSettings)
{
@@ -19,20 +24,99 @@ public class SendCollectionManager
}
/// <summary>
/// Returns the element's host collection based on level, category and optional type. Additionally, places the host collection on the provided root object.
/// Returns the element's host collection based on level, category and optional type if the main model only is sent.
/// The host collection is placed on the provided root object.
/// If linked models are being sent, nested collections are sent under the provided root object.
/// Note, it's not nice we're mutating the root object in this function.
/// </summary>
/// <param name="element"></param>
/// <param name="rootObject"></param>
/// <returns></returns>
public Collection GetAndCreateObjectHostCollection(Element element, Collection rootObject)
public Collection GetAndCreateObjectHostCollection(
Element element,
Collection rootObject,
bool sendWithLinkedModels,
string? modelDisplayName = null
)
{
var doc = _converterSettings.Current.Document;
var path = new List<string>();
// Step 1: create path components. Currently, this is
// Get model path and name
string modelPath = doc.PathName;
string modelName = Path.GetFileNameWithoutExtension(modelPath);
bool isLinkedModel = doc.IsLinked;
// Set up the correct hierarchy based on whether we have linked models or not
Collection startingCollection;
if (sendWithLinkedModels) // this arg comes from RevitRootObjectBuilder and check is setting enabled and linked models present
{
// if we're sending linked models, create a nested structure
// for the main model
if (!isLinkedModel)
{
// create main model collection if it doesn't exist yet
if (_mainModelCollection == null)
{
_mainModelCollection = new Collection(rootObject.name);
rootObject.elements.Add(_mainModelCollection);
}
startingCollection = _mainModelCollection;
}
// for linked models
else
{
// Use display name from settings if available, otherwise use original name
string displayName = modelDisplayName ?? modelName;
// Check if we already have a collection for this model display name
if (!_linkedModelCollections.TryGetValue(displayName, out Collection? linkedModelCollection))
{
// First time seeing this model with this display name
linkedModelCollection = new Collection(displayName);
rootObject.elements.Add(linkedModelCollection);
_linkedModelCollections[displayName] = linkedModelCollection;
}
startingCollection = linkedModelCollection;
}
}
else
{
// if we don't have linked models, use the root directly
startingCollection = rootObject;
}
// get the level and its properties
string levelName = "No Level";
Dictionary<string, object?> levelProperties = new();
if (element.LevelId != ElementId.InvalidElementId)
{
if (_levelCache.TryGetValue(element.LevelId, out var cachedLevel))
{
levelName = cachedLevel.name;
levelProperties = cachedLevel.props;
}
else
{
try
{
var level = (Level)doc.GetElement(element.LevelId);
levelName = level.Name;
levelProperties.Add("elevation", level.Elevation);
levelProperties.Add("units", _converterSettings.Current.SpeckleUnits);
_levelCache.Add(element.LevelId, (levelName, levelProperties));
}
// the exception is swallowed since if an exception occurs, we fall back to "No Level" for the element
catch (Exception e) when (!e.IsFatal()) { }
}
}
// create path components. Currently, this is
// level > category > type
path.Add(doc.GetElement(element.LevelId) is not Level level ? "No level" : level.Name);
path.Add(levelName);
path.Add(element.Category?.Name ?? "No category");
var typeId = element.GetTypeId();
if (typeId != ElementId.InvalidElementId)
@@ -48,18 +132,23 @@ public class SendCollectionManager
path.Add("No type");
}
string fullPathName = string.Concat(path);
// Use the collection's name for cache keys to ensure proper separation
string modelIdentifier = startingCollection.name;
// create a model-specific key for the collection cache
string fullPathName = $"{modelIdentifier}:{string.Join(":", path)}";
if (_collectionCache.TryGetValue(fullPathName, out Collection? value))
{
return value;
}
string flatPathName = "";
Collection previousCollection = rootObject;
string flatPathName = modelIdentifier;
Collection previousCollection = startingCollection;
foreach (var pathItem in path)
for (int i = 0; i < path.Count; i++)
{
flatPathName += pathItem;
var pathItem = path[i];
flatPathName += ":" + pathItem;
Collection childCollection;
if (_collectionCache.TryGetValue(flatPathName, out Collection? collection))
{
@@ -68,6 +157,12 @@ public class SendCollectionManager
else
{
childCollection = new Collection(pathItem);
// add properties to level collection
if (i == 0 && levelProperties.Count > 0)
{
childCollection["properties"] = levelProperties;
}
previousCollection.elements.Add(childCollection);
_collectionCache[flatPathName] = childCollection;
}
@@ -5,7 +5,7 @@ namespace Speckle.Connectors.Revit.HostApp;
public static class SupportedCategoriesUtils
{
/// <summary>
/// Filters out all categories besides Model categories. This utility should be used
/// Filters out all categories besides Model categories, and Grids in Annotation. This utility should be used
/// to clean any elements we might want to send pre-conversion as well as in what categories
/// to display in our category filter.
/// </summary>
@@ -13,18 +13,32 @@ public static class SupportedCategoriesUtils
/// <returns></returns>
public static bool IsSupportedCategory(Category? category)
{
return category is not null
&& (
category.CategoryType == CategoryType.Model
// || category.CategoryType == CategoryType.AnalyticalModel
)
#if REVIT_2023_OR_GREATER
&& category.BuiltInCategory != BuiltInCategory.OST_AreaSchemes
&& category.BuiltInCategory != BuiltInCategory.OST_AreaSchemeLines
if (category is null || !category.IsVisibleInUI)
{
return false;
}
switch (category.CategoryType)
{
case CategoryType.Annotation:
return
#if REVIT2023_OR_GREATER
category.BuiltInCategory == BuiltInCategory.OST_Grids;
#else
&& category.Name != "OST_AreaSchemeLines"
&& category.Name != "OST_AreaSchemes"
category.Name == "OST_Grids";
#endif
&& category.IsVisibleInUI;
case CategoryType.Model:
return
#if REVIT2023_OR_GREATER
category.BuiltInCategory != BuiltInCategory.OST_AreaSchemes
&& category.BuiltInCategory != BuiltInCategory.OST_AreaSchemeLines;
#else
category.Name != "OST_AreaSchemeLines" && category.Name != "OST_AreaSchemes";
#endif
default:
return false;
}
}
}
@@ -33,6 +33,7 @@ public sealed class RevitHostObjectBuilder(
RevitGroupBaker groupManager,
RevitMaterialBaker materialBaker,
RootObjectUnpacker rootObjectUnpacker,
RevitViewManager viewManager,
ILogger<RevitHostObjectBuilder> logger,
IThreadContext threadContext,
RevitToHostCacheSingleton revitToHostCacheSingleton,
@@ -61,6 +62,13 @@ public sealed class RevitHostObjectBuilder(
CancellationToken cancellationToken
)
{
// ignore Receive in any other views (e.g. Section, Elevation, ViewSheet etc.)
View activeView = converterSettings.Current.Document.ActiveView;
if (!viewManager.IsSupportedReceiveView(activeView))
{
throw new ConversionException($"Receive in '{activeView.ViewType}' View is not supported");
}
var baseGroupName = $"Project {projectName}: Model {modelName}"; // TODO: unify this across connectors!
onOperationProgressed.Report(new("Converting", null));
@@ -201,6 +209,16 @@ public sealed class RevitHostObjectBuilder(
new(Status.SUCCESS, localToGlobalMap.AtomicObject, directShapes.UniqueId, "Direct Shape")
);
}
else if (result is List<string> elementsIds)
{
// This is the case when conversion returns not a GeometryObject, but Documentation elements (Annotations, Details etc.)
// If Regions were a part of DataObject, it can return more than 1 native shape
foreach (var elementId in elementsIds)
{
conversionResults.Add(new(Status.SUCCESS, localToGlobalMap.AtomicObject, elementId, "Filled Region"));
bakedObjectIds.Add(elementId);
}
}
else
{
throw new ConversionException($"Failed to cast {result.GetType()} to direct shape definition wrapper.");
@@ -16,6 +16,7 @@ public class RevitCategoriesFilter : DiscriminatedObject, ISendFilter, IRevitSen
private Document? _doc;
public string Id { get; set; } = "revitCategories";
public string Name { get; set; } = "Categories";
public string Type { get; set; } = "Custom";
public string? Summary { get; set; }
public bool IsDefault { get; set; }
public List<string> SelectedObjectIds { get; set; } = new();
@@ -40,12 +41,17 @@ public class RevitCategoriesFilter : DiscriminatedObject, ISendFilter, IRevitSen
/// <exception cref="SpeckleSendFilterException">Whenever no view is found.</exception>
public List<string> RefreshObjectIds()
{
var objectIds = new List<string>();
if (SelectedCategories is null)
{
return objectIds;
return [];
}
// ⚠️ this is ugly, BUT we need to preserve RevitLinkInstances regardless of category.
// these get unpacked later in the RefreshElementsIdsOnSender, so if we don't do this, they'll get filtered out here
using var linkCollector = new FilteredElementCollector(_doc);
var linkInstanceIds = linkCollector.OfClass(typeof(RevitLinkInstance)).Select(link => link.UniqueId).ToList();
// get elements that match the selected categories (excluding RevitLinkInstance objects)
var elementIds = SelectedCategories.Select(c => ElementIdHelper.GetElementId(c)).Where(e => e is not null).ToList();
using var categoryFilter = new ElementMulticategoryFilter(elementIds);
@@ -55,7 +61,11 @@ public class RevitCategoriesFilter : DiscriminatedObject, ISendFilter, IRevitSen
.WhereElementIsViewIndependent()
.WherePasses(categoryFilter)
.ToList();
objectIds = elements.Select(e => e.UniqueId).ToList();
// combine both sets
var objectIds = elements.Select(e => e.UniqueId).ToList();
objectIds.AddRange(linkInstanceIds);
SelectedObjectIds = objectIds;
return objectIds;
}

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