Sub CATMain() Set productDocument1 = CATIA.ActiveDocument Set selection1 = productDocument1.Selection selection1.Clear selection1.Search "CATPrtSearch.PartFeature,in" If selection1.Count = 0 Then MsgBox "当前没有零件处于编辑状态" End End If CATIA.StartCommand "将图居中" End Sub |