EBDN - Community - Question & Answers

  Monday, 26 April 2021
  1 Replies
  682 Visits
0
Votes
Undo
Hello All Community Members,

I want to add potential on connection for which I am using below code.

Dim oPotential As ObjectItem
Dim oConnection As ObjectItem
Set oConnection = Application.Application.ActiveSheet.Selection(1)
Set oPotential = oFolder.NewChild(aucObjPotential)
oPotential.Attributes.ItemByID(aucAttrDesignation).Value = "Potential_T101"
Call oPotential.SourceAssociations.New(aucRoleSymbolInSheet, oConnection)
oPotential.Store


Above code adds new potential and associate it with connection, but it does not include Shape of potential (Potential Tag) on the connection.

To add Shape of potential (Potential Tag) I have to manually right click on connection and select Menu option "Refresh AutoPotentialTag" or have to drag and drop potential shape on connection.

My question is: is there any way to call "Refresh AutoPotentialTag" menu option from VBA code? I also tired to drop shape of potential (Potential Tag) using sheet BOP but for that I am not able to get coordinates of connection object so I can drop Potential Shape on it.

Please help!