Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - PHannah

Pages: [1]
1
I am trying to switch off the Full Port compartment on blocks in a number of diagrams using VB script, but I can't work out how to do this.
Visibility of Proxy Ports is contained within the diagramObjects.Style data, but this does not appear to contain anything that controls the visibility of the Full Ports compartment.

2
General Board / Re: How to create Association Block using scripting
« on: April 14, 2021, 10:39:39 pm »
Yes I am using SysML.

3
General Board / Re: How to create Association Block using scripting
« on: April 14, 2021, 09:18:53 pm »
Yes, my mistake. When you create an association block through the user interface EA automatically adds each end (BlkA and BlkB) as part participants on the Association Block. I therefore thought if I could add the "part participants" , this would link the association block to the connector.
It turns out that you create a connector of type "association", and then create the association class. On the association class you then call CreateAssociationClass(con.ConnectorID) which creates the association.

   set p = Repository.GetPackageByID(22)
   set blkA = Repository.GetElementByID(2496)
   set blkB = Repository.GetElementByID(2503)
   set blkC = p.Elements.AddNew("NEW IB", "Block")
   
   set con = blkA.Connectors.AddNew("TEST", "Association")
   con.ClientID = blkA.ElementID
   con.SupplierID = blkB.ElementID
   con.Update

   blkC.CreateAssociationClass(con.ConnectorID)

Thanks for your help.

4
General Board / Re: How to create Association Block using scripting
« on: April 14, 2021, 07:39:41 pm »
Thanks qwerty, I can create a block and type it. If I am trying to create an association between BlkA and BlkB, the Association Block needs to have BlkA and BlkB as "Part Participants", And I think if I can work out how to add these as Part Participants, it might all work.

5
General Board / How to create Association Block using scripting
« on: April 14, 2021, 06:40:26 pm »
Using VBScript I am trying to create an association block between two exiting blocks. I can get the existing blocks and create standard relationships between them, but I can't work out how to create an Association Block. I have a reasonable amount of VBScripting experience and am using EA 12.1. Thanks.

Pages: [1]