Skip to content

Conversation

jsdbroughton
Copy link
Contributor

@jsdbroughton jsdbroughton commented Dec 6, 2024

Description & motivation

This PR adds Navisworks support to the next-generation Speckle connectors. The implementation enables users to export Navisworks models and their properties into Speckle, providing high-fidelity data exchange capabilities. These changes are the first step towards fully integrating Navisworks into the Speckle ecosystem, setting the stage for future enhancements like bidirectional workflows and advanced automation.

Fixes: CNX-428, CNX-894, CNX-900, CNX-901, CNX-902, CNX-903, CNX-904

Changes:

  • Introduced Navisworks Connector and Converter projects to the next-gen architecture.
  • Added dependency injection for Navisworks converters to improve modularity.
  • Added Send functionality for exporting Navisworks models and their properties.
  • Class, element, and model properties were included for comprehensive data transfer.
  • Implemented RunOnMainThreadAsync for thread-safe COM Interop execution.
  • Developed GeometryExtractor and PrimitiveProcessor for handling Navisworks geometries.
  • Added GC.KeepAlive events and Added some Safe* primitives as structs to prevent early disposals
  • Added User facing options and implements Respecting display modes

To-do before merge:

  • Ensure comprehensive testing of the 'Send' functionality with real-world datasets.
  • Confirm documentation updates to guide users using the new Navisworks connector.

Screenshots:

Screenshot 2024-12-07 214807
Screenshot 2024-12-07 215302
Screenshot 2024-12-07 220832

Validation of changes:

  • Tested basic 'Send' workflows with sample Navisworks models.
  • Validated geometry extraction and property mapping against complex datasets.
  • Ensured thread safety during COM Interop operations using RunOnMainThreadAsync.

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the exact update/change.
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a style similar to the existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

jsdbroughton and others added 30 commits November 5, 2024 16:00
* dev:
  moves pointcloud converter to top level (#349)
* dev:
  supporting ICurves as fallback (#339)
  fix(revit): handles plane origin out of bounds and creating group with no elements exceptions (#346)
* dev:
  Fixed autocad async (#370)
  chore: comments
  fix: allows pre-transformation of all ITransformable objects
  adds a setting to send rebars as line or solid (#367)
  Update SDK and dependencies (#366)
  Jrm/parameter extraction (#365)
  dogukan/cnx-753-normals-are-flipped (#364)
  Dogukan/cnx 691 extract appropriate class properties by type (#352)
  Revit async fix for sending (#362)
  feat: adds top level converter for railings
  dogukan/cnx-748-send-grids-from-tekla (#353)
  fix: adds built in category for setting ds cat on receive reliably
  feat: CXPLA-120 Added tekla zip packaging prior to installers (#357)
  add appId (#358)
  adds logic for rendering rebars as lines and arcs (#356)
  Fixed test failing on german culture (#355)
  CNX-501 Temp folder arcgis (#351)
  receive operation fix (#350)
The commit modifies the access modifier of the Container property in the Connector class from public to private. This change improves encapsulation and ensures that the property can only be accessed within the class itself.
…lidation

The commit fixes the initialization of the Models list in the NavisworksDocumentStore class. Instead of assigning an empty array, it now uses the Clear() method to clear the existing models.

Additionally, the commit improves the document validation logic by checking if critical properties are accessible before considering the document valid. It also handles cases where the document is disposed.

These changes ensure proper initialization of model lists and accurate document validation in NavisworksDocumentStore.
- Refactor NavisworksDocumentEvents to manage both document and model state change notifications
- Update comments to reflect the new functionality
- Rename SubscribeToEvents method to SubscribeToDocumentModelEvents for clarity
- Add HandleDocumentModelCountChanging and HandleDocumentModelCountChanged methods to track model count changes
- Update OnDocumentModelCountChanged method name to NotifyValidModelStateChange for clarity
- Update UnsubscribeFromEvents method name to UnsubscribeFromDocumentModelEvents for clarity
- Remove unused constants from NavisworksDocumentStore class
- Update references to `Autodesk.Navisworks.Api` namespace to `NAV` namespace
- Fix typo in file name: `GlobalUsings.cs` renamed to `GlobalUsing.cs`
- Update references to `ModelItem` type from `Autodesk.Navisworks.Api` namespace to `NAV.ModelItem`
- Update references to `Document` type from `Autodesk.Navisworks.Api` namespace to `NAV.Document`
- Update references to database related types from `Autodesk.Navisworks.Api.Data` namespace to `NAV.Data`
- Add new file: NavisworksRootObjectBuilder.cs
- Remove unused using statements
- Added "Objects.Converter.Navisworks2024" to the packages.lock.json file with dependencies on "Speckle.Converters.Common" and "Speckle.Navisworks.API"
- Updated the Speckle.Connectors.Navisworks2024.csproj file to include a reference to "Speckle.Converters.Navisworks2024.csproj" and "Speckle.Converters.Common.csproj"
- Added "speckle.converters.common" to the packages.lock.json file with dependencies on "Microsoft.Extensions.Logging.Abstractions" and "Speckle.Objects"
- Renamed files:
  - NavisworksConversionSettings.cs -> NavisworksConversionSettingsFactory.cs
  - GlobalUsings.cs -> GlobalUsing.cs
  - NavisworksConversionSettings.cs -> Settings/NavisworksConversionSettings.cs
  - NavisworksConversionSettings.cs -> Services/NavisworksToSpeckleUnitConverter.cs
  - NavisworksConversionSettings.cs -> ToSpeckle/NavisworksRootToSpeckleConverter.cs
- Updated the project reference for "Navisworks" in Local.sln to use a new GUID
- Updated the project reference for "2024" in Local.sln to use a new GUID
- Updated the project reference for "Shared" in Local.sln to use a new GUID
- Updated the project reference for "Speckle.Connectors.NavisworksShared" in Local.sln to use a new GUID
- Updated the project reference for "Speckle.Converters.NavisworksShared" in Local.sln to use a new GUID
- Updated the project name and GUID for "Navisworks" in Speckle.Connectors.sln
- Updated the project name and GUID for "Shared" in Speckle.Connectors.sln
…ad connectors for versions 2022, 2023, 2024, and 2025.

This commit updates the Microsoft.Web.WebView2 package in the Autocad connectors for versions 2022, 2023, 2024, and 2025 from version 1.0.1938.49 to version 1.0.2088.41. This change ensures compatibility with the latest version of the package and includes necessary bug fixes or improvements related to web view functionality in the connectors.
- Updated the project reference for "Navisworks" in Local.sln to use a new GUID
- Updated the project reference for "2024" in Local.sln to use a new GUID
- Updated the project reference for "Shared" in Local.sln to use a new GUID
- Updated the project reference for "Speckle.Connectors.NavisworksShared" in Local.sln to use a new GUID
- Updated the project reference for "Speckle.Converters.NavisworksShared" in Local.sln to use a new GUID
- Updated the project name and GUID for "Navisworks" in Speckle.Connectors.sln
- Updated the project name and GUID for "Shared" in Speckle.Connectors.sln
…nd Civil3d connectors

This commit updates the version of Microsoft.Web.WebView2 to [1.0.1938.49, ) in the Autocad and Civil3d connectors packages.lock.json files. The previous version was 1.0.2088.41, and the contentHash has also been updated accordingly.

Note: This commit message is exactly 50 characters long, as per the requirement for a short description less than 50 characters.
- Remove the `GeometryNodeMerger` class from service registration in `NavisworksConnectorServiceRegistration.cs`
- Change the access modifier of `UnpackRenderMaterial` method in `NavisworksMaterialUnpacker.cs` to internal
- Change the access modifier of `ConvertRenderColorAndTransparencyToSpeckle` method in `NavisworksMaterialUnpacker.cs` to private static
- Change the access modifier of `GroupSiblingGeometryNodes` method in `GeometryNodeMerger.cs` to public static
- Add null checks for parameters in methods:
  - GetClassProperties in ClassPropertiesExtractor.cs
  - GetPropertySets and AssignProperties in BasePropertyHandler.cs
  - AssignClassProperties and ExtractClassProperties in ClassPropertiesExtractor.cs
  - GetPropertySets in PropertySetsExtractor.cs
  - AssignPropertySets, AssignModelProperties, and ExtractModelProperties in ModelPropertiesExtractor.cs
  - NavisworksRootObjectBuilder constructor
- Added `DisplayValueExtractor` class for extracting display values from Navisworks model items
- Added `GeometryToSpeckleConverter` class for converting Navisworks geometry to Speckle SDK models
- Updated dependencies in `NavisworksConverterServiceRegistration.cs` to include the new classes
This commit renames the file GeomtryNodeMerger.cs to GeometryNodeMerger.cs.
- Updated NavisworksSelectionBinding to include IElementSelectionService as a dependency in the constructor.
- Updated NavisworksSendBinding to include IElementSelectionService as a dependency in the constructor.
- Removed ElementSelectionExtension.cs file.
- Added ElementSelectionService.cs file which includes methods for getting model item path, resolving model item from path, checking visibility of model items, and getting geometry nodes.
@jsdbroughton jsdbroughton marked this pull request as ready for review December 8, 2024 00:11
jsdbroughton and others added 5 commits December 10, 2024 13:09
@adamhathcock adamhathcock changed the title Jsdb/navisworks Navisworks! Dec 16, 2024
@jsdbroughton
Copy link
Contributor Author

Navisworks!

Sounds important 😎

@adamhathcock adamhathcock enabled auto-merge (squash) December 16, 2024 10:32
@adamhathcock adamhathcock enabled auto-merge (squash) December 17, 2024 14:28
@adamhathcock adamhathcock merged commit f924a59 into dev Dec 17, 2024
5 checks passed
@adamhathcock adamhathcock deleted the jsdb/navisworks branch December 17, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants