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

Pages: [1]
1
Geert,

I'll stay with your solution. It works.

Thanks again!

2
Hi Geert,

I was talking about the id properties as visible in the Properties view (under the group "Requirement (from SysML 1.5)").
Thank you for pointing the tagged value out to me. I am now able to set the id using this:

Code: [Select]
for count = 0 to e.TaggedValues.Count - 1
  set tag = e.TaggedValues.GetAt(count)
  if tag.Name = "id" then
    tag.Value("test")
    tag.Update
  end if
next

But this simpler code does not work:
Code: [Select]
dim tag
set tag = e.TaggedValues.GetByName("id")
tag.Value("test")
tag.Update

Any ideas? Am I missing something?

3
Automation Interface, Add-Ins and Tools / Creating Requirement using Script
« on: December 02, 2020, 09:07:59 pm »
Hi,

I'm developing a script to import requirements from an Excel sheet (with EA Version 15). I am able to create new requirements in a package and assign the SysML::requirement profile to them by using this code snippet:

Code: [Select]
dim e as EA.Element
set e = spec.Elements.AddNew("Requirement1", "Requirement")
e.StereotypeEx = "SysML1.4::requirement"
e.Update

But I cannot figure out how to set the id property of the newly created requirement. I tried using the Properties Attribute of the Element class as specified in the object reference model, but I failed...

Has anyone ever succeeded to automatically access element properties using a script? Is it possible?

Thanks for your help!

Pages: [1]