Hallo
habe das selbe Problem. Bekam mal folgenden Lösungsvorschlag. Bei mir funktionierts nicht so ganz aber einen Versuch isses doch wert oder ? ;-) Bei dem Beispiel kann der Benutzer eingreifen und auf das Achsenkreuz klicken das er aktivieren will.
HAT NOCH JEMAND EINE IDEE ?
----
Language="VBSCRIPT"
Sub CATMain()
Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As Part
Set part1 = partDocument1.Process
'**************************************************
' Selektion des relatives koordinatensystems
'**************************************************
Dim axisSystems2 As AxisSystems
Set axisSystems2 = part1.AxisSystems
Dim select2 As Selection
Set select2= CATIA.ActiveDocument.Selection
Dim sStatus2 As SelectedElement
ReDim sFilter(0)
sFilter(0) = "AxisSystem"
sStatus2 = select2.SelectElement(sFilter,"Bitte das Koordinatensystem selektieren, das aktiviert werden soll!", false)
'MsgBox sStatus2
If (sStatus2 = "Cancel") Then
MsgBox "Macro wird beendet"
Exit Sub
End If
'MsgBox select2.Count
Set object2 = select2.Item(1)
Dim axisSystem2 As AxisSystem
Set axisSystem2 = object2.Value
axisSystem2.IsCurrent = True
'MsgBox "Axis Type:" & axisSystem2.Type
'axisSystem2.Type =1
'MsgBox "Origin Type: " & axisSystem2.OriginType
'axisSystem2.OriginType=0
Dim originCoord2(2)
axisSystem2.GetOrigin originCoord2
MsgBox "Origin: " & originCoord2(0) & " " & originCoord2(0) & " " &originCoord2(2)
End Sub
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP