.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Clearing Xrecord from Copied Block

3 REPLIES 3
Reply
Message 1 of 4
kwarmington
324 Views, 3 Replies

Clearing Xrecord from Copied Block

If one of more blocks are copied, I want to be able to clear all Xrecord data in the copied blocks. Can anyone shed some light on where I should start?

I have looked at the CommandWillStart Event Handler to monitor for the Paste Command, but haven't been able to figure out how to access the blocks that have been pasted? I have also looked at the ObjectAppended Database Event Handler but haven't had any luck in accessing the block.

Can anyone point me in the right direction?

Thanks,

Kate
3 REPLIES 3
Message 2 of 4
NathTay
in reply to: kwarmington

These are the steps I use.

1. Create global variable as ObjectIdCollection
2. In CommandWillStart Event Handler if command name is a command that can result in copies being produced instantiate the global variable.
3. In ObjectAppended Event Handler check "CMDNAMES" system variable if command is same as checked for in Step 2 add objects to global variable.
4. In CommandCancelled or CommandEnded Event Handlers if it is the relevant command process the global variable and then set it to nothing.
Message 3 of 4
kwarmington
in reply to: kwarmington

Cheers for that. Those steps worked brilliantly.
Message 4 of 4
arcticad
in reply to: kwarmington

One Issue I have run into.

If your drawing is modified out side of your control and your program isn't running.

I store the handle of the object with the data, then later on I can tell if it is a copy or the original.

If the handles don't match then it's a copy.
---------------------------



(defun botsbuildbots() (botsbuildbots))

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost