Dimension Linear - how to make it "stick" to geometry (like when created with the UI)?


When I create a linear dimension with the UI, the endpoints “stick” to the geometry to which they are attached. So if I move the thing one end of the dimension is attached to, the dimension stretches. I can’t make this work programmatically with the API however. The dimension object is not attached to anything. So it I move the geometry, the dimension gets left behind.

Also, the dimensions you can make with the UI can show the X, Y, or Z distance between two points. But with the API, the distance is always the absolute distance between the points. I can’t get the same behavior as with the UI.

I’ve read elsewhere on this forum that it’s a limitation in the API. Has anyone else gotten it to work? Or does the Sketchup Team have plans to fix this?

Ruby dimensions