AutoCAD VBA - Create Table and insert data

AutoCAD VBA - Create Table and add data

ADD TABLE @ X=400,  Y = 300

 

Call AddTable(400, 300)

 

Code Begins

'----------------------

Sub AddTable(ByVal x1 As Double, ByVal y1 As Double)

Dim pt(0 To 2) As Double
Dim acTable As AcadTable
pt(0) = x1: pt(1) = y1: pt(2) = 0
Set acTable = ThisDrawing.ActiveLayout.Block.AddTable(pt, 5, 3, 15, 80)

AutoCAD VBA - Create Table and insert data

AutoCAD VBA - Create Table and add data

ADD TABLE @ X=400,  Y = 300

 

Call AddTable(400, 300)

 

Code Begins

'----------------------

Sub AddTable(ByVal x1 As Double, ByVal y1 As Double)

Dim pt(0 To 2) As Double
Dim acTable As AcadTable
pt(0) = x1: pt(1) = y1: pt(2) = 0
Set acTable = ThisDrawing.ActiveLayout.Block.AddTable(pt, 5, 3, 15, 80)

AutoCAD VBA - Create Table and insert data

AutoCAD VBA - Create Table and add data

ADD TABLE @ X=400,  Y = 300

 

Call AddTable(400, 300)

 

Code Begins

'----------------------

Sub AddTable(ByVal x1 As Double, ByVal y1 As Double)

Dim pt(0 To 2) As Double
Dim acTable As AcadTable
pt(0) = x1: pt(1) = y1: pt(2) = 0
Set acTable = ThisDrawing.ActiveLayout.Block.AddTable(pt, 5, 3, 15, 80)

AutoCAD VBA - Create Table and insert data

AutoCAD VBA - Create Table and add data

ADD TABLE @ X=400,  Y = 300

 

Call AddTable(400, 300)

 

Code Begins

'----------------------

Sub AddTable(ByVal x1 As Double, ByVal y1 As Double)

Dim pt(0 To 2) As Double
Dim acTable As AcadTable
pt(0) = x1: pt(1) = y1: pt(2) = 0
Set acTable = ThisDrawing.ActiveLayout.Block.AddTable(pt, 5, 3, 15, 80)

AutoCAD VBA - Create Table and insert data

AutoCAD VBA - Create Table and add data

ADD TABLE @ X=400,  Y = 300

 

Call AddTable(400, 300)

 

Code Begins

'----------------------

Sub AddTable(ByVal x1 As Double, ByVal y1 As Double)

Dim pt(0 To 2) As Double
Dim acTable As AcadTable
pt(0) = x1: pt(1) = y1: pt(2) = 0
Set acTable = ThisDrawing.ActiveLayout.Block.AddTable(pt, 5, 3, 15, 80)

AutoCAD VBA - simple code to draw line with colour information

Simple Code to Draw lines in AutoCAD VBA

'call statement

Call drawline(x1, y1, x2, y2, 1)

replace x1, y1, x2, y2 with your X and Y cordinates

replace 1 with colour of choice

available colours

1 : White

2 : Cyan

3 : Green

4 : Red

5 : Yellow

6 : Blue

7 : Magenta

 

 

FULL CODE

Tags

AutoCAD VBA 3D Extrude Example 6. (user form project) CAAadmin Tue, 04/03/2018 - 10:03

Use VBA USer form to create 3D extrsion in Autocad

Refer previous articles (to create userform project)

http://www.computeraidedautomation.com/article/autocad-vba-create-circle-user-form

autocad 3d vba

Tags

AutoCAD Drawing Automation : Part 1 - Create custom toolbar and button

AUTOCAD DRAWING AUTOMATION FREE TUTORIALS

In this tutorial, we will see how to create your own command button and insert it to the custom toolbar (name it under your organization/institution). when you click on those buttons, it can perform certain pre-written actions like draw objects, add dimensions, change properties, change drawing scale, printing, export to other data formats like excel/access database. there will be more tutorials on each subject soon..

Now, let us begin with the basic toolbar/button creation

 

Tags