Over 1.110.000 registered users (EN+CZ).
AutoCAD tips, Inventor tips, Revit tips, Civil tips, Fusion tips.
Try the updated section Converters and online CAD tools,
new AutoCAD 2026 commands and environment variables.
CAD tip # 1366:
Question
A
Use the following function for a LISP generator of pseudo-random numbers:
(defun rnd (/ modulus multiplier increment random) (if (not seed) (setq seed (getvar "DATE")) ) (setq modulus 65536 multiplier 25173 increment 13849 seed (rem (+ (* multiplier seed) increment) modulus) random (/ seed modulus) ) )Each call of the function (rnd) then returns a pseudo-random number in the range (0,1). E.g. to get random integers from 0 to 20, use (fix(* 20 (rnd))).
ACAD
1.6.2001
20904×
this tip shared by ARKANCE experts applies to: AutoCAD ·
![CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]](../common/arkance_186.png)

