Author Topic: Column Numbering Tool  (Read 3835 times)

0 Members and 1 Guest are viewing this topic.

whdjr

  • Guest
Column Numbering Tool
« on: December 21, 2005, 08:55:14 PM »
Does anybody have a tool (or something close) that numbers either "AA", "AB", "AC", "AD" ... or "A1", "A2", "A3", "A4", ...?  I need to number a bunch or column lines now and I don't have too much time to do it in.  I am currently using a block with a single attribute for the column reference.

Anything to help would be appreciative.

LE

  • Guest
Re: Column Numbering Tool
« Reply #1 on: December 21, 2005, 09:31:36 PM »
Will,

I remember some functions provided by Jürg Menzi, that can do what you are asking, have a look into his web site:

http://www.menziengineering.ch/

paulmcz

  • Bull Frog
  • Posts: 202
Re: Column Numbering Tool
« Reply #2 on: December 21, 2005, 10:31:17 PM »
Does anybody have a tool (or something close) that numbers either "AA", "AB", "AC", "AD" ... or "A1", "A2", "A3", "A4", ...?  I need to number a bunch or column lines now and I don't have too much time to do it in.  I am currently using a block with a single attribute for the column reference.

Anything to help would be appreciative.

Don't have AA, AB, AC but text-integer-text. Try it. I am sure, you can use it.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Column Numbering Tool
« Reply #3 on: December 21, 2005, 11:47:20 PM »
Will
Here is some stuff I have collected. :-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: Column Numbering Tool
« Reply #4 on: December 22, 2005, 02:23:49 AM »
I remember some functions provided by Jürg Menzi, that can do what you are asking, have a look into his web site:
-> Free Stuff -> Free Programs 'ItemIndex.lsp'
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

whdjr

  • Guest
Re: Column Numbering Tool
« Reply #5 on: December 22, 2005, 08:15:40 AM »
Thank You Guys for answering my post; however none of them is very close to what I need so I guess I will continue on with the lsp I was creating. 


man...I don't have time for this right now...we're already a week late on our job...everybody in the office is working 18 hour days...and I still haven't bought the first Christmas gift.  I tell ya...I hate having a job due at Christmas Time.

 :x  bah hum bug

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Column Numbering Tool
« Reply #6 on: December 22, 2005, 08:22:33 AM »
Will
Could you explain exactly what you want to do?
We understand you could do it, but don't have the time.

Are you working with existing text, or mtext or attributes?
Or are you wanting to generate the new objects?
When you say column lines are you talking a 'Column Grid' or 'table object' or 'text object', vertical lined of text?
Do you want to add the letters to an existing entity?
Can you post a sample drawing?


Too many options & directions! :-o
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Column Numbering Tool
« Reply #7 on: December 22, 2005, 08:42:40 AM »
Or I could send you my collection of "Increment Text" lisp routines.
About 8 to 10 routines I have collected, some with DCL front ends.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

whdjr

  • Guest
Re: Column Numbering Tool
« Reply #8 on: December 22, 2005, 08:47:44 AM »
Sorry CAB, didn't mean to sound ungrateful.  I just so tired and irritable right now and it's only 8:40 in the morning.

Ok, I attached the column attribute that I made to use at the end of each column line.  The column lines are already in place but not the attributes.  I just wanted something that as I selected them it would re-number them using a letter/letter or letter/number combination.  I would given the starting letter and/or number in the beginning of the routine.

Clear? or still mud?




EDIT RE-ADDED THE ATTACHMENT

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Column Numbering Tool
« Reply #9 on: December 22, 2005, 09:39:52 AM »
I did not down load your dwg but through this togather, hope it works. 8-)


Code: [Select]
;;  12/21/2005  CAB modified for Will to use....


(defun add-str (str / char ltr res)
  (and (not (eq str ""))
       (setq char
       (ascii
  (setq ltr (chr (1+ (ascii (substr str (strlen str))))))))
       (setq res (strcat (substr str 1 (1- (strlen str)))
    (cond
      ((> char 90) "A")
      ((< char 65) "Z")
      (t ltr)))))
  res)



;;  Room Number Update by CAB 03/21/2005
;;  Update selected blocks with attribute "ROOM#"
;;  with user entered room number
;;  NOTE: Very little error checking
;;
;;   Modified a subroutine by Jeff Mishler 1/11/05
;;
(defun c:attradd (/ rm# attname ss count blk atts2 att2 att1 bc)
  (vl-load-com)

  (setq rm# (getstring t "\nEnter the Increment Start value: ")
        attname "RM#"  ; uppercase only  ;;  <-------<<< 
        bc 0) ; block counter

  (prompt "\n***  Select blocks to change in the correct order.  ***")
  ;;  get only blocks with attributes
  (if (and rm#
           (not (eq rm# ""))
           (setq ss (ssget (list '(0 . "INSERT") '(66 . 1))))
      )
    (progn
      (setq count -1)
      (while (< (setq count (1+ count)) (sslength ss))
        (setq blk   (vlax-ename->vla-object (ssname ss count))
              atts2 (vlax-invoke blk "getattributes")
        )
        (foreach att2 atts2
          (if t ; (= attname (vla-get-tagstring att2))
            (progn
              (vla-put-textstring att2 rm#)
              (vla-update att2)
              (vla-update blk)
              (setq bc (1+ bc))
              (setq rm# (add-str rm#))
            )
          )
        )
      )
      (prompt (strcat "\n-=< " (itoa bc) " blocked updated  >=-"))
    ) ; progn
    (prompt "\n---  No blocks Updated  ---")
  ) ; endif
  (princ)
) ; defun
(prompt "\nAttribute Update Loaded, Enter AttrAdd to run.")
(princ)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Column Numbering Tool
« Reply #10 on: December 22, 2005, 09:42:08 AM »
Here is on one that Jeff M wrote....doesn't do the AA,AB,AC....but will do the A1,A2,A3.

Code: [Select]
(defun c:nd (/ ent entlist newnext newnum newpre next)

  (if (not *latnum*)
    (setq *latnum* 1)
  )
  (if (not *latpre*)
    (setq *latpre* "A")
  )
  (setq newpre (getstring (strcat "\nEnter prefix (" *latpre* "): ")))
  (if (not (eq newpre ""))
    (setq *latpre* newpre)
  )
  (setq
    newnum (getint
     (strcat "\nNumber to start with (" (itoa *latnum*) "): ")
   )
  )
  (if newnum
    (setq *latnum* newnum)
  )
  (while (setq ent (car (entsel "\nSelect designator: ")))
    (setq entlist (entget ent))
    (if (and (eq (cdr (assoc 0 entlist)) "INSERT")
     (= (cdr (assoc 66 entlist)) 1)
)
      (progn
(setq next (entget (entnext ent)))
(setq
  newnext (subst (cons 1 (strcat *latpre* (itoa *latnum*)))
(assoc 1 next)
next
  )
)
(entmod newnext)
(entupd (cdr (assoc -1 newnext)))
(setq *latnum* (1+ *latnum*))
      )
    )
  )
  (princ)
)
« Last Edit: December 22, 2005, 09:47:47 AM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Column Numbering Tool
« Reply #11 on: December 22, 2005, 09:44:43 AM »
No that won't work, as you want to increment the letter prefix only, right?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

whdjr

  • Guest
Re: Column Numbering Tool
« Reply #12 on: December 22, 2005, 10:01:28 AM »
CAB,

Yours worked for the letters but not the numbers.
When the "AA" increments it goes "AA" "AB" "AC" "AD" ... but
when the "A1" increments it goes "A1" "AZ" "AA" "AB" ""AC"...
I need the number one to go "A1" "A2" "A3" "A4"...

One of these is the vertical column lines and one is the vertical lines.

Other than that it worked great.  :-)

whdjr

  • Guest
Re: Column Numbering Tool
« Reply #13 on: December 22, 2005, 10:03:59 AM »
Ron,

Your right it works for the numbers but not the letters.

Thanks,

I can just run one then the other.   :-D

whdjr

  • Guest
Re: Column Numbering Tool
« Reply #14 on: December 22, 2005, 10:13:11 AM »
CAB,

I just took out this ---  ((< char 65) "Z")   --- and now it works both ways.

Thanks,
 :-)