Disable geometry editing

Disable geometry editing

tamara
Advocate Advocate
2,090 Views
6 Replies
Message 1 of 7

Disable geometry editing

tamara
Advocate
Advocate

Hello,

is there any way to prevent geometry editing in drawing, but still maintain other properties of an object to stay editable using C#?

 

Thank you,

Popovic Tamara

0 Likes
Accepted solutions (1)
2,091 Views
6 Replies
Replies (6)
Message 2 of 7

tamara
Advocate
Advocate

Any hint, even "There is no way to do this" would be greatly appreciated.

 

Best regards,

Tamara Popovic

0 Likes
Message 3 of 7

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> prevent geometry editing

Could be solved by locking layers

 

>> maintain other properties of an object to stay editable

What is meant by that?

Not editing the geometry, but in the property window modify line-start point should work?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 4 of 7

norman.yuan
Mentor
Mentor
Accepted solution

You can use ObjectOverrule to achieve your goal by properly overriding the Open()/Close() methods. I posted 2 articles on ObjectOverrule a few years back: one was about how to prevent entity to be changed/modified/erased; the other was about to force entity being only changed in certain way (geometrically).

 

After seeing your question, I thought it would be doable with ObjectOverrule to make certain properties of an entity not changeable, while other properties changeable. I have put together some testing code completed as of now, I'll post it in my blog later (today, or tomorrow, if I can manage some time). I'll provide link to my post here once it published.

 

I do not know the context of your user case of when/why you want to disable geometry (or any other non-geometry property, for that matter), I'd be careful that Overrule is not overused/abused. I tend to only enable custom Overrule when a particular process/operation needs it and disable it when that process/operation is done, within an AutoCAD session.

Norman Yuan

Drive CAD With Code

EESignature

Message 5 of 7

norman.yuan
Mentor
Mentor
Message 6 of 7

tamara
Advocate
Advocate

@Alfred.NESWADBA locking layers is not applicable in our case, because we need other non-geometric properties to stay editable.

@norman.yuan , thank you very much for your examples. 

We are building a plugin for road GIS, and our client wants to have geometry locked so that it cannot be edited. But we also have some custom properties added to objects that must be allowed to be edited (custom OPM properties). We will take a look at your code and see if we can modify it so that it suits our needs. I will report the results 🙂

 

Best regards,

Tamara Popovic

 

0 Likes
Message 7 of 7

norman.yuan
Mentor
Mentor

Well, as I said in previous reply, if your purpose is to lock data not to be changed by others, who is not in the process of creating the drawing content, I'd think using Overrule is a bit of mis-use.

 

However, you indicated that the said client is allowed to change some data in the drawing (be your custom data or not), if you do use the Overrule approach as I described, then you have to bear the burden of making sure the said client loads your DLL plugin into their AutoCAD, which, seems to me, is already an requirement to your client (using your custom OPM properties) anyway.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes