Using layout api, how can I add a linear dimension between two points from an imported sketchup model?

I would like to create a layout document from the current sketchup model, and then add some dimensions in that document between certain entities in the sketchup model. I can do that easily enough from the UI, but I can’t seem to get a grip on the entities in the imported model so that I can use, end_point, height)

1 Like

I believe you must use connection points into the model, see:

Any idea why the Layout::ConnectionPoint constructor expects a string for the pid? When I get entitiy.persistent_id, it’s an int. If I use to_s, I get Error: #<ArgumentError: pid must be valid>.

This retrieves 154 hits for API doc booboos:

Make it 155 and please open an issue for the incorrect argument type. :wink:

Is this really a doc error? The method does require a string. It’s just that the pid I get from the entity in my model does not seem to be valid.

Well, it sounds like some kind of issue, bug or whatever.