Thread Content
Applications of VBA in AutoCAD and Excel Chapter 1: Overview 1. Introduction In chemical process design, the most commonly used software at the initial stage is AutoCAD and Excel; later on, 3D software was introduced as well. The use of 3D software has greatly improved our work efficiency and accuracy, but when working on smaller projects, it proves to be less useful. In small projects, the time spent on database creation, subsequent maintenance, and modeling using 3D software can account for most of the project’s timeline. Moreover, 3D software is typically available in large design firms, as many small design firms lack the resources and funding to acquire such software. I often wonder whether VBA can be used to create software modules that enable automation of certain tasks without the need for 3D software; for example, automating the calculation of material quantities, generating various finished product tables, and facilitating data exchange between AutoCAD and Excel. 2. VBA: The full name of VBA is Visual Basic for Applications. The reason why VBA is chosen over other programming languages such as VB, LISP, C, or Python is that once AutoCAD and Excel are installed, they already come with a VBA programming environment, so there is no need to install additional programming software ; The second reason is that VBA is simple and easy to use; development can be carried out with only basic programming knowledge, without the need for numerous references or complex application environment settings. Figure 1: The location of VBA in Excel. Figure 2: The VBA programming interface in Excel. Figure 3: The location of VBA in AutoCAD. Figure 4: The VBA programming interface in AutoCAD. 3. Example: This example relates to a small device I developed a few years ago; I have worked on similar projects before. However, for this project, the client required that all tables be displayed in AutoCAD. Therefore, in addition to modifying some of the Excel code, it was also necessary to automatically import large amounts of data from Excel into AutoCAD and handle pagination – which makes it an excellent example for demonstration. Video 1: Automatically generating various data tables in Excel. Video 2: Importing data from Excel into AutoCAD and paging it. 4. I hope to write down, step by step, all the knowledge I have on this topic, in the hope that it will be helpful to everyone. On the other hand, I also hope to communicate more with everyone and learn from one another to make progress. In a broader sense, if someone could turn these data and calculations that we use frequently into mobile applications, such as those for calculating the properties of water vapor, selecting pipe diameters, determining insulation thickness, calculating loads and spans for steel pipes, as well as estimating costs, it would greatly facilitate our ability to address issues promptly. It’s my first post, so I’m not entirely sure; it seems that videos can’t be inserted. Therefore, I’ve compressed the entire content and uploaded it as an attachment. Those who are interested can download it and take a look.
I developed a mobile app many years ago, for the Android system. Just search online; it’s available there, search for “unit conversions for steam properties in pipelines”. Use a smartphone to calculate the flow velocity of steel pipes, the volume of the insulation layer, the pipe area, the weight and volume of the metal, as well as the external surface area of the pipe, the external surface area of the insulation, the bending moment capacity factor of the pipe, and a list of all pipe diameters. Check the wall thickness by selecting SCH of SH ; Calculation of water vapor properties such as specific weight, viscosity, saturation temperature, enthalpy and entropy, as well as enthalpy difference ; Conversion of measurement units. Those who need it can give it a try; there are actually no ads.
Give it a try right away; you can also write about how to develop APKs. I really want to port these Excel spreadsheets and small software applications from the PC version to mobile devices.
Applications of VBA in AutoCAD and Excel, for reference, thank you