Hello, I have been struggling with trying to create a spline using v6 vb net macro for the frame and title block. I am very new to this and am trying to create a logo. I have been able to create lines and circles but splines/curves have alluded me. I have tried multiple time, this is my latest attempt.
Any help with this would be greatly appreciated.
Code:
' Initialize CATIA
Dim CATIA As Object
Set CATIA = GetObject(, "CATIA.Application")
' Access the active drawing document
Dim drawingDoc As DrawingDocument
Set drawingDoc = CATIA.ActiveDocument
' Access the drawing sheet
Dim drawingSheet As DrawingSheet
Set drawingSheet = drawingDoc.Sheets.Item(1)
' Access the drawing view
Dim drawingView As DrawingView
Set drawingView = drawingSheet.Views.Item(1)
' Access the Factory2D
Dim factory2D As Factory2D
Set factory2D = drawingView.Factory2D
' Define the points for the spline
Dim points(2) As Point2D
Set points(0) = factory2D.CreatePoint(0, 0)
Set points(1) = factory2D.CreatePoint(10, 10)
Set points(2) = factory2D.CreatePoint(20, 0)
' Create a SafeArray to hold the points
Dim poles As Variant
poles = CATIA.CreateObject("CATSafeArrayVariant")
poles.SetArray points
' Create the spline
Dim spline As Spline2D
Set spline = factory2D.CreateSpline(poles)
spline.Name = "ProjSpline1"
' Add the spline to the selection
MyCATIA.ActiveDocument.Selection.Add spline
' Set visual properties for the spline
Dim visProperties1 As VisPropertySet
Set visProperties1 = MyCATIA.ActiveDocument.Selection.VisProperties
visProperties1.SetRealWidth 2 * inch, 0.25 * inch
' Update the drawing
drawingDoc.Update
Any help with this would be greatly appreciated.