"2D Text Tag" not visable when using API embedded model

Im using the following dimensions cluster:

For some reason the dimension/font wont show up in the api embedded model but in the shapediver frontend (iframe version).
Is there any css rule or JS attribute I need to use to make it work?

Thx!

You don’t need any CSS for the dimensions to show up but we have developed a new C# script for dimensions which is more optimised and has additional features for DXF exports. Try replacing the old cluster and let me know if you still have issues with displaying the dimensions.

DimC#.gh (37.3 KB)

Also, find code examples for direct embedding and more in the CodePen library.

Thank you Pavol,

Unfortunately the problem still exists. It seems like the “Text Tag” component is not rendered in the embedded viewport.

grafik

It seams like you are using HTML/CSS for “Text Tag” components rendering.
I just found this:

So Im wondering:
If this is the case, what is the defined CSS class for making “Text Tag” visible?

Yes, you are right 2D tags (unlike 3D text) are HMTL elements rendered on top of the viewer and need CSS. Please make sure that the class shapediver-domElements has position absolute and let me know if you still experience any issues.

Hi Pavol,

I copied the classes .shapediver-domElements & .shapediver-domElement
from here https://viewer.shapediver.com/v2/2.23.0/sdv.css into my page and the tag text is finally visible now - but the positioning of the text ist not correct or as it usually is in the native shapediver iframe view (centered?)

Is it possible that https://viewer.shapediver.com/v2/2.23.0/sdv.css is outdated or not the same as the iframe version?

I have the same offset behaviour when I embedd the full style sheet.

It might be something in your code that overrides the style of those 2D tags. Could you check? Also, feel free to share the link to your website so we can get a better idea about what’s happening there.

Its a modifyed version of one of your tutorials:

There is almost no CSS

Similar as proposed here:

I addded the shapediver-viewport-flex landscape classes to my shapediver container div.
Didnt get what the causing issue is but apprently this fixes it. Props also to Winston

1 Like