Implement AutoCAD API in Java

xiaoxiao2021-03-06  51

Because in the project you need to extract the properties in the Title box in the DWG file in the project to the database to implement the batch of the drawings in the database.

At first, some controls are available online, some of which can be detached from the AutoCAD system, but they are all charged. For example, OpenDWG is more useful. But to pay a member to use. I want to analyze myself. DWG file format, then write a control out. Find DWG file format description. At first glance, it is scared, so complicated, write is unrealistic.

I have to find other gates. Later, I learned Automation, you can use the ActiveX Automation to operate AutoCAD, and then extract information about the DWG file. So use VB to write a control, call in the client, but you need a digital signature in JavaScript, you There are a lot of certificates for other tools, and you cannot sign the ActiveX control, you have to give up.

However, this way can not be separated from AutoCAD Application. It feels like this, the entire system must be taken by AutoCAD Application. It can't get the Windows of MS. Later, after analysis, in fact, his own ideas were traveled by Java, always excluded MS's things. And customers use AutoCad, he can only run on the MS Windows, and the customer's server is also MS. In this way, the server can use .NET or JAVA, but customers have selected the latter. In this case, you can control the AUTOCAD Application Operation DWG at the server side of Java call AutoCAD.

Now the idea is: The client is uploaded to the server in the system, obtains information in the DWG on the server, then returns to the client. So use Jacob to call the ActiveX component operation in the servlet. Question, each client request Will open an application so that you will take a lot of system resources. Released by the database connection pool, you can view the AutoCAD Application as a database, which is open, and each request in the Client is a connection, after it is complete. .

This is just a preliminary idea. Specific use of Jacob is called. Although you can search for secondary development in AutoCAD website, it is like J for MS. So you have to call ActionX through Jacob. Due to Jacob. Due to use Jacob to implement calls that require a large number of parameters. So further packages are needed for the API.

转载请注明原文地址:https://www.9cbs.com/read-40866.html

New Post(0)