Modifying Parameters outside host applications with Speckle

Is there a way to access this functionality through the API? I’m looking to change parameters in a web app and then stream these back to the host desktop application through a connector.

Hi @bfortunato not yet, upading an element, even if just one of its parameters, is a bit delicate. This because its hash and its parents’ hashes need to be recalculated to guarantee proper updating and diffing…

I might have phrased the question incorrectly. It seems that the Excel connector already has the functionality I am looking for: https://www.youtube.com/watch?v=x4QJ_AzCKtM and the hack that @jonathon referenced does exatly what I’m looking for.

What am I missing? Do you know how this hack https://hack.speckle.dev/Parameter%20Panther%20-%20A%20tool%20to%20update%20Revit%20parameters%20from%20your%20browser.html was able to modify the parameter values in speckle without having that functionality avialable as an API?

Are these hacks avaiable on github? Would love to see how this was done.

The Parameter Updater works by updating parameters in the Revit model, not in the Speckle one.
Docs here: Excel | Speckle Docs

The hack’s code instead is here: GitHub - arup-group/parameter-panther-hackathon as it was not developed by us we cannot provide any guarantees :slight_smile:

Thanks, I’ll check out the github. Is there anything particular that you are concerned about?

I’m still not understanding your comments on the Parameter Updater. Maybe I’m missing something.

The Parameter updater would need to update parameters in speckle at some point since speckle is what connects the two. From what I understand, speckle pushes data from the revit model to a server then this data is fetched and writen in excel via the excel connector. Data is edited in excel and then this updated data is posted to speckele. I’m assuming that behind the connectors there are REST API calls doing all this. This new posted version of the model is then used to compare with the Revit data model using a Speckle method to check for any updates. The speckle model is then updated based on the data posted from the excel. This new data or updated data is then synced to the Revit model.

Is that a fair summary of the process? I’m not sure how I could use excel to update Revit without some go-between like speckle or by using the Revit DB link. I don’t see how that could work without making API calls from the desktop to the speckle server to update, merge etc the data.

What am I missing?

Hey @bfortunato ,

The Parameter Updater (PU) does not update properties of objects inside Speckle, because of the limitations I mentioned earlier.
When you use the PU, you are instead just sending instructions to the Revit connector to update parameters in Revit itself upon receive (see the ParameterUpdater class here).

Let me explain why: let’s say you publish a set of walls from Revit to Speckle, and then you edit the height parameter of each wall. Speckle is not currently capable to update the geometrical representation of the walls, and when received in Rhino or visualized in the online viewer, the mesh representing it will have the original height, not the updated one. There might also be other parameters, such as volume, that depend on height and do not get updated correctly under this scenario. And this is why we recommend doing any sort of modifications in the originating authoring tools instead.
PU offers a quick and convenient way to batch-update Revit parameters using Excel. Similarly to our support for Schedules:

I think I understand the distinction. It’s a bit semantics since you are changing data in speckle that then updates the model through the connector. I would consider that changing the speckle model.

The distinction would be that you can’t download a native format .rvt or .3dm file with the updates. That’s the only differences I could see.
. We are just looking at data not the actual geometry, which is a whole other animal. Is it possible to send instructions to rhino to update key value pairs stored in geometry?

That brings us back to the question of how we would be able to change the “speckle model” or updater. I’ll have to dig into the documentation

Instead of excel we would use an online postgre database. Honestly I could probably convert everything to csv or json, whatever works with the speckle.

Is there documentation on creating your own connector?

This is likely not what you want to do for this purpose.

Any suggestions on approach?
I was going to use the GitHub as a starting point. Thanks for providing that link. It seems that @teocomi had some concerns about this approach?

Could you provide some more context about what you’re trying to achieve? What kind of parameters are you looking to update, and what’s the use case?

We would be updating custom parameters. Nothing that would be related to geometry creation in Revit or rhino. The use case would be for clients and contractors to interact with our model, and input data via a web app. For example a contractor might input prices for a bid

Internally we would also like to be able to change the model using a web app. We are creating a procurement app that combines takeoffs with an online product catalog so we can generate a material shopping

. A lot of the data’s would be id keys that would relate to a relational database. For example a key would refer to a product in our catalog. That way all the relational data like products, product variants price etc would be in the bin model just a key to link the bim model to a larger database.

Gotcha, txs. So What I could suggest, is to have your custom app/script do the following:

  • pull the Speckle model/version you want to edit
  • edit the parameters you want to update
  • recompute the hash of their parent objects (this is done while serializing your objects)
  • re-publish the model as a new version

I have not see the Parameter Panther code, so I’m not sure what that does, but you could have a look at the code of our Excel connector if you are curious on how to serialize/send objects in JS.

Let us know how it goes!

Awesome, looks like I have two great references to start from.

So I can better track how we are assisting you @bfortunato, are you looking to do this within the scope of a JS/TS project?

I ask as I have an Automate demo in Python that allows for the data changes to be made within the original structure of the version on the Speckle server instead of a flattened object. This could be a straightforward graph traversal-and-modify-in-place operation.

This would be javascript, but if there is something in python we can call it from JS. The goal here is to hack something together to test out the concept, we can clean it up later.