VBA Add text into DXF while exporting to dxf

VBA Add text into DXF while exporting to dxf

bionorica2015
Enthusiast Enthusiast
258 Views
1 Reply
Message 1 of 2

VBA Add text into DXF while exporting to dxf

bionorica2015
Enthusiast
Enthusiast

Hello!

I want to add text into DXF while exporting to dxf.

I use this oDataIO.WriteDataToFile sOut, oPath for exporting part to dxf.

How can I add text into DXF while exporting to dxf?

I have this code below for adding text:

Dim txtpt As Variant
    Dim txtvl As String
    Dim acadText As Object
    
    txtpt = ThisDrawing.Utility.GetPoint(, "Text position")
    txtvl = Val(TextBox10.Text)
    Dim TextPosition(0 To 2) As Double
    TextPosition(0) = 1 'txtpt(0)
    TextPosition(1) = 2 'txtpt(1)
    TextPosition(2) = 0# 'txtpt(2)
Set acadText = ThisDrawing.ModelSpace.AddText("test", TextPosition, 2)

Bu I think word ThisDrawing is incorrect. Please help. Maybe I must add ThisRow instead of ThisDrawing when I loop through all iparts in part document?!

 

0 Likes
259 Views
1 Reply
Reply (1)
Message 2 of 2

Michael.Navara
Advisor
Advisor

I don't understand, what do you try to do. 

You try to export flat pattern to DXF? In this case you are not able to add any text description as ACAD text object.

0 Likes