si_mon
Aerospace
- Mar 8, 2023
- 2
Hi all,
I'm trying to create a simple dimension in the drawing module in VBScript.
The following code works fine in CATScript but when I try to use it VBScript I get an error.
Any idea what is wrong with this code?
here is the error
compile error:
function or interface marked as restricted, or the function uses an automation type not supported in VB
I'm trying to create a simple dimension in the drawing module in VBScript.
The following code works fine in CATScript but when I try to use it VBScript I get an error.
Any idea what is wrong with this code?
Code:
Dim Draw_point_1
Set Draw_point_1 = fact_Draw.CreatePoint(Blank_size_x_max.Value + 50, 0)
Dim Draw_point_2
Set Draw_point_2 = fact_Draw.CreatePoint(-Blank_size_x_min.Value - 50, 0)
Dim Line1
Set Line1 = fact_Draw.CreateLine(0, 0, 1, 0)
Dim iType As CatDimType
iType = catDimDistance
ReDim myElements(1)
myElements(1) = Array(Draw_point_1, Draw_point_2)
ReDim selpoints(3)
selpoints(3) = Array(0, 0, 0, 0)
Dim MyDimension
[highlight #CC0000]Set MyDimension = oFrontView11.Dimensions.Add2(iType, myElements(1), selpoints(3), Line1, 0)[/highlight]
Set oDimVal = MyDimension.GetValue
oDimVal.SetFormatPrecision 1, "1"
here is the error
compile error:
function or interface marked as restricted, or the function uses an automation type not supported in VB