Cannot draw a LinearDimension!

When I mark a slash, I want a horizontal line of dimension.
It seems that only one of these two methods (start_extent_point and end_extent_point) works.

doc = Layout::Document.open('test.layout')
start_point = Geom::Point2d.new(50.mm, 70.mm)
end_point = Geom::Point2d.new(100.mm, 75.mm)
dim = Layout::LinearDimension.new(start_point, end_point, 25.mm)
dim.start_extent_point = Geom::Point2d.new(50.mm, 50.mm)
dim.end_extent_point = Geom::Point2d.new(100.mm, 50.mm)
doc.add_entity dim, doc.layers.first
doc.save('test.layout')

image

Interim solution

doc = Layout::Document.open('test.layout')
# start_point = Geom::Point2d.new(50.mm, 65.mm)
start_point = Geom::Point2d.new(50.mm, 75.mm)   # change the start point
end_point = Geom::Point2d.new(100.mm, 75.mm)
dim = Layout::LinearDimension.new(start_point, end_point, 25.mm)
dim.start_extent_point = Geom::Point2d.new(50.mm, 50.mm)
dim.start_offset_length = 10.mm    # use the start_offset_length
dim.end_extent_point = Geom::Point2d.new(100.mm, 50.mm)
doc.add_entity dim, doc.layers.first
doc.save('test.layout')

What happens if you change the start extent point after adding the dimension and update the doc ?


Also, I think this has been noticed before but no public issue has been logged in the tracker. Please open an issue when you find time.

Still the same.
image

Okay, then please log an issue in the API tracker.