Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/23/2024 in all areas

  1. There is also this *.lsp... (defun c:6_digit_rnd-1 ( / rnd *a* 1_digit 2_digit 3_digit 4_digit 5_digit 6_digit done ) (defun rnd ( / ti tis ns n ) ; *a* - lexical global number variable ; return - n random number from 0 to 9 (setq ti (car (_vl-times))) (setq tis (itoa ti)) (setq ns (substr tis (strlen tis))) (setq n (atoi ns)) (if (null *a*) (setq *a* n) (progn (while (= *a* n) (setq ti (car (_vl-times))) (setq tis (itoa ti)) (setq ns (substr tis (strlen tis))) (setq n (atoi ns)) ) (setq *a* n) ) ) n ) (while (not done) (while (= (setq 1_digit (rnd)) 0)) (setq 2_digit (rnd)) (setq 3_digit (rnd)) (setq 4_digit (rnd)) (setq 5_digit (rnd)) (setq 6_digit (rnd)) (if (not (vl-position (setq *rtn* (atoi (strcat (itoa 1_digit) (itoa 2_digit) (itoa 3_digit) (itoa 4_digit) (itoa 5_digit) (itoa 6_digit)))) *lst*)) (setq done t) (setq done nil) ) ) (prompt (strcat "\n" (itoa *rtn*))) ; *rtn* - global variable - 6 digits number (setq *lst* (cons *rtn* *lst*)) ; *lst* - global variable - list of passed 6 digits numbers (prompt "\n6_digit_rnd is stored in global variable *rtn* - you can call it with !*rtn*...") (princ) ) HTH. M.R.
    1 point
  2. (atoi (strcat (itoa (LM:randrange 0 9)) (itoa (LM:randrange 0 9)) (itoa (LM:randrange 0 9)) (itoa (LM:randrange 0 9)) (itoa (LM:randrange 0 9)) (itoa (LM:randrange 0 9)))) or (* (LM:rand) 1000000) https://www.lee-mac.com/random.html HTH. M.R.
    1 point
  3. Keep in mind loading a lisp doesn't run the lisp, you have to run the command afterwards. AutoCAD installs with it's own very complete Swis721 collection of TrueType fonts you can assign to a Text Style or inside a portion of Mtext. Compare your romans shape font to the Swis721 Lt BT Light Italic TrueType font by putting two copies of a sentence on top of each other with one romans with an oblique angle of 5 and the other assigned the Swis721 Lt BT Light Italic TrueType font. The TrueType font is easier to read, takes up a lot less space in your drawing and you don't have to modify the lineweight for different sized text. You should consider all BIGAL's comments as you should never have to add a text style unless you're working on a drawing you got from someone else as all your standard text & dimension styles, layers, blocks and linetypes should already be in every drawing you create if your DWT's were properly set up.
    1 point
  4. Look at the command line when you do -style manually, press F2 to see the correct input, why would you set Romans to txt.shx why not Romans. Again look at using a DWT.
    1 point
  5. Here are a few other System-related Environmental Variables accessible from ACAD which may be useful. Note that all variable names are case-sensitive. (getenv "Path") ; [sTR] System Search paths (getenv "COMSPEC") ; [sTR] cmd.exe Path (getenv "UserName") ; [sTR] User logon name (getenv "Temp") ; [sTR] Temp path (getenv "TMP") ; [sTR] Temp path (getenv "ComputerName") ; [sTR] Computer name (getenv "Windir") ; [sTR] Windows path (getenv "OS") ; [sTR] Operating System (getenv "UserProfile") ; [sTR] Current user profile path (getenv "Pathext") ; [sTR] Executable extensions (getenv "SystemDrive") ; [sTR] System drive (getenv "SystemRoot") ; [sTR] System root path
    1 point
×
×
  • Create New...