Jump to content

Recommended Posts

Posted
(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.

Posted

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

Posted
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?

Posted
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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...