1
General Board / Re: How to disable class diagram auto-layout on Insert Related Elements
« on: February 07, 2018, 07:59:58 pm »
Thanks - never thought of looking there, checked all the other tool options!
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.
Thanks - never thought of looking there, checked all the other tool options!
EA.Repository r = new EA.RepositoryClass();
r.OpenFile("C:\\CMC.eap");
EA.Collection models = r.Models;
foreach (object obj in models)
{
if (obj is EA.Package)
{
EA.Package package = (EA.Package)obj;
MessageBox.Show(package.Name);
}
}
$rep = New-Object -ComObject EA.Repository
--- EA launches as COM server process with no visible window
$rep1.OpenFile("C:\CMC.eap")
Method invocation failed because [System.__ComObject] doesn't contain a method named 'OpenFile'.
At line:1 char:15
PowerShell using interop assembly:[system.reflection.assembly]::LoadFile("C:\Program Files\Sparx Systems\EA Trial\Interop.EA.dll")
$rep=New-Object EA.RepositoryClass
$rep.OpenFile("C:\CMC.eap")
$rep.ShowWindow(1)
---- EA Window shows loaded model
$models = [EA.Collection]$rep.Models
$models.Count
1 --- Correct count of top-level packages
$package = [EA.Package]$models.GetAt(0)
Cannot convert "System.__ComObject" to "EA.Package".
At line:1 char:37