Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Categories
  • Forums
  • Knowledge Center
  • Blogs
  • Ideas
  • Events & Webinars
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Replacing Genies with Graphics Builder Automation Interface

AVEVA Plant SCADA Forum

A support forum for AVEVA Plant SCADA (formerly Citect SCADA). Share new and exciting product information, connect, learn, and collaborate with the ecosystem of Plant SCADA Users. AVEVA Plant SCADA a reliable, flexible and high-performance Supervisory Control and Data Acquisition software solution for industrial process customers. This forum is to connect, share, learn and collaborate new and exciting product information. Feel free to join and share to your Ecosystem of Plant SCADA Users.

Search in

Improve your search experience:

  • Exact phrase → Use quotes " " (e.g., "error 404")
  • Wildcard → Use * for partial words (e.g., build*, *tion)
  • AND / OR → Combine keywords (e.g., login AND error, login OR sign‑in)
  • Keep it short → Use 2–3 relevant words , not full sentences
  • Filters → Narrow results by section (Knowledge Base, Users, Products)
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Industrial Automation
  • AVEVA Plant SCADA Forum
  • Replacing Genies with Graphics Builder Automation Interface
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
olivier_vallee
Commander olivier_vallee
34
Oncom
Commander Oncom
6
Kien_Mac
Lieutenant JG Kien_Mac Lieutenant JG
2
View All

Recommended Forums

  • Industry Automation and Control Forum

  • Machine and Motion Control Forum

  • Alliance Partner Program System Integrator

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to AVEVA Plant SCADA Forum
Start a Topic
Solved
XavierVilabril
Crewman XavierVilabril
Crewman

Posted: ‎2025-09-11 10:52 AM

0 Likes
2
454
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2025-09-11 10:52 AM

Replacing Genies with Graphics Builder Automation Interface

Hello everyone,

 

I am working on replacing all the genies of a certain type in a project while changing certain parameters contained within them. I am using the automation interface.

 

The goal is to check each page in the project for instances of the old genie. I achieved this by giving them a metadata property "TipoUpgrade" which tells me they are the ones to be replaced (please tell me if there is a simpler way to do this). Afterwards, what I want to do is read the parameters in the genie, store them and delete the old genie. Then, after modifying certain aspects in these values, I want to instance the new genie in the same position as the old one and write the adequate parameters to the corresponding fields. So far what I have is this: 

duvida.png

Note that the parameters in the old and new genies are NOT the same. I will use the parameters I read from the old genie to search for the appropriate ones for the new genie in another document.

 

Thank you for your attention!

Labels
  • Labels:
  • Graphics Builder
  • Tags:
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
olivier_vallee
Commander olivier_vallee
Commander

Posted: ‎2025-09-14 08:55 PM

0 Likes
1
415
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2025-09-14 08:55 PM

Hi @XavierVilabril 

You might get more responses over at the AVEVA Forum: 

https://community.aveva.com/heroes-hq/f/aveva-plant-scada

 

I don't personally have much experience with the GBA, so I can't personally answer your question without deeper research. The following is an answer from a GPT chat bot, please take all information on face value and do your own research. Shared for information purposes only and caries no guarantees:

{response from GPT start now...}

I see you're looking to automate the replacement of Genies in AVEVA Plant SCADA using the Graphics Builder (GB) Automation Interface—this is a great way to handle bulk updates without manual editing. The GB Automation Interface exposes an OLE automation server that lets you script page manipulations, object selection/deletion, and Genie placement via Visual Basic (VB) or VBA. It's particularly useful for migrating or updating legacy Genies to newer templates.

Based on the Citect/AVEVA documentation and community examples, here's a step-by-step approach to replace a specific Genie on an existing page. This assumes you're targeting Genies by name, tag, or position (you'll need to adapt based on your criteria). I'll include a VB code sample to get you started.

Key Steps:

  1. Reference the Type Library: In your VB project, go to Project > References and check "GraphicsBuilder" (or "IGraphicsBuilder2" in later versions) to access the methods.
  2. Open the Target Page: Use PageOpen to load the page containing the Genie.
  3. Locate and Delete the Old Genie: Iterate through objects with selection functions, check properties (e.g., type, name, or tag) using ObjectGetProperty, and delete with PageDeleteObject if it matches.
  4. Place and Configure the New Genie: Use LibraryObjectPlace to insert the replacement, position it with PositionAt, and set properties (e.g., tag) with LibraryObjectPutProperty.
  5. Save and Close: Commit changes with PageSave and clean up.

Potential Challenges:

  • Identifying the Genie: If you don't have object IDs (AN numbers), loop through all objects and filter by properties like "Type" (should return "Genie" for library objects) or "Tag".
  • Positioning: Capture the old Genie's X/Y coords via ObjectGetProperty("X") and ObjectGetProperty("Y") before deletion.
  • Error Handling: Wrap in try-catch for cases like read-only projects or missing libraries. Check gb.LastError after calls.
  • Version Notes: This works in AVEVA Plant SCADA 2020+ (formerly Citect SCADA). Test in a dev project first.

Sample VB Code (Console App or VBA Module)

vb
 
Dim gb As IGraphicsBuilder2
Set gb = New GraphicsBuilder.GraphicsBuilder

With gb
    .Visible = True  ' Optional: Shows GB window for debugging
    
    ' Step 1: Open the page
    .PageOpen "YourProjectName", "YourPageName"  ' e.g., "Demo", "MainPanel"
    
    ' Step 2: Find and delete old Genie (loop example, targeting by name)
    Dim oldGenieName As String, oldTag As String, oldX As Integer, oldY As Integer
    oldGenieName = "OldMotorGenie"  ' Replace with your target Genie name
    
    .PageSelectFirstObject  ' Start at first object
    Do While True
        Dim objType As String
        objType = .ObjectGetProperty("Type")  ' Check if it's a Genie
        
        If objType = "Genie" Then
            Dim objName As String
            objName = .ObjectGetProperty("Name")  ' Or use "Tag" if that's your identifier
            
            If objName = oldGenieName Then
                ' Capture position and tag before delete
                oldX = .ObjectGetProperty("X")
                oldY = .ObjectGetProperty("Y")
                oldTag = .ObjectGetProperty("Tag")
                
                .PageDeleteObject  ' Delete it
                Exit Do
            End If
        End If
        
        If Not .PageSelectNextObject Then Exit Do  ' No more objects
    Loop
    
    ' Step 3: Place new Genie and configure
    If oldTag <> "" Then  ' Only if we found and deleted one
        .LibraryObjectPlace "include", "YourLibrary", "NewMotorGenie", 0, True  ' Library path and new Genie name
        .PositionAt oldX, oldY  ' Match old position
        .LibraryObjectPutProperty "Tag", oldTag  ' Preserve tag (add more properties as needed)
        ' Optional: Set other props, e.g., .LibraryObjectPutProperty "Rotation", 90
    End If
    
    ' Step 4: Save and close
    .PageSave
    .PageClose
    .Visible = False
End With

Set gb = Nothing
MsgBox "Genie replacement complete!"
 
 

Tips for Bulk Replacement:

  • Loop Over Multiple Pages: Wrap this in a loop over your page list (query from DBF files if needed, but avoid direct DBF edits—stick to GB for integrity).
  • For Super Genies: Use PageOpenEx and LibraryObjectPlace with the "supergenie" flag.
  • Testing: Run with .Visible = True to watch it happen. If you hit errors, check the GB help file under "Automation Interface" for full param lists.

You can also check the official docs for the full function reference or community threads on similar migrations.

Hope this helps—let us know how it goes!

 

https://community.aveva.com/heroes-hq/f/aveva-plant-scada/33782/how-to-update-the-composite-genie-in...

 

https://docs.aveva.com/bundle/plant-scada/page/1152714.html

See Answer In Context

Reply

Link copied. Please paste this link to share this article on your social media post.

Replies 2
olivier_vallee
Commander olivier_vallee
Commander

Posted: ‎2025-09-14 08:55 PM

0 Likes
1
416
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2025-09-14 08:55 PM

Hi @XavierVilabril 

You might get more responses over at the AVEVA Forum: 

https://community.aveva.com/heroes-hq/f/aveva-plant-scada

 

I don't personally have much experience with the GBA, so I can't personally answer your question without deeper research. The following is an answer from a GPT chat bot, please take all information on face value and do your own research. Shared for information purposes only and caries no guarantees:

{response from GPT start now...}

I see you're looking to automate the replacement of Genies in AVEVA Plant SCADA using the Graphics Builder (GB) Automation Interface—this is a great way to handle bulk updates without manual editing. The GB Automation Interface exposes an OLE automation server that lets you script page manipulations, object selection/deletion, and Genie placement via Visual Basic (VB) or VBA. It's particularly useful for migrating or updating legacy Genies to newer templates.

Based on the Citect/AVEVA documentation and community examples, here's a step-by-step approach to replace a specific Genie on an existing page. This assumes you're targeting Genies by name, tag, or position (you'll need to adapt based on your criteria). I'll include a VB code sample to get you started.

Key Steps:

  1. Reference the Type Library: In your VB project, go to Project > References and check "GraphicsBuilder" (or "IGraphicsBuilder2" in later versions) to access the methods.
  2. Open the Target Page: Use PageOpen to load the page containing the Genie.
  3. Locate and Delete the Old Genie: Iterate through objects with selection functions, check properties (e.g., type, name, or tag) using ObjectGetProperty, and delete with PageDeleteObject if it matches.
  4. Place and Configure the New Genie: Use LibraryObjectPlace to insert the replacement, position it with PositionAt, and set properties (e.g., tag) with LibraryObjectPutProperty.
  5. Save and Close: Commit changes with PageSave and clean up.

Potential Challenges:

  • Identifying the Genie: If you don't have object IDs (AN numbers), loop through all objects and filter by properties like "Type" (should return "Genie" for library objects) or "Tag".
  • Positioning: Capture the old Genie's X/Y coords via ObjectGetProperty("X") and ObjectGetProperty("Y") before deletion.
  • Error Handling: Wrap in try-catch for cases like read-only projects or missing libraries. Check gb.LastError after calls.
  • Version Notes: This works in AVEVA Plant SCADA 2020+ (formerly Citect SCADA). Test in a dev project first.

Sample VB Code (Console App or VBA Module)

vb
 
Dim gb As IGraphicsBuilder2
Set gb = New GraphicsBuilder.GraphicsBuilder

With gb
    .Visible = True  ' Optional: Shows GB window for debugging
    
    ' Step 1: Open the page
    .PageOpen "YourProjectName", "YourPageName"  ' e.g., "Demo", "MainPanel"
    
    ' Step 2: Find and delete old Genie (loop example, targeting by name)
    Dim oldGenieName As String, oldTag As String, oldX As Integer, oldY As Integer
    oldGenieName = "OldMotorGenie"  ' Replace with your target Genie name
    
    .PageSelectFirstObject  ' Start at first object
    Do While True
        Dim objType As String
        objType = .ObjectGetProperty("Type")  ' Check if it's a Genie
        
        If objType = "Genie" Then
            Dim objName As String
            objName = .ObjectGetProperty("Name")  ' Or use "Tag" if that's your identifier
            
            If objName = oldGenieName Then
                ' Capture position and tag before delete
                oldX = .ObjectGetProperty("X")
                oldY = .ObjectGetProperty("Y")
                oldTag = .ObjectGetProperty("Tag")
                
                .PageDeleteObject  ' Delete it
                Exit Do
            End If
        End If
        
        If Not .PageSelectNextObject Then Exit Do  ' No more objects
    Loop
    
    ' Step 3: Place new Genie and configure
    If oldTag <> "" Then  ' Only if we found and deleted one
        .LibraryObjectPlace "include", "YourLibrary", "NewMotorGenie", 0, True  ' Library path and new Genie name
        .PositionAt oldX, oldY  ' Match old position
        .LibraryObjectPutProperty "Tag", oldTag  ' Preserve tag (add more properties as needed)
        ' Optional: Set other props, e.g., .LibraryObjectPutProperty "Rotation", 90
    End If
    
    ' Step 4: Save and close
    .PageSave
    .PageClose
    .Visible = False
End With

Set gb = Nothing
MsgBox "Genie replacement complete!"
 
 

Tips for Bulk Replacement:

  • Loop Over Multiple Pages: Wrap this in a loop over your page list (query from DBF files if needed, but avoid direct DBF edits—stick to GB for integrity).
  • For Super Genies: Use PageOpenEx and LibraryObjectPlace with the "supergenie" flag.
  • Testing: Run with .Visible = True to watch it happen. If you hit errors, check the GB help file under "Automation Interface" for full param lists.

You can also check the official docs for the full function reference or community threads on similar migrations.

Hope this helps—let us know how it goes!

 

https://community.aveva.com/heroes-hq/f/aveva-plant-scada/33782/how-to-update-the-composite-genie-in...

 

https://docs.aveva.com/bundle/plant-scada/page/1152714.html

Reply

Link copied. Please paste this link to share this article on your social media post.

XavierVilabril
Crewman XavierVilabril
Crewman

Posted: ‎2025-09-17 01:50 AM

In response to olivier_vallee
0 Likes
0
396
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2025-09-17 01:50 AM

Thank you Olivier, I was able to achieve what I wanted using your advice.

Reply

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 

You’ve reached the end of your document

WHAT’S NEXT?

Ask our Experts

Didn't find what you are looking for? Ask our experts!

My Dashboard

Check out the new Feeds and activities that are relevant to you.

To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support

    Ask our Experts

    Have a question related to our products, solutions or services? Get quick support on community Forums

    Email Us

    For Community platform-related support, please email us

Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

Welcome!

Welcome to your new personalized space.

of

Explore