Danke, mit professioneller Unterstützung hat es dann doch noch geklappt. So sieht der Codeausschnitt aus:
Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim theSession As Session = Session.GetSession()
Dim workPart As Part
workPart = theSession.Parts.Work
Dim dataset As Tag = Tag.Null
Dim writer As New StreamWriter("C:\\Test.txt")
Dim toFind As String = "CHECK CLEARANCES"
Dim fDataset As Tag
Try
theUfSession.Clear.FindDataset(workPart.Tag, toFind, fDataset)
Catch ex As Exception
fDataset = Tag.Null
End Try
If (fDataset <> Tag.Null) Then
Dim fdsName As String = ""
theUfSession.Clear.AskDatasetName(fDataset, fdsName)
writer.WriteLine("Running in Find Mode: " + fdsName)
Try
theUfSession.Clear.DoClearanceAnalysis(fDataset)
writer.WriteLine("Success")
Catch ex As Exception
writer.WriteLine("Error detected")
End Try
Else
writer.WriteLine("Dataset " + toFind + " not found")
End If
Schwierigkeit war auch, das "FindDataset" das dataset nicht findet wenn der Clearance Check mit der Option "Component" definiert wurde. Sobald man dort auf "Body" umschaltet funktioniert es.
GTAC dazu:
***** <<<<< This PR has been closed. The resolution was: >>>>> *****
Many of the Open C API UF_CLEAR_xxx functions nolonger work.
Specifically these functions will fail to find assembly clearance datasets created interactively:
UF_CLEAR_count_datasets
UF_CLEAR_ask_next_dataset
UF_CLEAR_find_dataset
The problems documented in this PR are due to the fact that component based clearance datasets are not supported through the NX/Open API. This is a longstanding limitation. Since component based clearance was introduced, no NX/Open support has existed for component based datasets. The introduction of such support is a larger and more involved effort than can be covered under a PR, so the PR is being closed in favor of and ER.
As a workaround for the customer, it is suggested that they stick to body based clearance datasets for any datasets they expect to process with NX/Open functionality.
------------------
mfg
Leon
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP