Reference the largest variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
On the left of my sample title block, you can see that I have 3 revisions and they are numbered 1, 2 and 3. On the right side of my drawing title block, I have an area that lists the current revision number. I have about 20k+ drawings and about half of the bottom right "##" revision number areas are blank or outdated. Is there a way that I can reference the largest revision number on the left to automatically update the area on the right? OR... since I also have a spreadsheet with the most updated revision numbers, could I possibly search my drawings to see if that REV area of my drawing is blank, and if that area IS blank, then insert the revision number as text from my spreadsheet? Ideally some sort of script since I have so many files to update would be best.
I can currently see my revisions but I'm unsure how to reference the "max" or highest revision number in my list. The script I'm using to view my revisions is:
(defun C:JSREV (/ blkss ent foundit att maximum); = block REV's Attributes
(vl-load-com)
(if (setq blkss (ssget "_X" '((2 . "PGREV401,PGREV301,PGREV003,PGREVD,PGREV006,PGREV008,PGREV202,PGREV203,PGREV302,PGREV303"))))
(progn ; then
(prompt "\nComments:")
(repeat (sslength blkss)
(setq ent (ssname blkss 0))
(while
(and
(not foundit)
(setq ent (entnext ent))
(= (cdr (assoc 0 (entget ent))) "ATTRIB")
); end and
(setq att (vlax-ename->vla-object ent))
(IF (=(vla-get-TagString att) "REVNO")
(progn
(setq foundit T)
(prompt (strcat "\n" (vla-get-TextString att)))
); progn
); IF
); while
(setq foundit nil)
(ssdel (ssname blkss 0) blkss)
); repeat
); progn
); if
(princ)
); defun
I know I have a mess with different title blocks amongst my 20k+ files, but for right now I just want to get one thing working at a time. We have 40 years of drawings and everyone had their own ideas on how to do them and I've been tasked with getting them back in order so any suggestions or recommendations are appreciated. Hopefully this all makes sense.