Inserts the specified text along the curve of the specified Arc.
.NET Syntax
Visual Basic (Declaration) | |
---|
Function InsertCurvedText( _
const dsString& Contents As System.String, _
dsCircleArc* CircleArc As CircleArc _
) As ArcAlignedText |
Parameters
- Contents
- Text string
- CircleArc
- ICircleArc
- ArcAlignedText[out] or Return Value
- IArcAlignedText
Example
'--------------------------------------------------------------
' Preconditions:
' 1. Create a VBA macro in a software product in which VBA is
' embedded.
' 2. Copy and paste this example into the Visual Basic IDE.
' 3. Add a reference to the DraftSight type library,
' install_dir\bin\dsAutomation.dll.
' 4. Start DraftSight.
' 5. Open c:\ProgramData\Dassault Systemes\DraftSight\Examples\pump housing.dwg.
' 6. Run the macro.
'
' Postconditions: Creates an Arc with "Curved Text" in the
' lower-left area of the drawing.
'----------------------------------------------------------------
Option Explicit
Sub main()
Dim dsApp As DraftSight.Application
Dim dsDoc As DraftSight.Document
Dim dsModel As DraftSight.Model
Dim dsSketchManager As DraftSight.SketchManager
Dim circlearc1 As DraftSight.CircleArc
Dim arcAlignedText As DraftSight.arcAlignedText
Dim curvedTextSettings As DraftSight.CurvedSettings
Dim typeface As String
Dim Bold As Boolean
Dim Italic As Boolean
Dim Charset As Long
Dim pitchAndFamily As Long
Dim dsSheet As DraftSight.Sheet
Dim dsVarSheets As Variant
Set dsApp = GetObject(, "DraftSight.Application")
'Abort any command currently running in DraftSight
'to avoid nested commands
dsApp.AbortRunningCommand
Set dsDoc = dsApp.GetActiveDocument()
If Not dsDoc Is Nothing Then
Set dsModel = dsDoc.GetModel()
Set dsSketchManager = dsModel.GetSketchManager()
Set circlearc1 = dsSketchManager.InsertArc(7.36982486789842, 1.85302055152848, 0#, 5.20869124502084, 1.54022710953838, 2.99868519349434)
Set arcAlignedText = dsSketchManager.InsertCurvedText("Curved Text", circlearc1)
Set curvedTextSettings = arcAlignedText.GetCurvedTextSettings
curvedTextSettings.GetFontParameters typeface, Bold, Italic, Charset, pitchAndFamily
Else
MsgBox "No drawing open in DraftSight"
End If
End Sub
Remarks
See Also
Availability
DraftSight 2018 SP2