Looking For An Automatic Numbering Solution

Looking For An Automatic Numbering Solution

Anonymous
Not applicable
840 Views
5 Replies
Message 1 of 6

Looking For An Automatic Numbering Solution

Anonymous
Not applicable

Hello everyone and thank you in advance for any help you can offer.  I'm trying to find the best solution within the AutoCAD ecosystem (vanilla, Civil, Electrical, etc.) for an automated number system to label data drops on low voltage plans.

 

It would need to be something were I could define the syntax, number places, ranges, alphanumeric and when it needs to jump up to the next character etc.  Different  clients request different numbering systems so it needs to be configurable \ extensible.

 

For example PT.PT1.A:9-10 I would need to automatically increment the #-# range counting up as I place labels and be able to give it a maximum (like 24 or 48 for patch panel sizes) and tell it to increment up the A charater alphabetically and start the next #-# range.

I feel this might need a custom scripted solution to automate but I'm hoping there's some tool out there I'm just not familiar with.

 

Thank you.

0 Likes
841 Views
5 Replies
Replies (5)
Message 2 of 6

vinodkl
Mentor
Mentor

Hi @Anonymous 

 

You can use Incremental numbering suite lisp to do what you are asking for. You can download it from here.

Just download the .lsp file from the link given and then drag and drop that file into AutoCAD and then type in the command "NUMINC" 🙂

--------------------------------------------------------------------------------------------------------------------------
ವಿನೋದ್ ಕೆ ಎಲ್( System Design Engineer)
Likes is much appreciated if the information I have shared is helpful to you and/or others.

Please mark "Accept as Solution" if my reply resolves the issue or answers your question, to help others in the community.
--------------------------------------------------------------------------------------------------------------------------
Message 3 of 6

3wood
Advisor
Advisor

I remember a similar question has been asked a few months before by others. But I couldn't find the post.

Previous question is simpler than your one. It only has a "A-1" format.

Here attached 2 formulas which can be used in ALTEXT.

Instead of adding text in "PT.PT1.A:24-48" format directly, my solution is adding simple numbers without prefix in a sequence from 1 with some autonumbering tool, such as INNB, then convert these numbers into A:24-48 format (with the first formula), then add Prefix such as "PT.PT1." to all these texts (also with ALTEXT)

The benefit of this workflow is, in case of error and you need add or delete a number in the sequence, you can easily convert them back to the original numbers (with the second formula), then add or minus numbers in a certain number range (also with ALTEXT), and then convert these numbers back to "A:24-48" format.

Step 1, Add numbers.

altext2-1.PNG

Step 2, Use ALTEXT and load Formula 1.

formula.PNG

Step 3, Convert numbers to "A:24-48" format.

altext2-2.PNG

Step 4, Add Prefix "PT.PT1."

altext2-3.PNG

Step 5, the result:

altext2-4.PNG

 

 

 

0 Likes
Message 4 of 6

3wood
Advisor
Advisor

I remember a similar question has been asked a few months before by others. But I couldn't find the post.

Previous question is simpler than your one. It only has a "A-24" format.

Here attached 2 formulas which can be used in ALTEXT. (for TEXT objects only)

Instead of adding text in "PT.PT1.A:24-48" format directly, my solution is adding simple numbers without prefix in a sequence from 1 with some autonumbering tool first, such as INNB, then convert these numbers into A:24-48 format (with the first formula), then add Prefix such as "PT.PT1." to all these texts (also with ALTEXT)

The benefit of this workflow is, in case of error and you need add or delete a number in the sequence, you can easily convert them back to the original numbers (with the second formula), then add or minus numbers in a certain number range (also with ALTEXT), and then convert these numbers back to "A:24-48" format.

Step 1.1, Add numbers.

altext2-1.PNG

Step 1.2, Use ALTEXT and load Formula 1.

formula.PNG

Step 1.3, Convert numbers to "A:24-48" format.

altext2-2.PNG

Step 1.4, Add Prefix "PT.PT1."

altext2-3.PNG

Step 1.5, the result:

altext2-4.PNG

 

Now, if there is an error in the sequence, for example, need add 1 to all numbers after A:24-48, ie. A:24-48 becomes B:1-1, B:1-1 becomes B:1-2, etc. We can use the second formula to convert texts into original numbers first, then use steps above to convert numbers into "A-24-48" format again.

 

Step 2.1, remove all prefix with FIND command

altext2-5.PNG

Step 2.2, the result of Step 2.1:

altext2-2.PNG

Step 2.3, Use ALTEXT and load Formula 2 to convert these texts into original numbers.

altext2-1.PNG

Step 2.4, Use ALTEXT to add 1 to all numbers ≧ 1152.

altext2-6.PNG

Step 2.5, the result of Step 2.4:

altext2-7.PNG

Then repeat Step 1.2 to Step 1.5 to convert the numbers into "PT.PT1.A:24-48" format.

altext2-8.PNG

 

Attachments:

Formula 1, Convert numbers into "A:24-48" format.

 

;;; This is an example formula for ALTEXT.vlx
;;; Convert selected numbers into mixed alphbat / numbers such as "A-1-1", last digit in a term of 48, first digit in a term of 24
;;; Revise corresponsive variables to suit
(defun ALTEXT_FORMULA (/ number TERM1 TERM2 CONNECTOR1 CONNECTOR2 PartA PartB PartC)
  (setq TERM1 48 	;Changes it if the circulation is not 48
	TERM2 24 	;Changes it if the circulation is not 24
	CONNECTOR1 "-"	;Add space in front or after the dash as you need, or change it to any other character you need put in between the letter and number
	CONNECTOR2 ":"	;
        )
  (setq number (atoi ALTEXT_STR_ORG))
  (setq PartA (fix (rem number TERM1)) 
	PartB (1+ (fix (rem (/ (1- number) TERM1) TERM2)))
	PartC (chr (+ (fix (/ (1- number) (* TERM1 TERM2))) 65))	
	)
  (strcat PartC CONNECTOR2 (itoa PartB) CONNECTOR1 (itoa (if (= PartA 0) TERM1 PartA)))
  )

 

 

Formula 2, Convert "A:24-48" format texts back into numbers:

 

;;; This is an example formula for ALTEXT.vlx
;;; You can use AutoCAD command FIND to remove prefix and suffix first.
;;; It reverts mixed alphbat / numbers such as "A-1-1" back to its original number.
;;; Revise corresponsive variables TERM & CONNECTOR to suit.

(defun ALTEXT_FORMULA (/ TERM1 TERM2 CONNECTOR1 CONNECTOR2 PartA PartB PartC t1 p1 p2 L1)
  (setq TERM1 48 	;Changes it if the circulation is not 48
	TERM2 24 	;Changes it if the circulation is not 24
	CONNECTOR1 "-"	;Add space in front or after the dash as you need, or change it to any other character you need put in between the letter and number
	CONNECTOR2 ":"	;
        )
  (setq t1 (substr ALTEXT_STR_ORG (1+ (strlen PREFIX)))) 
  (setq p2 (vl-string-search CONNECTOR2 t1))
  (setq p1 (vl-string-search CONNECTOR1 t1 (+ p2 (strlen CONNECTOR2)))) 
  (setq PartA (substr t1 (+ p1 (strlen CONNECTOR1) 1)) 
	PartB (substr t1 (setq L1 (+ P2 (strlen CONNECTOR2) 1)) (1+ (- P1 L1))) 
	PartC (substr t1 1 1)
	)
  (if (and PartA PartB PartC)
    (itoa (+ (* (- (ascii PartC) 65) TERM1 TERM2) (* (1- (atoi PartB)) TERM1) (atoi PartA)))) 
  )

 

 

0 Likes
Message 5 of 6

Anonymous
Not applicable

Thank you very much this solution looks like it has a lot of potential.

I'll let you know how it goes.

0 Likes
Message 6 of 6

Anonymous
Not applicable

Thank you for laying things out in such detail.  I will try that and get back to you.  Sorry I took a while to back to you guys.  I have a pile of deadlines on me at work.  Thanks.

0 Likes