Book a Demo

Author Topic: Level or Depth of a Package?  (Read 2887 times)

ndg2

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Level or Depth of a Package?
« on: June 12, 2018, 03:28:03 pm »
Hello, I would like to know whether there is an easy means to know the "level" or "depth" of a package relative to the start (="model" package) or relative to some other package? There is no "Package.Level" though in the Package class of the automation interface(https://www.sparxsystems.com/enterprise_architect_user_guide/9.3/automation/package_2.html). The actual reason for
 this question is some other problem, though: in a report, I have problems with adjustment of headings for elements like use cases. I use "list override" numberings for both packages and elements. But only for the packages, the heading levels (and therefore the numbering 1, 1.1, 1.1.1 etc.) gets adjusted automatically. Knowing the package nesting would allow me to adjust the heading automatically within DocumentElement (long elementID, long nDepth, string templateName) of the DocumentGenerator class (https://www.sparxsystems.com/enterprise_architect_user_guide/9.3/automation/document_generator_interface_class.html). Highly appreciated, if someone could help with either the first or the second problem (preferably both  ;) )

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Level or Depth of a Package?
« Reply #1 on: June 12, 2018, 08:44:50 pm »
Hello,

There's no property you can check to find a package's (or element's) depth, so the simple way is to write a subroutine in whatever language you're using that calculates it.

/Uffe
My theories are always correct, just apply them to the right reality.