Author Topic: Attribute tags name that change from sheet to sheet.  (Read 1062 times)

0 Members and 1 Guest are viewing this topic.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Attribute tags name that change from sheet to sheet.
« on: March 06, 2013, 11:10:30 AM »
I have revision block to update with the next issue for more than a hundred drawings.  My problem is that some sheets were issued previously more than others and thus this this will have different revision number for each sheet.  (whatever letter is next in line).  IN reviewing all the lisp that edit attributes I did not see any that jump out as the ticket.  And since this set has to be issued this Friday, I am ready to start filling them out manually.   :cry:

So I wondering if any you know of something that is already created that I did not find or realize would work.  Of something that is good starting point because we have going to have more revisions.

What I need it to do.
  • After block selection it has step thru all the attributes and cull out the attributes that are empty.
  • Then sort the empty attributes by the tag-name and then cull out the attributes that are next in line.
  • And then fill in those next-in-line attributes with the user or hard coded data

I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Attribute tags name that change from sheet to sheet.
« Reply #1 on: March 06, 2013, 11:58:16 AM »
what i would do would be grab the rev block and check the value that is there.  convert that letter to the ascii #, +1 and put in the new one
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Attribute tags name that change from sheet to sheet.
« Reply #2 on: March 06, 2013, 06:01:39 PM »
Will skip revision letters I, O and Q.  Works with number strings also.

I have one for up'ing revisions, but it is specific to a company title block.  Not an easy thing to change if you did not write the code, sorry.
Code: [Select]
(defun UpRevisionString (String / tmpPos tmpStr tmpStr2 tmpStr3 EndStr tmpAddValue)
    ; Update to the new revision. A->B, Z->AA, AZ->BA, AZA->AZB
   
    (setq tmpPos (strlen String))
    (while (and (/= tmpPos 0) (= (setq tmpStr (substr String tmpPos 1)) "Z"))
        (setq tmpPos (1- tmpPos))
        (if tmpStr2
            (setq tmpStr2 (strcat "A" tmpStr2))
            (setq tmpStr2 "A")
        )
    )
    (if (= tmpPos 0)
        (repeat (1+ (strlen String))
            (if EndStr
                (setq EndStr (strcat EndStr "A"))
                (setq EndStr "A")
            )
        )
        (progn
            (setq tmpStr3 (substr String 1 (1- tmpPOs)))
            (if (or (= tmpStr "H") (= tmpStr "N") (= tmpStr "P"))
                (setq tmpAddValue 2)
                (setq tmpAddValue 1)
            )
            (setq tmpStr (chr (+ tmpAddValue (ascii tmpStr))))
        )
    )
    (cond
        (EndStr
            EndStr
        )
        ((and tmpStr tmpStr2 tmpStr3)
            (strcat tmpStr3 tmpStr tmpStr2)
        )
        ((and tmpStr tmpStr3)
            (strcat tmpStr3 tmpStr)
        )
    )
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.