Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lock Entity using object reactor

1 REPLY 1
Reply
Message 1 of 2
srir_soft
288 Views, 1 Reply

Lock Entity using object reactor

Hi,

I am developing a small reactor application, where i don't want the user to delete a certain objects. Even if i lock the layer user can easily un-lock the layer and can delete the object.
For this i am trying to make use of reactor objects. But not sure how :vlr-unerased function will work. Please help me
Following is my code:

(defun c:ret()
(setq dng_obj(car(entsel)))
(setq vlobj(vlax-ename->vla-object dng_obj))
(vlr-object-reactor (list vlobj)
nil '((:vlr-goodbye . dont_delete))
)

);def

(defun dont_delete(notifier reactor arg-list)
(setq new_ent(vlax-vla-object->ename notifier))
;need a function to block the entity from deleting..
);def

Srikanth
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: srir_soft

Can't be done reliably with reactors unless your users are complete
beginners and even then they probably can delete protected objects
accidentally. Look into CADlock if you are serious about such protection.


wrote in message news:5726973@discussion.autodesk.com...
Hi,

I am developing a small reactor application, where i don't want the
user to delete a certain objects. Even if i lock the layer user can easily
un-lock the layer and can delete the object.
For this i am trying to make use of reactor objects. But not sure how
:vlr-unerased function will work. Please help me
Following is my code:

(defun c:ret()
(setq dng_obj(car(entsel)))
(setq vlobj(vlax-ename->vla-object dng_obj))
(vlr-object-reactor (list vlobj)
nil '((:vlr-goodbye . dont_delete))
)

);def

(defun dont_delete(notifier reactor arg-list)
(setq new_ent(vlax-vla-object->ename notifier))
;need a function to block the entity from deleting..
);def

Srikanth

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost