Book a Demo

Author Topic: How to delete all the non-visible objects from EA?  (Read 3901 times)

chrvi

  • EA User
  • **
  • Posts: 75
  • Karma: +0/-0
  • There are so many hidden features...
    • View Profile
How to delete all the non-visible objects from EA?
« on: May 24, 2007, 04:51:01 am »
Hi,

I've been "playing" with an EA project for a while. I added objects, removed them or moved them in the Project Browser several times. I did it both manually and automatically using the automation interface.

The trouble is I've just realised that the project which seems to have only a few ordinary packages is surprisingly big (over 50MB) and what's worse it must contain many objects I can't see in the project browser. I've written out the project contents using automation and there were lots of such objects not displayed in Project browser(elements in my case).

Pleeease, if you know how, show me the way I can destroy those hidden objects. I've realised they appear in one of my rather complicated projects and they cause me troubles.

Thanks for any hint.

I'd also appreciate any advice I can avoid these troubles in future...
Radek

thomaskilian

  • Guest
Re: How to delete all the non-visible objects from
« Reply #1 on: May 24, 2007, 06:13:12 am »
EA uses a MS Access database. They tend to only grow. Shrink them manually by using Tools/Manage.../Compact... This will definitely free unused space.

Elements not visible in the browser are just those used in diagrams (like frames and a few more). The go away when you delete them from the diagram.

chrvi

  • EA User
  • **
  • Posts: 75
  • Karma: +0/-0
  • There are so many hidden features...
    • View Profile
Re: How to delete all the non-visible objects from
« Reply #2 on: May 27, 2007, 11:56:39 pm »
Well, the Compact function optimalised the file and decreased its size but my problem still remains...

Oh dear... I'm sorry. I didn't notice that package.elements returned a collection of all elements, not just the direct children elements as I expected before.

That was the reason I thought about the existence of some hidden objects since I processed them twice - once when processing package.elements, once when processing the particular element.elements...

Isn't there a way to easily obtain only direct child elements of a given package?

For example - in the following scheme I'd like to obtain a collection with only element1 included (as the only direct child of package1). Can this be easily achieved?
The other elements will always be easily accessible through elementX.elements...

<pre>

package1
 |
 ---> element1
         |
         ---> element2
         |
         ---> element3
                 |
                 ---> element4

</pre>
« Last Edit: May 27, 2007, 11:59:25 pm by chrvi »
Radek

thomaskilian

  • Guest
Re: How to delete all the non-visible objects from
« Reply #3 on: May 30, 2007, 12:03:46 pm »
I'm too busy (lazy?) to test that by myself now. But if it indeed returns everything then you need to iterate through the collection and look for the parent package to be your package1.

chrvi

  • EA User
  • **
  • Posts: 75
  • Karma: +0/-0
  • There are so many hidden features...
    • View Profile
Re: How to delete all the non-visible objects from
« Reply #4 on: May 31, 2007, 01:39:06 am »
You're right, it seems I have to process each element in package1.elements collection. One by one, and test whether their ElementID = 0 (this means its parent isn't an element but a package).
I can't look for elements with parent package equal to package1 because all the elements (element1..element4) in the example have package1 as their parent package.

Yes, the way of finding the package's direct child elements is iterating through all the elements in package.elements collection. I was rather confused but it works.
« Last Edit: May 31, 2007, 01:41:33 am by chrvi »
Radek