1.VBA projects are commonly used in three types of inserts: Forms, modules, and a VBA-thisdrawing
- form, very simple, learn VB all understand
- The module is like a warehouse that provides rich functions and procedures for the form, thisdrawing code area
- Thisdrawing, through a small amount of practice, I regard him as the entry of VBA, the equivalent of C's main function (if not correct), in this code area input:
You can start the form when the program starts running.
Option Explicit Sub Start () ' Form name End Sub
2. Get the coordinates of the mouse in CAD
This function uses the utility function:
Private SubCommandButton2_Click ()DimPtpick asVariant userform1.hide Ptpick= ThisDrawing.Utility.GetPoint (,"Pointing Point Ptpick") PtX= Ptpick (0) PtY= Ptpick (1) PtZ= Ptpick (2) Pxbox. Text=PtX Pybox. Text=PtY Pzbox. Text=PtZ userform1.showEnd Sub
Results:
Today is a little late, learn a little bit, tomorrow refueling ~!
AutoCAD VBA Learning _2015.7.13 late