Dynamic component - copy and manually move

Hello everyone,
I have a Dynamic track light that I would like some help on taking it 1 step further. I currently have the component setup for you to specify the length of the track and how many light heads you want. It spaces the light heads evenly along the track which is how I would like it to start off. If possible, I would like to manually move individual light heads as needed to locate them in front of different fixtures that may be spaced unevenly. I’m OK with entering the component and manually moving the Light heads as needed, but having them inserted evenly when you move 1 light head, it will snap back to the evenly spaced location.

Attached is my dynamic component.
Thank you for any help!
DYNAMIC Track Lighting_2020.skp (97.1 KB)

That’s the way DCs work. If you move a light head manually, the logic in the DC resets it back once you finish the Move operation, possibly only after a redraw.

You could remove the light head from the context of the DC (Edit cut), then exit the DC component, then Edit/Paste in place, then move it manually. You could either leave the relocated light head component(s) ‘loose’ in the model but moved to the place you want them/it to be, or combine the moved heads and the original DC in a new component. It would lose much or all of its Dynamic characteristics though.

Another possible option might be to add Component Options for the linear position of each head along the track, so you could specify where they should go. But calculate the equal spacing for the default positioning and fill in the position fields accordingly on first placement.

I’m by no means an expert on DCs but I have made several, andI think this could work.

I originally had the heads an track as separate components withing the main component and we would just copy/paste then move as needed. I was just trying to make it an easier dynamic component for other people on my team.

I like your second idea, however, I only know how to set that up with an exact light head count… Since some of these tracks could have more than others, I’m not sure how I would do that.
I guess I will try to figure it out on Monday.

Thanks, John!

I’m pretty sure you can’t change the number of fields in a DC’s Component Options except at design time, so you’d have to allow for the maximum number possible, I think.

Or (it would be bad practice in a database) use a single non-normalised field, and input positional values separated by commas , semicolons, colons or pipe ‘|’ characters?

But then I’m not sure how the DC would read them and place light head components accordingly? You’d have to parse or split the string, count the number of elements, and do some error trapping in case the user gets the format wrong.

Commas or semicolons would cause complications in different countries - some use one, some the other, for string separator characters, with either a full stop/period or a comma for the decimal place. Colons aren’t always acceptable in some contexts, though probably ok in a DC text field. Pipe characters are used by SU Ruby in inputbox lists, so might be a relatively easy choice.

Getting close to out of my depth here, it not beyond it…

Maybe someone more knowledgeable about DCs could chip in here? @pcmoor perhaps?

Thanks for the plug, John
To control copies individually it is convenient to use the current formula to point to the attribute holding the data (these attributes have same prefix with a number to match a copy (I used one more increment)
Using the current formula to excess pass data to copies.skp (43.7 KB)

You would have a maximum, say ten, twenty?

Rather than fill the option dialog with lots of input boxes, you could use a text string for each light, if its blank or 0, then no copy,
pos, angx,angy, angz,color
500, 30, -30, 0, red
Then separate the string in your attributes (as per John, the delimiter is your choice) , Though note when using find, add the delimiters to the searched string at the end to avoid the error,

lights.skp (177.6 KB)

To add more lights, add extra condition to “num”, insert another control and make unique rename to control_5, change attribute dialog header to suit, then place inside the lights DC at the origin next to the others. Then edit it from the attribute code to match the new light number and add the other attribute sequences, copy the formula (change num) or reference the correct new light

note this DC needs a redraw for attribute changes other than the position.

This really helps, Thank you both!