0% found this document useful (0 votes)
14 views

Point Excel To Cad

This macro extracts data from an Excel worksheet, defines variables, and prints the data to a file using coordinates and text labels. It contains subroutines to configure layers and settings for the output file, plot point symbols and text for elevation and profile data, and call the main macro and form to run the process. The overall purpose is to take survey data from Excel and output a CAD file.

Uploaded by

Aris Hartono
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Point Excel To Cad

This macro extracts data from an Excel worksheet, defines variables, and prints the data to a file using coordinates and text labels. It contains subroutines to configure layers and settings for the output file, plot point symbols and text for elevation and profile data, and call the main macro and form to run the process. The overall purpose is to take survey data from Excel and output a CAD file.

Uploaded by

Aris Hartono
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Sub Macro1()

� Macro Created 27/09/2005 by Edse


Dim X(5000), Y(5000), Z(5000)
Dim Napt(5000) As String
Sheets(�XYZ�).Select
jdat = Application.WorksheetFunction.CountA(Range(Cells(4, 2), Cells(5004, 2)))
Cells(1, 2) = jdat
Pi = Application.WorksheetFunction.Pi
For r = 1 To jdat
brs = 4 + (r � 1)
X(r) = Cells(brs, 3)
Y(r) = Cells(brs, 4)
Z(r) = Cells(brs, 5)
Napt(r) = Cells(brs, 2)
Next
Configurasi
�=============Creat Point Symbol=================================
Poin
Print #1, �PDMODE�
Write #1, 34
Print #1, �PDSIZE�
Write #1, 1.5
For r = 1 To jdat
Print #1, �Point�
Write #1, X(r), Y(r)
Next
Elv
For r = 1 To jdat
Print #1, �TEXT�
Print #1, �J�
Print #1, �MC�
Write #1, X(r), Y(r)
Write #1, 3: Write #1, 0: Print #1, Format(Z(r), �#0.000�)
Print #1, ��: Print #1, ��: Print #1, ��
Next
Profil
For r = 1 To jdat

Print #1, �TEXT�


Print #1, �J�
Print #1, �TC�
Write #1, X(r), Y(r) � 0.5
Write #1, 3: Write #1, 0: Print #1, Napt(r)
Print #1, ��: Print #1, ��: Print #1, ��

Next
Print #1, �zoom�: Print #1, �e�
Close #1
End Sub
Sub Configurasi()
Print #1, �OSNAP�: Print #1, �OFF�
�=========Setting line type scale=======================================
Print #1, �LTSCALE�: Write #1, 1: Print #1, ��: Print #1, ��
�==========Setting font=============================================
Print #1, �STYLE�: Print #1, �ARIAL�: Print #1, �ARIAL�
Print #1, ��: Print #1, ��: Print #1, ��: Print #1, ��
Print #1, ��: Print #1, ��: Print #1, ��: Print #1, ��
Print #1, ��: Print #1, ��: Print #1, ��: Print #1, ��
Print #1, ��: Print #1, ��: Print #1, ��: Print #1, ��
Print #1, ��: Print #1, ��: Print #1, ��
Print #1, ��: Print #1, ��

�SETTING NEW LAYER :

�================== Layer Elvasi =================================


Print #1, �-LAYER�: Print #1, �N�: Print #1, �Elv�
Print #1, �C�: Print #1, �3�: Print #1, �Elv�
Print #1, �L�: Print #1, �CONTINUOUS�: Print #1, �Elv�
Print #1, �Lw�: Print #1, �0.2�: Print #1, �Elv�
Print #1, ��: Print #1, ��: Print #1, ��
�================== Layer Elvasi =================================
Print #1, �-LAYER�: Print #1, �N�: Print #1, �Profil�
Print #1, �C�: Print #1, �2�: Print #1, �Profil�
Print #1, �L�: Print #1, �CONTINUOUS�: Print #1, �Profil�
Print #1, �Lw�: Print #1, �0.2�: Print #1, �Profil�
Print #1, ��: Print #1, ��: Print #1, ��

�=================Layer Point==================================
Print #1, �-LAYER�: Print #1, �N�: Print #1, �Point_Symbol�
Print #1, �C�: Print #1, �1�: Print #1, �Point_Symbol�
Print #1, �L�: Print #1, �CONTINUOUS�: Print #1, �Point_Symbol�
Print #1, �Lw�: Print #1, �0.2�: Print #1, �Point_Symbol�
Print #1, ��: Print #1, ��: Print #1, ��
End Sub
Sub Profil()
Print #1, �-LAYER�: Print #1, �S�: Print #1, �Profil�
Print #1, ��: Print #1, ��: Print #1, ��
Print #1, ��: Print #1, ��
End Sub
Sub Elv()

Print #1, �-LAYER�: Print #1, �S�: Print #1, �Elv�


Print #1, ��: Print #1, ��: Print #1, ��
Print #1, ��: Print #1, ��
End Sub
Sub Poin()
Print #1, �-LAYER�: Print #1, �S�: Print #1, �Point_Symbol�
Print #1, ��: Print #1, ��: Print #1, ��
Print #1, ��: Print #1, ��
End Sub
Sub Gbr()
Dim NFile As String
NFile = FrmInsert.CommonDialog1.Filename
Open NFile For Output As #1
Macro1
End Sub
Sub Plot()
FrmInsert.Show
End Sub

You might also like