Ruby dimensions

Hi Barry. Thanks for the reply. You are correct I am not trying to connect
inside the group but outside. I query both it vertices but not managing yet
to get them to connect and stretch and move with the group.
So any further Ideas are welcome. Thanks again

Look at the API documentation for Entities.add_dimension_linear
There are several options for defining the start and end. You need to specify the vertex within the group NOT a point3D.

Be aware also that the API has no way for you to set the text characteristics (font, size, etc.) for dimensions.
As far as I am aware, you are only the second person who has tried to add dimensions within an extension. Mine is 2DXY SiteSurvey: see: - YouTube

Hi,
This is currently a limitation in the Ruby dimensions API. You do have to place the dimension inside the group’s entities. Even if the dimension is attached to a vertex of the group, (and the dimension is outside the group), SketchUp will not know which instance of the vertex the dimension is supposed to follow. This is because the API doesn’t provide a way to specify an instance path. Sorry :frowning:

Bugra

Hi Barry
Thanks for this. I watched your video very interesting, Good work.
Looks like it cannot be done according to Burga, see his comment.
Kimberley

Thanks Dan for the heads up.
Tried this but did not work yet. still coding away.
Will have a cool quick dimensioning plugin very soon
Kimberley

Hi Burga
Can you put in a feature request for this option for us. We have made a really cool auto dimensioning plugin and it would be nice if we can mimic the native dimension tool where dimensions stick to a group or components vertices when moved or scaled.
many thanks for your quick response, saved us hours trying to do something that cannot be done.
are you 100% this cannot be done at moment
kimberley

Hi Kimberley,
I logged this issue in our system. I agree, it’s a pretty big limitation and we’ll fix it.
Thank you!

3 Likes

It’s been a year. Has any progress been made on this? I’ve been experimenting again, and it still seems I can attach a dimension end point to the model, and have it “stick”.

But with the SketchUp 2017 release 4 months later (than the comment above,) a new class was introduced to get instance paths, but it may not have yet been “wired into” the dimension factory methods of the Entities class.

1 Like

Hi Bugra

Any progress on API ref Dimensions sticking to groups using ruby???
We want to develop plugin further .

Kim

bugra http://forums.sketchup.com/users/bugra SketchUp Team Member
July 13

Hi Kimberley,
I logged this issue in our system. I agree, it’s a pretty big limitation
and we’ll fix it.
Thank you!

My comment above indicates that there is some progress toward the goal. :roll_eyes:

@daiku
EDIT: The referenced post has been relocated to prevent duplication in conformance with Forum Guidelines.
https://forums.sketchup.com/t/dimension-linear-how-to-make-it-stick-to-geometry-like-when-created-with-the-ui/51306

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?

Hi Daiku
I am not sure what the sketch-up team do. I was hoping for a fix or a
solution by now, so it must not be important to them at the moment.
Hopefully they will add better control over dimension attribute soon in the
API, it is holding us back from developing the auto magic dimensions plugin.
We would like also to add it to Lay-out. Every other CAD program I have
tried uses auto dimensions so hopefully the team will add this feature
themselves or give us the ability to do so.
I cannot understand how the native tool can have the dimension stick but
you cannot do the same in Ruby. and have the dimensions offset from the
group. keep your fingers crossed for the next version.

Agreed. I started working on an “auto-dimension” feature for my plugin when the dimension_linear component first appeared a few years ago, but had to abandon the effort due to these limitations. I’d be happy to beta-test any WIP the SU team wants to take for a spin. CB.

1 Like

Again, I quote @bugra above:

This is really old, but I’d still like to see this feature added.

I believe the ability to specify instance paths for a dimension’s startpoint and endpoint was added in the 2019 release.

@bugra Can you confirm?

The real issue is the inability to restrict the dimension to one of the cardinal planes. For example, I want to show the distance between two points in the Z direction only, even if the points do not have the same X or Y value. This is easy in the UI - it likes to “snap” a dimension to one of the cardinal planes. But it’s not possible with the API.

Oh, I understand what you mean now that you actually explained it.

But looking back up at the original thread, there are quite a number of different dimensioning issues discussed. Originally, this thread was about dimensioning to objects inside groups. So, my response to your recent post, was correctly answered against the original question of this thread.

The official API issue tracking is done at the GitHub tracker, as you well know as this is where you filed the request to enhance API definition of dimensions:

It is probably better to discuss this feature there, where you already asked the question that popped into my mind whether LayOut dimensions could do what you desire.


I know you’ve been waiting 6 years for this feature. There are features we’ve been waiting 16 years for.

1 Like

Thanks, Dan. Yeah, I lost track of all the places things are tracked. I bumped the thread over there.