Determine an object/block were copied/moved

Determine an object/block were copied/moved

kinakira2013
Advocate Advocate
486 Views
3 Replies
Message 1 of 4

Determine an object/block were copied/moved

kinakira2013
Advocate
Advocate

Hi,

Are there any ways to check a block object is copied/moved to a new position from the initial position?

 

position.png

 

Thanks for your help!

0 Likes
487 Views
3 Replies
Replies (3)
Message 2 of 4

_gile
Consultant
Consultant

Hi,

For the objects you want to monitor, you can register the Copied and Modified events.

Have a look at this topic for Object Events.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 4

dgorsman
Consultant
Consultant

You could attach XDATA to it.  There's several DXF data types which support different coordinate manipulations, one of which is static i.e. the values are not changed when the entity is moved, rotated, or scaled.  Although there isn't a type for xrecords which behaves the same way, it's not that hard to simply add an extension dictionary and xrecord containing the original coordinates and other properties.

 

That only handles the basic transforms though, not creating copies.  The only way I can think to handle that is with the event handlers mentioned.

 

If I may ask, what's the end game/purpose for this?

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 4 of 4

kinakira2013
Advocate
Advocate

Thank you for your advice, _gile & dgorsman!

My purpose is that I will modify that block (if it is the initial block) and will create a new block (if it is copied/moved to another position)

0 Likes