News:

Interested in some really terrific mobile apps? Visit www.turboapps.com for details.

Main Menu
TurboCAD 2026 Platinum box
Now available

TurboCAD 2026.2

The latest update for TurboCAD 2026. It installs over any 2026 build and keeps your activation, drawings and settings. Get it from the Start Page or Help > Check for Update.

Random Number Generator

Started by AussieBloke, April 16, 2022, 01:37:25 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

AussieBloke

Id like to see a random number generator for use in Animationlab for simulating moving objects as well as Turbocad for use with variables.

Random number generation is a process by which, often by means of a random number generator (RNG), a sequence of numbers or symbols that cannot be reasonably predicted better than by random chance is generated. from wikipedia.

Andy H

#1
It is built into VBScript Darryl.  SeeW3 Schools explanation

In AL, you may also use it with the INT, and possibly with multiplication..  For example. 
X = Int(RND() X 10).  Would give integer numbers between 0 and 10.  The RND() alone just gives between 0 and 1.

Andy H

OK.  Just thought I'd have a play. the attached is only a tiny cyclic gif (3 to 4 seconds). using 4 point lights. set to randomise a light every 3 frames. The command is simply LightSwitch, but instead of using '0' or '1'.  it user r (for red), g (for green) etc.

I've attached the file in v2021. in case you want to look at the code.  However The materials (4 coloured glass bits) are RedSDK, so you would have to change them to Lightworks. 

AussieBloke

Thanks for the heads up Andy, Ive rarely looked at the vbsript functions.