ObjectARX-based multi-version development method and system
By creating new ObjectArx projects in lower versions of VS software, and using higher versions of VS software for one -way upgrade and code writing, the problem of rewriting code for each CAD software version in the existing technology has been solved. Use a set of codes to generate multiple versions of CAD plug -in to improve development efficiency.
Patent Information
- Application Number
- CN202411459195.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-21
AI Technical Summary
The existing ObjectARX plug-in development method requires rewriting code for each CAD software version, resulting in high workload and low efficiency in code development.
By creating a new ObjectARX project in a lower version of VS software, using a higher version of VS software for one-way upgrade and code writing, creating multiple versions of solution configurations in the project properties, and batch compiling code to generate multiple versions CAD plug-in.
It is possible to compile multiple versions of CAD plug-ins using one set of codes, which greatly reduces the code development workload and improves development efficiency.
Smart Images

Figure CN119336335A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of software development, and relates to a multi-version development method and system based on ObjectARX. Background Art
[0002] Planning and design is a complex systematic project. In addition to compiling planning texts, a large number of planning drawings need to be drawn. There are also multiple rounds of adjustments and updates in the planning process. Planning designers are bound by a large amount of low-level drawing work. The emergence of planning-assisted design software has liberated the hands of planning designers to a certain extent. The improvement of preparation efficiency and standardization of the format of results have allowed planning designers to devote more energy to thinking about whether the plan itself is reasonable and scientific.
[0003] For a long time, the planning and design drawing platform has been mainly concentrated on the AutoCAD software platform of Autodesk, and most of the various planning auxiliary design software used in the planning and design industry are also secondary development software based on AutoCAD. Among the numerous auxiliary software, some software is just a simple integration of some functional tool sets, with a small application scope, and cannot fully support the entire process of drawing planning and design.
[0004] Using ObjectARX to develop CAD plug-ins is a very efficient method, but this method has a great limitation, that is, one version of ObjectARX plug-in can only be used for the same version of CAD software. If you want to develop multiple versions of ObjectARX plug-ins, you need to rewrite the code in the corresponding Microsoft Visual Studio (hereinafter referred to as VS) software and finally generate the plug-in, which undoubtedly brings great inconvenience to programming work. Summary of the invention
[0005] The purpose of the present invention is to provide a multi-version development method and system based on ObjectARX, which utilizes a set of code to compile multiple versions of CAD plug-ins, greatly reducing the workload of code development and improving development efficiency.
[0006] In order to achieve the above object, the basic scheme of the present invention is: a multi-version development method based on ObjectARX, comprising the following steps:
[0007] Create a new ObjectARX project P from the lower version of VS software, select the .NET Framework version corresponding to the VS software as the architecture, and save the project file;
[0008] Open project P with a higher version of VS software, upgrade the project file unidirectionally, and complete the code writing of project P;
[0009] In the properties of project P, create solution configurations of the version that needs to be compiled. Name each configuration "PZ_CAD_XXXX", where XXXX is the year of the CAD version. Configure the compilation environment for each solution.
[0010] Batch compile the code under all solution configurations that need to be compiled to generate multiple versions of CAD plug-ins.
[0011] The working principle and beneficial effects of this basic solution are as follows: this technical solution uses a lower version of VS to establish a project, and then uses a higher version of VS software to open and upgrade it, configures various versions of the Objectarx plug-in development environment in the higher version of VS software, and uses a set of code to compile multiple versions of CAD plug-ins. There is no need to rewrite the code, which greatly reduces the workload of code development and improves development efficiency.
[0012] Furthermore, create the solution configurations that need to be compiled in the properties of project P. Name each configuration "PZ_CAD_XXXX" and configure the compilation environment for each solution. The specific method is as follows:
[0013] Select the platform toolset corresponding to CAD_XXXX in each configuration;
[0014] Add the inc file and inc-x64 file directory under the ObjectARX_XXXX installation file to the include directory, and add the lib-x64 file directory under the ObjectARX_XXXX installation file to the library directory, where ObjectARX_XXXX is the ObjectARX version corresponding to CAD_XXXX;
[0015] When compiling CAD2013 and above plug-ins, add the statement "_WIN32_WINNT=x1" in the preprocessor definition to modify the default value of item P, where x1 is the Windows version number supported by CAD_XXXX;
[0016] Add "WINVER=x2" in the preprocessor definition to modify the default value of project P, where x2 is the Windows version number supported by CAD_XXXX.
[0017] Create a solution configuration that requires a compiled version in the properties of project P, and configure the compilation environment for each solution for easy use.
[0018] Furthermore, if there are different codes in different CAD version compilations, solve it by adding predefined values:
[0019] Add the statement "CADVersion = XXXX" in the preprocessor definition of the configuration "PZ_CAD_XXXX". When writing code, determine the currently compiled CAD version based on the value of CADVersion, and use #if, #elif, and #endif instructions to write inconsistent codes in multiple versions.
[0020] Simple operation and easy to use.
[0021] The present invention also provides a multi-version development system based on ObjectARX, comprising a processing unit, wherein the processing unit executes the method of the present invention to generate multiple versions of CAD plug-ins.
[0022] This system uses a processing unit to compile multiple versions of CAD plug-ins using a set of codes to improve development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a flow chart of the multi-version development method based on ObjectARX of the present invention. DETAILED DESCRIPTION
[0024] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0025] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0026] In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a mechanical connection or an electrical connection, or it can be the internal connection between two components. It can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to the specific circumstances.
[0027] Projects created by VS software can be upgraded from a lower version to a higher version, but cannot be downgraded from a higher version to a lower version. Therefore, you can use a lower version of VS to create a project, and then use a higher version of VS software to open and upgrade it. Then configure the Objectarx plug-in development environment of each version in the higher version of VS software, so that you can compile plug-ins suitable for different versions of CAD software.
[0028] The present invention discloses a multi-version development method based on ObjectARX. Figure 1 As shown, the following steps are included:
[0029] Create a new ObjectARX project P from a lower version of VS software (such as VS2008 or lower), select the .NET Framework version corresponding to the VS software as the architecture, and save the project file; for example, create a new ObjectARX project P in Microsoft VisualStudio2008, and select .NET Framework 3.5 as the architecture.
[0030] Use a higher version of VS software (such as VS2010 or above) to open project P, upgrade the project file unidirectionally, and complete the code writing of project P; for example, use Microsoft Visual Studio2017 to open project P.
[0031] In the properties of project P, create solution configurations of the version that needs to be compiled. Name each configuration "PZ_CAD_XXXX", where XXXX is the version year of CAD, and configure the compilation environment for each solution; for example, in Microsoft VisualStudio2017, create three solution configurations in the properties of project P, and name each configuration "PZ_CAD_2010", "PZ_CAD_2016", and "PZ_CAD_2020". These three configurations correspond to CAD2010, CAD2016, and CAD2020, respectively.
[0032] Batch compile the code under all solution configurations that need to be compiled to generate multiple versions of CAD plug-ins. The batch compilation operation is as follows:
[0033] In the "Build" drop-down list of Microsoft Visual Studio software, select "Batch Build", locate the "Select Project Configuration to Build" column in the pop-up dialog box, check the "Build" column of the row where the created solution configuration is located, and then click "Build".
[0034] In a preferred solution of the present invention, a solution configuration that needs to be compiled is created in the properties of the project P. Each configuration is named "PZ_CAD_XXXX". A compilation environment is configured for each solution. The specific method is as follows:
[0035] Creating a solution configuration is a feature in Microsoft Visual Studio software that is used to configure the compilation environment for code. In the Configuration Manager dialog box of Microsoft Visual Studio software, use the Active Solution Configuration drop-down list to select New to generate a new solution configuration. Creating a new solution configuration requires a custom configuration name and selecting the settings you want to copy in the Copy Settings From drop-down list.
[0036] The number of solution configurations created is equal to the number of CAD plugin versions that need to be compiled.
[0037] Select the platform toolset corresponding to CAD_XXXX in each configuration;
[0038] Add the inc file and inc-x64 file directory under the ObjectARX_XXXX installation file to the include directory, and add the lib-x64 file directory under the ObjectARX_XXXX installation file to the library directory, where ObjectARX_XXXX is the ObjectARX version corresponding to CAD_XXXX;
[0039] When compiling CAD2013 and above plug-ins, add the statement "_WIN32_WINNT=x1" in the preprocessor definition to modify the default value of item P, where x1 is the Windows version number supported by CAD_XXXX;
[0040] Add "WINVER=x2" in the preprocessor definition to modify the default value of project P, where x2 is the Windows version number supported by CAD_XXXX.
[0041] In a preferred embodiment of the present invention, if there are different codes in different CAD version compilations, it is solved by adding predefined values:
[0042] Add the statement "CADVersion = XXXX" in the preprocessor definition of the configuration "PZ_CAD_XXXX". When writing code, determine the currently compiled CAD version based on the value of CADVersion, and use #if, #elif, and #endif instructions to write inconsistent codes in multiple versions.
[0043] For example, in configuration "PZ_CAD_2010", select "Visual Studio 2008(V90)" as the platform toolset. In configuration "PZ_CAD_2016", select "Visual Studio 2010(V110)" as the platform toolset. In configuration "PZ_CAD_2020", select "Visual Studio 2017(V141)" as the platform toolset.
[0044] In the configuration "PZ_CAD_2010", add the inc file and inc-x64 file directory under the ObjectARX_2010 installation file to the include directory, and add the lib-x64 file directory under the ObjectARX_2010 installation file to the library directory. Similarly, add the inc file, inc-x64 file, and lib-x64 file directory under the ObjectARX_2016 and ObjectARX_2020 installation files to their respective configurations.
[0045] In the configuration "PZ_CAD_2010", add the statement "CADVersion = 2010" in the "Preprocessor Definitions". The _WIN32_WINNT value supported by CAD2016 is 0x0500, and the supported WINVER value is 0x0500. Therefore, in the configuration "PZ_CAD_2016", add the statements "WINVER = 0x0500" and "_WIN32_WINNT = 0x0500" in the "Preprocessor Definitions", and also add the statement "CADVersion = 2016".
[0046] The _WIN32_WINNT value supported by CAD2020 is 0x0501, and the supported WINVER value is 0x0501. Therefore, in the configuration "PZ_CAD_2020", add the "WINVER=0x0501" and "_WIN32_WINNT=0x0501" statements in the "Preprocessor Definitions", and at the same time, add the "CADVersion=2020" statement.
[0047] If you complete the code writing of project P in Microsoft Visual Studio 2017,
[0048] The following code represents drawing a circle in CAD. Write the following code in the file "acrxEntryPoint.cpp":
[0049]
[0050]
[0051] The present invention also provides a multi-version development system based on ObjectARX, including a processing unit, which executes the method of the present invention to generate multiple versions of CAD plug-ins. The system uses the processing unit to compile multiple versions of CAD plug-ins using a set of codes, thereby improving development efficiency and solidifying the secondary development results of CAD in the work for easy protection.
[0052] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0053] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A multi-version development method based on ObjectARX, characterized in that: The steps include: Create a new ObjectARX project P from the lower version of VS software, select the .NET Framework version corresponding to the VS software as the architecture, and save the project file; Open project P with a higher version of VS software, upgrade the project file unidirectionally, and complete the code writing of project P; In the properties of project P, create solution configurations of the version that needs to be compiled. Name each configuration "PZ_CAD_XXXX", where XXXX is the year of the CAD version. Configure the compilation environment for each solution. Batch compile the code under all solution configurations that need to be compiled to generate multiple versions of CAD plug-ins.
2. The ObjectARX-based multi-version development method according to claim 1, characterized in that: In the properties of project P, create the solution configuration that needs to be compiled. Name each configuration "PZ_CAD_XXXX" and configure the compilation environment for each solution. The specific method is as follows: Select the platform toolset corresponding to CAD_XXXX in each configuration; Add the inc file and inc-x64 file directory under the ObjectARX_XXXX installation file to the include directory, and add the lib-x64 file directory under the ObjectARX_XXXX installation file to the library directory, where ObjectARX_XXXX is the ObjectARX version corresponding to CAD_XXXX. When compiling CAD2013 and above plug-ins, add the statement "_WIN32_WINNT=x1" in the preprocessor definition to modify the default value of item P, where x1 is the Windows version number supported by CAD_XXXX; Add "WINVER=x2" in the preprocessor definition to modify the default value of project P, where x2 is the Windows version number supported by CAD_XXXX.
3. The ObjectARX-based multi-version development method according to claim 2, characterized in that: If there are different codes in different CAD versions, solve it by adding predefined values: Add the statement "CADVersion = XXXX" in the preprocessor definition of the configuration "PZ_CAD_XXXX". When writing code, determine the currently compiled CAD version based on the value of CADVersion, and use the #if, #elif, and #endif instructions to write inconsistent codes in multiple versions.
4. A multi-version development system based on ObjectARX, characterized in that: The method comprises a processing unit, wherein the processing unit executes the method according to any one of claims 1 to 3 to generate multiple versions of a CAD plug-in.