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
91
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?


92
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?
 

93
General Board / SysML is jumping on EA_OnPostNewElement
« on: March 07, 2016, 07:08:47 am »
Hi,
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?

Thanks,
Tzafrir

94
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.

Tzafrir

95
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?

thanks,
tzafrir

96
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...

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

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?

Thanks.

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

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?

99
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.

Tzafrir

100
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;
repository.SQLQuery(sql);
got an error that an update can not be performed and select is needed
Is there a good 3rd option?

101
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?

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

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?

Thanks.


103
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?


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

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.

105
General Board / Retrieving the Package above an element
« on: January 07, 2016, 12:33:21 am »
Hi,
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);
or
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