Disabling DROPGEOM

Kyudos
Collaborator

Disabling DROPGEOM

Kyudos
Collaborator
Collaborator

EDIT: For convenience I'm just adding the latest builds to this first post 🙂

 

********

I've found that dealing with OLEDRAGDROP / DROPGEOM as well as grip editing makes the handling for my custom objects unnecessarily complicated.

 

Hence I'm posting my solution to disabling this function for my objects, I don't know if its the best way, but it works.

 

In your AcApDocManagerReactor::documentLockModeChanged handler you can use something like this:

 

if (_tcsicmp(pGlobalCmdName, _T("OLEDRAGDROP")) == 0 || 
_tcsicmp(pGlobalCmdName, _T("DROPGEOM")) == 0 ||
_tcsicmp(pGlobalCmdName, _T("DRAGENTER")) == 0)
{
    // Prevent objects from being dragged
    for (int i = 0; i < aLastSelectionArray.length(); i++)
    {
        AcDbObjectId objId = aLastSelectionArray[i];
	MyObject* pObj = IsMyObject(objId);

        if (pObj != NULL)
        {
            this->veto();
            break;
        }
    }
}

 

Reply
Accepted solutions (3)
18,823 Views
63 Replies
Replies (63)

Kyudos
Collaborator
Collaborator
Accepted solution

@Anonymous 

 

Due to requests I've rebuilt this for ACAD 2020, including both disabling methods:

 

DISABLEDD : disable drag and drop
ENABLEDD : enable drag and drop
ENABLEDO : enable drag override
DISABLEDO : disable drag override

 

Enjoy!

Anonymous
Not applicable

Never have I been so happy to see the "action denied" mouse icon. Thanks so much for this.

 

Regards,

 

Tom

troma
Mentor
Mentor

@Kyudos wrote:

Well, if you aren't interested in how the code works, you can simply load up one of the included ARX files and use the commands to enable or disable drag and drop as you like.


@Kyudos 

Very well for you to say "simply load up the file".

Not so simple for some of us! 😁 I've had this in the back of my head for four years, wondering how I could get it loaded.

Here's what worked for me, in case I can help anyone else here.

 

I downloaded and unzipped your file. I finally found two files with .arx extension; one in the Debug_Acad folder and one in the Release_Acad folder. I have no idea why there are two versions of this .arx file or why there are so many other random files in the parent directory.

I used the Appload command and selected the .arx file in the Release_Acad folder.

When that loaded, I typed the DISABLEDD command and tested it. Bingo it worked! You're a genius and I will be forever grateful!

 

This is working for me in Civil 3D 2019.

 

Next I am going to test what happens if I move the .arx file out of the location with all the other random stuff to a network drive to share with my coworkers. Then I will add it in to the startup suite.


Mark Green

Working on Civil 3D in Canada

Kyudos
Collaborator
Collaborator

The 'random' files are the code and solution files needed to build the ARX files you found from scratch. This is the ObjectARX forum after all! But indeed, the only file you 'need'' for this is the ARX - and I'd say if that is all you are after, use the release version, rather than the debug one. The rest is just for code-monkeys like me 🙂

Anonymous
Not applicable

@Kyudos wrote:

The 'random' files are the code and solution files needed to build the ARX files you found from scratch. This is the ObjectARX forum after all! But indeed, the only file you 'need'' for this is the ARX - and I'd say if that is all you are after, use the release version, rather than the debug one. The rest is just for code-monkeys like me 🙂


I've been searching for a solution to this issue for months, and just as I find this thread, I realize that I just upgraded to 2021, rendering your arx outdated. Would you mind explaining how to update this file for new releases? I have a feeling that yours will remain the only solution for a long time and perhaps that info will save you a bit of headache in the years to come. 

0 Likes

Kyudos
Collaborator
Collaborator

Assuming nothing related to the calls / methods I've used has changed internally, you would just need to rebuild the ARX against the 2021 ObjectARX SDK.

 

If that makes sense to you, it's a very quick and easy job. If it sounds like gobbledegook...not so much! (i.e., I don't know how much help you need 🙂 )

Anonymous
Not applicable

I've never worked with ARX files beyond loading a few. I would need some direction on how to rebuild the file. 

 

I found this article for creating an ARX app from scratch, but I'm not sure which steps would be necessary/ relevant to rebuilding an existing file. I assume I need Visual Studio and the ARX SDK, but I'm not sure where to go from there. 

https://www.digitalcoastsoftware.com/how-to-create-an-arx-app-simple-step-by-step/2018/6/29/how-to-c...

 

If you know of a more relevant tutorial, that would get me pointed in the right direction. 

 

Thank you.

0 Likes

moogalm
Autodesk Support
Autodesk Support

@Anonymous wrote:

I've never worked with ARX files beyond loading a few. I would need some direction on how to rebuild the file. 

 

I found this article for creating an ARX app from scratch, but I'm not sure which steps would be necessary/ relevant to rebuilding an existing file. I assume I need Visual Studio and the ARX SDK, but I'm not sure where to go from there. 

https://www.digitalcoastsoftware.com/how-to-create-an-arx-app-simple-step-by-step/2018/6/29/how-to-create-an-arx-app-step-by-step

 

If you know of a more relevant tutorial, that would get me pointed in the right direction. 

 

Thank you.


Go through - 
https://www.youtube.com/watch?v=bTgmsp38kQc

 

Kyudos
Collaborator
Collaborator
Accepted solution

Well, since I'll have to get 2021 sorted soon anyway, I decided to just bite the bullet and rebuild this.

 

Find the 2021 version attached.

 

Acquiring and setting up Visual Studio and the SDKs etc. is a lot of effort and hardly worth it if you aren't a developer or a very keen tinkerer (but don't let me discourage you, if you're interested!)

 

Enjoy!

Anonymous
Not applicable

Awesome, this is much appreciated. I was weighing whether or not I could get away with a 20+ GB download on a work computer haha. I still might download Visual Studio at home to push my boundaries, but I'm glad it can be at my leisure now. 

 

Thanks again  👍🏻

0 Likes

codee
Advocate
Advocate

I would also love this in 2020

0 Likes

Kyudos
Collaborator
Collaborator

See message 21 in the thread for 2020 version

 

( Here! )

 

🙂

0 Likes

mzarchtech
Participant
Participant

Hi Kyudos, any chance of a 2013 compatible version?

0 Likes

Kyudos
Collaborator
Collaborator
Accepted solution

Well...I can build it, but I can't test it 🙂

 

Hope it works.

 

 

mzarchtech
Participant
Participant

It works perfectly! Awesome! Thanks so much.

Autodesk should have implemented something like this from day 1: a dropgeom toggle, like we can toggle osnaps ortho, selection cycling, etc.

0 Likes

Major_CAD
Explorer
Explorer
Thank you so much!
Absolutely life saver!

You are a HERO! 😉

shelmer
Enthusiast
Enthusiast

Hi, Thanks for this.  We had a surface in Civil 3D that was accidentally moved with DROPGEOM today.  I may look to incorporate this as a preventative measure.  I have Sincpac, and it gives me a warning if DROPGEOM is run, but prevention is even better.  

0 Likes

aeichnerMBLN5
Contributor
Contributor

You are a hero. Autodesk should invest in a subscription to you 🙂 it would be the best decision they have made since 2010.

Kyudos
Collaborator
Collaborator

Hey AutoDesk guys - this is a perennially popular post....just sayin'...🤔

Kyudos
Collaborator
Collaborator

Just in case anyone wants/needs an updated version...