ja genau Michael, so hab ich es auch umgesetzt.
Funktioniert auch FAST :-P
also wenn meinen Text direkt auf die Zeichnung plaziere, dann kann ich ihn auch auf einen View setzen. Wenn ich zuvor allerdings eine Selektion in einem View ausgeführt habe dann nimmt er im Anschluss nicht mehr die Koordinaten auf der Zeichnung sondern die eines Selektierten Punktes im View. Die Koordinaten sind nachtürlich weit außerhalb meines Bildschirms(Zeichnungsrahmens).
Folgende Funktion verwende ich zuvor bspw. für die Selection einer Linie in einem View:
Function SelectAEdges(ByVal prompt As String, ByRef obj As NXObject, ByRef EndPoint1 As Point3d) _
As Selection.Response
Dim massage As String = "Select Edge"
Dim title As String = "Selection"
Dim scope As Selection.SelectionScope = Selection.SelectionScope.WorkPart
Dim scope2 As Selection.SelectionScope = Selection.SelectionScope.AnyInAssembly
Dim sel_action As Selection.SelectionAction = Selection.SelectionAction.ClearAndEnableSpecific
Dim keepHighlighted As Boolean = True
Dim includeFeatures As Boolean = True
Dim resp As Selection.Response
Dim selobj2 As NXObject = Nothing
Dim typeArray() As Selection.SelectionType = _
{Selection.SelectionType.Edges}
'Dim obj As NXObject = Nothing
EndPoint1 = Nothing
Dim cursor As Point3d = Nothing
ufs.Ui.SetCursorView(0)
title = prompt
resp = ui.SelectionManager.SelectObject(prompt, "Select an object", _
scope2, _
False, typeArray, obj, cursor)
Dim response As Selection.DialogResponse = SelectPoint(EndPoint1)
' MsgBox("x=" & EndPoint1.X & ",y=" & EndPoint1.Y & ",z=" & EndPoint1.Z)
If resp = Selection.Response.ObjectSelected Or _
resp = Selection.Response.ObjectSelectedByName Then
Return Selection.Response.Ok
Else
Return Selection.Response.Cancel
End If
End Function
Für das Absetzen des Textes verwende ich:
ufs.Ui.LockUgAccess(NXOpen.UF.UFConstants.UF_UI_FROM_CUSTOM)
Try
' Hier evtl. SpecifyScreenPosition ersetzen
ufs.Ui.SpecifyScreenPosition("Select location", _
Nothing, IntPtr.Zero, point, view_tag, response)
Finally
ufs.Ui.UnlockUgAccess(NXOpen.UF.UFConstants.UF_UI_FROM_CUSTOM)
End Try
Gruß Patric
------------------
Internet: http://www.imtech.de
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP