Hallo SMario,
hab da wieder mal ein Problem mit diesem code.
Habe ein form1 mit einem button1 mit dem rufe ich form2 auf
-------------------------------------------
Dim F2 As New Form2
Me.Hide()
F2.Show()
-------------------------------------------
Auf der form2 befindet sich ein button2 mit dem ich dem ich den
Kreis erstellen kann
------------------------------------------
Private Sub kreis_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kreis.Click
Dim theSession As Session = Session.GetSession()
Dim center As Point3d
If 2 = SelectPoint(center) Then
Dim radius As Double = 3.0
Dim startAngle As Double = 0.0
Dim endAngle As Double = 360.0
Dim pi As Double = 3.1415926535897931
Dim t As Integer = 180
Dim t1 As Double = startAngle * pi
Dim t2 As Double = endAngle * pi
startAngle = t1 / t
endAngle = t2 / t
Dim orientation As Matrix3x3
orientation.Xx = 1.0
orientation.Xy = 0.0
orientation.Xz = 0.0
orientation.Yx = 0.0
orientation.Yy = 1.0
orientation.Yz = 0.0
orientation.Zx = 0.0
orientation.Zy = 0.0
orientation.Zz = 1.0
Dim matrix As NXOpen.NXMatrix
matrix = theSession.Parts.Work.NXMatrices.Create(orientation)
theSession.Parts.Work.Curves.CreateArc(center, matrix, radius, startAngle, endAngle)
End If
End Sub
Function SelectPoint(ByRef center As Point3d) As Selection.Response
Dim point_tag As NXOpen.Tag
Dim base_pt(2) As Double
Dim response As Integer
Dim cue As String = "Select a point"
Dim nxopenSession As NXOpen.UF.UFSession = NXOpen.UF.UFSession.GetUFSession()
nxopenSession.Ui.LockUgAccess(NXOpen.UF.UFConstants.UF_UI_FROM_CUSTOM)
Try
nxopenSession.Ui.PointConstruct(cue, nxopenSession.Ui.PointBaseMethod.PointCursorPos, point_tag, base_pt, response)
Finally
nxopenSession.Ui.UnlockUgAccess(NXOpen.UF.UFConstants.UF_UI_FROM_CUSTOM)
End Try
center.X = base_pt(0)
center.Y = base_pt(1)
center.Z = 0.0
Return response
End Function
------------------------------------------
Das ist also der gleiche code wie für module, denn möchte ich nur als
.exe ausführen.
Der führt das zwar aus ich bekomme den kreis angezeigt, nur hinterher
kommt eine messagebox von unigraphics "Vorgang aktiv" "Mit Stopp beenden Sie diese Operation".
Jetzt beende ich meine .exe datei und möchte weiter in Unigraphics arbeiten, geht aber leider nicht die ganzen funktionen sind grau und wenn ich jetzt unigraphics beenden will, bekomme ich eine info "Modelliererfehler: STAMOD muß erster Aufruf an KI sein".
Kannst du damit was anfangen? Es klappt irgendwie vor und hinten nicht, ich bekomme immer diese Fehlermeldung.
Wenn jemand anders mir auch helfen kann bin für jede hilfe dankbar.
Danke in voraus für eure hilfe
Gruß l.pesch
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP