The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 AutoCAD
 Lisp & Other Handy Files
 Copy attribute text in block to another attribute
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jjb299
New Member



USA
8 Posts

Posted - June 25 2014 :  2:20:14 PM  Show Profile  Reply with Quote
Has anyone come up with a LISP to copy attribute text in a block to another attribute in the same block? What I'm looking for goes something like this:
1. Block name?
2. FROM attribute tag? (text to be copied)
3. TO attribute tag? (insert copied text)
Maybe it could be called COPYCAT.lsp? (get it? copy ATT?)

That's all. Any code geniuses (geniui? lol) out there who can conquer this? Thanks guys. Love the program by the way.
-Justin

Admin
Administrator



652 Posts

Posted - June 25 2014 :  2:34:38 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Maybe this... http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Copy-attribute-from-one-tag-to-another-tag-within-same-block/td-p/4550807 might help?

I haven't read all the way through it, but seems to be a good starting point with lots of lisp examples...

Please advise!

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

jjb299
New Member



USA
8 Posts

Posted - June 25 2014 :  5:13:27 PM  Show Profile  Reply with Quote
Thanks for the lead. That link doesn't do exactly what I want. However, with more Google Engineering, I found a LISP someone posted on a forum. I've attached it to this post. This LISP works great, but it relies on screen clicks. I want to use this in a script, so I need command line prompts.
Like in my first post, I want the command line prompts to go:
1. Block name
2. FROM attribute tag
3. TO attribute tag

I'm working on trying to reverse engineer this to make that work for command lines. Let me know if someone beats me to it.

Download Attachment: CopyAttributes.txt
2.7 KB
Go to Top of Page

Admin
Administrator



652 Posts

Posted - June 26 2014 :  08:49:56 AM  Show Profile  Visit Admin's Homepage  Reply with Quote
Take a look inside the Hurricane/Lisp folder. All the lisps in there that are "command line only" types. No screen clicks. So you can use portions of those to modify your lisp.

I'm thinking you could even get most of what you need from the TB_WIZ1.LSP in that directory.

Cheers!

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

jjb299
New Member



USA
8 Posts

Posted - June 26 2014 :  4:19:23 PM  Show Profile  Reply with Quote
Thanks admin. I found the tbwiz file very useful. I've managed to get a file together that should be working, but isn't. I've attached a copy of my code in TXT form. Where am I going wrong? Thanks.

Download Attachment: COPYCAT.txt
5.27 KB
Go to Top of Page

jjb299
New Member



USA
8 Posts

Posted - June 27 2014 :  11:16:03 AM  Show Profile  Reply with Quote
Got it!
Attached are 2 files. COPYCAT will search for the first block it comes to that matches and copy one attribute to another. COPYCAT2 will find all blocks that match the name and copy the attribute to another. The first one is useful for something like a titleblock that should only be in a drawing once. The second one is useful for blocks that span across model and layouts.


Download Attachment: COPYCAT.txt
1.66 KB

Download Attachment: COPYCAT2.txt
1.68 KB
Go to Top of Page

jjb299
New Member



USA
8 Posts

Posted - June 27 2014 :  11:23:34 AM  Show Profile  Reply with Quote
oops. forgot to give credit to the amazing people who helped.
Thanks to "mid-awe" over at ACAD forums, Lee Mac at lee-mac.com, and admin at hurricane.
Go to Top of Page

Admin
Administrator



652 Posts

Posted - June 27 2014 :  11:32:44 AM  Show Profile  Visit Admin's Homepage  Reply with Quote
Good stuff!!

Glad it got sorted out!

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.22 seconds. Snitz Forums 2000