maahee Posted 4 hours ago Posted 4 hours ago (defun c:Autoalpha (/ pt index alphabet) (setq alphabet '("A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z" ) ) ; Alphabet string (setq index 0) (while (setq pt (getpoint "\nPick point: ")) (setq letter (nth index alphabet)) ;; Insert the letter as text (entmake (list (cons 0 "TEXT") (cons 8 "0") ; Layer 0 (cons 10 pt) ; Insertion point (cons 40 2.0) ; Text height (cons 1 letter) ; Text string (cons 7 "STANDARD") ; Text style ) ) (setq index (1+ index)) ) ) Modified code after the letter A to Z should follow this format: 1. Use combinations such as AA, AB, AC, ..., AZ, then BA, BB, BC, ..., Bz. 2. Add a numerical prefix or suffix to each letter combination. 3. The numerical prefix or suffix can be either constant or variable. Quote
Tsuky Posted 1 hour ago Posted 1 hour ago Here is an example of a function that might be right for you. Command:BlockTC_POINTAtt2Vtx If this seems correct to you after trying, you can get the function: (defun inc_txt (....)); usage: (inc_txt "arg_string") to insert it after adaptation, in your code ... BlockTC_POINTAtt2Vtx(en).lsp Quote
Saxlle Posted 49 minutes ago Posted 49 minutes ago 3 hours ago, maahee said: 3. The numerical prefix or suffix can be either constant or variable. Can you describe more about this, part when the numerical prefix or suffix are changable? Quote
maahee Posted 1 minute ago Author Posted 1 minute ago 50 minutes ago, Saxlle said: Can you describe more about this, part when the numerical prefix or suffix are changable? The numerical prefix or suffix is changeable Quote
Recommended Posts
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.