1. the VBA script cannot be run automatically.
Solution: Set the acadlspasdoc system variable to 1.
Explanation:
Acadlspasdoc is a system variable
Type: integer
Location: Registry
Initial Value: 0
Control whether to load the Acad. LSP file to each graph or only to the first graph opened in the task.
0: Load Acad. LSP to the first graph opened in the task.
1. Load Acad. LSP to each open image
How to Set 1?
(1) Search for this value in the Registry and change the value to 1.
(2) AutoCAD menu bar --- "Tools" --- "options" --- "system" tab --- Select "Attach Acad. LSP for each graph" --- OK
2.IDE problem "the caller rejects the call. (Exception from hresult: 0x80010001 (rpc_e_call_rejected ))"
Exception description
In envdte80.solution2. addfromtemplate (stringfilename, string destination, string projectname, booleanexclusive)
In codegen. form1.createnewinstance () Location C: \ Documents andsettings \ Administrator \ My Documents \ visual studio2005 \ projects \ codegen \ form1.cs: row number 101
The reason is that the IDE is not fully prepared for implementing the IDE automation operation, and there is no time to respond to the commands we issue.
Solution. Before executing the command, pause the thread. It takes about one second. Then call the IDE Function
System. Threading. thread. Sleep (500 );
It cannot be stopped for 0.5. However, the above problem may occur in one second, but the probability is much lower.