how to APPLOAD ? (dll, brx .... files )

how do it bricscad loading application files .dll .brx type of files.. Must be startup program loading dll and brx files...Thanks

Comments

  • If you are familiar with the startup of acad, which is load acad.lsp for each new session, and acaddoc.lsp for each document, Bricscad does it like this:

    On_start_default.lsp for each session. On_doc_load_default.lsp for each doc

    You can put all your code in the On_doc_load_default.lsp file if you use the trick below. Make the On_start_default.lsp contain one line - (princ).

    For items you only want to run once per session, set up an if statement like this:

    (IF (NOT STARTUP-HAS-RUN)
      (PROGN
       ;do stuff here you only want once per session...
      )
    )
    (SETQ STARTUP-HAS-RUN 1)
    (vl-propagate 'STARTUP-HAS-RUN)

    then do anything you want for all docs after that. This is one of my better CAD Mgmnt tricks IMO. It keeps the startup to one file.

    Putting that all together, the On_doc_load_default.lsp file look like this:

    (defun s::startup ( / )
      (vl-load-com)
      (IF (NOT STARTUP-HAS-RUN)
        (PROGN
          (princ "\nRunning Initial Startup...")
            ;place more code here if desired
           
          )
       )
       ;now place code that should be run for every document
       (load "this.brx")
       (COMMAND "NETLOAD" "that.dll")
      
       ;set run flag
       (SETQ STARTUP-HAS-RUN 1)
       (vl-propagate 'STARTUP-HAS-RUN)
      
       ;nice ending message to be sure it ran through
       (PRINC "\nStartup has finished.")
       (PRINC)
     )

    Note that the On_doc_load_default.lsp should be in a folder at the top of your support paths. Make a special folder if you want to keep separate and add to top.

    That will allow you to load whatever you want, and to set settings as desired for all dwgs opened.

  • Just one more hint :
    as Acad.lsp / on_start.lsp / on_start_default.lsp are initially intended to be "once per session", but Lisp
    is strictly bound to "per document", the strategy has slightly changed, to allow Acad.lsp / on_start.lsp / on_start_default.lsp
    files to be loaded "per document" as well :

    ACADLSPASDOC = 0/1 is designed to control the behaviour ...

    it seems best to have ACADLSPASDOC = 1, meaning those 3 files are also loaded for each drawing;
    you can even define (setvar "ACADLSPASDOC" 1) in those startup lisp files :-)
  • It is my understanding that the files on_doc_load_default.lsp and on_start_default.lsp can be overwritten by BricsCAD. For customizations you should use (create) on_doc_load.lsp and on_start.lsp.
  • Thanks@James Maeding 

    Find some other way ..ı did change toolbars add new command  (COMMAND "NETLOAD" "LoftX.dll") loftx

    click toolbar button ( added new buton) and use in bricscad..  :)

    but ı did change today  add  On_doc_load_default.lsp ,  on_start.lsp

    (IF (NOT STARTUP-HAS-RUN)
      (PROGN  
       
       )
    )
    (SETQ STARTUP-HAS-RUN 1)
    (vl-propagate 'STARTUP-HAS-RUN)

     (defun s::startup ( / )
      (vl-load-com)
      (IF (NOT STARTUP-HAS-RUN)
        (PROGN
          (princ "\nRunning Initial Startup...")
            ;place more code here if desired
           
          )
       )  
           (load "sweep.brx")
       (COMMAND "NETLOAD" "LoftX.dll")  
          (COMMAND "Xcopy" "filter.dll")  

    (COMMAND "NETLOAD" "qqa.dll")  
        ;set run flag
       (SETQ STARTUP-HAS-RUN 1)
       (vl-propagate 'STARTUP-HAS-RUN)  
         
         (PRINC "\nStartup has finished.")
       (PRINC)
     )

    imagesample 2.jpg
  • brx files doesnt work.. ı did change On_doc_load_default.lsp ,  on_start.lsp not work...

    brx files here,

    http://www.mtmlab.ru/download/

  • For .brx files you should use ARXLOAD instead on LOAD.
  • Does anyone know if Bricsys is planning to implement a pseudo-named 'Bricsloader' mechanism (similar to AutoCAD's Autoloader)?

    Cheers
  •  Not too sure what their plans are - I ended up writing my own that parses each support path and loads the .lsp files in each folder (there is more to it than that) - I currently don't use any other types of application so I have not extended it to do that yet.  It allows me to make once call to the loader program in the on_doc_load.lsp and it does the rest.  Adding new programs is as simple as copying the .lsp file into a directory listed in the support paths and opening a new drawing, executing the loader lisp routine or reopening the current drawing...
  • Thanks for reply, Scott.

    I'm new to Bricsys & BricsCAD (BCAD) generally... So new that I do not yet even have it installed yet.

    What little I do know of BCAD, is that it too supports multiple development APIs, and simply thought I'd ask about such an initiative. I am finding it (Autoloader) to be a good mechanism for handling the automatic/demand-loading of the desired executable file(s) for each applicable version by way of a given app .bundle's PackageContents.xml file (the .bundle format also makes it portable for Mac OS, etc.).

    Methinks a similar mechanism, if implemented for BCAD, would need to be developed using BRX in order to properly hook the highest level events, in order to properly load the various executable file at the appropriate time during BCAD's startup sequence, etc... At minimum, certainly a .NET assembly would be needed as (and I could be mistaken), not even BCAD's LISP API has such API features exposed.

    That said, as with any new mechanism ambitious as this (Autoloader was first implemented in AutoCAD 2012), there are some 'gotchas' to be mindful of, but that is for another conversation altogether.

    Again, I'd be interested to hear from others, particularly those whom may be a part of the Bricsys development team.

    Cheers


  • You can auto load BRX and .NET modules with a registry entry.  Here is a lisp routine that might help.
    http://www.theswamp.org/index.php?topic=31173.msg367523#msg367523
This discussion has been closed.