-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CNX-9228 : minimal working revit receive operation that receives levels #3286
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably be a bit picky about which bits we pull across from the old converters/connectors as we're getting into areas we want to make good/better and we will need more alignment
DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/ReceiveBinding.cs
Outdated
Show resolved
Hide resolved
DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/ReceiveBinding.cs
Outdated
Show resolved
Hide resolved
DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/AutofacUIModule.cs
Outdated
Show resolved
Hide resolved
...Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs
Outdated
Show resolved
Hide resolved
return result; | ||
} | ||
|
||
private ISpeckleObjectToHostConversion? GetToHostConversion(Type? targetType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would Type be null?
|
||
// factory for conversions | ||
builder | ||
.RegisterType<Factory<string, IHostObjectToSpeckleConversion>>() | ||
.As<IFactory<string, IHostObjectToSpeckleConversion>>(); | ||
builder | ||
.RegisterType<Factory<string, ISpeckleObjectToHostConversion>>() | ||
.As<IFactory<string, ISpeckleObjectToHostConversion>>(); | ||
|
||
// POC: do we need ToSpeckleScalingService as is, do we need to interface it out? | ||
builder.RegisterType<ToSpeckleScalingService>().AsSelf().InstancePerLifetimeScope(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should all be interfaced out
|
||
namespace Speckle.Converters.RevitShared.Services; | ||
|
||
public class ErrorPreprocessingService : IFailuresPreprocessor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems completely out of scope tbh, we need to design and POC the reporting and this far we've largely been ignoring it. I think this should come out for now - was this a copy and paste?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was copy paste. Removing for now, but this is a decently important class in Revit that we should make sure we reimplement. I've added a POC comment.
return UnitUtils.ConvertToInternalUnits(value, UnitsToNative(units)); | ||
} | ||
|
||
private static ForgeTypeId UnitsToNative(string units) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this being done elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the same thing but I don't think so. In the contextStack, we have an IHostToSpeckleUnitConverter which goes from hostUnit to string, but not string to HostUnit. Maybe we should add this to that interface instead?
/// </summary> | ||
public sealed class TransactionManagementService : ITransactionManagementService | ||
{ | ||
private readonly Lazy<RevitConversionContextStack> _lazyContextStack; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for making this lazy? Is this essentially a singleton with the context of a conversion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was needed because it was being instantiated in a dependency of the binding (right when Revit was opened before there was an active document) which was causing an error because the context stack is instantiated using the active document. However, this is no longer needed after moving the uow out to the binding.
return TransactionStatus.Uninitialized; | ||
} | ||
|
||
private void HandleFailedCommit(TransactionStatus status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like it maybe doing too much and is using SpeckleLog directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right. Removed the error handling and added POC comments
Moving this to |
closing in favor of #3542 |
Description & motivation
Changes:
To-do before merge:
Screenshots:
Validation of changes:
Checklist:
References