Book a Demo

Author Topic: GetPackageByPath - not available?  (Read 4191 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
GetPackageByPath - not available?
« on: July 01, 2009, 02:43:50 pm »
Hi All,

Am I correct in asserting that there is no Automation Interface mechanism to GetPackageByPath?

GetPackageByID and by GetPackageByGUID exist, but there is no way to find a package by its named path (for example: Model::View::Parent::Self)

Similarly, there's no equivalent get Element yes?

TIA,
Paolo
« Last Edit: July 01, 2009, 02:44:52 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: GetPackageByPath - not available?
« Reply #1 on: July 01, 2009, 03:24:07 pm »
Paolo,

See Package.FindObject(string).
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/package_2.html

The path passed to this function is relative to the package that you are calling from.  Can specify the path to a package, element, attribute or operation.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: GetPackageByPath - not available?
« Reply #2 on: July 01, 2009, 04:57:05 pm »
Thanks Aaron,

I thought I'd come across it last week, but I couldn't find it again.

Since it's relative, if I want to make it "absolute" I need to be at the top of the tree, yes?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!