Implementing the AutoCAD API in Java

Source: Internet
Author: User
Tags format requires client
Because in the project you need to extract the attributes from the title box in the AutoCAD DWG file into the database to realize the bulk of the drawings.

At the beginning of the online search for this information, some of the controls can be separated from the AutoCAD system extraction, but are charged. For example, OPENDWG is used more. But to pay for membership can be used. So I want to analyze DWG's file format for myself, Then write a control yourself. The DWG file format description was found. A look, startled, so complicated, write their own is not realistic.

I had to find another avenue. Then I know the ActiveX Automation, you can use the ActiveX Automation operation AutoCAD, and then extract the DWG file information. So I wrote a control with VB, Called on the client. But calling in JavaScript requires a digital signature, and a certificate that you have generated with other tools has a lot of problems, you can't sign ActiveX controls, you have to give up.

However, this way can not be separated from the AutoCAD application. Feel this kind of words strange, the whole system will be AutoCAD application, disconnected from MS Windows. Later after analysis, in fact, their own thinking by Java, Always repel Ms things. And customers they are using AutoCAD, he can only run on MS Windows, and the client's server is Ms. In this case, the development of the service side can be used. NET or Java, But the customer chose the latter. In this way, the server side with Java invoke AutoCAD API control AutoCAD application Operation DWG.


The idea now is that the client in the system uploads the DWG file to the server, gets the information in DWG on the server, and returns it to the client.
The ActiveX component operation is invoked in the servlet using Jacob. The problem arises, and each client's request opens a application, which consumes a lot of system resources. Inspired by database connection pool, AutoCAD can be Application is viewed as a database in which the system boot is turned on and each request of the client is a connection, which is closed after use.

This is only a preliminary idea. Use Jacob to make the call. Although in the AutoCAD website search can use Java for two times development, but it seems to be for Ms J + +. So I had to call ActionX through Jacob. Because using Jacob to implement the call requires a large number of arguments. So the API needs further encapsulation.




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.