Lee Mac Posted April 12, 2009 Posted April 12, 2009 (edited) Hi Guys, Wasn't that busy, so I thought I'd put together a little Incremental Numbering Suite for you all to sample. I've come to realise that this kind of LISP seems to be quite a popular one in many trades, and this was my main inspiration for its creation. As with all my programs - your comments and/or criticism is welcome, as this only helps to improve the program itself. Thanks & Enjoy! Cheers Lee Incremental Numbering Suite Main Dialog Preview: About Dialog Preview: Incrementing two sections of Text with a Background Mask and Rectangular Border: Incrementing with Leading Zeros: Text with a Slot Border: Placing text in a Table Cell: Incrementing Text with Leading Zeros and Hexagonal Border: Incrementing alpha text, demonstrating rotation of Triangular Border: Curve-Aligned Mode: Array Example 1 Demonstrating the difference between Spacing Vector and Endpoint specification, with Object Rotation set to 'Aligned'. Array Example 2 Demonstrating Perpendicular rotation and a fixed zero rotation. A full description of the program and the latest version can be found here. NumIncV3-9.zip Edited December 6, 2015 by Lee Mac Quote
StevJ Posted April 12, 2009 Posted April 12, 2009 Now that's sweet, Lee. I made that change you made for me in a previous version to allow a leading zero in the number, and the rotation ability you put in the program really adds to the utility of it. But then a small thought came into my head: What if we need the prefix and the number to be static, and the suffix to increment? Only the prefix and suffix accept alpha input, but neither of these will increment. Steve Quote
Lee Mac Posted April 12, 2009 Author Posted April 12, 2009 Thanks for your suggestions Steve I suppose I could include options for an incrementing Prefix and/or Suffix, but this would add extra prompts for the user. I shall have a think about this one Quote
StevJ Posted April 13, 2009 Posted April 13, 2009 Yep. Too many user prompts would make it a real endurance test, and might possibly turn many potential users away from it. It's very good as is. I was just tossing out some thoughts. Steve Quote
Lee Mac Posted April 13, 2009 Author Posted April 13, 2009 Yep. Too many user prompts would make it a real endurance test, and might possibly turn many potential users away from it.It's very good as is. I was just tossing out some thoughts. Steve As I said, I like the comments and criticism, (after all, it can only potentially make it better... ) and, if I think this is feasible without too much clutter, I may well incorporate it Thanks Steve Quote
flowerrobot Posted April 13, 2009 Posted April 13, 2009 Purhaps a "kword" system, i find that is quite helpfull, when trying to steam line a program, or even a kword toggle. Quote
SEANT Posted April 13, 2009 Posted April 13, 2009 Hey, great routine. This will certainly speed up the creation of “Part Callout” drawings. The only thing I would suggest is coordinate translation to eliminate the need to have the WCS current. Quote
Lee Mac Posted April 13, 2009 Author Posted April 13, 2009 Hey, great routine. This will certainly speed up the creation of “Part Callout” drawings. The only thing I would suggest is coordinate translation to eliminate the need to have the WCS current. Ahh good point Sean, thanks I shall endeavour to incorporate that. I only tested it in WCS, so didn't notice the need, but thanks for pointing that out mate Quote
Lee Mac Posted April 13, 2009 Author Posted April 13, 2009 Purhaps a "kword" system, i find that is quite helpfull, when trying to steam line a program, or even a kword toggle. Thanks Flowerrobot for your suggestion - I just like to keep the user prompts to a minimum, otherwise the user just sloggs through a load of prompts before he/she can get to the "business" end of the program... Quote
mdbdesign Posted April 13, 2009 Posted April 13, 2009 What if I need to get one sets of number without prefix or suffix? Another thing: What about dcl? Is it pending? Quote
Lee Mac Posted April 13, 2009 Author Posted April 13, 2009 What if I need to get one sets of number without prefix or suffix? Well, at the minute, I suppose you could use a space for a prefix and suffix - but yes, I shall incorporate the option of none. Another thing: What about dcl? Is it pending? Hmmm... I'm not sure about DCL, I may just keep it command line - with DCL, you have the complications of an extra file, and the coding turns "ugly"... But thanks for the suggestions Quote
CAB Posted April 13, 2009 Posted April 13, 2009 Here is one way to deal with options: (defun c:test() (setq snum 1 inc 1 pre "" suf "" ) ;; enter key sends the user on his way (while (cond ((progn (princ (strcat "\n*** Start #" (rtos snum 2 0) " Increment: " (rtos inc 2 0) " Prefix: " pre " Suffix: " suf)) (initget "Start Inc Prefix sUffix") (null (setq opt (getkword "\nEnter option to change [start/Inc/Prefix/sUffix]: ")))) nil ) ((= opt "Start") (setq snum (getreal (strcat "\nSpecify Starting Number <" (rtos snum 2 0) ">: "))) ) ((= opt "Inc") (setq inc (getreal (strcat "\nSpecify Increment <" (rtos inc 2 0) ">: "))) ) ((= opt "Prefix") (setq pre (getstring t (strcat "\nSpecify Prefix <" (if (eq "" pre) "-None-" pre) ">: "))) ) ((= opt "sUffix") (setq suf (getstring t (strcat "\nSpecify Suffix <" (if (eq "" suf) "-None-" suf) ">: "))) ) ) ) (princ) ) Quote
Lee Mac Posted April 13, 2009 Author Posted April 13, 2009 Thanks for the info CAB, I'll be sure to test that tomorrow when I get a minute Cheers Lee Quote
Lee Mac Posted April 13, 2009 Author Posted April 13, 2009 This is a preliminary - I am thinking DCL may be a good call - but not sure... Let me know of your thoughts on this: Quote
The Buzzard Posted April 13, 2009 Posted April 13, 2009 Lee, You should know by now. DCL is always a good call. The whole program in your face without anticipation of prompts. Quote
The Buzzard Posted April 15, 2009 Posted April 15, 2009 Now thats more like it. Outstanding work Lee. Quote
uddfl Posted April 15, 2009 Posted April 15, 2009 Very nice, Lee. You know what would make a program like this truly powerful? In addition the current option which creates new text, an option to edit existing text (or attributes). Quote
uddfl Posted April 15, 2009 Posted April 15, 2009 Also for some reason the text angle changes in the middle of executing the program... :confused: Quote
The Buzzard Posted April 15, 2009 Posted April 15, 2009 Lee, One thing I noticed was you cannot have preceeding zero's in the suffix. (Example: To have a suffix start at 001 and increment it.) The program does not put the zero's in except for the one you put in the dialog. 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.