Speckle Compute Units Help

Hi all,

I am posting this again because I did not get a reply on my previous post almost a month back. I am really trying to fix this issue for our web app and the speckle functionality has been totally unusable without this fix.

I am trying to automate Rhino conversion to Revit through compute using a grasshopper script but the output geometry is in mm and not in metres as I require for Revit. Commit

I have tried putting a python script in my gh script to create a headless doc with meters as default units but it doesnt work.
image

Thanks

Hey @Rivindu_Bandara sorry we missed you other post!
I’m not sure I understand how you’ve set up things, but have you tried changing units in your grasshopper/rhino environment?

So this is a grasshopper script running on rhino compute. It pushes some geometry to a speckle stream. I have created a python component that has a headless doc and set the units to meters. But the output geometry is still in millimetres. You can see from the link to this commit for example. Speckle

I think that Speckle might not be able to properly get units form the document when inside Rhino Compute… Adding @AlanRynne who might have some more ideas.

1 Like

Any follow up on this? @teocomi @AlanRynne

Hey Rinvidu, I check with the team - this issue is logged internally and we will try to get at it soon!

Unfortunately no ETA or workarounds for the time being.

Hey @Rivindu_Bandara

Just looked into this, I created a small demo file to double check the overriding doc behaviour.

It seems like it works as expected, at least on my side. I’m attaching both documents so you can verify this on your setup.

One thing to note is that when planning to override the ActiveDoc, you must ensure this is done before any other components run in your solution. In my file I just ensured this happened by connecting it to one of the inputs and passing the input data through.

This ensures that this component is a dependency of everything else, which automatically ensures every following component uses the right doc.

If you override your ActiveDoc in a component with no inputs/outputs (disconnected from everything), Grasshopper will choose the order it solves the components. I’ve heard you can influence this by sending the component to be drawn in the back, but I haven’t personally tested it. I wouldn’t recommend the “draw to back” approach as it is not obvious to other users editing your script.

You can find the files here. Do let us know if the issue persists in your setup, we’d be happy to look into this further. If this is the case, could you also provide us with a sample script we could use to reproduce the issue?

Thanks!

Here are the files :point_down:t3:
hops_test_units.gh (14.6 KB)
hops_test_units_parent.gh (5.9 KB)

Hi @AlanRynne

Thanks for the reply. I’m still having trouble trying to get this to work. The arrange function doesn’t really seem to work. I moved the python script to the back but it didn’t work. Now I used your C# function and it doesn’t seem to change the units, it also somehow duplicated each of the commits for some odd reason too.




https://speckle.xyz/streams/6c47892271/commits/5042a7b885

Yea I am not sure what I am doing wrong.

Thanks

In order to guarantee you are in fact running the script before any other speckle node is run, you need to connect the output of that script to the input of whatever is next.

In your screenshot, you are not connecting the c# script to anything, and hence letting Grasshopper figure out when would it solve it. Since It has no dependent nodes, my educated guess would be that this is running last.

Grasshopper will solve the graph in mysterious ways, I’ve heard the send to back trick would work, but I personally don’t use it as it feels wrong…

Could you connect the B output of the script to the displayMesh input of the RevitTopography node? Does this fix the issue?

I get an object not set to an instance error when I connect the B output to the displayMesh. Here is the gh script.
topoSpeckle.ghx (488.0 KB)

Is this Rhino8 or Rhino7?

This is in Rhino8. The script was originally made in Rhino7.

Hi @Rivindu_Bandara!

I just released a release candidate version of 2.19.1 that includes a fix for your issue (at least it works on my side! :raised_hands:t3:)

Could you install 2.19.1-rc2 in your machine and see if you still experience this problem?

Thank you in advance, and sorry for the inconvenience while we figured this one out.

This is what I am getting now

Do you have an example I can run manually?

I am seeing a boundary object. It would seem that the view box cut the boundary in the deprecated legacy app.

This doesn’t affect any issues you have with compute units, but I would recommend migrating your account to app.speckle.systems