Hi,
A customer asked me how to delete a graphic objet on a mimic from VBA code : is it possible ? If yes how to ?
Thanks
Hi Nico P,
Not possible I guess.
I think you should ask him the exact need as it's quite a strange request....
Nico K
I asked him and he answered :
Nous avons récupérer un projet d’une vielle version avec une résolution réduite, nous avons passé ce projet en V11 avec une résolution plus grande et je dois repasser sur plus d’une centaine de vue pour les redimensionner, retirer des parties de dessins qui ne servent plus d’où le souhait de les supprimer.
Actuellement en appuyant sur une touche j’arrive à utiliser le model que je veux pour redimensionner la fenêtre et repositionner/agrandir les éléments comme il faut ceci dans le but de gagner du temps.
Voici le code que j’utilise actuellement sachant qu’une touche de fonction dans PCVUE me met à 0 / 1 la variable DIVERS.TEST :
Dim WithEvents MyVarEvents As Variable
Public Sub fvProject_StartupComplete()
Set MyVarEvents = [DIVERS.TEST]
MyVarEvents.EnableEvents = True
End Sub
Public Sub MyVarEvents_valuechange()
Dim name As String
Dim index As Window
name = Me.ActiveMimic.name
If MyVarEvents = vbTrue Then
‘Application du model
Me.ActiveMimic.TemplateName = "MODEL_TEND01"
Me.ActiveMimic.UseTemplateAccessRights = True
Me.ActiveMimic.UseTemplateBackground = True
Me.ActiveMimic.UseTemplateGrid = True
Me.ActiveMimic.UseTemplateSize = True
'trend2 changement de taille
Me.Windows(ActiveMimic.index).Application.ActiveMimic.Graphics.Item(3).Width = 1902
Me.Windows(ActiveMimic.index).Application.ActiveMimic.Graphics.Item(3).Height = 937
'text1 changement de position
Me.Windows(ActiveMimic.index).Application.ActiveMimic.Graphics.Item(5).Left = 665
Me.Windows(ActiveMimic.index).Application.ActiveMimic.Graphics.Item(5).Top = 21
'text2 changement de position
Me.Windows(ActiveMimic.index).Application.ActiveMimic.Graphics.Item(7).Left = 781
Me.Windows(ActiveMimic.index).Application.ActiveMimic.Graphics.Item(7).Top = 1030
End If
End Sub
In english : the customer wants to delete some old graphics objects he don't need anymore on a lot of mimics.
I think I will tell him to work with notepad++
Nico P


