vferrara
2006-11-13, 02:31 PM
Hello AUGI Members:
I have tried to develop a lisp reactor that would fire-off when the "image" command is given to create and set a specific layer current (s-image) to attach the image file on. The code is giving me an error when I try to create the new "s-image" layer.
Here is the example code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;IMAGE REACTOR
;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(vl-load-com)
(Setq Alay (Getvar "clayer"))
(or DimageReactor (setq DimageReactor (VLR-Command-Reactor nil '((:VLR-commandWillStart . VINCEimg::CommandWillStart)))))
(or DimattReactor (setq DimattReactor (VLR-Command-Reactor nil '((:VLR-commandWillStart . VINCEima::CommandWillStart)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;IM COMMAND
;;;;;;
(defun VINCEimg::CommandWillStart (pReactor sCommandName / )
;;; (princ (strcat "\n" (car sCommandName) " has started.\n"))
(if (= (car sCommandName) "IMAGE")
(GetIMlay)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;IMAGEATTACH COMMAND
;;;;;;
(defun VINCEima::CommandWillStart (pReactor sCommandName / )
(if (= (car sCommandName) "IMAGEATTACH")
(GetIMlay)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;IMAGE LAYER SETUP
;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(DEFUN GetIMlay ()
(SetVar "CMDECHO" 0)
(Setq Alay (Getvar "clayer"))
(if (= Alay "Defpoints")(Dimg1))
(if (/= Alay "Defpoints")(Dimg2))
(SetVar "CMDECHO" 1)
(PRINC)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;LAYER DEFPOINTS CURRENT
;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(Defun Dimg1 ()
(SetVar "CMDECHO" 0)
(Command "-layer" "M" "s-image" "C" "9" "" "")
(Setvar "clayer" "S-Image")
(alert "...Current Layer Is Defpoints...Do Not Attach Image Files in Layer Defpoints...Setting Layer S-image Current... ")
(SetVar "CMDECHO" 1)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;LAYER DEFPOINTS NOT-CURRENT
;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(Defun Dimg2 ()
(SetVar "CMDECHO" 0)
(Command "-layer" "M" "s-image" "C" "9" "" "")
(Setvar "clayer" "S-Image")
(SetVar "CMDECHO" 1)
)
If anyone can provide any assistance, it would be appreciated....!
Regards,
Vince
I have tried to develop a lisp reactor that would fire-off when the "image" command is given to create and set a specific layer current (s-image) to attach the image file on. The code is giving me an error when I try to create the new "s-image" layer.
Here is the example code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;IMAGE REACTOR
;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(vl-load-com)
(Setq Alay (Getvar "clayer"))
(or DimageReactor (setq DimageReactor (VLR-Command-Reactor nil '((:VLR-commandWillStart . VINCEimg::CommandWillStart)))))
(or DimattReactor (setq DimattReactor (VLR-Command-Reactor nil '((:VLR-commandWillStart . VINCEima::CommandWillStart)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;IM COMMAND
;;;;;;
(defun VINCEimg::CommandWillStart (pReactor sCommandName / )
;;; (princ (strcat "\n" (car sCommandName) " has started.\n"))
(if (= (car sCommandName) "IMAGE")
(GetIMlay)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;IMAGEATTACH COMMAND
;;;;;;
(defun VINCEima::CommandWillStart (pReactor sCommandName / )
(if (= (car sCommandName) "IMAGEATTACH")
(GetIMlay)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;IMAGE LAYER SETUP
;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(DEFUN GetIMlay ()
(SetVar "CMDECHO" 0)
(Setq Alay (Getvar "clayer"))
(if (= Alay "Defpoints")(Dimg1))
(if (/= Alay "Defpoints")(Dimg2))
(SetVar "CMDECHO" 1)
(PRINC)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;LAYER DEFPOINTS CURRENT
;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(Defun Dimg1 ()
(SetVar "CMDECHO" 0)
(Command "-layer" "M" "s-image" "C" "9" "" "")
(Setvar "clayer" "S-Image")
(alert "...Current Layer Is Defpoints...Do Not Attach Image Files in Layer Defpoints...Setting Layer S-image Current... ")
(SetVar "CMDECHO" 1)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;LAYER DEFPOINTS NOT-CURRENT
;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(Defun Dimg2 ()
(SetVar "CMDECHO" 0)
(Command "-layer" "M" "s-image" "C" "9" "" "")
(Setvar "clayer" "S-Image")
(SetVar "CMDECHO" 1)
)
If anyone can provide any assistance, it would be appreciated....!
Regards,
Vince