Custom copy mechanism

Custom copy mechanism

Anonymous
Not applicable
914 Views
4 Replies
Message 1 of 5

Custom copy mechanism

Anonymous
Not applicable

Hi, I need something like custom copy mechanism. It should work like that:

 

1. When a _COPYCLIP command is invoked I need to stop it.

2. Then my mechanism should be invoked

3. When a _PASTECLIP is invoked I need to stop it.

4. And call my mechanism to paste entity.

 

What's more, this should be only for my custom entities. For AutoCAD entities, Autocad copy & paste mechanism should be invoked.

 

The problem is that part of my entities are not copyable. And I don't want Autocad to copy them. I tried to return eInapplicable in subDeepClone and subwBlockClone, but it ended up in an error message. Any ideas?

0 Likes
Accepted solutions (1)
915 Views
4 Replies
Replies (4)
Message 2 of 5

owenwengerd
Advisor
Advisor
Accepted solution

You can create your own COPYCLIP and PASTECLIP commands to replace the built-in commands. If you really must prevent the built-in commands from executing you'll need to veto() them during AcApDocManagerReactor::documentLockModeChanged().

--
Owen Wengerd
ManuSoft
0 Likes
Message 3 of 5

Anonymous
Not applicable

So there is another question.

I don't have any selection set. Then start COPYCLIP. This command then let me chose entities to copy - so it creates a new selection set. Is there any way to get to this selection set and check what's in it? PickfirstModified doesn't get called in such case.

0 Likes
Message 4 of 5

nick83
Advocate
Advocate

The problem is that part of my entities are not copyable. And I don't want Autocad to copy them.

 

so, if you need to prevent coping try this:

http://adndevblog.typepad.com/autocad/2012/05/disabling-copy-command-for-certain-entities.html

 

or this:

http://adndevblog.typepad.com/autocad/2013/01/prevent-coping-of-the-entity.html

0 Likes
Message 5 of 5

Anonymous
Not applicable

Well veto command this way works. I wish it could work in commandWillStart - it would be more predictable. I accepted this as solution, because it really stopped these commands. But it occured that this is not all what makes my problems.

It's something with my application, and unfortunately I will have to solve it by myself.

0 Likes