Reactors

#1
I seem to be having trouble porting a LISP reactor from AutoCad into Intellicad 9.0. According the Help file the particular function is supported but not documented. Here is what I get when I paste into the command line.

Command: (vl-load-com)
Command: (defun LO-changed (LO-data LO-callback / ) (SV-changed T '("CANNOSCALE" T)))
LO-CHANGED
Command: (if (not *LOReactor*) (setq *LOReactor* (vlr-miscellaneous-reactor nil '((:vlr-layoutswitched . LO-changed)))))
LISP Error in function: vlr-miscellaneous-reactor: Not initialized yet
error: Unknown exception thrown.

How can "vlr-miscellaneous-reactor" not be intialized when "(vl-load-com)" is the first thing done? The "(vl-load-com)" is what's suposed to initialize many VL functions and all VLR functions.

Thanks for any help anyone can provide.

Re: Reactors

#3
Thank you for the test on version 9.2.
I have been thinking it might be a version problem. Or a computer problem. Or an install problem.

When I first bought this 9.0 I was running Windows 8.1. I couldn't get any customizations working (including but not limited to Menus, Ribbon, Toolbars). LISP was flaky, at best. I reinstalled it twice on Windows 8.1 but it never got any better. Since installing Windows 10, I have found that Menus and Ribbon can be customized (although not so user friendly). and most LSP files only need a bit of tweaking I wish the CUI workspaces had a location to attach LISP files for loading (like ACAD does). It sure would be easier than hunting down the icad.exe path and creating ICADDOC.LSP.

Customizing my tools to work on Intellicad was my whole reason for the purchase. I am nearing retirement and I wanted to share my 30 years of ACAD written tools with the intellicad community. But not ALL of the VL commands port over. So I am still not sure if may have been a bug that was found and fixed by version 9.2.

Re: Reactors

#5
Thank you for the trial suggestion.

In reading over the instructions for the upgrade, it warns about backing up and uninstalling the current version. I have version 9.0.1260.0.PE.VC15.x64.RF90a
I think these numbers mean its the PE version and not the PE Plus version. Is that correct?

If I install 9.2 for a trial, can it be installed side by side without interference of the registered version?

Re: Reactors

#6
9.0.1260.0.PE.VC15.x64.RF90a means you're running a 9.0 PE version.

The information about backing up and uninstalling the current version
means that users are advised / remembered to backup the installer file for their licensed version.

Q: If I install 9.2 for a trial, can it be installed side by side without interference of the registered version?
R: yes, should not be an issue.

Re: Reactors

#7
QuanNguyen wrote:
Fri May 22, 2020 7:26 pm
Hi ,
Not sure about version 9.0, but it works well in CMS IntelliCAD version 9.2IntelliCAD Reactor.png
Hello, long time AutoLisp programmer looking into IntelliCAD as an economic alternative.
I loaded the following code (mostly from this post) into AutoCAD and Intellicad 12.1:

(defun LO-changed (LO-data LO-callback /)
(pn "lo-data")
(pn "lo-callback")
(SV-changed T '("CANNOSCALE" T))
)
(defun SV-changed ( whichvar action)
(pn "whichvar")
(pn "action")
(princ)
)
(if (not *LOReactor*)
(setq *LOReactor* (vlr-miscellaneous-reactor nil '((:vlr-layoutswitched . LO-changed))))
)
(defun PN (s)
; print the variable after a new line
(princ (strcat "\n" s " = "))
(princ (eval (read s)))
(prin1)
)

In AutoCAD, having loaded the following lisp, on changing from model to layout view responds with the following (which is what I expect):

lo-data = #<VLR-Miscellaneous-Reactor>
lo-callback = (Model)
whichvar = T
action = (CANNOSCALE T)
lo-data = #<VLR-Miscellaneous-Reactor>
lo-callback = (Model)
whichvar = T
action = (CANNOSCALE T)

In Intellicad 12.1 changing from model to layout view does not execute the LO-changed and SV-changed functions.
I can execute these functions manually but they don't get executed when the reactor is activated.
I also know that the reactor is activating and tries to execute the SV-changed function because if I set that function to nil, when executing the change from model to layout tab the system responds with:
Command: (setq SV-changed nil)
nil
Command:
error: null function: SV-CHANGED
error: null function: SV-CHANGED
error: null function: SV-CHANGED
Command: '_PMTHIST

Any help would be appreciated, I added to this reactor post to simplify my question. The simple code is just for testing as I have more complex code that does not execute properly.

Re: Reactors

#8
Hi,
Yes, something is wrong when running the function "pn".
The LO-changed function fired but the function "pn" didn't.

Code: Select all

(defun LO-changed (LO-data LO-callback / )
  (alert (strcat "Layout Switched to " (getvar "ctab") "."))
  (pn "LO-data")
  (pn "LO-callback")
  (SV-changed T '("CANNOSCALE" T))
  )