Book a Demo

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 - drjmansell

Pages: [1]
1
I think I figured it out!  Here is my code for the next person:

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                Collection elements = r.GetElementSet("", 0);
                msg("Found This Many Elements: " + elements.Count.ToString());

                //make scan all elements
                int portcnt= 0;
                List<EA.Element> ports = new List<Element>();
                List<int> diagrams = new List<int>();
                for (int i = 0; i < elements.Count; i++)
                {
                    EA.Element e1 = elements.GetAt((short)i);

                    for (int j=0;j<e1.Diagrams.Count;j++)
                    {
                        try
                        {
                            EA.Diagram d = e1.Diagrams.GetAt((short)j);
                            if (!diagrams.Contains(d.DiagramID)) diagrams.Add(d.DiagramID);
                        }
                        catch (Exception ee) { msg("Error:" + ee.Message); }
                    }
                }

                //diagrams
                msg("Found Diagrams:" + diagrams.Count.ToString());
                for(int i=0;i<diagrams.Count;i++)
                {
                    EA.Diagram d = r.GetDiagramByID(diagrams);
                    string style = d.ReadStyle("Show Element Property String");
                    for(int j=0;j<d.DiagramObjects.Count;j++)
                    {
                        EA.DiagramObject do1 = d.DiagramObjects.GetAt((short)j);
                        EA.Element e2 = r.GetElementByID(do1.ElementID);
                        if (e2.Type.Contains("Port"))
                        {
                            if (do1.Style.Contains("HDN=1"))
                            {
                                string s = do1.Style;
                                s = s.Replace("HDN=1", "HDN=0");
                                do1.Style = s;
                                do1.Update();
                            }
                            else
                            {
                                string s = do1.Style;
                                if (!s.Contains("HDN=0"))
                                {
                                    s += ";HDN=0";
                                    do1.Style = s;
                                    do1.Update();
                                }
                            }
                        }
                    }
                }
                Cursor.Current = Cursors.Default;
            }
            catch (Exception ee)
            {
                Cursor.Current = Cursors.Default;
            }



2
Thanks for the information!  Can this be done via the object model in a language like C#?  I notice that I don't have access to the repository.execute command, but there is a r.ExecutePackageBuildScript() function. 

3
We have now hundreds of ports in a model and want to turn on the "Show Labels" option for all of them.  Can I access this from the object model?

4
Also, I did send several e-mails to the support team 4 days ago and have not received any response back.  It seems like the forum site is much more responsive than the support e-mail. 

5
I forgot to include that it is Windows 10 Pro for Workstations.

6
Windows 10 - Version 2004 (OS Build 19041.450)

There is some evidence that it might be associated with pictures inside the model, but I have yet to confirm this on my system.  Could it be the t_image database?

7
I get "Unrecognized database format" error, followed by "To enable Jet 4, go to Start | Preference | Use JET 4.0, restart EA."

Again, this opens on a computer before the recent Windows 10 update, so its not a file format issue, but something more fundamental to the program.  I think we're going to need a patch.


8
After the most recent Windows 10 update, which did affect SQL database files I believe, I am now unable to open my model with the error:
"DAO.Database [0x00000be9]  Cannot open database '#Temporary QueueDef#'.  It may not be a database that your application recognizes, or the file may be corrupt."  We were able to open it without problem on a computer that had not been updated.  Can you advise on how to proceed?

Pages: [1]