liormic Posted May 24, 2012 Share Posted May 24, 2012 Hi, I'm looking for a lisp to help me rename tags in a drawing according to another drawing. The values in the attributes should remain the same and it involves many different blocks so it can't be done manually. Thanks. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 24, 2012 Share Posted May 24, 2012 Welcome to the CADTutor Forum liormic. That sounds fun to code. Ttry this one first: -- > LM Batch Attribute Editor Quote Link to comment Share on other sites More sharing options...
liormic Posted May 24, 2012 Author Share Posted May 24, 2012 Thanks but it doesn't work. After selecting the blocks I get "Automation Error. No database" and it returns to the command prompt. I also didn't understand where exactly do I write the new tag name. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 24, 2012 Share Posted May 24, 2012 Thanks but it doesn't work.After selecting the blocks I get "Automation Error. No database" and it returns to the command prompt. I also didn't understand where exactly do I write the new tag name. My apologies liormic, I just blindly directed you to that particular lisp program. It does work on certain conditions. Perhaps look at the other codes for attributes on Lee Mac's website. LM may have an updated attribute function that deals with TAGS along If all else fails then we'll write one for you. or better yet, Quote Link to comment Share on other sites More sharing options...
liormic Posted May 24, 2012 Author Share Posted May 24, 2012 It's a great site LM has with many interesting things but I didn't find anything that deals with renaming the tag. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 25, 2012 Share Posted May 25, 2012 I see, okay tell us what do you have in mind. rename tags in a drawing according to another drawing. Will it always be that drawing as source? or it differs for one drawing to another? it involves many different blocks so it can't be done manually. Is that the source block or the target? Quote Link to comment Share on other sites More sharing options...
liormic Posted May 28, 2012 Author Share Posted May 28, 2012 The thing is that there's a drawing with a set of blocks and every once in a while I get another drawing with another set of blocks which I have to change the blocks in it so the tags would be the same every time. The values shouldn't be changed but the blocks's names, tags and layers should. I can manage changing manually the blocks's name and layers but not the tags. I think the best would be if it's possible to make some kind of a table with the block's name, layer and attribute's tags from 1 drawing to corraspond to another block's name, layer and attribute's tags from another drawing it would be the best. Thanks. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 29, 2012 Share Posted May 29, 2012 I can manage changing manually the blocks's name and layers but not the tags. The caped crusader can take care of that really. [commnad: Battman] But if you want a lips code. Give me a real time example and we'll wirte a code for that. I still don't get the "Master Drawing" factor though. make some kind of a table with the block's name, layer and attribute's tags from 1 drawing to corraspond to another block's name You may have something there with that idea . I couldve have sworn i wrote a code similar to that some time ago. Quote Link to comment Share on other sites More sharing options...
liormic Posted May 29, 2012 Author Share Posted May 29, 2012 The Battman does the job but every time I need to go and change each block according to it's tags. The "master drawing" isn't important. It's just a drawing which has the new blocks. A list of old blocks and tags Vs. new ones should do. Thanks. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 30, 2012 Share Posted May 30, 2012 The "master drawing" isn't important. It's just a drawing which has the new blocks. A list of old blocks and tags Vs. new ones should do.Thanks. Do you need a lisp routine? or are you telling us that is what you going to do? You can include the list within the lisp routine though [hardcoded], to eliminate the need to open/read an external file. Quote Link to comment Share on other sites More sharing options...
irneb Posted May 30, 2012 Share Posted May 30, 2012 I agree, a list mapping the old names to the new would be a lot easier to use. You could even add such as an Excel sheet and read from that / just a text file / hard-coded into your LSP, whatever makes you happy. If you do want to read from the "template" file, then you'd need ObjectDBX to read the blocks from that without opening it, as sample: http://www.lee-mac.com/odbxbase.html Yet even if you do this, you would simply get the new names from the template. Then you'd still need to figure out which old name needs to become which new one. Thus you'd need to ask the user every time, or ... you'd need a list. So you see: the "template" file then becomes useless, since you could simply have the list anyway. What you could do though, is to extract all the new names from the template. Then remove all the items from the list which points to "new" names not existing anymore. Then ask the user for those old names not mapped to a new one. Modify the list and save back to the file for future. That way you can edit the template and have the routine update itself with minimal user input. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 30, 2012 Share Posted May 30, 2012 (edited) Yet even if you do this, you would simply get the new names from the template. Then you'd still need to figure out which old name needs to become which new one. Thus you'd need to ask the user every time, or ... you'd need a list. So you see: the "template" file then becomes useless, since you could simply have the list anyway. ...every once in a while I get another drawing with another set of blocks which I have to change the blocks in it so the tags would be the same every time.The values shouldn't be changed but the blocks's names, tags and layers should. .... So it begs the question: Are those "another set of blocks" have the same name/tags/layers every time you received the files from the source? hard-coded or not that will complicate things if its different everytime. Edited May 30, 2012 by pBe Quote Link to comment Share on other sites More sharing options...
liormic Posted May 30, 2012 Author Share Posted May 30, 2012 I need a lisp routine. I don't know how to write one and I know that learning it will take a long long time to get to being able to write something like that. So, if possible I would appreciate it a lot. Thanks. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 30, 2012 Share Posted May 30, 2012 I need a lisp routine.I don't know how to write one and I know that learning it will take a long long time to get to being able to write something like that. Contact me through my site here, I would be happy to provide a quotation to write such an application for you. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 31, 2012 Share Posted May 31, 2012 If i were you liormic i'll take him up on his offer, your're in capable hands i tell you . BTW: where were you this past few days LM? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 31, 2012 Share Posted May 31, 2012 If i were you liormic i'll take him up on his offer, your're in capable hands i tell you . Cheers dude. BTW: where were you this past few days LM? Had a break from the programming for a while... why, you miss me? Quote Link to comment Share on other sites More sharing options...
pBe Posted June 1, 2012 Share Posted June 1, 2012 Had a break from the programming for a while... why, you miss me? We worry about Lee, just keeping tabs is all Cheers Quote Link to comment Share on other sites More sharing options...
liormic Posted June 1, 2012 Author Share Posted June 1, 2012 Contact me through my site here, I would be happy to provide a quotation to write such an application for you. Done, Thanks. Quote Link to comment Share on other sites More sharing options...
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.