This code should get you started -- it draws lines between successive
mouse clicks. This routine is entered with the x,y pos of the mouse.
You need the Whip toolkit (free from Autodesk last I looked) to get
the opcodes for drawing text.
Private StartPoint As Boolean
Private DrawColor As Integer
Private LineWt As Long
Private StartPt As String
Private EndPt As String
Const DWF_Header = "(DWF V00.42) "
Const DWF_Layer = " (Layer 99 Draw1) "
Const DWF_End = " (EndOfDWF) "
Private Sub DrawLine(x As Variant, y As Variant, StartPoint As
Boolean, DrawColor As Integer, LineWt As Long)
Get_CurrentView
If StartPoint Then
x1 = x
y1 = y
StartPt = x1 & "," & y1
StartPoint = False
Else
x3 = x
y3 = y
EndPt = x3 & "," & y3
Whip1.Add (DWF_Header & DWF_Layer)
Whip1.Add ("C " & DrawColor & " ")
Whip1.Add (" (LineWeight " & LineWt & ") ")
Whip1.Add ("L " & StartPt & " " & EndPt)
Whip1.Add (DWF_End)
StartPt = EndPt
Reset_View
End If
End Sub
ganeshcr wrote:
>Using the whip ActiveX control.Can I use a script to add some text to the displayed dwf file.
Michael Porter Naval Architect / Boatbuilder
mporter at mp-marine.com
www.mp-marine.com
Cartography: www.cba-inst.org