hallo zusammen
hier ein programmteil mit folgender absicht:
- es werden werte reingeladen über die Datei Punkte.txt
- damit werden kreise erstellt.
bei mir funktioniert das bestens.
bei meienn kollegen an einem anderen standort nicht,
ihre werte werden anders gerechnet, das "." (punkt)
wird einfach ignoriert, die erhlaten folgende mass der punkte:
P1: X=0 / Y=0 / durchmesser=15
P2: X=15 / Y=15 / durchmesser=25
kann mir das bitte einmal einer testen, danke?
(wenn möglich testen in nx8.5 und nx6)
wenn auch falsch, was kann da unternommen werden?
danke!
-----------------------------------------------------------
Option Strict Off
Imports System
Imports System.Windows
Imports System.Windows.Forms
Imports System.Math
Imports System.IO
Imports NXOpen
Imports NXOpen.UF
Module Module1
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim workpart As Part = theSession.Parts.Work()
Dim theUI As UI = UI.GetUI()
Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim filebox As New OpenFileDialog()
filebox.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
filebox.Title = "Datei mit Kreis-Daten wählen"
filebox.InitialDirectory = "C:\temp"
If filebox.ShowDialog() = DialogResult.OK Then
theSession.LogFile.WriteLine(filebox.FileName)
Dim mystream As StreamReader = New StreamReader(filebox.FileName)
Dim linecount As Integer = 0
Do While mystream.EndOfStream = False
linecount = linecount + 1
Dim zeile As String = mystream.ReadLine()
Dim cwerte As String() = zeile.Split(",")
' ------ Kreis Werte
dim x as decimal = cwerte(0)
dim y as decimal = cwerte(1)
dim z as decimal = 0
dim dm as decimal = cwerte(2)
' ----- kreis erzeugen
Dim center_pt As Point3d = New Point3d(x, y, z)
Dim mx As Matrix3x3
With mx
.Xx = 1
.Xy = 0
.Xz = 0
.Yx = 0
.Yy = 1
.Yz = 0
.Zx = 0
.Zy = 0
.Zz = 1
End With
Dim top As NXMatrix = workpart.NXMatrices.Create(mx)
workpart.Curves.CreateArc(center_pt, top, dm/2, 0, 2 * PI)
Loop
mystream.Close()
End If
End Sub
End Module
------------------
gruss urs
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP