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 - sandeep bhat

Pages: 1 [2] 3
16
Damn!. so i need to write an sql query to update this entry?

whenever i want to check the direction of an activity this is how i do it.
Code: [Select]
subElements=Collection.Elements
for index in range(0,len(subElements)):
                subElem=subElements.GetAt(index)              
                props = subElem.CustomProperties;
                direction=""

                for propsCount in range(0,len(props)):
                    if(props[propsCount].Name=="direction"):
                        direction=str(props[propsCount].value)

17
So is there any way i can specify the direction?

18
Whenever i add an activity parameter to an activity, by default the direction is "in". i want to change this to "out". Would be great if anybody can help me with this. Below is the code i am using in pythoin

Code: [Select]
NewElem2=SelectedPackage.Elements.AddNew('testActivity','Activity')
NewAttr1=NewElem2.Elements.AddNew('Att1','ActivityParameter')
NewElem2.Update()
NewAttr1.Update()

the above code adds an activity with an activity parameter with all the default values.

I tried to make the same activity parameter(Att1) of a particular type by specifying its ClassifierId

Code: [Select]
NewElem2=SelectedPackage.Elements.AddNew('testActivity','Activity') NewAttr1=NewElem2.Elements.AddNew('Att1','ActivityParameter')
NewAttr1.ClassifierId=239 (user defined type)
NewElem2.Update()
NewAttr1.Update()

similarly i want to change the direction of the parameter. Basically i am trying to convert a class into an activity.


19
Yes, i will definitely have a look at it. Thanks again q.

20
Thanks q, by  the way is the Enterprise Architect Database accessible? Any location where it is saved?

21
Automation Interface, Add-Ins and Tools / More info on GetElementsByQuery
« on: November 15, 2014, 01:01:15 am »
Hi,
There is this method from the Repository Class GetElementsByQuery (string QueryName, string SearchTerm).

i want to find an Element object with its name 'sint16'.
By default this query- GetElementsByQuery ("Simple", "sint16") returns a collection witth the string sint16 contained in either name or notes. I want to filter this query only if it matches the name.

22
Hi,
I want to import from source files using a matlab bus file(.m) and the only possibility is to use the grammar framework. Anybody has an experience or have written a grammar for import matlab source files?

23
Hi,
I solved it. I was trying to add a new class to a collection which is not possible  so here is what i did.

SelectedPackage = m_Repository.GetTreeSelectedPackage()      
obj=SelectedPackage.Elements.AddNew('test','Class')
obj.Update()


 :)

24
I did try this piece of code and it worked like a charm

root2 = m_Repository.Models.AddNew ("A New Root", "");
root2.Update ();
m_Repository.Models.Refresh ();

but i am not sure how do i do it if at all i want to add elements like class or activity

25
Hi,
I get this


26
Hi qwerty,
Thanks for your reply. Well GetTreeSelectedElements returns an Collection object. But as per your suggestion i have made the changes but i still get the exception.
I get an exception immediately after the addnew line

SelectedPackage = m_Repository.GetTreeSelectedObject()
        try:            
            obj=SelectedPackage.AddNew('test','Class')
            obj.Update()
            return
        except Exception:
            MessageBox(None, str(traceback.format_exc()), 'EA2Simulink',0)



27
Hi,
I have written an Addin using python as a scripting language. I would like to add an class or activity to an existing package using the script.
I did try doing this but i would get an exception.

Collection = m_Repository.GetTreeSelectedElements()
Collection = Collection.GetAt(0)

NewColl=Collection.AddNew('test','4')
NewColl.Update()
Collection.Refresh()


28
Hi,
I have a requirement to generate a class from the source file. So far I have done it using a c(.h) file. But now i have the same bus definitions in a .m file. EA directly wont support .m files but is there any workaround or if someone has already tried doing this and succeeded?. Any help would be appreciated.

29
Thanks a lot Qwerty and Simon. Appreciate it!

30
Hi,
I have a project which starts at Model, under that i have a view and under that view i have many packages. Is there any way i get to know by some property if its a view or a package? i tried debugging it all i see is in a view, the property Flags has some value isModel=1;VICON=4 and for the other packages the Flags property is empty.

Pages: 1 [2] 3