hi
please help me
i want to know how i get the x, y, z coordinates from the DXF file and save them in arrays
with VB6
thank you
Page 1 of 1
Get coordinates of DXf file how to get the x & y of DXF file in VB^
#2
Posted 21 November 2007 - 04:09 PM
Please have a look at this topic: finding cordinates
To insert a DXF file you can use function Add_DXF
To insert a DXF file you can use function Add_DXF
Athanasios Gardos
Avax-Software.com
Avax-Software.com
#3
Posted 29 November 2007 - 08:01 AM
Thank you for your replay
but i still can't get the coordinate of the DXF file in VB6.
i want to take them in arrays, like
the X coordinate saved in e.g. X() array, and
the Y coordinate saved in e.g. Y() array.
in order to use these arrays to get some statisticals.
sorry, i want the code please.
but i still can't get the coordinate of the DXF file in VB6.
i want to take them in arrays, like
the X coordinate saved in e.g. X() array, and
the Y coordinate saved in e.g. Y() array.
in order to use these arrays to get some statisticals.
sorry, i want the code please.
#4
Posted 29 November 2007 - 12:14 PM
There is a ready to use function (GetAllNodes) that returns all the different x and y coordinates (not points) in a drawing.
Please, have a look at the following example:
If this is not what you want please let me know.
Please, have a look at the following example:
Private Sub Form_Load() Dim x() As Single, y() As Single Dim lMaxX As Long, lMaxY As Long, lCnt As Long Call cAvax1.StartAvax Call cAvax1.Add_DXF(App.Path & "\test.dxf", "", 0, 0, 0) If cAvax1.GetAllNodes(x(), y()) = True Then lMaxX = UBound(x()) Debug.Print "-----X------" For lCnt = 1 To lMaxX Debug.Print x(lCnt) Next lCnt lMaxY = UBound(y()) Debug.Print "-----Y------" For lCnt = 1 To lMaxY Debug.Print y(lCnt) Next lCnt End If End Sub Private Sub Form_Unload(Cancel As Integer) Call cAvax1.EndAvax End Sub
If this is not what you want please let me know.
Athanasios Gardos
Avax-Software.com
Avax-Software.com
#6
Posted 03 December 2007 - 09:27 PM
The following VB6 code returns the line coordinates of a DXF file:
Private Sub Form_Load() Dim sDXFFile As String Dim iType() As AvaxItemType Dim vProp() As Variant Dim vData() As Variant Dim xyx() As Single Dim h() As Long Dim lCnt As Long Dim x1 As Single, y1 As Single, z1 As Single Dim x2 As Single, y2 As Single, z2 As Single sDXFFile = App.Path & "\test.dxf" Call cAvax1.StartAvax If cAvax1.Add_DXF(sDXFFile, "", 0, 0, 0, , , , , h()) = True Then If cAvax1.GetProperties(h(), iType(), vProp(), vData()) = True Then For lCnt = 1 To UBound(h()) If iType(lCnt) = Line_i Then xyz() = vData(lCnt) x1 = xyz(1) y1 = xyz(2) z1 = xyz(3) x2 = xyz(4) y2 = xyz(5) z2 = xyz(6) Debug.Print x1, y1, z1, x2, y2, z2 'line coordinates End If Next lCnt End If End If End Sub Private Sub Form_Unload(Cancel As Integer) Call cAvax1.EndAvax End Sub
Athanasios Gardos
Avax-Software.com
Avax-Software.com
Page 1 of 1
Sign In
Register
Help
Add Reply
MultiQuote