Displaying dimensions without 2D tags

Hello !

We have all our volumes dimensions always available in real time from one of our model outputs.
We also have vectors 3D positions so we could draw lines in the right position to display these dimensions.
My question is : what would be the best way of displaying those vectors + numbers in the ShapeDiver Viewer ?

I saw some topics about 2D tags but I would like to avoid using these (if possible), so I don’t rely on the GrassHopper model.

Thanks for your help!

Could you explain what you mean by “not relying on the Grasshopper model”?

If I understand correctly, you get dimensions and vectors as outputs of your definition and you would like to display this information in the viewer, which means that in any case you are trying to display information that relies on your Grasshopper definition, correct?

Are is your strategy to recompute positions and dimensions directly in the viewer so that you do not rely on logic in Grasshopper to compute and output this information?

Hello @mathieu1

Basically I would like to avoid adding some new integration on the Grasshopper model (in that case the 2D tags).

We already have this object exported by the GH model which has all the data we need so I’m trying to find a solution to simply use that data to display dimensions in the Viewer.

[
    {
        "data": {
            "Dimensions": {
                "carcass": {
                    "W_SP": "-1000,0,0",
                    "W_EP": "1000,0,0",
                    "W_V": 2000,
                    "D_SP": "1000,0,0",
                    "D_EP": "1000,600,0",
                    "D_V": 600,
                    "H_SP": "1000,0,0",
                    "H_EP": "1000,0,1200",
                    "H_V": 1200
                },
                "level_0": {
                    "ID_0": {
                        "W_SP": "-981,0,19",
                        "W_EP": "981,0,19",
                        "W_V": 1962,
                        "D_SP": "981,0,19",
                        "D_EP": "981,581,19",
                        "D_V": 581,
                        "H_SP": "981,0,19",
                        "H_EP": "981,0,1181",
                        "H_V": 1162,
                        "level_1": {
                            "ID_0": {
                                "W_SP": "-981,0,19",
                                "W_EP": "-9.5,0,19",
                                "W_V": 971.5,
                                "D_SP": "-9.5,0,19",
                                "D_EP": "-9.5,581,19",
                                "D_V": 581,
                                "H_SP": "-9.5,0,19",
                                "H_EP": "-9.5,0,1181",
                                "H_V": 1162
                            },
                            "ID_1": {
                                "W_SP": "9.5,0,19",
                                "W_EP": "981,0,19",
                                "W_V": 971.5,
                                "D_SP": "981,0,19",
                                "D_EP": "981,581,19",
                                "D_V": 581,
                                "H_SP": "981,0,19",
                                "H_EP": "981,0,1181",
                                "H_V": 1162
                            }
                        }
                    }
                }
            }
        },
        "format": "data",
        "name": "dimensionsJson"
    }
]

If your priority is to avoid modifying your Grasshopper file, you can make use of the data output with the viewer API to create yourself tags and dimension geometry. You could for example add HTML anchor elements: HTML Anchor Elements

However, this will require a Designer Plus subscription (API access) and some development work, which might become significatively more complex than just adding 2d tags to your Grasshopper model.

I’ll give it a try with the Anchor Elements as we have a Designer Plus subscription.
Thanks for the heads up!

Hello @mathieu1

we have been able to use the API to display some dimensions but depending on their origin the text is sometimes not displayed at all (mostly when it’s inside our model furniture), or it disappears depending on the camera rotation.
It seems that it’s caused by some kind of collision with our model.

I don’t find any method or property to prioritize the text over the model or to force the text to be on the foreground.

Is there a way to manage that?

Thanks.

Text tags are handled like geometry in the viewer; they get hidden if they are obstructed by an object between them and the camera position. Do you mean that you would like a way to show text tags even when geometry is in front of them?

We’ve found a way to handle that by playing with some attributes of the Anchor object (intersection and some other stuff).
Thanks for your help!

1 Like