Basic move or copy command with drag

Basic move or copy command with drag

Anonymous
Not applicable
6,520 Views
24 Replies
Message 1 of 25

Basic move or copy command with drag

Anonymous
Not applicable

Hi All,

 

I'm a newbie with vb.net but I'm very excited about the first tutorials I did.

 

To get any further with VB.net I'm trying to (re)create some autocad commands (and a own features, eventually).

 

I'm trying a move command now.A recreation of the Autocad command.

 

The selection of object works. Moving the set between two points works. The only thing thats too advanced for me is the drag posibility VB offers.

 

I looked close to the code by Kean Walmsley. http://through-the-interface.typepad.com/through_the_interface/2010/06/allowing-interactive-dragging...

But I'm a newbie and fail to translate the C# code correctly. The dragcallback is a mystery to me. 

 

Can anyone help me with a (simple) piece of code from which I can learn how the drag/jig system for selections works? Or has anyone a sample code of a command that's similar to the move or copy command so I can learn from those examples.

 

Thank you very much!!!

 

Jeroen

 

 

0 Likes
6,521 Views
24 Replies
Replies (24)
Message 21 of 25

Anonymous
Not applicable

Hi Yuan,

 

You the man!

 

But i found an glitch.

 

Create a rectangle.

Run the myarea command.

 

Click the points a in the picture.

myarea.png

 

Now let you object snap (endpoint) attach to the left uppercorner from the rectangle or click it your code will crash.

 

Hope you can fix it.

 

 

 

Irvin

 

0 Likes
Message 22 of 25

norman.yuan
Mentor
Mentor

OK, I managed a fix, not ideal, but seems working OK. Plus other fixes. I have appended the fixed code to the post:

 

http://drive-cad-with-code.blogspot.com/2011/01/mimicking-autocads-area-command-with_20.html

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 23 of 25

Anonymous
Not applicable

HI Yuan,

 

Thanks for the fix.

 

Could you please look at message 19 from this threat.

 

Hope you can fix that as well.

 

Kind regards,

 

Irvin

0 Likes
Message 24 of 25

norman.yuan
Mentor
Mentor

I just create another version of it, using Overrule, so that I can eliminate the troublesome approach of having adding/removing polyline and hatch to/from working database. It posted here:

 

http://drive-cad-with-code.blogspot.com/2011/01/mimicking-autocads-area-command-with_21.html

 

As for fixing bug in the other post, let me see if I can find some time later. Man, I spent too much time on this in the last few days. Now I can put it into rest finally.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 25 of 25

Anonymous
Not applicable

Norman,

This is great stuff!

With some modifications, I can make this work with my groups.

You are a true wizard. :^)

 

Thanks!

0 Likes