Excel to Revit error

Hi all,

I’m trying to learn how to modify parameter values from Excel, trying to change something like Base Offset of a Wall.

My excel table looks something like this, I’ve tried different variations:

I’ve tried setting the WALL_TOP_EXTENSION_DIST_PARAM.value to 500, or topOffset to 500, or both.

The speckle commit receives the data:

but on the Revit side there’s a warning:

Cannot deserialize System.Int64 to System.String
  at Speckle.Core.Serialisation.BaseObjectDeserializerV2.Dict2Base(Dictionary`2 dictObj)
  at Speckle.Core.Serialisation.BaseObjectDeserializerV2.ConvertJsonElement(JToken doc)
  at Speckle.Core.Serialisation.BaseObjectDeserializerV2.ConvertJsonElement(JToken doc)
  at Speckle.Core.Serialisation.BaseObjectDeserializerV2.ConvertJsonElement(JToken doc)
  at Speckle.Core.Serialisation.BaseObjectDeserializerV2.DeserializeTransportObject(String objectJson)
  at Speckle.Core.Serialisation.BaseObjectDeserializerV2.Deserialize(String rootObjectJson)
  at Speckle.Core.Api.Operations.<Receive>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  at Speckle.ConnectorRevit.UI.ConnectorBindingsRevit.<ReceiveStream>d__5.MoveNext() in C:\Users\circleci\project\ConnectorRevit\ConnectorRevit\UI\ConnectorBindingsRevit.Receive.cs:line 62
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  at Speckle.DesktopUI.Streams.StreamsRepository.<ConvertAndReceive>d__3.MoveNext() in C:\Users\circleci\project\DesktopUI\DesktopUI\Streams\StreamsRepository.cs:line 46

I apologize in advance if I’m missing something obvious, I’ll blame it on the impatience of getting my greedy hands on this wonderful tool.

Thanks!

Hey @daria_ivnc , welcome to the forum, feel free to Introduce yourself 🙆 if you’d like.

Can you try to use WALL_BASE_OFFSET as a parameter name instead?
We also changed a bit how these parameters should be sent to Revit from Excel (see docs), so your excel table should look like the below:

elementId parameters.speckle_type parameters.WALL_BASE_OFFSET.value parameters.WALL_BASE_OFFSET.units parameters.WALL_BASE_OFFSET.speckle_type speckle_type
1101940 Base 0 mm Objects.BuiltElements.Revit.Parameter Objects.BuiltElements.Revit.ParameterUpdater

P.S.
We know this mechanism for an Excel<>Revit link is not ideal and we’re thinking how to improve it, see here a suggestion for a dedicated tool.

Hi @teocomi, thanks for the quick reply!

I realize now that it’s probably failing because I’ve been trying to change the uneditable parameter WALL_BOTTOM_EXTENSION_DIST_PARAM

but WALL_BASE_OFFSET is missing from the list on the Excel side.

Come to think of it, lots of other parameters, like the string ones (Mark, Comments), are also missing.

Hi Daria,

We are indeed excluding some parameters from that list, such as the Base Offset, as they are already included on the top level Wall element. Having them also inside the list of parameters could lead to inconsistencies:

Comments, should be in the Parameters list as ALL_MODEL_INSTANCE_COMMENTS.

I understand this can be a bit confusing, but hopefully now it’s a bit clearer!

Sorry, still not sure how this works:

  • does the order of columns matter?

  • which fields should I add to excel for the change to work? since WALL_BASE_OFFSET is not in the list, I’m adding:
    baseOffset,
    speckle_type,
    elementId,
    parameters.speckle_type.

  • parameters.WALL_BASE_OFFSET.value,
    parameters.WALL_BASE_OFFSET.units
    parameters.WALL_BASE_OFFSET.speckle_type are missing.

  • using ‘Set range with headers’ to send data from excel

  • error “Cannot deserialize System.Int64 to System.String on Revit side”.

  • ALL_MODEL_INSTANCE_COMMENTS in not in the list of parameters:

Hiya,

The order of the columns does not matter. Even if WALL_BASE_OFFSET is not in the list, you need to use that for the ParameterUpdater to work. So your excel should look like this:

elementId parameters.speckle_type parameters.WALL_BASE_OFFSET.value parameters.WALL_BASE_OFFSET.units parameters.WALL_BASE_OFFSET.speckle_type speckle_type
1101940 Base 0 mm Objects.BuiltElements.Revit.Parameter Objects.BuiltElements.Revit.ParameterUpdater

Make sure the elementId exists in your scene and please let me know if that works!

Regarding the missing ALL_MODEL_INSTANCE_COMMENTS param I’d need to investigate! Any chance you could share a sample project file with a couple of elements?

  • Sorry, still encountering the same error.
    My model has just one wall, the id is the same as in excel (wetransfer link here -
    https://we.tl/t-a56bZLTNql )
    image

  • The Comments and Mark parameters started coming through once I’ve introduced a value to them in Revit.
    I’ve tried changing the string to some other value in excel, it results in the same error back in Revit - 'Cannot deserialize… ’

Hey @daria_ivnc I did check and actually, you’re right, there is a small bug with some of the latest serialization improvements we introduced recently. Apologies for the time lost!

Good news is that there’s also a workaround! Long story short, we need to let excel think the elementId column is text instead of a number.
You can do so by adding a space in front of the id eg: " 1101940"

Alternatively a fix will be included in the next release (2-3 weeks for a stable, 1 week for a beta).

Doing so I can confirm it should work as expected:

excel-revit

2 Likes

Hey @daria_ivnc , I also got to the bottom of the missing parameters.
That is simply because Speckle is ignoring null values, and if a parameter has never been set in Revit it is null.

If you fill the “Comments” parameter you should then see it in Speckle as well. Please let us know if it’s a deal breaker for you, as a matter of fact we’ve been discussing nulls internally quite intensively in the past :sweat_smile:

Thank you for your patience, @teocomi ! yes, it did work, just took me a while :roll_eyes:

I don’t have any strong oppinions on the nulls, i was just exploring which parameters can be accessed and value changed.