Questions about dropping blocks.

Questions about dropping blocks.

Anonymous
Not applicable
313 Views
3 Replies
Message 1 of 4

Questions about dropping blocks.

Anonymous
Not applicable
Hi Gang,
I'm just looking for some guidance on where to start my research.

What I want to do is to do a drag and drop from a tool palette into my
current drawing.

If these were traditional style:
I would have the symbols on a menu.
When a user picks the item off the menu, I run my cutesy lisp routine that
would insert the object, break my line I put it on, and then fill out the
attributes and then stop.

So, question is, what do I do to capture the drop of the drag and drop?

I looked at the Bolt Sample in the directories. One thing, the new wizards
don't generate the same code and I couldn't reproduce the steps it took to
generate the wrapper classes. Too many things just didn't jive with the
code. (What I was doing was to try to generate my own sample, instead of
doing a bolt, I was doing a simple box. 4 sides, able to change the length
of one side and the box would change. You know, a simple "I can reproduce
this" kind of attack).

Any ideas on where to start?

Nick
0 Likes
314 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
I haven't looked at the sample that you're talking about, but i do a lot of
drag and drop stuff with AutoCAD. The first thing to do is to create a
COleDropTarget derived class. An instance of this class will be registered
with AutoCAD by calling acedAddDropTarget( ). Don't forget to remove the
target before your app shuts down - acedRemoveDropTarget.

You'll want to override the virtual functions OnDrop, OnDropEx, OnDragEnter,
OnDragOver, OnDragLeave.

As to how to do the actual processing - that's up to you. I often use XML
to represent the item being dragged. So when i detect that a drag operation
has started, i assemble a short XML with the symbol name or whatever i need.
Use that string with a COleDataSource to begin the drag (if you're
unfamiliar with how to do that, i could point you in the right direction).

Let me know if that's what you're looking for...

-Rich


"Nick Jacobs" wrote in message
news:4901197@discussion.autodesk.com...
Hi Gang,
I'm just looking for some guidance on where to start my research.

What I want to do is to do a drag and drop from a tool palette into my
current drawing.

If these were traditional style:
I would have the symbols on a menu.
When a user picks the item off the menu, I run my cutesy lisp routine that
would insert the object, break my line I put it on, and then fill out the
attributes and then stop.

So, question is, what do I do to capture the drop of the drag and drop?

I looked at the Bolt Sample in the directories. One thing, the new wizards
don't generate the same code and I couldn't reproduce the steps it took to
generate the wrapper classes. Too many things just didn't jive with the
code. (What I was doing was to try to generate my own sample, instead of
doing a bolt, I was doing a simple box. 4 sides, able to change the length
of one side and the box would change. You know, a simple "I can reproduce
this" kind of attack).

Any ideas on where to start?

Nick
0 Likes
Message 3 of 4

Anonymous
Not applicable
Rich,
Thanks for the pointers. That's a start... I'm coming from mostly an ads
background so some of this is VERY new to me.

I could use any pointers you might like to pass along.

Thanks for the help!
Nick

P.S. I'll start looking into the docs right now for the DropTarget class
and it's features.

"Justavian" wrote in message
news:4903323@discussion.autodesk.com...
I haven't looked at the sample that you're talking about, but i do a lot of
drag and drop stuff with AutoCAD. The first thing to do is to create a
COleDropTarget derived class. An instance of this class will be registered
with AutoCAD by calling acedAddDropTarget( ). Don't forget to remove the
target before your app shuts down - acedRemoveDropTarget.

You'll want to override the virtual functions OnDrop, OnDropEx, OnDragEnter,
OnDragOver, OnDragLeave.

As to how to do the actual processing - that's up to you. I often use XML
to represent the item being dragged. So when i detect that a drag operation
has started, i assemble a short XML with the symbol name or whatever i need.
Use that string with a COleDataSource to begin the drag (if you're
unfamiliar with how to do that, i could point you in the right direction).

Let me know if that's what you're looking for...

-Rich


"Nick Jacobs" wrote in message
news:4901197@discussion.autodesk.com...
Hi Gang,
I'm just looking for some guidance on where to start my research.

What I want to do is to do a drag and drop from a tool palette into my
current drawing.

If these were traditional style:
I would have the symbols on a menu.
When a user picks the item off the menu, I run my cutesy lisp routine that
would insert the object, break my line I put it on, and then fill out the
attributes and then stop.

So, question is, what do I do to capture the drop of the drag and drop?

I looked at the Bolt Sample in the directories. One thing, the new wizards
don't generate the same code and I couldn't reproduce the steps it took to
generate the wrapper classes. Too many things just didn't jive with the
code. (What I was doing was to try to generate my own sample, instead of
doing a bolt, I was doing a simple box. 4 sides, able to change the length
of one side and the box would change. You know, a simple "I can reproduce
this" kind of attack).

Any ideas on where to start?

Nick
0 Likes
Message 4 of 4

Anonymous
Not applicable
Keep in mind that COleDropTarget is not an ObjectARX class - you can find
info in microsoft's msdn library. Should be the first entry if you just
google COleDropTarget...

-Rich




"Nick Jacobs" wrote in message
news:4903381@discussion.autodesk.com...
Rich,
Thanks for the pointers. That's a start... I'm coming from mostly an ads
background so some of this is VERY new to me.

I could use any pointers you might like to pass along.

Thanks for the help!
Nick

P.S. I'll start looking into the docs right now for the DropTarget class
and it's features.

"Justavian" wrote in message
news:4903323@discussion.autodesk.com...
I haven't looked at the sample that you're talking about, but i do a lot of
drag and drop stuff with AutoCAD. The first thing to do is to create a
COleDropTarget derived class. An instance of this class will be registered
with AutoCAD by calling acedAddDropTarget( ). Don't forget to remove the
target before your app shuts down - acedRemoveDropTarget.

You'll want to override the virtual functions OnDrop, OnDropEx, OnDragEnter,
OnDragOver, OnDragLeave.

As to how to do the actual processing - that's up to you. I often use XML
to represent the item being dragged. So when i detect that a drag operation
has started, i assemble a short XML with the symbol name or whatever i need.
Use that string with a COleDataSource to begin the drag (if you're
unfamiliar with how to do that, i could point you in the right direction).

Let me know if that's what you're looking for...

-Rich


"Nick Jacobs" wrote in message
news:4901197@discussion.autodesk.com...
Hi Gang,
I'm just looking for some guidance on where to start my research.

What I want to do is to do a drag and drop from a tool palette into my
current drawing.

If these were traditional style:
I would have the symbols on a menu.
When a user picks the item off the menu, I run my cutesy lisp routine that
would insert the object, break my line I put it on, and then fill out the
attributes and then stop.

So, question is, what do I do to capture the drop of the drag and drop?

I looked at the Bolt Sample in the directories. One thing, the new wizards
don't generate the same code and I couldn't reproduce the steps it took to
generate the wrapper classes. Too many things just didn't jive with the
code. (What I was doing was to try to generate my own sample, instead of
doing a bolt, I was doing a simple box. 4 sides, able to change the length
of one side and the box would change. You know, a simple "I can reproduce
this" kind of attack).

Any ideas on where to start?

Nick
0 Likes