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

Basic move or copy command with drag

24 REPLIES 24
Reply
Message 1 of 25
jeroen_verdonschot
4858 Views, 24 Replies

Basic move or copy command with drag

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

 

 

24 REPLIES 24
Message 21 of 25
Irvin
in reply to: fieldguy

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

 

Message 22 of 25
norman.yuan
in reply to: Irvin

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

 

Message 23 of 25
Irvin
in reply to: Irvin

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

Message 24 of 25
norman.yuan
in reply to: Irvin

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.

 

Message 25 of 25
BillZndl
in reply to: norman.yuan

Norman,

This is great stuff!

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

You are a true wizard. :^)

 

Thanks!

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