are available which you have selected in the "Configuration Dialog" for the customized object.
It is not possible to configure a customized object with VBA.
Further information regarding customized objects can be found in the WinCC documentation
under "Customized Object".
Creating a customized object with VBA
Use the "CreateCustomizedObject()" method to create a customized object from selected
objects:
Sub CreateCustomizedObject()
'VBA52
Dim objCustomizedObject As HMICustomizedObject
Set objCustomizedObject = ActiveDocument.Selection.CreateCustomizedObject
objCustomizedObject.ObjectName = "My Customized Object"
End Sub
When you apply the "CreateCustomizedObject()" method, the "Configuration Dialog" appears
in
which you select the object properties. The customized object that you have created is added
to the "HMIObjects" listing. Give the customized object an appropriate name
(objCustomizedObject.Name = "My Customized Object") so that you can uniquely identify it.
Editing Customized Objects
You can edit a customized object as follows:
● "Destroy" method: Ungroups the customized object.
● "Delete" Method: Deletes the customized object and the objects that it contains.
Editing objects in a customized object
Use the "Properties" property to access the selected object properties of the objects contained
in the customized object.
Sub EditCustomizedObjectProperty()
'VBA53
Dim objCustomizedObject As HMICustomizedObject
Set objCustomizedObject = ActiveDocument.HMIObjects(1)
objCustomizedObject.Properties("BackColor") = RGB(255, 0, 0)
End Sub
If you have selected more than one identical property (for example the background color of a
circle
and of a rectangle), these properties will be numbered ("BackColor" and "BackColor1").
VBA for Automated Configuration
4.3 VBA in the Graphics Designer
MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
System Manual, 11/2008,
1627