Welcome, Guest. Please login or register.
May 16, 2012, 03:30:47 pm
Home Help Search Login Register
News: When replying to a specific statement be sure to quote the previous post.

+  TurboCAD Forums
|-+  SDK Corner
| |-+  Contributions
| | |-+  VBScript to target a selected light to a selected object.
« previous next »
Pages: [1] Go Down Print
Author Topic: VBScript to target a selected light to a selected object.  (Read 2353 times)
kchapman
Administrator
Full Member
*****
Posts: 201


« on: June 02, 2009, 09:22:27 pm »

The attached vbscript changes a single selected light's direction to point to the center of a single selected object.

Usage:
Unzip the vbs file into a folder of your choice.
Open TurboCAD, open a drawing, and select one light and one target object.
Right-click on the vbs file and choose Open. (If Windows asks what program to open the file with, browse to c:\Windows\System32\wscript.exe.)
This script can also be loaded into the Macro Recorder Palette in TC16 and run from there.

Limitations:
The script currently only works on one light and object at a time.

As always, comments and suggestions for improvements are welcome (as are contributions of improved versions).

Logged
Dave C
Sr. Member
****
Posts: 269



« Reply #1 on: July 09, 2009, 08:27:29 am »

Thanks for that.
Takes a lot of the hassle out of setting up lighting.

Regards
Dave
« Last Edit: July 10, 2009, 01:06:54 pm by Troubled » Logged

Dave C
TC Pro V14.2
TC Pro V16.2 Platinum Edition Build 54.0
TC 18 Platinum
TC 19 Platinum 64 Bit Build 26.1
Acer Aspire 8943G  i7-740QM processor.  16GB DDR3 memory.
http://www.flickr.com/photos/fizzyfitz/
kchapman
Administrator
Full Member
*****
Posts: 201


« Reply #2 on: July 10, 2009, 09:26:15 am »

I'm glad you find it useful!
Logged
Dave C
Sr. Member
****
Posts: 269



« Reply #3 on: July 10, 2009, 04:10:18 pm »

Is there any chance that you may have one of these that will do the same for luminance?.....

Is that even possible?

Regards

Dave
Logged

Dave C
TC Pro V14.2
TC Pro V16.2 Platinum Edition Build 54.0
TC 18 Platinum
TC 19 Platinum 64 Bit Build 26.1
Acer Aspire 8943G  i7-740QM processor.  16GB DDR3 memory.
http://www.flickr.com/photos/fizzyfitz/
kchapman
Administrator
Full Member
*****
Posts: 201


« Reply #4 on: September 26, 2009, 03:09:16 pm »

Here is an updated version of the SetLightTarget script that can be loaded into TurboCAD's MacroRecorder Palette and run from there. This removes the need to browse for wscript.exe or to link .vbs extensions to that application.

Unzip the attached file to a location of your choice.
In TurboCAD, View/MacroRecorder Palette...
In the MacroRecorder palette, click on the Open icon, select files of type VBScript (*.vbs), and browse for SetLightTarget_MR.vbs.
Click on the Run button when the macro is loaded.

As before, to use the macro successfully, you must pre-select exactly one light and one graphic which should be the light's target. (The target can be any type of graphic except another light.)
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.054 seconds with 17 queries.