hi there
I am trying to import dxf file and edit a text at this file
how i can do it in vb6?
Page 1 of 1
editing text dxf file
#2
Posted 28 June 2010 - 09:07 AM
Hi,
use this code:
use this code:
Dim sDxfFile As String
Dim lTextHandles() As Long, lHandles() As Long
Dim lMaxHandles As Long, l As Long
Dim sText As String
Dim iType() As AvaxItemType, iColor() As Integer, iWidth() As Integer
Dim iStyle() As Integer, iLayer() As Integer, Elevation3D() As Single, Height3D() As Single
Dim x As Single, y As Single, z As Single, sFontName As String
Dim vItemProperties As Variant, sScale As Single, iFontNumber As Integer
Dim Angle As Single, iNewClr As Integer
Dim iNewWidth As Integer, iNewStyle As Integer, iNewLayer As Integer
Dim fBold As Boolean, fItalic As Boolean, fUnderline As Boolean
Dim fStrikeOut As Boolean, lCharset As Long
Dim dWidth As Single, dHeight As Single, lTextLines As Long
sDxfFile = "......."
Call cAvax1.Add_DXF(sDxfFile, "", 0, 0, 0)
lMaxHandles = cAvax1.GetAllHandlesArr(lTextHandles(), Text_i)
For l = 1 To lMaxHandles
'To get the text attributes'
ReDim lHandles(1) As Long
lHandles(1) = lTextHandles(l)
Call cAvax1.GetAttributes(lHandles(), iType(), iColor(), iWidth(), iStyle(), iLayer(), Elevation3D(), Height3D())
sText = cAvax1.GetTextAttributes(lTextHandles(l), sFontName, fBold, fItalic, fUnderline, fStrikeOut, lCharset)
iFontNumber = cAvax1.GetTextFontNumber(lTextHandles(l))
Call cAvax1.GetTextGeometry(lTextHandles(l), x, y, dWidth, dHeight, Angle, lTextLines)
sScale = dHeight / cAvax1.GetAvaxProperty(TextInitHeight_p)
'To change the text'
Call cAvax1.DeleteItems(lHandles())
Call cAvax1.Add_Text(sText, x, y, z, vItemProperties, sScale, iFontNumber, Angle, iNewClr, iNewWidth, iNewStyle, iNewLayer, fBold, fItalic, fUnderline, fStrikeOut, lCharset)
Next l
Page 1 of 1
Sign In
Register
Help
Add Reply
MultiQuote