I am writing VBA code for Catia V5 to define an endpoint on a reference line.
The section of code looks as follows:
Dim oReference1 As Reference
Dim oHybridShapeFactory As HybridShapeTypeLib.HybridShapeFactory
Dim intPoint As HybridShapePointOnCurve
Dim oCount As Double
oCount = 10
LenVal = GetLengthValue(oPart, MessRef) 'LenVal stems from a function and is equal to 654.5 (for instance) of Type Double
Dim NoOfSections As Integer
NoOfSections = LenVal / oCount
Dim i As Double
For i = 0 To NoOfSections
Set intPoint = oHybridShapeFactory.AddNewPointOnCurveFromDistance(oReference1, (i * (LenVal / NoOfSections)), False)
...
There is an error message on the Set intPoint...
line stating:
runtime error 91: object variable or with-block variable not defined
I have been digging through the help documentation. Everything seems to be defined as required - the Function AddNewPointOnCurveFromDistance takes a Reference, a double, and a boolean as HybridShapePointOnCurve.