Conditional compilation solves the problem of multiple versions of AutoCAD

Source: Internet
Author: User

The principle of Conditional compilation is that codes are useful only when [Conditional compilation symbols] (SEE) are met. This helps our CAD developers solve a great problem, we can only maintain one set of code to avoid confusion in managing multiple sets of code.

 

I used a set of code files and several project frameworks to implement them. In a simple analogy, the project framework is equivalent to a wine bottle, and the code is the wine in it, the bottle can have different shapes (. net and CAD versions), you can also paste different labels (equivalent to referencing files), but no matter how you get it, the wine inside (code, using the [link from the main program, see the image below.) All are wine ......

Sample solution

Http://pan.baidu.com/s/1gdsWSVp

 

The following is the sample code:

# If (cadversion2013)
// When the project is version 2013 (applied to cad2013), the following code is effective and can be compiled
String code2013 = "";
# Elif (cadversion2010)
// When the project is version 2010 (applied to cad2010), the following code is effective and can be compiled

String code2010 = "";
# Endif

 

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.