Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Sun1 on July 24, 2008, 02:15:47 am

Title: Why I can't set SetShowDetails to false?
Post by: Sun1 on July 24, 2008, 02:15:47 am
Hi, I try to create a new basic architect file with java.
I wrote the following code:

File f;
f = new File("text.eap");
try {
      f.createNewFile();
     } catch (IOException e) {
      e.printStackTrace();
}

but the file created is of 0KB and is impossible to open.
      
how can I do?
          
            
Title: Re: How to create a new basic architect file
Post by: «Midnight» on July 24, 2008, 02:45:08 am
You need to copy a 'seed' project to do this. An empty file just won't work. That's actually what EA does when you create a new file. You also have the ability to use a link on the default EA start page to copy a file of your choice. This last feature lets you use several seed projects, which could have different sets of default values.

By default EA looks for EABase.EAP in the EA installation location. You can do the same, or set up your own customized versions. Just make sure you have some dependable way to locate the files, particularly if you deploy your applications elsewhere.

HTH, David
Title: Re: How to create a new basic architect file
Post by: Sun1 on July 24, 2008, 08:02:09 pm
Ok, I solved my problem by creating a copy of the file .eap
Thanks!
Title: Re: Why I can't set SetShowDetails to false?
Post by: Sun1 on July 24, 2008, 08:15:20 pm
a curiosity...Why I can't set SetShowDetails to false?

currentDiagram.SetShowDetails(0)

but when I write

currentDiagram.GetShowDetails()

the result is always 1!  :-?
Title: Re: Why I can't set SetShowDetails to false?
Post by: «Midnight» on July 24, 2008, 10:29:17 pm
Don't know...

Did you remember to call Update on the diagram? [You'll never guess why I thought of that first. Hint: guess who forgets all the time.]

Another thing to try - after the Update() - is to reload the diagram, then test. I don't know if you can reload the diagram without showing it (even if you have an 'invisible' application). You might need to set the diagram as current, or reload its package. [I don't have the help file open just now, but I think all the correct information is there.]

David