Code:
Sub CATMain()
Dim ArrayOfParts() 'As Object
Dim ArrayOfParts_size 'As Integer
Dim SelectedPart 'As Object
Dim PartFilt(0)
Set ProdDoc1 = CATIA.ActiveDocument
Set SelectedParts = ProdDoc1.Selection
PartFilt(0) = "Part"
Dim ret
ArrayOfParts_size = -1
SelectedParts.Clear
ret = SelectedParts.SelectElement2(PartFilt, "Select Part", False)
ArrayOfParts_size = ArrayOfParts_size + 1
ReDim Preserve ArrayOfParts(ArrayOfParts_size)
MsgBox TypeName(SelectedParts.Item(1).Value)
MsgBox ArrayOfParts_size
ArrayOfParts(ArrayOfParts_size) = SelectedParts.Item(1).Value
End Sub
Hello everyone
I've got problem with filling array of parts -see code below.
Macro stops at error on line:
ArrayOfParts(ArrayOfParts_size) = SelectedParts.Item(1).Value
"Object doesn't support this property or method"
is it even possible to create array of Part object's type?
LukaszSz. Poland, Warsaw University of Technology, Faculty of Power and Aeronautical Engineering : MEchanical Engineering. BsC - 2013