Autocad.net (4)-automatically load the application when AutoCAD is started

Source: Internet
Author: User
Method 1:
1. Find c: \ Program Files \ AutoCAD 2006 \ support \ acad2006.lsp In the AutoCAD installation directory
Open it with notepad and add it at the end (next section Code Line 2. Note the path) (If (not (= (substr (VER) 1 11) "Visual LISP") (Load "acad2006doc. LSP "))
(Command "netload" C: \ mxcad \ bin \ debug \ mxcad. dll ")
; Silent load.
(Princ)

2. AutoCAD settings (important, required ):
Tool-Option-file-support file search path-add-browse to mxcad path

Method 2:
Modify the registry, create a new notepad file, rename it netload. Reg, add the following content, and double-click the file to add the information to the Registry.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Autodesk \ AutoCAD \ r16.2 \ ACAD-4001: 804 \ applications \ mxcad]
"Loader" ="C: \ mxcad \ bin \ debug \ mxcad. dll"
"Managed" = DWORD: 0001c101
"Loadctrls" = DWORD: 0001c102

"Loadctrls": ControlProgramWith the CAD loading method, set ox02 to load together with the CAD startup;
"Loader": shows the path of the program to be loaded by CAD;
"Managed": Set to ox01, telling CAD That This Is A hosted program.
-----------------------------
Note: The registry key value "loadctrls" control describes how to control the ARX program loading method (in the above example, ox02 is loaded along with the CAD startup)

0x01: load the application upon detection of proxy object.
Currently, the corresponding ARX program is loaded when the object is controlled.

0x02: load the application upon AutoCAD startup.
When AutoCAD is started, the corresponding ARX program is loaded.

0x04: load the application upon invocation of a command.
Load the corresponding ARX program when you enter the command.

0x08: load the application upon request by the user or another application.
When a user or another program requests, load the corresponding ARX program.

0x10: Do not load the application.
Never load the application.

0x20: load the application transparently.
Explicitly load the program. (I wonder if the translation is incorrect)
-----------------------------
During packaging, add the registry key to the Registry to enable automatic configuration during installation.

Private   Bool Writeregistrykey ()
{
Try
{
Registrykey localmachine = Registry. localmachine;
Registrykey Software = Localmachine. opensubkey ( " Software " , True );
Registrykey Autodesk = Software. opensubkey ( " Autodesk " , True );
Registrykey AutoCAD = Autodesk. opensubkey ( " AutoCAD " , True );
Registrykey r16_2 = AutoCAD. opensubkey ( " R16.2 " , True );
Registrykey ACAD = R16_2.opensubkey ( " ACAD-4001: 804 " , True );
Registrykey applications = Acad. opensubkey ( " Applications " , True );

Registrykey mxcad = Applications. createsubkey ( " Mxcad " );
Mxcad. setvalue ( " Loadctrls " , 0x02 );
Mxcad. setvalue ( " Loader " , This . Targetdir +   @" Bin \ debug \ mxcad. dll " );
Mxcad. setvalue ( " Managed " , 0x01 );
Return   True ;
}
Catch
{
Return False;
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.