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

Pages: 1 ... 5 6 [7] 8
General Board / Re: SysML is jumping on EA_OnPostNewElement
« on: March 08, 2016, 08:01:58 am »
Let my clarify my last post,

The problem is not with My AddIn,
SysML has its own postEvent API in its AddIn and it is jumping on the new element probably trying to load the new element and fails because it does not exist anymore in the model.

My question is, is there anyway I can disable it, since I dont have SysML source code?

General Board / Re: SysML is jumping on EA_OnPostNewElement
« on: March 07, 2016, 05:05:36 pm »
1. I do need SysML support. currently I am using the trial version but I will get the licensed one shortly (if that affects anything)
2. I need the created element to be on the diagram since I am taking information from it, like its stereo type and coordinates on screen that I am using later on in my AddIn.
Currently I am using:
public Boolean EA_OnPostNewElement(EA.Repository repository, EA.EventProperties info)
    prop = (EA.EventProperty)info.Get(0);
    EA.Element newElement= repository.GetElementByID(int.Parse(prop.Value.ToString()));
The 2nd line is causing the SysML addIn to crush on 2nd unwanted run.

When using EA_OnPreNewElement, element is not created yet and I can get that info. Is there any other way I can get that information from the element on PreNewElement stage without it being created?

General Board / SysML is jumping on EA_OnPostNewElement
« on: March 07, 2016, 07:08:47 am »
I have written an AddIn that jumps on EA_OnPostNewElement event.
One of the Addin functionality is getting the ID of the element that was inserted to a diagram and then deleting it from it.
Up until here everything was fine.
I then installed SysML Addin from sparxsystems site.
What happens is that the SysML started running my event, the problem is that it looked for an Id that does not exist in the model anymore and that causes a crush.
Does anyone have any idea how this issue can be resolved?


General Board / Re: Copying a Dll for use on another Computer
« on: March 03, 2016, 06:01:40 pm »
Thanks a lot Geert.
I was able to create an msi file with your detailed guide.


General Board / Re: Copying a Dll for use on another Computer
« on: February 29, 2016, 07:46:48 am »
I follow Geert  instructions first:
1. Copied the dll, pdb and tlb files from Visual Studio bin\debug directory to a specific location on the 2nd computer
2. Run regasm MyAddin.dll /codebase from that specified location
3. Created a .reg file from 1st computer location, and run it on the 2nd computer. double clicked and it put it in the registry of the 2nd computer.

I saw that the new addin appeared on the 2nd computer with an error:
Error - missing (0x800401F3).
Reading about it in google said that registry went wrong (Invalid class string)

Since the dll is working ok on the 1st computer, any ideas what went wrong with this procedure?


General Board / Re: Copying a Dll for use on another Computer
« on: February 29, 2016, 03:56:12 am »
I want to run my NewAddIn on another computer.
Is that all you need to do?
Place is in the registry with path to the dll...

General Board / Copying a Dll for use on another Computer
« on: February 28, 2016, 11:36:32 pm »

I have places the NewAddIn dll and exported the registry of my current EAAddin setup for the 2nd computer use.
Can someone provide the full necessary steps that are needed in order to install the dll on the 2nd computer?


General Board / Delete an element
« on: February 26, 2016, 07:00:02 am »

I guess this should be straight forward,
but I can find any API that would simply delete an EA.Element from the module.
Is there such an API?

General Board / Re: Recursive run down all elements in a package
« on: February 26, 2016, 03:30:10 am »
Thanks Helmut and Geert.
That solved my issues.


General Board / Re: Recursive run down all elements in a package
« on: February 22, 2016, 08:45:36 am »
I guess if there is no short way to do it,
I managed to run on each group separately.

Another small issue I have is moving a cloned package from where it was created to another place.
I tried 2 options which did not work:
1. Setting the clonePackageId to new packageId but I cant replace read only parameter.
2. Used this query:
string sql = "update t_object set package_id = " + packageId2 + " where package_id = " + clonedPackageId;
got an error that an update can not be performed and select is needed
Is there a good 3rd option?

General Board / Re: Recursive run down all elements in a package
« on: February 22, 2016, 07:32:56 am »
do you have a short example for packages drill down from top down?

General Board / Recursive run down all elements in a package
« on: February 22, 2016, 03:44:08 am »

Is there a simple way to get all the decedent elements underneath a specific package recursively?
i.e. all the elements, classes, diagrams or other packages underneath a package in one command?


General Board / Re: loading pattern in EA API
« on: January 14, 2016, 02:09:12 am »
I am talking about model templates. I am creating them in EA by standing on root of a package for example.
Then right click and choosing "Export package to XMI file".
I then put the path to this XML in my MDG file under <ModelTemplates> tags.
And I have those templates available once EA starts.

Does EA API supports loading those templates and doing some manipulations on the created templates?

General Board / loading pattern in EA API
« on: January 13, 2016, 07:44:07 am »

I have created a customized xml pattern that is I am using in EA (for example when creating a package, I am creating a set of other customized elements).
Does EA API support loading this pattern, do some manipulation on its xml (like changing created names in tags),
assuming I know the path where it is located.

General Board / Retrieving the Package above an element
« on: January 07, 2016, 12:33:21 am »
I am trying to retrieve the id of a Package and load the package that is located above a specific element.
PackageId and ParentId either give an Id that does not exist or does not return anything even though a package exist above the element

i.e. something like this:
EA.Element elem = <retrievedElement>;
int packageId = elem.PackageID;
EA.Package parentElement3 = (EA.Package)repository.GetElementByID(packageId);
int parentId = elem.ParentID;
EA.Element parent2Element = repository.GetElementByID(parentId);
Is there a more convenient way to do it, because this does not seems to be the one...?

Pages: 1 ... 5 6 [7] 8