The “Model info… settings… dimensions… expert settings” window has a useful option to "highlight non-associated dimensions."
If you manually draw a line, add a dimension for its length, delete the line = the dimension is highlighted.
However if I use ruby to:
- add the line from point1 to point2
- find vertexes of line (you can add dimensions by point3d but that won’t connect it to the line)
- add dimension to the vertices.
You can tell the dimension is connected the the line because moving the line will drag the dimension with it. But if I delete the line, the dimension is NOT highlighted. So something else must be going on here(??)
Here is code:
model = Sketchup.active_model entities = model.active_entities point1 = Geom::Point3d.new(0,0,0) point2 = Geom::Point3d.new(200,0,0) line = entities.add_line point1,point2 # get vertex for dimension vertex1 = line.start vertex2 = line.end #add dimension offset = [0,20,0] dimension = entities.add_dimension_linear vertex1, vertex2, offset