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; } } }
Solved! Go to Solution.
Solved by Kyudos. Go to Solution.
Solved by Kyudos. Go to Solution.
Solved by Kyudos. Go to 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!
@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.
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
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 🙂
@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.
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 🙂 )
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.
If you know of a more relevant tutorial, that would get me pointed in the right direction.
Thank you.
@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.
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
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!
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 👍🏻
Well...I can build it, but I can't test it 🙂
Hope it works.
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.
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.
You are a hero. Autodesk should invest in a subscription to you 🙂 it would be the best decision they have made since 2010.
Can't find what you're looking for? Ask the community or share your knowledge.