Lee Mac
20th Apr 2009, 07:26 pm
Incremental Numbering Suite
This program enables the user to place incrementing numerical text in a drawing, with a range of positioning utilities and an optional Prefix/Suffix.
The program is invoked with the syntax: NumInc
One can enter Prefix, Middle and Suffix text and have the option to increment either section (providing it is numerical), with the ability to have leading zeros. One can also specify any increment (including decimals), and alter the text layer, style and height.
http://www.theswamp.org/screens/leemac/NumIncV2-5.png
Upon submitting the options, the user will see a preview of the text on screen, with various options displayed at the command line.
http://www.theswamp.org/screens/leemac/Number%20Increment.gif
http://www.theswamp.org/screens/leemac/NumIncV2-3Tab.gif
http://www.theswamp.org/screens/leemac/NumIncV2-2.gif
http://www.theswamp.org/screens/leemac/NumIncV2-4Hex.gif
http://www.theswamp.org/screens/leemac/NumIncV2-5Tri.gif
From this interface, the user has various placement options, including:
<................. Rotates Text Anti-Clockwise.
>................. Rotates Text Clockwise.
Tab.............. Set Rotation back to zero, and rotates by 90.
Shift+Tab..... Mirrors Rotation.
C or c........... Switches to Curve Aligned Mode.
R or r........... Switches to Replacement Mode.
T or t............ Toggle the Incrementing Counter.
Curve Aligned Mode:
Upon pressing "C" or "c", the user will be prompted to select a curve. The text will then follow that curve, before the user clicks to place the text.
http://www.theswamp.org/screens/leemac/Number%20Increment%20Curve.gif
Replacement Mode:
Upon pressing "R" or "r", the user will be prompted to select either TEXT, MTEXT or ATTIButes, which, upon selection will be modified to contain the incremental text.
Restrictions:
Requires Express Tools for full functionality.
-- This program is available Free to Download --
;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø ¤ÂºÂ°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º °`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤à ¸,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸ ¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;
;; ;;
;; ;;
;; --=={ Incremental Numbering Suite }==-- ;;
;; ;;
;; Will sequentially generate numerical text upon mouse click, with optional ;;
;; prefix and suffix. ;;
;; ;;
;; [ Enter ] ~ Exit Program ;;
;; [ < ] ~ Rotate Text CCW ;;
;; [ > ] ~ Rotate Text CW ;;
;; [ Tab ] ~ Rotate Text by 90º ;;
;; [ Shift + Tab ] ~ Mirror Text Rotation (requires Express Tools) ;;
;; [ C ] ~ Align Text to Curve ;;
;; [ R ] ~ Replace Existing Text/Attribute String ;;
;; [ T ] ~ Toggle Counter Increment ;;
;; [ B ] ~ Rotate Polygonal Border ;;
;; ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;; ;;
;; FUNCTION SYNTAX: NumInc ;;
;; ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;; ;;
;; AUTHOR: ;;
;; ;;
;; Copyright © Lee McDonnell, April 2009. All Rights Reserved. ;;
;; ;;
;; { Contact: Lee Mac @ TheSwamp.org, CADTutor.net } ;;
;; ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;; ;;
;; VERSION: ;;
;; ;;
;; ø 1.0 ~¤~ 12th April 2009 ~¤~ º First Release. ;;
;;................................................ ...............................;;
;; ø 1.1 ~¤~ 14th April 2009 ~¤~ º Added Prefix/Suffix Option. ;;
;;................................................ ...............................;;
;; ø 1.2 ~¤~ 15th April 2009 ~¤~ º Added Dialog. ;;
;;................................................ ...............................;;
;; ø 1.3 ~¤~ 15th April 2009 ~¤~ º Added Option to Replace Existing ;;
;; text/attribute string. ;;
;;................................................ ...............................;;
;; ø 1.4 ~¤~ 18th April 2009 ~¤~ º Made program compatible with leading ;;
;; zeros. ;;
;;................................................ ...............................;;
;; ø 1.5 ~¤~ 16th June 2009 ~¤~ º Upgraded program code. ;;
;;................................................ ...............................;;
;; ø 1.6 ~¤~ 27th June 2009 ~¤~ º Added Counter Toggle. ;;
;; º General Bug Fixes. ;;
;;................................................ ...............................;;
;; ø 1.7 ~¤~ 18th February 2010 ~¤~ º General Program Upgrade. ;;
;;................................................ ...............................;;
;; ø 1.8 ~¤~ 19th February 2010 ~¤~ º Change Rotation Controls. ;;
;;................................................ ...............................;;
;; ø 1.9 ~¤~ 22nd February 2010 ~¤~ º Added option to not use GrRead loop, ;;
;; and hence allow OSnap to function. ;;
;; º Added ability to place text in Table ;;
;; Cells. ;;
;;................................................ ...............................;;
;; ø 2.0 ~¤~ 24th February 2010 ~¤~ º Fixed Text Height Bug. ;;
;;................................................ ...............................;;
;; ø 2.1 ~¤~ 5th May 2010 ~¤~ º Removed imitation OSnap. ;;
;; º Modified loop to allow multiple ;;
;; replacements when in standard mode. ;;
;; º Added ability to use Alphabetical ;;
;; Increment. ;;
;;................................................ ...............................;;
;; ø 2.2 ~¤~ 6th May 2010 ~¤~ º Fixed bug with text case when ;;
;; incrementing alphabetical strings. ;;
;; º Added ability to border text with ;;
;; either Circle, Rectangle or Slot; ;;
;; and offset from text. ;;
;;................................................ ...............................;;
;; ø 2.3 ~¤~ 7th May 2010 ~¤~ º Changed the way that layer/style ;;
;; globals are stored to allow for ;;
;; layer/style changes between uses. ;;
;; º Removed Xref layers/styles from ;;
;; list. ;;
;; º Fixed UCS bugs. ;;
;;................................................ ...............................;;
;; ø 2.4 ~¤~ 10th May 2010 ~¤~ º Added a 'By Style' option for text ;;
;; height selection. ;;
;; º Added option to enclose text with ;;
;; n-sided Polygon. ;;
;; º Added ability to rotate polygonal ;;
;; border. ;;
;;................................................ ...............................;;
;; ø 2.5 ~¤~ 11th May 2010 ~¤~ º Allowed for Zero height in ;;
;; TextStyle. ;;
;; º Added ability to fix border size. ;;
;; º Fixed Text Height variable bug. ;;
;; º Fixed Rotation of odd-sided ;;
;; polygons. ;;
;;................................................ ...............................;;
;; ø 2.6 ~¤~ 12th May 2010 ~¤~ º Fixed Rotation of odd-sided polygons ;;
;; when text is not set to follow ;;
;; cursor. ;;
;; º Fixed Slot Bulges. ;;
;; º Added 'B' control to DCL About page. ;;
;;................................................ ...............................;;
;; ø 2.7 ~¤~ 22nd May 2010 ~¤~ º Fixed Border issue when in different ;;
;; view. ;;
;;................................................ ...............................;;
;; ø 2.8 ~¤~ 24th May 2010 ~¤~ º Changed DCL/CFG file save path to ;;
;; make program compatible with ;;
;; Bricscad. ;;
;;................................................ ...............................;;
;; ø 2.9 ~¤~ 29th May 2010 ~¤~ º Upgraded code to determine DCL/CFG ;;
;; Filepath, to allow for AutoCAD ;;
;; Versions pre 2004. ;;
;;................................................ ...............................;;
;; ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;; ;;
;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø ¤ÂºÂ°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º °`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤à ¸,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸ ¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;
Instructions for Running:
Save the attached LISP file.
Open AutoCAD and type "_appload" at the command line, or go to "Tools" > "Load Application".
Load the LISP file as previously saved, and add the file to your start-up suite if desired.
Type "NumInc" at the command line to invoke the command.
For more info, see here. (http://www.cadtutor.net/faq/questions/28/How+do+I+use+an+AutoLISP+routine%3F)
Your comments and suggestions are welcome. Either PM (http://www.cadtutor.net/forum/member.php?u=16898) me directly, or post a reply to the original thread.
(http://www.cadtutor.net/forum/showthread.php?t=34914)
Cheers
Lee
--=={ Code Updated to Version 2.9 }==--
Code available here (http://lee-mac.com/numinc.html).
This program enables the user to place incrementing numerical text in a drawing, with a range of positioning utilities and an optional Prefix/Suffix.
The program is invoked with the syntax: NumInc
One can enter Prefix, Middle and Suffix text and have the option to increment either section (providing it is numerical), with the ability to have leading zeros. One can also specify any increment (including decimals), and alter the text layer, style and height.
http://www.theswamp.org/screens/leemac/NumIncV2-5.png
Upon submitting the options, the user will see a preview of the text on screen, with various options displayed at the command line.
http://www.theswamp.org/screens/leemac/Number%20Increment.gif
http://www.theswamp.org/screens/leemac/NumIncV2-3Tab.gif
http://www.theswamp.org/screens/leemac/NumIncV2-2.gif
http://www.theswamp.org/screens/leemac/NumIncV2-4Hex.gif
http://www.theswamp.org/screens/leemac/NumIncV2-5Tri.gif
From this interface, the user has various placement options, including:
<................. Rotates Text Anti-Clockwise.
>................. Rotates Text Clockwise.
Tab.............. Set Rotation back to zero, and rotates by 90.
Shift+Tab..... Mirrors Rotation.
C or c........... Switches to Curve Aligned Mode.
R or r........... Switches to Replacement Mode.
T or t............ Toggle the Incrementing Counter.
Curve Aligned Mode:
Upon pressing "C" or "c", the user will be prompted to select a curve. The text will then follow that curve, before the user clicks to place the text.
http://www.theswamp.org/screens/leemac/Number%20Increment%20Curve.gif
Replacement Mode:
Upon pressing "R" or "r", the user will be prompted to select either TEXT, MTEXT or ATTIButes, which, upon selection will be modified to contain the incremental text.
Restrictions:
Requires Express Tools for full functionality.
-- This program is available Free to Download --
;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø ¤ÂºÂ°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º °`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤à ¸,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸ ¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;
;; ;;
;; ;;
;; --=={ Incremental Numbering Suite }==-- ;;
;; ;;
;; Will sequentially generate numerical text upon mouse click, with optional ;;
;; prefix and suffix. ;;
;; ;;
;; [ Enter ] ~ Exit Program ;;
;; [ < ] ~ Rotate Text CCW ;;
;; [ > ] ~ Rotate Text CW ;;
;; [ Tab ] ~ Rotate Text by 90º ;;
;; [ Shift + Tab ] ~ Mirror Text Rotation (requires Express Tools) ;;
;; [ C ] ~ Align Text to Curve ;;
;; [ R ] ~ Replace Existing Text/Attribute String ;;
;; [ T ] ~ Toggle Counter Increment ;;
;; [ B ] ~ Rotate Polygonal Border ;;
;; ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;; ;;
;; FUNCTION SYNTAX: NumInc ;;
;; ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;; ;;
;; AUTHOR: ;;
;; ;;
;; Copyright © Lee McDonnell, April 2009. All Rights Reserved. ;;
;; ;;
;; { Contact: Lee Mac @ TheSwamp.org, CADTutor.net } ;;
;; ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;; ;;
;; VERSION: ;;
;; ;;
;; ø 1.0 ~¤~ 12th April 2009 ~¤~ º First Release. ;;
;;................................................ ...............................;;
;; ø 1.1 ~¤~ 14th April 2009 ~¤~ º Added Prefix/Suffix Option. ;;
;;................................................ ...............................;;
;; ø 1.2 ~¤~ 15th April 2009 ~¤~ º Added Dialog. ;;
;;................................................ ...............................;;
;; ø 1.3 ~¤~ 15th April 2009 ~¤~ º Added Option to Replace Existing ;;
;; text/attribute string. ;;
;;................................................ ...............................;;
;; ø 1.4 ~¤~ 18th April 2009 ~¤~ º Made program compatible with leading ;;
;; zeros. ;;
;;................................................ ...............................;;
;; ø 1.5 ~¤~ 16th June 2009 ~¤~ º Upgraded program code. ;;
;;................................................ ...............................;;
;; ø 1.6 ~¤~ 27th June 2009 ~¤~ º Added Counter Toggle. ;;
;; º General Bug Fixes. ;;
;;................................................ ...............................;;
;; ø 1.7 ~¤~ 18th February 2010 ~¤~ º General Program Upgrade. ;;
;;................................................ ...............................;;
;; ø 1.8 ~¤~ 19th February 2010 ~¤~ º Change Rotation Controls. ;;
;;................................................ ...............................;;
;; ø 1.9 ~¤~ 22nd February 2010 ~¤~ º Added option to not use GrRead loop, ;;
;; and hence allow OSnap to function. ;;
;; º Added ability to place text in Table ;;
;; Cells. ;;
;;................................................ ...............................;;
;; ø 2.0 ~¤~ 24th February 2010 ~¤~ º Fixed Text Height Bug. ;;
;;................................................ ...............................;;
;; ø 2.1 ~¤~ 5th May 2010 ~¤~ º Removed imitation OSnap. ;;
;; º Modified loop to allow multiple ;;
;; replacements when in standard mode. ;;
;; º Added ability to use Alphabetical ;;
;; Increment. ;;
;;................................................ ...............................;;
;; ø 2.2 ~¤~ 6th May 2010 ~¤~ º Fixed bug with text case when ;;
;; incrementing alphabetical strings. ;;
;; º Added ability to border text with ;;
;; either Circle, Rectangle or Slot; ;;
;; and offset from text. ;;
;;................................................ ...............................;;
;; ø 2.3 ~¤~ 7th May 2010 ~¤~ º Changed the way that layer/style ;;
;; globals are stored to allow for ;;
;; layer/style changes between uses. ;;
;; º Removed Xref layers/styles from ;;
;; list. ;;
;; º Fixed UCS bugs. ;;
;;................................................ ...............................;;
;; ø 2.4 ~¤~ 10th May 2010 ~¤~ º Added a 'By Style' option for text ;;
;; height selection. ;;
;; º Added option to enclose text with ;;
;; n-sided Polygon. ;;
;; º Added ability to rotate polygonal ;;
;; border. ;;
;;................................................ ...............................;;
;; ø 2.5 ~¤~ 11th May 2010 ~¤~ º Allowed for Zero height in ;;
;; TextStyle. ;;
;; º Added ability to fix border size. ;;
;; º Fixed Text Height variable bug. ;;
;; º Fixed Rotation of odd-sided ;;
;; polygons. ;;
;;................................................ ...............................;;
;; ø 2.6 ~¤~ 12th May 2010 ~¤~ º Fixed Rotation of odd-sided polygons ;;
;; when text is not set to follow ;;
;; cursor. ;;
;; º Fixed Slot Bulges. ;;
;; º Added 'B' control to DCL About page. ;;
;;................................................ ...............................;;
;; ø 2.7 ~¤~ 22nd May 2010 ~¤~ º Fixed Border issue when in different ;;
;; view. ;;
;;................................................ ...............................;;
;; ø 2.8 ~¤~ 24th May 2010 ~¤~ º Changed DCL/CFG file save path to ;;
;; make program compatible with ;;
;; Bricscad. ;;
;;................................................ ...............................;;
;; ø 2.9 ~¤~ 29th May 2010 ~¤~ º Upgraded code to determine DCL/CFG ;;
;; Filepath, to allow for AutoCAD ;;
;; Versions pre 2004. ;;
;;................................................ ...............................;;
;; ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;; ;;
;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø ¤ÂºÂ°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º °`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤à ¸,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸ ¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;
Instructions for Running:
Save the attached LISP file.
Open AutoCAD and type "_appload" at the command line, or go to "Tools" > "Load Application".
Load the LISP file as previously saved, and add the file to your start-up suite if desired.
Type "NumInc" at the command line to invoke the command.
For more info, see here. (http://www.cadtutor.net/faq/questions/28/How+do+I+use+an+AutoLISP+routine%3F)
Your comments and suggestions are welcome. Either PM (http://www.cadtutor.net/forum/member.php?u=16898) me directly, or post a reply to the original thread.
(http://www.cadtutor.net/forum/showthread.php?t=34914)
Cheers
Lee
--=={ Code Updated to Version 2.9 }==--
Code available here (http://lee-mac.com/numinc.html).