VS Dotted Line extension

Hi there!

Seven month studying Ruby and three month learning SketchUp API documentation (and four years on learning English :smile:) — that’s what I needed to make my the first own extension for SketchUp.

The extension does an easy thing: it replaces edges by dotted lines and saves your time. This video shows a demonstration of its work.

For training purposes I’ve published the source code on Github, were you can explore its and download. I’ll be happy if people look at my code, point to the mistakes and give me some advices.

2 Likes

very nice! A much needed feature for architects for instance.
Has great potential if, at some point, more (custom) line styles could be added.
Thanks for sharing.

This is exactly what I am looking for. It seems that this will be a way to show foundation footing lines, and roof overhangs in dashed lines in scenes for Layout without exploding and loosing the connection with the model. Am I right?

Is this extension available?

Thanks, @maxB! I’m an architect, so this feature was needed for myself. Other line styles are planned. Stay tuned for updates!

Exactly! The main reason to make this extansion was to avoid drawing dashed lines in Layout. The plugin is on the beta, but you can use it right now. Go to this page and click “Download” on the right side: github.com/syroezhkin/VsDottedLine. Stay tuned for updates!

This seems very useful. However, users should be aware that it works by drawing a series of short edges along the dashed line. As a result, it has the potential to bloat your model with lots of tiny edge geometry. Think about the overall length versus the dash and gap sizes you choose!

did you have at look at PenTools by Rich O Brien?
it has variety of line types…

This is interesting, Vladimir. And look at all you learned! :smile:

It works well although I prefer to make dashed lines in LO and usually make them from lines drawn in SU.

Steve has a point about the added geometry and the file bloat.

Todd Burch did a dashed line plugin some years ago. It divides the selected edges and hides alternate segments instead of deleting them. The result is that you can select an entire dashed line by double clicking on one end of it. It also means that you don’t lose a face if the dashed line is forming an edge of the face. Since your version deletes alternate segments, those features won’t be available.

John also has a good point that the Pen Tool can do a variety of line styles

Thank you, @slbaumgartner! I’m not sure that I’ve understood you correctly. Do you mean the situation when the overall length is too big comparing to the dash? For example, it takes several seconds to replace 1 000 000 mm line by my script. Should I limit the number of selected edges or just to notify user about that it’s may takes several seconds to calculate?

Thank you, @DaveR! And how many things I still have to learn now :smile:

I think that’s a good idea to add an option whether the user wants to make new dashed lines in new group or not. The grouped lines will not effect on connected faces, and selected lines will be hidden. What do you think?

Of course it’s a bad idea to make dashed lines too big, which can bloat the file. But at my work I often draw dashed lines by copying a little line several times — mostly when I draw 2D plans in SU. This lines are not big (just some meters) and they can’t influence the model’s size.

I think making the lines a group is a good idea. If the edge(s) is part of a loop that defines a face, maybe you could copy the edge(s) hide the original and paste the copy as a dashed edge. That would allow you to create something like this:

As I said before, I prefer to make them in LO. There’s a whole lot more control over their appearance and weight in LO. They can be made from edges drawn in SU if you want to start them there.

No, I wasn’t so much worried about the run time of your plugin as by the potential amount of geometry that could be generated. For example, if a user chose 3mm dashes with 1mm spaces, a 10m edge would be replaced by 2500 3mm edges. Do that on more than a few places, and your model will use a huge amount of geometry to present a relatively small amount of model content.

1 Like

Using Groups may turn out to be the best option. Using Groups will make the lines easier to manage using Ruby and for the user. You will have essentially a “Dotted Line” entity. This entity does not merge with existing model geometry so you do not need to be concerned with mangling the user’s model as much. The Groups can be searched by name and . they can be seen in the Outliner so they can be easily discovered and manipulated by users. They can store their parameters and so could be updated. If you keep track of which Edges you have hidden they can be restored. The Groups can be purged from a model and yet have no effect on the underlying geometry.

Well, guys! Thanks for youre ideas! I’ll add some new feature like groups (and other) soon. I understend that my extension may not be useful for some people, however the main reason to do it — is learning Ruby and SketchUp API.

Well done Syroezhkin for what you have achieved. All building designers want dotted lines for their drawings. They had them when they used drawing boards and when they used other CAD programs. The fact they don’t exist in SU must mean that it is either very difficult to achieve or that the programmers don’t believe they have a place in 3D software. Relying on LO for them is clunky to say the least. I use a plug in that creates dotted lines but they are not editable. Funny things happen if you try to lengthen them for example. You would mine a rich vein if you cracked this one completely!

I made my own dashed and dotted lines as dynamic components.

Anssi

Thank you so much for your plugin!!!
It works perfectly, though I had to pick the previous version .rb instead of the latest .rbz which did not appear in the context menu. I don’t know why (I’m using SketchUp Pro 2017 on Mac)… Do you have a clue?
It was really a missing feature in SketchUp when drawing the hidden geometry in 2D (inside a furniture or behind a wall surface).
It was worth the hard work you did!
:clap: :+1: :grinning:

I’m glad that my plugin turned out to be useful for you! Thank you! :slight_smile:

It should work correctly on 2017 for Mac since it’s been tested on my own computer. Firstly check if you use the latest version 1.0.2 or download it here. Before installing it’s better to delete vs_export_to_dxf.rb file and the folder with the same name from Plugins directory in order to avoid problems.

Also make sure that you select only edges. The plugin’s menu (right click) appears on edges only.

Thank you Vladimir for your fast answer.
Well, I tried again and with the same result. I didn’t have a vs_export-to-dxf.rb file to erase and there just no visible function with the 1.0.2 version where the “replace by dotted lines” appear with the 1.0.1 one.
Anyway, I am already very happy with the previous version.
Thanks again from France (yes, it’s the magic of Internet… you’re a world benefactor :wink: )
FredM