"DocumentCreated" event handler not working as expected

Hi all,

I am at my wits end with this one. Hopefully someone can help.

All I want to do is load my code "after" a drawing has finished opening.
I would prefer not using acaddoc.lsp because I want the installation to be version non-specific.

The code below works as expected in AutoCAD but in BricsCAD the event is fired straight away in the current drawing and not in the drawing just opened.

AddHandler docMan.DocumentCreated, AddressOf OpenDrawingEvent

Public Sub OpenDrawingEvent(ByVal sender As Object, ByVal e As DocumentCollectionEventArgs)

"my code"

End Sub

I am open to alternative methods but can't find anything that works for me.

Regards,
Paul.





Comments

  • ALANH
    edited June 2022
    What does Appload add to Autoload do for you.
  • there is also "DocumentBecameCurrent" event - but also triggered when switching *between* open drawings;
    another one is "initialDwgFileLoadComplete" (or something like that), but used for dwg files opened from disk ...
    Best, to send us a support request (maybe with a code snippet), so that we can fix the timing here ...
    many greetings !
  • basically I want to run a vb.net function each time a drawing is loaded from file. New or existing. The function will check if the drawing is up to date and take action if required. The above works with AutoCAD
    but fires too early in BricsCAD. Where do I send a support request ?
  • initialDwgFileLoadComplete looks like it would do. How do I implement it ?
  • Torsten Moses
    edited July 2022
    Hi,

    "initialDwgFileLoadComplete()" might only be triggered for dwg files opened from disk, potentially not for for drawings created by "New/QNew" .... it is a reactor, to be used the same way as "DocumentCreated";

    but "DocumentCreated" might be too early, it does not necessarily mean that the database inside the document is ready yet.

    for SupportRequest :
    https://boa.bricsys.com/protected/support/NewSupportRequest.do
  • Thanks everyone for your suggestions. I have made a support request now.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Click one of the buttons on the top bar to get involved!