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