Chain line creation

Hi there
Can anyone help me figure out how to do a dynamic copy chain line or multiple pattern line with definable spacing and solid line at each end.

This dynamic component can draw various styles of dashed line. It starts and ends on a line (half a dash). The dash length can be adjusted as a percentage of the period. The pattern length sets the approximate size of the pattern, but it will be scaled slightly to suit the total line length.

On 3D Warehouse: Dashed Line
Don’t download directly into your model. Save it to disk, then bring it in from the component browser or it won’t work.

Some examples:

Using this instead of a native line style would be quite awkward. You’d have to do a lot of rotating, scaling, etc.

Hi
when I download this file or any of the variants it is exploded and not a dynamic component ??

Download the file, save it somewhere on your computer, maybe in an empty folder so you can find it easier in the next step.
Now in Sketchup:
Open the Components window from the Window menu. Click the icon shown below and choose “Open a local collection…” and choose the folder you just saved the component in (not the file, the folder).

You should now see the component:

Dash component

Click it, then place in your model. Change view to Top, parallel projection as it will be drawn on the floor in the xy plane (red/green).

If not already open, open dynamic components toolbar:
View Menu → Tool Palettes → Dynamic Components
Then click on the icons on this toolbar to open Component Options and Component Attributes.

1 Like

thanks
works great.
Do you know if its possible to nest formulas such that a combination of lengths can be accommodated… think chain lines.
Is there documentation on this other than the fence example on the SU site?
once again thanks for the info and example

If you mean like centre lines with a short dash, then long dash repeating or other patterns, then yes you can do that with a dynamic component. The component I put up already has different components for the ends and the normal dashes. By the way, the hidden line in the y-axis was to enable the scaling drag handles. Without them, SketchUp doesn’t let you scale it as it’s a one dimensional component.

I really think this would be better as a Ruby plugin tool which worked like the native pencil line drawing tool.

There’s some documentation and example components here:
https://help.sketchup.com/de/article/3000123

I’ve updated the Dashed Line component to make it work better at shorter line lengths. It now must be at least two periods long. If you set it such that this won’t be possible, it scales the period down so that you’ll get 2 like this:
half dash, gap, whole dash, gap, half dash
Dashed Line

Here’s another dynamic component that draws a centre line with a short dash and long dash
Centre Line
Examples of lines produced by CentreLine.skp:

1 Like

Now if only the Carpathia had understood the dots and dashes…

1 Like

McGordon you are a star.
still want to know how it all works mind you.

someone posted a ruby script that allows you to right click on a line and turn it into a dotted one…maybe this is how yours should work…
But the dynamic object works fine for me for making setout lines and centre lines mostly with the occasional drain line or boundary. I want to keep as much as possible in the SketchUp model…
Guessing the dynamic object method would work for SU free users very well…I assume you can use these.

How does it work?
There’s probably lots of ways of doing it and this is just the way I did it this time. I’m not sure I can explain it without making it look more complicated that it is. DC’s aren’t like source code that you can comment easily. Some parts are messy because SketchUp didn’t handle the units the way I expected so some variables are in inches. This would probably be simpler if the whole component used inches.

Using these settings as an example:

It starts with the total line length:
DashedLine!LenX = 36cm (The length you scaled the line to)
Preferred pattern length:
Pattern_Length = 3.937007874015748 (10cm)
Calculate number of copies of pattern:
Dash_Copies = Largest(Floor(LenX/(Pattern_Length*2.54)),2) = 3

LenX/(Pattern_Length*2.54) = 360cm/10cm = 3.6
Floor(3.6) = 3
Largest(3,2) = 3
The ‘Floor’ function rounds down the number of spaces. The ‘Largest’ function sets a minimum of two spaces. This gives the minimum pattern of half-dash,gap,full-dash,gap,half-dash.

Period =LenX/DashCopies = 36cm / 3 = 12cm
We now have the real pattern length of 12cm from the preferred length of 10cm.

Now in the Dash component:
Dash!Copies = LARGEST(0,DashedLine!DashCopies-2) = 1
The ‘Largest’ function sets the minimum copies to 0 and stops it going negative. For 0 copies there is still one instance of the Dash component. This happens at the minimum pattern length as above. There is one dash and no copies of it.

Half Ends Dashed!LenX = =Dash!LenX/2
Just sets the half-dash to be half the length of the full dash.
There’s always 1 copy of the half-end. The original near the origin and the copy at the end furthest from the origin.

The dashes are positioned with the X coordinates using the copies variable and a multiplier to distribute them along the line.

You could think of it like a section of fence with the end posts 4.5m apart. Your preferred spacing is 1m. Divide 4.5/1 = 4.5 and round down to 4. So you need 4 spaces (3 posts + end posts). This tells us how many copies of the dash to make. Divide 4.5 by 4 to get the real spacing 4.5/4 = 1.125m. In the DashedLine.skp, this 1.125 is just multiplied by the percentage dash length, say 50% to get 1.125 x 50% = 0.5625m.

In Sketchup Free, you can use Dynamic Components, but you can’t edit the Component Attributes and unless I’m missing something, I can’t even see how to change the Component Options. Sketchup Make lets you use them but not edit the attributes or create new dynamic components. I don’t have Make installed here, but I think you have access to the Component Options.
To edit the Attributes and create new Dynamic Components, you need the Pro version.

:question:

Carpathia ?

Wikipedia: RMS Carpathia - Titanic disaster

On the night of 14 April, [1912] Carpathia’s wireless operator, Harold Cottam, had missed previous messages from the Titanic, as he was on the bridge at the time. After his shift ended at midnight, he continued listening to the transmitter before bed, and received messages from Cape Race, Newfoundland, stating they had private traffic for Titanic. He thought he would be helpful and at 12:11 a.m. on 15 April sent a message to Titanic stating that Cape Race had traffic for them. In reply he received Titanic’s distress signal, stating that they had struck ice and were in need of immediate assistance.

Cottam took the message and coordinates to the bridge, where the officers on watch were sceptical about the seriousness of the distress call. Agitated, Cottam rushed down the ladder to the captain’s cabin and awakened Captain Arthur Henry Rostron, who immediately sprang into action and “gave the order to turn the ship around”, and then “asked the operator if he was absolutely sure it was a distress signal from the Titanic”. The operator said that he had “received a distress signal from the Titanic, requiring immediate assistance”, gave Titanic’s position, and said that “he was absolutely certain of the message”.

(The account continues describing how Carpathia immediately changed course and made best possible speed; … navigating the icefield in darkness at great risk to themselves, to reach Titanic’s last position in just under 4 hours. Whilst, nearby, the bridge officers on the idle SS Californian just watched the Carpathia speed by on it’s rescue mission.)

Californian ?

Wikipedia: SS Californian - Sinking of Titanic

On Sunday April 14, [1912] at 18:30 ship’s time, Californian’s only wireless operator, Cyril Evans, signalled to the Antillian that three large icebergs were five miles to the south. Titanic’s wireless operator Harold Bride also received the warning and delivered it to the ship’s bridge a few minutes later.

Californian encountered a large ice field at 22:20 ship’s time, and Captain Lord decided to stop the ship and wait until morning before proceeding further. … Lord asked Evans if he knew of any ships in the area, and Evans responded: “only the Titanic.” Lord asked Evans to inform her that Californian was stopped and surrounded by ice.

Titanic’s on-duty wireless operator, Jack Phillips, was busy clearing a backlog of passengers’ messages with the wireless station at Cape Race, Newfoundland, 800 miles (1,300 km) away, at the time. Evans’ message that SS Californian was stopped and surrounded by ice, due to the relative proximity of the two ships, drowned out a separate message Phillips had been in the process of receiving from Cape Race, and he rebuked Evans: “Shut up, shut up! I am busy; I am working Cape Race!” Evans listened for a little while longer, and at 23:35 he turned off the wireless and went to bed. Ten minutes later, Titanic hit an iceberg. Twenty-five minutes after that, she transmitted her first distress call.

(The account continues explaining how the Californian’s on-duty officers did nothing but watch for the next 5 hours as many distress rockets were fired by the Titanic, never occurring to them that they were distress signals, until they learned in the morning that Titanic had sunk.)

1 Like

Titanic.

According to Wikipedia, it did.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.