Dim iBody(100) Dim InputDocType(0) Set partDocument1 = CATIA.ActiveDocument Set selection1 = partDocument1.Selection j = selection1.Count
If 0 < j Then '<は半角 for ii=1 to j set iBody(ii) = selection1.FindObject("CATIABody") next
msgbox j & "個のmirrorを生成します。次にPlaneを選択してください" Else msgbox "Bodyが事前選択されていません。" Exit Sub End If
Set part1 = partDocument1.Part Set shapeFactory1 = part1.ShapeFactory InputDocType(0)="Plane" selection1.Clear Result = selection1.SelectElement2(InputDocType, "Select Plane", True) Set pln1 = selection1.Item(1).Value
for ii=1 to j on error resume next
part1.InWorkObject = iBody(ii) 'msgbox iBody(ii).name Set mirror1 = shapeFactory1.AddNewMirror(pln1) part1.Update next