Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main with changes from dev #3196

Merged
merged 90 commits into from
Feb 26, 2024
Merged

Update main with changes from dev #3196

merged 90 commits into from
Feb 26, 2024

Conversation

AlanRynne
Copy link
Member

Updating main with changes from dev prior to releasing the first 2.18.0-rc

AlanRynne and others added 30 commits November 20, 2023 22:48
chore!(core): Cleanup base object serializer v2
…repo (#3070)

* ci: Show all warnings on CI builds

* fix(all): Do not allow IDE0005 on CI

* fix(sdk): IDE0005 Redundant Using statements in SDK projects (#3071)

* fix(core): IDE0005 Redundant Using statements

* fix(ci): GenerateDocumentationFile is required for IDE0005 to run on CI

* fix(ci): Allow warnings on all CI jobs

* fix(rhino/grasshopper): Fix IDE0005 Redundant Using Statements  (#3072)

* fix(gh): IDE0005 for Grasshopper connector

* fix(rhino): IDE0005 for Rhino connector

* fix(rh/gh): IDE0005 for Rhino/Grasshopper shared converter

* Revit: IDE0005 fix (#3073)

* remove connector usings

* remove converter usings

* remove revit shared resources usings

* dxfConverter

* remove more usings

* remove unused statement

* is this all of them?

---------

Co-authored-by: Connor Ivy <connor@speckle.systems>

* fix(dyn): IDE0005 Redundant Using Statements (#3074)

* fix(dyn): IDE005 first run

* fix(dyn): Fix dangling warning

* fix(CNX-8300): IDE0005 Redundant using statements (#3076)

* fix(tekla): IDE0005 Redundant using statements

* fix(structuralUtils): IDE0005 Redundant Using statements

* fix(CNX-8301): IDE0005 Redundant using statements in CSI (#3079)

* fix for csi

* fix(csi): Wrapped pending using statement in pre-processor directive

---------

Co-authored-by: Connor Ivy <connor@speckle.systems>
Co-authored-by: Alan Rynne <alan@speckle.systems>

* fix (navisworks): CNX-8305 - IDE0005 (#3077)

* Refactor NavisworksOptions Manager.cs

- Remove unused using statements
- Clean up namespace declaration

* Update Ribbon.xaml.cs for rogue using

---------

Co-authored-by: Alan Rynne <alan@speckle.systems>

* fix(acadcivil): resolves IDE0005 warnings (#3080)

* Fixes IDE0005 for acadcivil connector and converter

* other warn cleanups

* fixes civil warn

* Update Directory.Build.props

---------

Co-authored-by: Alan Rynne <alan@speckle.systems>

---------

Co-authored-by: connorivy <43247197+connorivy@users.noreply.github.com>
Co-authored-by: Connor Ivy <connor@speckle.systems>
Co-authored-by: Jonathon Broughton <jonathon@stardotbmp.com>
Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
* adds name prop to surfaces with minor refactor

* Update Converter.AutocadCivil.Utils.cs
…ns/none (#3081)

* ci: Show all warnings on CI builds

* fix(all): Do not allow IDE0005 on CI

* fix(sdk): IDE0005 Redundant Using statements in SDK projects (#3071)

* fix(core): IDE0005 Redundant Using statements

* fix(ci): GenerateDocumentationFile is required for IDE0005 to run on CI

* fix(ci): Allow warnings on all CI jobs

* fix(rhino/grasshopper): Fix IDE0005 Redundant Using Statements  (#3072)

* fix(gh): IDE0005 for Grasshopper connector

* fix(rhino): IDE0005 for Rhino connector

* fix(rh/gh): IDE0005 for Rhino/Grasshopper shared converter

* tamed some warnings

* Hushed more warnings

---------

Co-authored-by: Alan Rynne <alan@speckle.systems>
* ci: Show all warnings on CI builds

* fix(all): Do not allow IDE0005 on CI

* fix(sdk): IDE0005 Redundant Using statements in SDK projects (#3071)

* fix(core): IDE0005 Redundant Using statements

* fix(ci): GenerateDocumentationFile is required for IDE0005 to run on CI

* fix(ci): Allow warnings on all CI jobs

* fix(rhino/grasshopper): Fix IDE0005 Redundant Using Statements  (#3072)

* fix(gh): IDE0005 for Grasshopper connector

* fix(rhino): IDE0005 for Rhino connector

* fix(rh/gh): IDE0005 for Rhino/Grasshopper shared converter

* Revit: IDE0005 fix (#3073)

* remove connector usings

* remove converter usings

* remove revit shared resources usings

* dxfConverter

* remove more usings

* remove unused statement

* is this all of them?

---------

Co-authored-by: Connor Ivy <connor@speckle.systems>

* fix(dyn): IDE0005 Redundant Using Statements (#3074)

* fix(dyn): IDE005 first run

* fix(dyn): Fix dangling warning

* fix(CNX-8300): IDE0005 Redundant using statements (#3076)

* fix(tekla): IDE0005 Redundant using statements

* fix(structuralUtils): IDE0005 Redundant Using statements

* Refactor NavisworksOptions Manager.cs

- Remove unused using statements
- Clean up namespace declaration

* Fix IDE1006

Update variable names in ConnectorNavisworksBindings.cs to follow naming conventions. Update _doc to s_doc, _cachedCommit to s_cachedCommit, and _cachedState to s_cachedState.

* Fix CA1032

The try-catch block swallows unknown exceptions in the InitAvalonia instance of the CreateControlPane method.

Introduced as a justified suppression

* FIX IDE0059

Refactor code to use discard variable (`_`) instead of unused variable (`unused`) in ConverterNavisworks.ToSpeckle.cs. This change is to a different convention to eliminate the warning generated by the IDE.

* Fix 1859

- Changed return type of GetObjectsFromSelection and GetObjectsFromSavedSets methods from IEnumerable<ModelItem> to HashSet<ModelItem>
- Changed return type of TranslateFragmentGeometry method from IReadOnlyList<Base> to List<Base>
- Changed return type of MoveAndScaleVertices method from IEnumerable<double> to List<double>
- Changed return type of ViewpointToBase method from Base to View3D

* Fix IDE0036

Refactor code to use `static readonly` instead of `readonly static` for dictionary and string variables in multiple files. This improves code readability and follows best practices.

* Fix CA1860

Refactor code to use `Count` property instead of `Any()` method for checking if a collection is empty. This change was made in multiple files: ConnectorNavisworksBindings.cs, ConnectorNavisworksBindings.Filters.cs, ConnectorNavisworksBindings.Send.cs, SelectionBuilder.cs, ConverterNavisworks.Properties.cs, and ConverterNavisworks.ToSpeckle.cs.

* FIX IDE0010

Mostly adding redundant default conditions.

- In ConnectorNavisworksBindings.Filters.cs, added a default case to handle savedItem.IsGroup == true.
- In Autosave.cs, added a default case with an empty comment to cover all logical scenarios for a boolean 'enable'.
- In SelectionBuilder.cs, added a default case in the switch statement to throw an ArgumentOutOfRangeException for an unrecognized filter type. Also added a default case in the switch statement to handle SDK object scenarios.

* Fix CA1861

Refactor code to use a static readonly array for `lowerBounds` and `separator`. This improves code readability and maintainability by centralizing the values used in multiple places.

* FIX IDE0033

The variable "element" is now assigned from `pair.Value.Key` instead of `pair.Value.Item2` use of the explicit Tuple value provided.

* FIX CA1854

Refactor ConverterNavisworks.Settings.cs to use `TryGetValue` instead of `ContainsKey` and indexer access for retrieving values from the Settings dictionary. This improves code readability and reduces unnecessary dictionary lookups.

* FIX IDE0066

Refactor switch statement to use switch expression in ConverterNavisworks.Other.cs.

This commit replaces the switch statement with a switch expression to simplify the code and improve readability. The `renderColor` variable is now assigned based on the value of `materialSettings.Mode`, with corresponding cases for "`active`", "`permanent`", and "`original`". A default case has also been added to handle any other values.

* FIX IDE0047

Refactor code to remove unnecessary parentheses.

* FIX CA1508

Adds a suppression as the switch expression includes the method solutions for future development feature already scoped and partially implemented.

* FIX IDE0047

Add [SuppressMessage] attribute to internal classes in Ribbon.xaml.cs and SpeckleNavisworksCommand.cs to avoid CA1812 warning.

These classes are the Plugin and the Ribbon which will be instantiated by Navisworks at runtime.

* FIX IDE0004 : Remove unnecessary Cast

- Remove cast to `Action`

consequently
- Remove unnecessary line breaks and indentation in the Invoke method call.

* FIX IDE0044

variable `_settingsHandler` was not marked as `readonly`.

* FIX CA1051

Change the access modifier of `ProgressBar` field in `SelectionBuilder.cs` to `internal`. This fixes the Code Analysis warning CA1051: Do not declare visible instance fields

* FIX CA1724 : Type names should not match namespaces

Refactor `Utilities` class to `SpeckleNavisworksUtilities` to avoid clash with `Autodesk.Navisworks.Gui.Utilities`.

Update references in ConnectorNavisworksBindings.cs, ConnectorNavisworksBindings.Send.cs, and SpeckleStreamManager.cs to use the new class name.

* dang missed one

---------

Co-authored-by: Alan Rynne <alan@speckle.systems>
Co-authored-by: connorivy <43247197+connorivy@users.noreply.github.com>
Co-authored-by: Connor Ivy <connor@speckle.systems>
* adds design speeds and other warn fixes

* sets design speeds on receive
* ci: Show all warnings on CI builds

* fix(all): Do not allow IDE0005 on CI

* fix(sdk): IDE0005 Redundant Using statements in SDK projects (#3071)

* fix(core): IDE0005 Redundant Using statements

* fix(ci): GenerateDocumentationFile is required for IDE0005 to run on CI

* fix(ci): Allow warnings on all CI jobs

* fix(rhino/grasshopper): Fix IDE0005 Redundant Using Statements  (#3072)

* fix(gh): IDE0005 for Grasshopper connector

* fix(rhino): IDE0005 for Rhino connector

* fix(rh/gh): IDE0005 for Rhino/Grasshopper shared converter

* tamed some warnings

* Hushed more warnings

* Eliminated many warnings in core

* More fixes for Alan

* Core fix

* More changes

* Base object serializer

* fixed erroneous disposal

* Reverted accidental change to blob constructor accessiblity

* reverted switch needless statement change

* Reverted some extra changes that weren't meant to be made

* Supressed some extra resharper analysers

* fixed typo

---------

Co-authored-by: Alan Rynne <alan@speckle.systems>
Worked on CI bc `RELEASE` mode did not require it.
Added net runtime version info to global logging
* include custom properties

* fix formatting

---------

Co-authored-by: Connor Ivy <connor@speckle.systems>
* chore(all): Flag CA1806 as error in CI

* fix(objects): Remove obsolete warning that had CA1806 warning.

The setter never actually worked so I'm not sure what we intended to do here 🤔

* fix(revit): Fix usage of obsolete `Wall.surface`

* fix(rhino/gh): CNX-8340 CNX-8341 - Fixes CA1806 in Rhino/Grasshopper projects (#3091)

fix(rhino/gh): CTX-8340 CTX-8341 - Fixes CA1806 in Rhino/Grasshopper projects

* fix(csi): CNX-8342 Fix CA1806 for CSI projects (#3092)

* fix(csi): Removes unnecessary `ToList` calls that were not saving the output

* fix(csi): Fixed output of `GetAllNamesOfObjectType` for `"Model"` input type.

* Fix CA1806 for Revit (#3096)

* fix ca 1806 (mostly)

* suppress warning in class

---------

Co-authored-by: Connor Ivy <connor@speckle.systems>

* fix(dyn): CNX-8344 Fix CA1806 in Dynamo projects (#3097)

fix(dyn): CA1806 warnings in Dynamo

* fix(all): Minor changes as per Ian's review

---------

Co-authored-by: connorivy <43247197+connorivy@users.noreply.github.com>
Co-authored-by: Connor Ivy <connor@speckle.systems>
…essions (#3105)

* Simplify methods consistently using lambda expressions

* Remove commented out code for model collection change event
* Feat(Core)!: Cleaner Send overloads with clear exception throws (#3089)

* ci: Show all warnings on CI builds

* fix(all): Do not allow IDE0005 on CI

* fix(sdk): IDE0005 Redundant Using statements in SDK projects (#3071)

* fix(core): IDE0005 Redundant Using statements

* fix(ci): GenerateDocumentationFile is required for IDE0005 to run on CI

* fix(ci): Allow warnings on all CI jobs

* fix(rhino/grasshopper): Fix IDE0005 Redundant Using Statements  (#3072)

* fix(gh): IDE0005 for Grasshopper connector

* fix(rhino): IDE0005 for Rhino connector

* fix(rh/gh): IDE0005 for Rhino/Grasshopper shared converter

* tamed some warnings

* Hushed more warnings

* Eliminated many warnings in core

* More fixes for Alan

* Core fix

* More changes

* Base object serializer

* fixed erroneous disposal

* Reverted accidental change to blob constructor accessiblity

* reverted switch needless statement change

* Reverted some extra changes that weren't meant to be made

* Supressed some extra resharper analysers

* Deprecated serailizer v1 for sending

* Deprecated send using v1 deserailize and offered cleaner overloads to send function

* unnecessary using directive

* fixed issue with checking struct for null

---------

Co-authored-by: Alan Rynne <alan@speckle.systems>

* fixed spelling mistake

* Updated send overloads to make use of sqlite cache more explicit

* Extra overload to smooth backwards compat

* Send nolonger accepts null transport

---------

Co-authored-by: Alan Rynne <alan@speckle.systems>
* Simplify methods consistently using lambda expressions

* Remove commented out code for model collection change event

* Set or reset the IsUpright flag for model orientation

This commit updates the code to set or reset the IsUpright flag instead of the ElevationMode flag for model orientation. The changes are made in multiple files, including ConverterNavisworks.cs and ConverterNavisworks.Geometry.cs. The SetModelOrientationMode method is modified to use the IsUpright flag instead of checking vector matches. Additionally, the PrimitiveProcessor class is updated to use the TargetUpVector method instead of SetElevationModeVector method.

* Update ConverterNavisworks.Geometry.cs to use a constant for the target units in BoxToSpeckle method.

* Refactor geometry path comparison logic

- Simplify variable names for better readability
- Use explicit conditions instead of negating the original condition

* Modify global event handlers for Navisworks document events

This commit adds event handlers to the `ConnectorBindingsNavisworks` class. The `RegisterAppEvents` method now registers event handlers for changes in the document filename, selection sets, and model collection.

A new method `IsInvalidOrClearDocument` has also been added to evaluate if a sender object from an event handler is a valid Document.
Finally, `NullifyCommitCache` has been implemented to reset the commit cache when necessary.

* whitespace
* Archicad properties and quanties

* build fix

* return

* AC25 build fix

* formatting

* braces

* split files

* DynamicBase.RemoveDisallowedPropNameChars

* NullValueHandling

* build fix
* layer handling exceptions

* Update ConverterRhinoGh.Organization.cs

* Update ConverterRhinoGh.Organization.cs
Removed extra config file
* More warnings resolved

* More warnings

* chore(core): Explicit disable nullability syntax for select files

* chore(core): Nullability now default

* more exception doc

* Fix tests

* The last warnings

* removed closure throw and tracked issue for further investigation

* Requested changes
* adds design speeds and other warn fixes

* sets design speeds on receive

* refactors design speeds on alignments
fix: handle FabricationPart host retrieval

This commit refactors the `RevitCommitObjectBuilder` class to handle the retrieval of a FabricationPart's associated host element. It introduces a new private method, `HandleFabricationPart`, which processes a `FabricationPart` and returns its host element. The method checks if the `FabricationPart` has a host and retrieves it using the `GetHostedInfo()` method.

The prior code would pass `null` from `GetHostedInfo()` into `GetElement()` which threw from deep withing the Revit API
…tal(this Exception) function (#3114)

* Transport exception handling

fix(core): No wrapping of fatal exceptions

fixed warnings

* Reverted inclusion of serializerv1 deprecation

* Better exception message

* Found more exceptions to avoid catching

* Reverted transport changes

* Resolved review comments
* fix: MeshToNative exceptions

continues on the specific error previously commented that should be swallowed, but throws on all other insertion errors.

* Add logging for properties that cannot be set in ConverterTeklaStructures

The code changes add logging functionality to handle exceptions thrown by the DynamicBase class when setting properties that cannot be set. The exceptions are not fatal and should simply be logged. The commit also includes a warning message with details about the element, property, and reason for skipping.

* feat: Add initialization and setup logic to MainForm

This commit adds the following changes to the MainForm class:
- Added an InitializeComponents method to initialize the components of the MainForm.
- Added a SetupApplication method to set up the application, including event subscriptions, UI build, and model bindings.
- Added a SubscribeToEvents method to subscribe to necessary application events.
- Added a BuildAndShowMainWindow method to build and display the main window of the application.
- Added a SetTeklaAsOwner method to set the Tekla application as the owner of the main window.

These changes improve the initialization and setup process in MainForm, ensuring that necessary components are properly initialized and that event subscriptions, UI build, and model bindings are correctly set up.

* feat: Add logging and error handling to StreamStateManager

This commit adds logging and error handling to the StreamStateManager class. It introduces the use of Speckle.Core.Logging for logging errors. Significant changes include:
- Added a using statement for the System namespace
- Added a using statement for the Speckle.Core.Logging namespace
- Implemented error handling in ReadState method, catching JsonException and returning an empty list if deserialization fails
- Implemented error handling in WriteState method, catching exceptions and logging an error message if writing to file fails
- Implemented error handling in ClearStreamStateList method, catching exceptions and logging an error message if clearing the stream state file fails
- Updated comments with more detailed explanations of methods and their behavior

* Update StreamStateManager.cs

- Renamed private field `_speckleFilePath` to `s_speckleFilePath`
- Added logging warning when deserialization of saved stream state list fails
- Updated method `WriteStreamStateList` to handle empty or null stream state string
- Updated method `ClearStreamStateList` to handle null or non-existent speckle file path
- Updated method `GetOrCreateSpeckleFilePath` to use lowercase variable names and added error handling for file creation/retrieval
- Updated method `ReadSpeckleFile` to use lowercase variable name and added error handling for file reading

* Removed defunct usings

* Throw an exception when the mesh cannot be converted or inserted.

Previously, there was a TODO comment suggesting to consider what to do in the case where the insert operation returned false but didn't throw an exception and no matching shape was found. This commit changes that behavior by throwing a `ConversionException` with an appropriate error message instead.

* Fix file write issue in StreamStateManager.cs

The code changes fix an issue where the file stream was not being properly checked for write access before attempting to write to it. This could result in an error when trying to write the stream state list to the file. The changes include adding a check for write access and throwing a `SpeckleException` with an appropriate error message if writing fails.

* Fix exception handling in SetupApplication method

The commit fixes the exception handling in the SetupApplication method. Instead of catching all exceptions and logging them, it now catches only general exceptions. The error message is also updated to include the specific error message from the caught exception.

---------

Co-authored-by: Alan Rynne <alan@speckle.systems>
…ucture (#3115)

* Core tests warnings

Integration tests

test namespace changes

Added old example project to the solution

csharpier

* Fixed slnf

* Tests

* Updated CI to run tests from new folder structure

* Fixed tests

* Fixed connectors that use DiskTransport

* Build targert test project
* remove catches for "GetAll___Names" methods in converter and connector

* remove usings

* fix remaining general exception catches

* remove unnecessary suppression message

* remove unused imports

* formatting fixes

---------

Co-authored-by: Connor Ivy <connor@speckle.systems>
AlanRynne and others added 23 commits February 9, 2024 19:00
…regardless of the input format (#3169)

* fix(gh): Variable input send and stream list FE2 fixes

* fix: formatting wrong? wth

---------

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
fix getAccountToken

Co-authored-by: Connor Ivy <connor@speckle.systems>
…3168)

* fix: enforce the minimum 1 objectId is in the automate result case

* fix(automate): Added xml comments to report functions

---------

Co-authored-by: Alan Rynne <alan@speckle.systems>
remove alpha

Co-authored-by: József L. Kiss <>
…ersion of Archicad (#3176)

* CNX-8875 Could not receive parametric elements with localized version of Archicad

* build fix

---------

Co-authored-by: József L. Kiss <>
…ed incorrectly (#3180)

* BUG: Grasshopper - Send node output URLs are incorrectly formatted in FE2 (missing branchID)

* all.sln
…er disposes created layer in connector (#3184)

restores previous collection to native method and no longer disposes connector layer creation
…#3183)

add filtered openings to separate collection

Co-authored-by: József L. Kiss <>
* project info fix

* format

* getCleanBasePropName

---------

Co-authored-by: Connor Ivy <connor@speckle.systems>
…3186)

uses MakeValidPath method for cleaning layer paths on receive

for both connector and converter layer creation
expect empty strings

Co-authored-by: Connor Ivy <connor@speckle.systems>
…ed streams (#3192)

* fixes regression of updating dui saved streams when saved streams is 0

* Update ConnectorBindingsAutocadCivil.Events.cs
…ening stream card (#3193)

* Fixed issue with stream state resetting to main

* logical branches

* adds comments with minor refactor

---------

Co-authored-by: Claire Kuang <kuang.claire@gmail.com>
…ve (#3194)

includes setting application id when converting instances
…vit/objects stream and between localized versions of Archicads (#3191)

* fix for CNX-9031

* CNX-9040 Layer import fix

---------

Co-authored-by: József L. Kiss <>
* hack: Added manager cert steps to config-template

* hack: Added test contest to revit job

* temp: ⚠️ Disable  CI pipeline dependencies to get some speed

* fix: CI copy action had wrong source folder

* fix: Incorrect path in KSP set step

* ci: Added verification step

* ci: Added installer for digicert sign tools

* ci: Moved some things around

* ci: Added sync certs

* ci: Minor revit sign tweaks

* Revert "temp: ⚠️ Disable  CI pipeline dependencies to get some speed"

This reverts commit 1102f5e.

* ci: Added test context to all jobs

* ci: Moved cert config to after external PR check

* ci: Removed innosetup context

* ci: Added signing only on tagged builds

* fix: revert unwanted .vscode settings
Reverted faulty disposal logic of multipart data forms

Co-authored-by: Alan Rynne <alan@speckle.systems>
@AlanRynne AlanRynne marked this pull request as ready for review February 26, 2024 15:15
@AlanRynne AlanRynne merged commit 3850b09 into main Feb 26, 2024
32 checks passed
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.

None yet

9 participants