Jump to content

Need help in reactor


prakashreddy

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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))
)

Link to comment
Share on other sites

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 by Costinbos77
Link to comment
Share on other sites

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 by prakashreddy
adding code
Link to comment
Share on other sites

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 by Costinbos77
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...