Dim markId1 As Session.UndoMarkId markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Create Symbol Instance") Dim customSymbolData1 As Annotations.CustomSymbolData customSymbolData1 = workPart.Annotations.CustomSymbols.NewCustomSymbolData("Indexmarkierung") customSymbolData1.TextPreferencesOption = Annotations.TextPreferencesOption.MasterSymbol customSymbolData1.SymbolPreferencesOption = Annotations.SymbolPreferencesOption.MasterSymbol customSymbolData1.Scale = scale Dim nullExpression As Expression = Nothing customSymbolData1.ScaleExpression = nullExpression customSymbolData1.Angle = 0.0 Dim data1() As Annotations.CustomSymbolTextData data1 = customSymbolData1.GetTextData() ' ---------------------------------------------- ' Dialogfenster Anfang Indexmarkierung ' ---------------------------------------------- Dim customSymbol1 As Annotations.CustomSymbol Dim letteringPrefs As Annotations.LetteringPreferences Dim generalText1 As Annotations.Lettering Dim message As String = "Position auswählen...." Dim screen_pos(2) As Double Dim viewTag As Tag = theSession.Parts.Display.Views.WorkView.Tag Dim response As Integer = 0 Dim motion_cb_data As System.IntPtr Dim client_data As System.IntPtr = Nothing theUFSession.Ui.LockUgAccess(UFConstants.UF_UI_FROM_CUSTOM) Try theUFSession.Ui.SpecifyScreenPosition(message, AddressOf my_motion_cb, _ motion_cb_data, screen_pos, viewTag, response) Finally theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM) End Try Dim pos As New Point3d(screen_pos(0), screen_pos(1), screen_pos(2)) If response = UFConstants.UF_UI_PICK_RESPONSE Then customSymbol1 = workPart.Annotations.CustomSymbols.CreateCustomSymbol(customSymbolData1, pos, Nothing) customSymbol1.SetName(Left$(symname, laenge8)) Dim displayModification1 As DisplayModification displayModification1 = theSession.DisplayManager.NewDisplayModification() displayModification1.ApplyToAllFaces = True Dim Farbe As String = Space$(5) Dim laenge3 As Long laenge3 = GetPrivateProfileString("Symbolfarbe", "Farbe", _ "", Farbe, 5, WirtgenTool + "\Indexmarkierung1.ini") displayModification1.NewColor = Left$(Farbe, laenge3) Dim objects1(0) As DisplayableObject objects1(0) = customSymbol1 displayModification1.Apply(objects1) displayModification1.Dispose() customSymbolData1.Dispose() Else letteringPrefs = workPart.Annotations.Preferences.GetLetteringPreferences() letteringPrefs.AlignmentPosition = pref0 generalText1.Size = pref1 generalText1.CharacterSpaceFactor = pref2 generalText1.AspectRatio = pref3 generalText1.LineSpaceFactor = pref4 generalText1.Cfw.Color = pref5 generalText1.Cfw.Font = pref6 generalText1.Cfw.Width = pref7 letteringPrefs.SetGeneralText(generalText1) workPart.Annotations.Preferences.SetLetteringPreferences(letteringPrefs) letteringPrefs.Dispose() GoTo End1 End If