PDA

View Full Version : Need some guidance with transferring attribute data


sumulong
2007-03-08, 07:34 PM
Need help on a problem that I need automated. Unfortunately, I have no clue on how to do it let alone which way, lisps or VBA. So here's the obstacle.

My title block has 10 rows of revision history, each row having 6 columns. Rev number, description, drafter, date drafted, approver and date approved. All are attributed. Some columns have multiple lines. The description has 3 lines, an option to have a 1 line description, left centered and the other option is a 2 liner, left justified stacked, just in case it doesn't fit the single line option. The drafter and approver column also has 3 lines, 1 option, centered, is to have the drafter's initial only. The 2nd option, center justified stacked, is to have the requester and drafter's initial. Same goes w/ the approver column but instead of the requester and drafter's initials for the stacked option, it's the first and last name of the approver. Each attribute has a unique tag of course.

So, each row has 12 attributes multiply that by 10 and you have 120 lines of attributes. The problem that sparked all this is that we have a mandate to keep the history of the revisions and move the rows only 1 at a time so we can insert the new revision. So we have to retype each line of revision to accommodate for the 1 new revision line. Fortunately if there's a number of years in between revisions, we can discard the older lines.

Here's what I was hoping to get done. Of course, automate the process by moving each line's data, "1 up" for a lack of a better description. For ex. (move attribute data in C1 - C12 to B1 - B12). In the process, you'll be asked from which line, 2 thru 10, do you want to move. For ex, I want to move all the data starting from line 7 then you click ok and it does it. Essentially, the first line would be reserved for a default note for previous revisions that's why I only indicated lines 2 thru 10.

Do I use lisps or VBA or something else? Is this fairly easy to figure out or do we need to hire someone for this type of programming? Has someone ask for something similar that I can just tweak?

Please advise. Hopefully something similar already exist somewhere.

Thanks!

kennet.sjoberg
2007-03-08, 10:04 PM
Here is how I do.
My tile block has only the revision letter attribute ( and a couple of more of course ).
When a revision letter is added/increased, I push an "update revision" button and a lisp program calculate where to insert an empty revison_line_block with empty attributes ( depending on drawing frame and title block size, and number of previous inserted revison_line_blocks ).
Then we add the revision text in the new empty revision block and press a "save revision" button, a text file (with same name as the drawing ) is created/updated with the new ( and old ) revision text.
When the "update revision" button is pressed all revision blocks are erased and purged, ( yes if graphical changes )
then the lisp program recreate the revision history with blocks and text from the text file.
The lisp program also push the "first" revision line "over the edge" if there is more than six revision lines.

So my answer is yes, you can do it with lisp and it will definitely be more easy than the way I do it.
just read the attributes to a list (you know the tag names ) and rewrite them to the new position / tag names.
If you are unfamiliar with lisp . . .we are not, upload your titleblock and let someone help you.

: ) Happy Computing !

kennet

sumulong
2007-03-08, 10:56 PM
Great. If someone want so take a shot at it, i'm attaching a copy of the border. I guess there's going to some research on my part since it can be done.

kennet.sjoberg
2007-03-09, 12:40 AM
Great. If someone want so take a shot at it, i'm attaching a copy of the border. I guess there's going to some research on my part since it can be done.
Sure, this is my suggestion to a flowchart

1. ssget the block ( I need the block name that you use not "test border.dwg" )
2. iterate trough the block
3. let a cond statement create a list with 120 id pair
4. skip all items in number 10 ( ? or 1 ) in the revision list
5. rewrite the list to the attributes, number 1 ( or 10 ? ) is left empty
6. smile

: ) Happy Computing !

kennet


( The code to write the list with all attributes and contents is done )

T.Willey
2007-03-09, 12:40 AM
What you want isn't to hard. I have done one for my company. What do you need help with, as eventhough it isn't to hard to write, I don't think people here will give you a whole routine (maybe they will though)? I'm willing to help if you are willing to learn.

sumulong
2007-03-09, 01:02 AM
The actual filename is 100G13BDRE.

sumulong
2007-03-09, 01:25 AM
My knowledge on writing routines is pretty much a bust. I'm actually just starting to dabble into it. We've got a handful of routines here which I actually got from these forums and all I pretty much do if i want to do something to a number of drawings is change the commands w/in the existing routine to make it work for my purpose.

As far as learning, it's just another thing that I can put under my belt, if you have any suggestions on books that I can read, i'd be more than happy to read them. I always get lost in those ssget, write-line, scrat, scrfile and all the quotes and parenthesis that's all over the routine. I actually just found out that having ;;; before a line makes the routine jump to then next line.

Now that I know a lisp would be able to do this then I can focus on learning that first to make my life as well as my collegues a little easier. If this routine is not for the beginners then I would just hire someone to write scripts all day since we need a number of them anyhow.

T.Willey
2007-03-09, 06:06 PM
It could be easy, or you could add more items to it, so then it is hard. The bare bone routine could be written pretty easy. The bare bones one I would do is.

I would use an 'ssget' to select the title block (this way you don't need the user to select it)
I would make a list of all the revision attributes, and then add the new revision information to the list.
Then I would just replace all the information for all the revisions.
And then your done.

The hard part is getting the revision information. The easy way is to prompt for it. The harder way is to use a dcl to get it.

Another thing is how do you label revisions? Is it by number? or letters? If letters do you skip any? We skip 'I' 'O' and 'Q', so I had to add that logic to the code, if numbers then it is easier.

peter
2007-03-10, 03:07 PM
Try This Routine,

Place the file in your search path somewhere.

Type (load "bumpatts") at the command line

Type bumpatts at the command line

Peter

kennet.sjoberg
2007-03-10, 05:30 PM
That was it. . . Good work Peter :beer:

sumulong, you may need to add this line of code
(vl-load-com)

and then change (cons 2 "test_border") to (cons 2 "100G13BDRE" )


: ) Happy Computing !

kennet

as I said
If you are unfamiliar with lisp . . .we are not, upload your titleblock and let someone help you. ;)

sumulong
2007-05-09, 02:02 AM
How awesome is that code! Thanks a million peter for the code. It works!

The thing that i'm trying to do w/ it now is reverse the order and leave the first line un-touched leaving the bottom left line empty instead of the top right being empty. We need to have the top right to stay the same to accommodate for the standard verbiage we use for previous revisions. Any suggestions on how we can do this.

Again, thanks everyone.

Christian