View.draw_lines point1, point2
-
Whats the problem with the following? I am unable to draw a line. I tried this:
` model=Sketchup.active_model
selection=model.selectionview=model.active_view
point1=Geom::Point3d.new(@light_fixture.transformation.origin)
point2=Geom::Point3d.new(point_here)
status=view.drawing_color="red"
status=view.draw_lines point1,point2,and this:
status=view.draw_lines (@light_fixture.transformation.origin,point_here)`This works, but I do not want a permanent line.
` model=Sketchup.active_model
entities=model.entitiesentities.add_line(@light_fixture.transformation.origin,point_here)`
-
The
view.draw...
commands for temporary graphics like rubberbanding only work inside aTool
class.
If you want to 'draw' temporary 'lines' try something likecl=model.active_entities.add_cline(point,point2)
to add a guide [construction] line.
I sometimes useclines
withinTools
too as you can't 'snap' back to a temporary 'draw
' line, but you can toedges
orclines
...
Because you've remembered it as 'cl
' you can remove it later [cl.erase! if cl.valid?
] when you've completed whatever it is you are doing [or youonCancel()
ordeactivate()
- but again they are part of theTool
class methods!]... -
Tig, thanks.
Advertisement