So your process is:
- Select Block
- Get rotation, insert point, block name
- Explode Block
- Edit 'Block' Entities
- Purge Existing Block
- Make block with old and edited entities
- Rename Block to old block name
That is all possible but trying to work out if there is a more efficient way. if you can make a list of the process then an internet search is your friend, you just need to plug it all together:
First LISP
- Get the ID of the last entity to be edited (for later)
- Select Block (use entsel and a check that it is a block the was selected)
- Get block insertion data
- Explode Block (use command 'explode'). End this LISP here
- Edit Block Entities
New Lisp Here
- Purge Existing Block (search for purge, or (command "Purge....) )
- Make block with old and edited entities (loop backwards with 'entlast' or similar to the last edited object from step 1 till you have done all the block objects added to a selection set)
- Create block (internet search is your friend)
- Rename Block to old block name (internet search is your friend as well)
- Paste the block back in again using the data taken from above
This will work if there is only 1 instance of the block in the drawing of course. Multiple instances you would have to ssget by block name to make a list of all the insertion points and rotations for insertion in the last stage, then delete all the existing blocks before the purge.
Not a simple one but possible... however I think edit the block instead of remaking it will be a lot simpler if that is possible. Full of problems and potential for errors though.
Should get your nearly there.