AutoCAD VBA Learning _2015.7.13 late

Source: Internet
Author: User

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

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.