j’ai une macro pour insérer rapidement des annotations dans un plan, il me manque la position comme un glisser déposer, ce que je ne trouve pas donc je cherche la position X Y comme dans la barre des tâches solidworks
Sub Note()
Dim swApp As Object
Dim Part As Object
Dim myModelView As Object
Dim myBlockDefinition As Object
Dim myAnnotation As Object
Dim URL_0 As String
Dim URL_1 As String
Dim choix As String
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set myModelView = Part.ActiveView
URL_0 = "C:\Users\xxx\"
choix = InputBox("1 : Découpe_insert_hex.SLDBLK" & vbCrLf & _
"2 : Gousset.sldnotestl" & vbCrLf & _
"3 : Soudure.SLDBLK" & vbCrLf & vbCrLf & _
"Entrez le numéro du bloc à insérer", "Choix du bloc")
Select Case choix
Case "1": URL_1 = URL_0 & "Découpe_insert_hex.SLDBLK"
Echelle = 1
Case "2": URL_1 = URL_0 & "Gousset.sldnotestl"
Echelle = 1
Case "3": URL_1 = URL_0 & "Soudure.SLDBLK"
Echelle = 0.05
Case Else: Exit Sub
End Select
If choix = 2 Then
Set myAnnotation = Part.Extension.InsertAnnotationFavorite(URL_1, X_cd, Y_cd, 0)
Else
Set myBlockDefinition = Part.SketchManager.MakeSketchBlockFromFile(Nothing, URL_1, False, Echelle, 0)
End If
End Sub
je veux capturer dans un plan la position du curseur au clique
par exemple j’ai un userform2 que je pensais utiliser en non modal, cliquer sur la feuille, visualiser les position X et Y, valider et me servir des coordonnées
Private Sub CommandButton1_Click()
'OK
Call Note
End Sub
Private Sub TextBox1_Change()
'X
End Sub
Private Sub TextBox2_Change()
'Y
End Sub

je n’arrives pas à trouver le code