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 aToolclass.
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 useclineswithinToolstoo as you can't 'snap' back to a temporary 'draw' line, but you can toedgesorclines...
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 theToolclass methods!]... -
Tig, thanks.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement