Hallo Zusammen,
ich bin erst seit kurzem hier und konnte bis jetzt immer wieder gute Tipps und Tricks nachlesen. Jetzt hab ich aber ein Problem, welches ich nicht gefunden habe oder alleine lösen konnte:
' ---------- Entsprechendes Part/Product öffnen SUB ----------
' ---------- Dateipfad lesen ----------
If oDrwSheets.Parent.Path = "" Then
Box = "The active drawing has no external references" & vbLf
Box = Box & "The makro will not work without external references on CATParts or CATProducts" & vbLf
Box = Box & "The makro ended now" & vbLf
Box = MsgBox(Box, 16, "abort!")
Exit Sub
End If
' ----------
Set ProductDrawn = oDrwSheet.Views.Item(3).GenerativeBehavior.Document
oPath = ProductDrawn.Parent.FullName
oName = ProductDrawn.Parent.Name
Dim CatWindows(100)
Dim oWindow
For II = 1 To CATIA.Windows.count
Set CatWindows(II) = CATIA.Windows.Item(II)
If oName = CATIA.Windows.Item(II).Name Then
Set oWindow = CatWindows(II)
oWindow.Activate
End If
Next
If Not oName = CATIA.Windows.Item(II).Name Then
Box = "the external reference PART/PRODUCT of the drwaing is not open!" & vbLf
Box = Box & " Please open the external reference before starting the makro again" & vbLf
Box = MsgBox(Box, 16, "abort!")
Exit Sub
End If
Set oName = CATIA.ActiveDocument
'---------
Es soll ein Part oder Product geöffnet werden auf das sich das Drawing bezieht.
1. Link auslesen
2. Prüfen ob Fenster bereits geöffnet wurde
3. Falls nicht geöffnet dann Fehlermeldung ausspucken.
und genau dann wenn ich den 3. Punkt im Debug-Mode angehe kommt die beliebte MEldung "Click OK to terminate"!!!
Bitte helft mir.
MfG Jan
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP