Jump to content

concatenate 2 record fields of lighting Instrument


Recommended Posts

Hi, 

 

I am posting this question about lighting instruments here, because I think this might more be a worksheet or scripting question than it is a Spotlight question.

 

To make my 3d and 2d lighting labels more efficient, I would be really happy if it where possible to concatenate two fields into a user field of a Lighting instrument.

 

The following fields I would like to concatenate:

 Universe and Adress into Userfield 1 

Circuitname and Circuit Number into Userfield 2 

 

The reason is that I would want my 3d labels to look exactly the same as my 2d labels. At this moment it is not possible to display fields next to each other in a 3d label. By concatenating and then displaying the userfields in my 3d label I would have workaround to fulllfill my desires. 

 

Also see screenshot of the desired end result.1239992794_ScreenShot2018-05-10at12_59_32.thumb.png.01ba6c1412ca7ee13f2ed5cbcf6d34e9.png

 

Would there be a worksheet formula that does this, like it can be done in excel? Or maybe a script can do this? I wouldn't prefer a solution that requires me to export it to another spreadsheet program and then import it again. 

 

Thank you in advance to anyone that is willing to share there knowledge on this.

Link to comment

A script would be the easiest way, but least flexible. Would you want it to effect every light in the drawing/Layer/Class or only selected ones?

 

A Worksheet could do this, but you would need to do a manual step to copy/paste the data from one column to the User Field column. But it would be more flexible in that you could decide which lights to do this for.

 

And now we wait for @JBenghiat or @Sam Jones or one of the the Spotlight Gurus to tell us that it is easy if you just do these three steps. 😉

 

If you need help with the script or worksheets ask again.

Link to comment

Unfortunately, or fortunately, depending on how you look at these things, there is not a way that does not involve scripting.  The script has already been written, but it is part of AutoPlot Tools for Spotlight.  The command is one of many and is called "Copy Field to Field" and throws up the dialog below.  There might be a VW version, but since I use AutoPlot, I haven't kept up.

1895592046_ScreenShot2018-05-10at8_47_38AM.thumb.png.5c5fbce587cd14a839767d879f21d242.png

 

You would input this:

1416079130_ScreenShot2018-05-10at8_53_42AM.thumb.png.4e28013859e89cf35493abde1d9b238a.png

 

This combines the fields, but it has to be run any time you make a change either in VW fields or LW fields.  I usually save it for late in the game.

Feel free to contact me if you have any questions about AutoPlot.

 

Sam

 

Samuel L. Jones
E-mail: sjones@autoplotvw.com
(310) 993-4172 (cell)
 

Screen Shot 2018-05-10 at 8.52.21 AM.png

Link to comment
14 minutes ago, Sam Jones said:

Unfortunately, or fortunately, depending on how you look at these things, there is not a way that does not involve scripting.  The script has already been written, but it is part of AutoPlot Tools for Spotlight.  The command is one of many and is called "Copy Field to Field" and throws up the dialog below.  There might be a VW version, but since I use AutoPlot, I haven't kept up.

1895592046_ScreenShot2018-05-10at8_47_38AM.thumb.png.5c5fbce587cd14a839767d879f21d242.png

 

You would input this:

1416079130_ScreenShot2018-05-10at8_53_42AM.thumb.png.4e28013859e89cf35493abde1d9b238a.png

 

This combines the fields, but it has to be run any time you make a change either in VW fields or LW fields.  I usually save it for late in the game.

Feel free to contact me if you have any questions about AutoPlot.

 

Sam

 

Samuel L. Jones
E-mail: sjones@autoplotvw.com
(310) 993-4172 (cell)
 

Screen Shot 2018-05-10 at 8.52.21 AM.png

Thank you! I didn’t know autoplot does this also! I Will try this tonight and think it will make my life happier. 

 

Thank you! 

Link to comment

So this a solution that works and I understand that is has to be rerun after each change. 

 

But what if I become greedy. And ask for something even faster. I only want these field to be concatenated, and I always want all of the instruments to be affected by the script.

 

So for me a single script that only concatenates :

 Universe and Adress into Userfield 1 

Circuitname and Circuit Number into Userfield 2 

 

I already use delimiters when I number the instruments. 

 

If i had such a script combined with a keyboard shortcut, I could run the script after every change  to the instruments. With the autoplot tool, however beautifull as it is, I have to go into the menu twice and change settings and run for the second fields to be concatenated. 

 

Would this require a lot of code or marionette scripting? I am a novice to scripting in VWX. I have done some Excel VBA so am willing to learn. Could somebody push me in a direction? @Pat Stanford

Link to comment

You could take a shot at it.  I don't know Marionette.  I don't know what's easy any more, but a personal script that has no variations would not involve much, and you would have to become familiar with the ForEachObject() procedure.  You might do this instead.  It only requires 2 keystrokes, 1 more than the solution you request.

1. In the workspace editor, assign a keystroke to the "Copy Field to Field" command.

2. In the "Copy Field to Field" dialog set it up as shown below.  Be sure the "Make Default" button is checked.

3. Press OK.

After that just hit the keystroke you assigned to the command and then hit enter.  You don't have to select or check anything.

 

 

1472997081_ScreenShot2018-05-10at3_36_03PM.thumb.png.ce8176d071a59bf9bca0e57e01c2e804.png

 

Link to comment
14 minutes ago, Sam Jones said:

You could take a shot at it.  I don't know Marionette.  I don't know what's easy any more, but a personal script that has no variations would not involve much, and you would have to become familiar with the ForEachObject() procedure.  You might do this instead.  It only requires 2 keystrokes, 1 more than the solution you request.

1. In the workspace editor, assign a keystroke to the "Copy Field to Field" command.

2. In the "Copy Field to Field" dialog set it up as shown below.  Be sure the "Make Default" button is checked.

3. Press OK.

After that just hit the keystroke you assigned to the command and then hit enter.  You don't have to select or check anything.

 

 

1472997081_ScreenShot2018-05-10at3_36_03PM.thumb.png.ce8176d071a59bf9bca0e57e01c2e804.png

 

Yes this would Be fast if it was just two fields in to one, but I need 4 fields into two user fields. So I have to do it twice and on the second one I need to change the three drop down lists. 

 

So so indeed either it should be done just before printing, but then I need to swap all label legends as well. And maybe rearrange my 3D labels all over again. 

 

Or if I had one script to do this all at once then I could do this as I Number my instruments. 

 

 

Link to comment
11 hours ago, Sebastiaan said:

Would this require a lot of code or marionette scripting? I am a novice to scripting in VWX. I have done some Excel VBA so am willing to learn. Could somebody push me in a direction? @Pat Stanford

Since Sam already wrote it you don't have to.

 

I am certainly more proficient in Vectorscript than Marionette, but in My  Not So Humble Opinion, Vectorscript will always beat Marionette when it comes to manipulating already existing objects. Especially if you are just working with attached data.

 

I have not looked at Sam's script, but I am pretty certain I could do what you asked in less than 20 lines of code.  Maybe less than 10.

 

BUT depending on the number of lights you have, it might not be fast enough to run after every change. 10 lines of code x 1000 lights is still a lot to process.

 

Link to comment

Thank you @Sam Jones & @Pat Stanford

 

I need to try and look at youR script tonight.  I hope i can inderstand the script and learn from it. 

 

I believe indeed it Will be a combination of your script and a double set of Label Legends. (48 by then)

 

Wouldn’t it be nice if VWX  would listen to us and build a optional configurable direct link between fields? Then the change would be instant upon each mutation. 

 

Thank you you so much Sam! Glad I caught you on a good day. 

Link to comment
11 hours ago, Sam Jones said:

28 lines of code actually, but that includes formatting and blank lines for clarity and the use of variable assignments that could be replaced with in line procedure calls also done for clarity.

Just tried your code in a drawing with approx 100 instruments and it feels instant! Now to remake my label legend and see what workflow fits best. Once again thank you so much.

 

btw, I was able to understand and read your code well, I really should make time to dig into vwx scripting!

 

Thank you once more, I am Happy!

Link to comment
Quote

btw, I was able to understand and read your code well, I really should make time to dig into vwx scripting!

 

You probably should, but beware of the quicksand.  It will disguise itself as a 15 minute task that will be reduced to a 10 second task after you write the appropriate script.  You will then spend the next 4 DAYS writing the script, debugging the script, refining the script, and debugging it again.  Good luck.

 

Sam

Link to comment
16 minutes ago, Sam Jones said:

 

You probably should, but beware of the quicksand.  It will disguise itself as a 15 minute task that will be reduced to a 10 second task after you write the appropriate script.  You will then spend the next 4 DAYS writing the script, debugging the script, refining the script, and debugging it again.  Good luck.

 

Sam

I still remember all those evenings wrecking my head over my excel dimmer and PSU macro's. In the end it made my life a bit more magical😉

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...