C # questions about secondary development of AutoCAD: "The caller rejects the call"

Source: Internet
Author: User

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.

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.