Help creating a dimension

Help creating a dimension

Postby ittayd » Mon Apr 17, 2017 5:41 am

I'm using the latest Sketchup Make (2017). I have the attached model. What I'm trying to do is create a dimension that will be a duplicate of the one in the drawing. So I select the dimension and then in the console:
Code: Select all
ss = Sketchup.active_model.selection
#<Sketchup::Selection:0x00000010cf1e20>
dim = ss[0]
#<Sketchup::DimensionLinear:0x00000010d20680>
dim2 = dim.parent.entities.add_dimension_linear(dim.start, dim.end, dim.offset_vector)
#<Sketchup::DimensionLinear:0x00000011dd0570>
dim.hidden = true
true


The new dimension is not seen, nor selected when I do ctrl-A. Furthermore:
Code: Select all
dim.start
[#<Sketchup::Vertex:0x00000011ac4a20>, Point3d(-4.19399, -68.4499, 42.0472)]
dim2.start
[#<Sketchup::Vertex:0x00000011ac4a20>, Point3d(68.4499, 0, 42.0472)]


So the two dimensions are attached to the same vertex, but with different points. The following doesn't work either:
Code: Select all
dim3 = dim.parent.entities.add_dimension_linear([dim.start[0], dim.start[1]], [dim.end[0],dim.end[1]], dim.offset_vector)
#<Sketchup::DimensionLinear:0x0000001363d018>
dim.start
[#<Sketchup::Vertex:0x00000011ac4a20>, Point3d(-4.19399, -68.4499, 42.0472)]
dim3.start
[#<Sketchup::Vertex:0x00000011ac4a20>, Point3d(68.4499, 0, 42.0472)]


Is this a bug or am I doing it wrong?
0

ittayd 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 


 

Return to Developers' Forum

Who is online

Users browsing this forum: Yahoo Bot and 3 guests

Visit our sponsors: