1
Automation Interface, Add-Ins and Tools / Re: Simple click->copy Add-in
« on: April 11, 2013, 05:22:11 am »
Of course I'm stuck again
Now I am able to copy attributes and methods, but while I'm copying parameters of methods:
I receive an error:

Also I tried to find out - without succes - which attribute of the column attribute holds the info about input data type (what type - eg. integer or char - is put inside a column) and how much data can user put inside (eg. char[15]). Also where can I set which column is primary key? And set the column's values as "unique" - or switch it off.
Thank you in advance.
P.S. about adding objects (in my case - link to object) to diagram:

Code: [Select]
for (short k = 0; k < originalMethod.Parameters.Count; k++)
{
EA.Parameter origParameter = (EA.Parameter)originalMethod.Parameters.GetAt(k);
EA.Parameter copyParameter = (EA.Parameter)copyParameter.Parameters.AddNew(origParameter.Name+"copy", origParameter.Type);
cV.Update();
cM.Update();
}
I receive an error:

Also I tried to find out - without succes - which attribute of the column attribute holds the info about input data type (what type - eg. integer or char - is put inside a column) and how much data can user put inside (eg. char[15]). Also where can I set which column is primary key? And set the column's values as "unique" - or switch it off.
Thank you in advance.
P.S. about adding objects (in my case - link to object) to diagram:
Code: [Select]
Repository.GetCurrentDiagram().DiagramLinks.AddNew(elementCopy.Name, elementCopy.Type);
Repository.GetCurrentDiagram().Update();
Repository.RefreshOpenDiagrams(true);
Of course it doesn't work. What am I missing?