Problem with rebuilding reactor on DWG open

Problem with rebuilding reactor on DWG open

O_Eckmann
Mentor Mentor
972 Views
5 Replies
Message 1 of 6

Problem with rebuilding reactor on DWG open

O_Eckmann
Mentor
Mentor

Hi,

 

I use ractor on some polyline to offset and add text and block along this polyline.

I don't want to use persistent reactor (I don't want than DWG modified outside of my compagny generate error on callback), so I use transient reactor.

To restore reactors when opening a drawing, I store data in reactor and same data in XData.

When opening a DWG, I search object with these Xdata and rebuild reactor.

If I open DWG and load my VLX, it's OK all works fine.

But if I put my VLX in program to load at opening (in the APPLOAD dialog)

image.png

AutoCAD never return to "Command". DWG is opened (viewed in editeur), but I can do nothing. No error message, no CPU usage (so no infinite loop)... I can just kill Acad.exe

I think DWG isn't completly opened before loading VLX => objects aren't accessible

I've tried to add a reactor on :vlr-endDwgOpen to execute my rebuild after DWG completly opened but it doesn't work.

Debugging this problem is a little bit hard (for me).

 

Is there a solution to delay execution of lisp when I'm sure DWG is fully opended?

Thanks

 

Olivier

Olivier Eckmann

EESignature

0 Likes
Accepted solutions (1)
973 Views
5 Replies
Replies (5)
Message 2 of 6

marko_ribar
Advisor
Advisor

Have you tried to write command function (c:xxx) that will rebuid reactor and autoload this function via start-up suite or acaddoc.lsp, so that when DWG is fully open you just type XXX (for ex.) and initialize your reacor(s)? Beside this I believe that not all DWGs you use will have XDATA stored for you to use it for rebuilding reacor(s), so why not just manual initializing upon correct DWG is active...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 3 of 6

O_Eckmann
Mentor
Mentor

Hi @marko_ribar ,

 

Thanks for your answer, but I'm looking for an automatic solution, because I manage 40 workstations modifing hundreds of DWG per day.

I can't just say "don't forget to enter XXX command when you open DWG with these data"

Bad news, lots of version of MAP 3D are installed, from 2012 to 2021. Updating acaddoc.lsp isn't so simple.

Good news, I can do almost what I want, because I manage servers too, and I've already written my own script executed when computer opens session. (automatic update of VLX, DLL, tool palette, template...)

 What I don't know exactly is order used by AutoCAD to load plug-in : bundle, acaddoc.lsp, mnl, ...

If you are sure acaddoc.lsp is loaded once DWG is fully open, I can find a solution to update it, but if there is another simplier solution, I'm interested.

 

Olivier

Olivier Eckmann

EESignature

0 Likes
Message 4 of 6

cadffm
Consultant
Consultant
Accepted solution

The perfect way should be to define a s::startup function.

(a good time to learn about defun-q, if never done before)

 

s::startup [F1]

Sebastian

0 Likes
Message 5 of 6

Sea-Haven
Mentor
Mentor

Whilst you have 40 involved just check a list for "username" if match then start reactor very unlikey to have a outside user with a company staff name. (getenv "username") I know in my last employee mine included employee number.

0 Likes
Message 6 of 6

O_Eckmann
Mentor
Mentor

Hi @cadffm ,

 

That's exactly what I need. Works like a charm.

Thanks.

 

Olivier

Olivier Eckmann

EESignature

0 Likes