Author Topic: reactors on dwg startup  (Read 1864 times)

0 Members and 1 Guest are viewing this topic.

jtoverka

  • Newt
  • Posts: 127
reactors on dwg startup
« on: May 04, 2020, 08:10:10 AM »
So I use the CUI to load a lisp file on drawing startup.
This lisp file has reactors that makes sure standard AutoCAD commands are compatible with AutoCAD Electrical. These functions work great. However, on some instances I open a drawing and I get the following:

; error: Unknown exception occurred
; warning: unwind skipped on unknown exception

I comment out the section with the reactors and these errors go away. These errors only occur during drawing startup. If I load these reactors when the drawing is active, no error occurs. Does anyone have any experience with this issue? There is a vaguely similar thread on this.

https://www.cadtutor.net/forum/topic/57424-bfind-20-unwinding-error/

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: reactors on dwg startup
« Reply #1 on: May 04, 2020, 10:52:39 AM »
In my experience that is often associated with a memory allocation error. Strategic placement of (gc) calls, e.g. every nth iteration of a memory intensive processing loop, generally remedies.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

jtoverka

  • Newt
  • Posts: 127
Re: reactors on dwg startup
« Reply #2 on: May 04, 2020, 01:21:56 PM »
Strategic placement of (gc) calls, e.g. every nth iteration of a memory intensive processing loop, generally remedies.

I used this before and after loading the file and there were more errors. xD
So I placed them before reading reactor information, and after writing reactor information. I can confirm now that it works.  :yay!: These intermittent errors are frustrating!  :x

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: reactors on dwg startup
« Reply #3 on: May 04, 2020, 01:53:15 PM »
I used this before and after loading the file and there were more errors. xD

That surprises me.

I placed them before reading reactor information, and after writing reactor information. I can confirm now that it works.  :yay!:

That doesn't surprise me.

These intermittent errors are frustrating!  :x

Naw man, just part of the journey to reign supreme over the machine. :evil:

Glad you're on to your next challenge. :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: reactors on dwg startup
« Reply #4 on: May 04, 2020, 08:29:52 PM »
acadlspasdoc = 1
acad.lsp
Code - Auto/Visual Lisp: [Select]
  1. (defun s::startup()
  2.  ;; do stuff
  3. )

Old school … run the lisp code after the drawing loads by loading acad.lsp with each drawing.
Another option is to enable VBA and utilize events like AcadDocument_Activate and AcadDocument_LayoutSwitched in Acad.dvb and then autoload it.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

BIGAL

  • Swamp Rat
  • Posts: 1434
  • 40 + years of using Autocad
Re: reactors on dwg startup
« Reply #5 on: May 05, 2020, 01:31:38 AM »
I use Appload and add my lisps to be autoloaded in the start up suite including reactor code.
A man who never made a mistake never made anything