Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Attribute Copy

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
218 Views, 6 Replies

Attribute Copy

I need a LISP routine that will read all of the attributes and thier labels from a selected entity and insert the data into either another block with identically named attributes or another instance of the same block (or multiple blocks). I would like it if the command gave the option to either insert the data into an existing block(s) or insert a new block with the specified fields filled in, but really just need the former function.

For example, I have a table that consists of many single lines of attributed blocks and I need to take the data from that table to an updated version of the same block (with more attributes). I have other functions in mind, as well.

I'm working on developing this myself while I wait for responses, but help would be appreciated. What I'm really looking for is sections of code that I can enter to do the overall function, as I may be adding much more to this command later. What I need to do right now is:
-extract all attributes from a single selected block and save them and thier tags as local variables, being sure to keep the two linked (associative lists probably the best bet there).
-insert data into the attributes of one or more selected blocks with similar tags. Needs to overwrite anything in the tags being inserted, while leaving the data of tags the original block didn't have data for.
-possibly have the function throw back a way for the user to sift through the data to pick and choose what to and not to insert.
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

Have you looked at BATTMAN? Seems like that does what you want.
Message 3 of 7
Anonymous
in reply to: Anonymous

Looking to kindof redefine it... Like I said, I've got other uses. This is the basis for a more complex routine I'm trying to make. It's too hard to explain the whole thing, as I'm uncertain how I'm going to approach it quite yet - so I just asked for the part I'm having trouble with at the moment.

My problem is actually that I don't know how to get LISP to work with attribute data. It's not showing up with entget, so I've no clue how to get to it.
Message 4 of 7
Anonymous
in reply to: Anonymous

Here is a routine to manually update a block's attributes to match another.
To access the attributes you need to use the entnext function to step
through the ATTRIB enties that are placed in the drawing after a block is
inserted.
Message 5 of 7
Anonymous
in reply to: Anonymous

Ah! Perfect! Hope you don't mind if I reverse engineer it a bit...

Strange. I guess I'll have to play with that a bit to get used to pulling out attributes - I've got a LOT more of this to do.

Thanks much!
Message 6 of 7
Anonymous
in reply to: Anonymous

Alright, came by something I don't understand. What is the purpose of this line?

(handent vHandle)
Message 7 of 7
Anonymous
in reply to: Anonymous

Ohhhhhhh. Nevermind, I figured it out. Self defined arguement type. Right.

I've never defined functions within a LISP, instead preferring to simply write out the whole thing under the main program... that way it's right there in front of you. Might be a good idea to do it this way for this thing, though.... I may have to use the same function repeatedly within the overall command.

Wewt for stupid questions! Thanks again, haha...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost