View Full Version : Reactor for Unload an X-reference
vferrara
2006-11-10, 01:28 PM
Hello AUGI Members:
Is there a way to have a reactor fire off when the "Unload Xref" option is selected from inside the Xref Manager dialogue box or on the command line when the "-xref" --> "Unload" option is used....??
I have tried to accomplish this but have only been able to have a reactor fire off when the XREF command is given and I do not want the reactor to fire off unless the user tries to use the Unload Xref option.
Any assistance in this area would be appreciated.....!!!
Regards,
Vince
kennet.sjoberg
2006-11-10, 04:04 PM
Hello AUGI Members:
Is there a way to have a reactor fire off when the "Unload Xref" option is selected from inside the Xref Manager dialogue box or on the command line when the "-xref" --> "Unload" option is used....??
I suppose not.
: ) Happy Computing !
kennet
kennet.sjoberg
2006-11-15, 02:14 PM
I suppose not. . .
Sorry, I have to correct myself. . . Yes you can.
Check the help file and find vlr-xref-reactor an editor reactor that notifies event related to attaching or modifying XREFs (vlr-xref-reactor data callbacks)
: ) Happy Computing !
kennet
vferrara
2006-11-27, 04:21 PM
Hi Kennet:
I tried to develop the reactor for the unload-xref sub-command but I have had no luck. Below is the example I was attempting to use unsuccessfully.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;UNLOAD XREF REACTOR
;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(vl-load-com)
(or DunloadReactor (setq DunloadReactor (VLR-xrefSubcommandUnloadItem-Reactor nil '((:VLR-commandWillStart . VINCEul::CommandWillStart)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;XREF-UNLOAD COMMAND
;;;;;;
(defun VINCEul::CommandWillStart (pReactor sCommandName / )
(if (= (car sCommandName) "unload")
(alert "...Please Do Not Unload Xreference Files....Use the Layer Manager to Turn Off Visability and Freeze Layers... ")
)
)
Any suggestions would be appreciated....!
Regards,
Vince
kennet.sjoberg
2006-11-28, 10:03 AM
Hi Kennet:
I tried to develop the reactor for the unload-xref sub-command but I have had no luck.
...mmm I think you are missing the [F1] button ;)
the :VLR-xrefSubcommandUnloadItem deliver the second argument ListArg as a list like
(0 0) or (2 2127552696) or (3 2127552696) or (4 0)
- The first parameter in the list is an integer indicating the activity the UNLOAD is carrying out. Possible values are :
0 BIND subcommand invoked.
2 xref with the indicated object ID is being bound.
3 xref with the indicated object ID was successfully bound.
4 BIND subcommand completed.
5 BIND operation is about to either terminate or fail to complete on the specified object ID.
6 BIND operation has either terminated or failed to complete on the specified object ID.
- Second parameter in the list is an integer containing :
the object ID of the xref being unloaded, or
0 if not applicable.
{ the first argument ObjArg is the #<VLR-XREF-Reactor> }
Here is the code you need. . .
(vl-load-com)
(setq MyXrefUnloadReactorVariable (vlr-xref-reactor nil '(( :VLR-xrefSubcommandUnloadItem . MyXrefUnloadReactorFunction ))) )
(defun MyXrefUnloadReactorFunction ( ObjArg ListArg / )
(if (equal ListArg '(0 0) ) (alert "...Please Do Not Unload Xreference Files..\n\n After the [ OK ] button\n\nPress U and [ Enter ]" ) ( ) )
(princ)
)
; (vlr-remove MyXrefUnloadReactorVariable ) ;; Removes the reactor assigned to the variable
; (setq MyXrefUnloadReactorFunction nil MyXrefUnloadReactorVariable nil ) ;; Clear\assign nil to the function and the reactor
: ) Happy Computing !
kennet
vferrara
2006-11-28, 01:10 PM
Hello Kennet:
Thank you so much for the help......developing Reactor programs is new to me and I am having a very difficult time creating them in my AutoCAD environment.
I appreciate your expert assistance and resolution to my problem.....!!
Regards,
Vince
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.