Is it possible to "lock" individual elements?

Is it possible to "lock" individual elements?

MbMinx
Enthusiast Enthusiast
4,742 Views
8 Replies
Message 1 of 9

Is it possible to "lock" individual elements?

MbMinx
Enthusiast
Enthusiast

When I am working in another software package, I have the ability to "lock" individual elements, or groups of elements. This comes in handy when I am working in tight quarters, replacing items, and other work more involved that a simple level lock. Not everything I would like to (temporarily) ignore is always on the same level.

 

Is that possible with AutoCAD? If so, where do I find that command? If not, can anyone suggest a workaround?

Thank you.

 

MaryB
AutoCAD Civil3D

0 Likes
4,743 Views
8 Replies
Replies (8)
Message 2 of 9

leothebuilder
Advisor
Advisor

You can place certain elements and objects on a specific layer or layers and lock that layer or layers.

0 Likes
Message 3 of 9

rkmcswain
Mentor
Mentor
Without customization, on an element level, no. As @leothebuilder said though, you can lock items on a layer level. It's possible with customization to lock entities in place. For example, in Civil 3D, Survey Points are "locked" in place.
R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 4 of 9

MbMinx
Enthusiast
Enthusiast

What sort of customization?

That's a shame it can't be done by element. Often the elements I want to lock are on the same layer as the items I want to manipulate (That's why I want to lock them).

Thank you for confirming to me that it can't be done.

0 Likes
Message 5 of 9

rkmcswain
Mentor
Mentor
 On a very basic level, using visual lisp, you could create a reactor that monitors the object and if a change is detected, restores the object (properties, location, etc.). Here is an example of a reactor that monitors a system variable, and restores it if its value is changed. On a more advanced level, I suspect there are more elegant ways of doing this using other languages/APIs. Let's drag @BlackBox_ into this conversation.
R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 6 of 9

Jonathan3891
Advisor
Advisor

Check out Lee Mac's object Lock lisp;

http://www.lee-mac.com/objectlock.html


Jonathan Norton
Blog | Linkedin
0 Likes
Message 7 of 9

dgorsman
Consultant
Consultant

Not BB, but...

 

The managed dotNET API has a nifty capability to override how objects are handled, such allowing for a "veto" on certain operations.  Like reactors and other advanced customization it requires a very structured approach to avoid self-inflicted problems.

 

There's a couple of OTHER methods which comes to mind without resorting to reactors/event handling, variations on things I've done (and with only LISP) in the past.  Tools for pushing entities to a locked layer and remembering which layer it came from.  Or hiding the entities entirely while keeping the same layer with a few tricks to selectively display them.

 

However as noted it's usually easiest to use AutoCAD as AutoCAD *first*, and box up and put away what the other programs can do.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 8 of 9

BlackBox_
Advisor
Advisor

@rkmcswain wrote:
 On a very basic level, using visual lisp, you could create a reactor that monitors the object and if a change is detected, restores the object (properties, location, etc.). Here is an example of a reactor that monitors a system variable, and restores it if its value is changed. On a more advanced level, I suspect there are more elegant ways of doing this using other languages/APIs. Let's drag @BlackBox_ into this conversation.

Sure @rkmcswain, one could implement a .NET Object Overrule to effectively 'lock' entity-specific elements (aka Properties, such as: Layer, Color, Linetype, etc), conditionally storing the 'monitored' elements (Properties) on DBObject.Open() and restoring them on DBObject.Close(), where a custom system variable determines which elements (Properties) the user wants to 'lock'.

 

[Edit] - Here's my most recent example of using an Object Overrule; see the link in this post: https://forums.autodesk.com/t5/civil-3d-forum/is-it-possible-to-turn-off-the-new-viewport-grips/m-p/...

 

Despite that, I wonder if @MbMinx has considered using ISOLATEOBJECTS and UNISOLATEOBJECTS Commands to do what they're after?

 

Cheers


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps

Message 9 of 9

BlackBox_
Advisor
Advisor

@dgorsman wrote:

Not BB, but...

 

 


... Vastly superior. FTFY :beer:

 


 

I'm a strange bird, with only one real skill.

 

(Spoilers: it's not coding)


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps

0 Likes