prakashreddy Posted March 15, 2013 Share Posted March 15, 2013 I have one block and a text at outside the block. When the user try to edit the block the outside text has to delete, but the same text should not delete when the block is updated by Lisp Routine. Drawing1.dwg Quote Link to comment Share on other sites More sharing options...
neophoible Posted March 15, 2013 Share Posted March 15, 2013 Doesn't make sense to me. I tried editing the block--no problem, no deletion. when I finished, the text was still there. Maybe you should explain in much greater detail just what is happening that you do not want to happen. Try a step by step explanation. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted March 16, 2013 Share Posted March 16, 2013 Methinks posting the reactor code would be helpful as well. Quote Link to comment Share on other sites More sharing options...
prakashreddy Posted March 16, 2013 Author Share Posted March 16, 2013 Thanks for reply, In above attached drawing, the block and text was created by lisp. Here the text outside the block have relation with the block. User or Checker has to check the drawing by that text only. So, if the block modified by the user means outside text has to delete then user or checker has to check the drawing only. To avoid the checking time i went to reactor. I tried yesterday to do something, but my code is firing when the user modified the block. I have tried with :vlr-subObjModified but not working. Please, i need some better solution. (defun c:aa () (if (setq lst (list (vlax-ename->vla-object (car (entsel))))) (vlr-object-reactor lst (car (entsel)) (list (cons :vlr-modified 'subObjModified1)) ) ) ) (defun subObjModified1 (owner reactor args / h) (vl-load-com) (entdel (vlr-data reactor)) ) Quote Link to comment Share on other sites More sharing options...
Costinbos77 Posted March 18, 2013 Share Posted March 18, 2013 (edited) Function subObjModified1, should not be quoted : 1: (setq rrr (vlr-object-reactor lst "Description Reactor" ; text (list (cons :vlr-modified 'subObjModified1)) ) ) or 2. (setq rrr (vlr-object-reactor lst "Description Reactor" ; text '((:vlr-modified . subObjModified1)) ) ) [color=#000000][color=#2a2a2a][font=Arial][i](vlr-data rrr)[/i] [/font][/color][/color] [color=#000000][color=#2a2a2a][font=Arial]#"Description Reactor"[/font][/color][/color] To delete objects : (vla-delete vlaobjectname) ; for vla-object : #<VLA-OBJECT IAcadCircle2 1347b55c> ; or (entdel dxfname) ; name get with entsel, entlast, etc : #<Entity name: 7ef036a8> Read about all VLR functions ! You thought if the reactor is persistent or not? Edited March 19, 2013 by Costinbos77 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 18, 2013 Share Posted March 18, 2013 Function subObjModified1, should not be quoted Yes it should. Quote Link to comment Share on other sites More sharing options...
prakashreddy Posted March 18, 2013 Author Share Posted March 18, 2013 (edited) As per Mr. Lee Mac quote is required and it is working with quote also. But my requirement is not fulfilled, Now i attached new drawing will give more clarity. When the user try to edit the block, top text has to delete. and at the same time it has to allow to edit through lisp routine, top text should not delete. (defun c:a1 () (if (setq lst (list (vlax-ename->vla-object (car (entsel))))) (vlr-object-reactor lst (LM:ss->vla (ssget)) (list (cons :vlr-modified 'subObjModified1)) ) ) ) (defun subObjModified1 (owner reactor args / h) (vl-load-com) (foreach each (vlr-data reactor) (entdel (vlax-vla-object->ename each))) ) (defun LM:ss->vla ( ss / i l ) (if ss (repeat (setq i (sslength ss)) (setq l (cons (vlax-ename->vla-object (ssname ss (setq i (1- i)))) l)) ) ) ) BEAM.dwg Edited March 18, 2013 by prakashreddy adding code Quote Link to comment Share on other sites More sharing options...
Costinbos77 Posted March 19, 2013 Share Posted March 19, 2013 (edited) I use version 2 : '((:vlr-modified . subObjModified1)) Name an AutoCAD entity is not the same at each session , must use the handle object for identification . But there's no active reactor in attached drawing: BEAM.dwg (vlr-reactors :vlr-modified) nil (vlr-reactors) nil (vlr-pers-list) nil Edited March 19, 2013 by Costinbos77 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.