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

Pages: 1 ... 9 10 [11] 12 13
I'm must be using the wrong words. The button on the lower right only affects individual custom templates. It does not seem to affect the built-in templates that EA creates when you create a new transform. How does one get rid of an entire transform?

I couldn't figure out how to delete an existing template, either. I guessed that the only way to delete the template is to start a new project. Is there a way to remove a template from a project? It must be right in front of me by I don't see it...


Is there a way to rename a model transform template? Also, how can I remove templates from a project?

I tried exporting the template, replacing the name (<template name>_Transform_Template) and importing. That doesn't work because there are many GUIDs that collide with the existing template.

I'd like to avoid creating an entirely new project just to change some bad template names.


Hi Graham,
that was the trick.  :)


I've created a C# add-in and am trying to call it via EXEC_ADD_IN() from a model transformation template. The add-in shows up in the Extensions context menu and I can hit the break-point on the EA_GetMenuItems(). When I initiate the transform I get an Invalid Parameter(s) message before I hit the breakpoint for the function I'm calling.

The documentation says this:
"Any function that is to be called by the EXEC_ADD_IN macro must have two parameters: an EA.Repository object, and a Variant array that contains any additional parameters from the EXEC_ADD_IN call. Return type should be Variant."

For C#, I guess that would be:
Code: [Select]
public object FindGUID(EA.Repository Repository, object[] type);I also tried replacing "EA.Repository" with "object".

The template line is this:
Code: [Select]
†$result = %EXEC_ADD_IN("Pegasus", "FindGUID", "String passed from template")%
Can anyone see my mistake?


There must be a way to execute a script in a way similar to EXEC_ADD_IN().

I need look up classifier GUIDs by name from a model template and it looks like the only way to do it is to execute an add-in.


Automation Interface, Add-Ins and Tools / Re: Code generation path
« on: May 08, 2013, 03:17:06 am »
See Local Paths and Directories under Settings.

Cool. I didn't know about MATH_*(). Here is my snippet:

Code: [Select]
$COMMENT=" Pull the first attribute, type pair from the † "
$COMMENT=" list and create an attribute for it. Prune † † "
$COMMENT=" the list and recurse until list is empty. The †"
$COMMENT=" list format is: {<name>,<type>}* † † † † † † † "
$COMMENT=" First, assign useful names to the parameters † "
$class † =$parameter1
$keys † †=$parameter2
$isKey † =$parameter3
%if $keys == ""%
$COMMENT= † † † † † † † "* Get the first name in the list "
$sep=%FIND($keys, ",")%
$name=%LEFT($keys, $sep)%
$COMMENT= † † † † † † † "* Cut the name from the list † † "
$next=%MID($keys, $sep)%
$next=%TRIM_LEFT($next, ",")%
$sep=%FIND($next, ",")%
$COMMENT= † † † † † † † "* Get the type of this attribute "
%if $sep != "-1"%
$type=%LEFT($next, $sep)%
$COMMENT= † † † † † † † "* † Cut the type from the list † "
$remaining=%MID($next, $sep)%
$remaining=%TRIM_LEFT($remaining, ",")%
 †type=%qt%%CONVERT_TYPE("IDL", $type)%%qt%
%if $isKey == "T"%

%AddAttribute($class, $remaining, $xumlTag)%

No error checking because when things go wrong, they go terribly wrong... †;)

I created a template that parses key/value pairs (and one to create them). It uses the Function macros like FIND, LEFT, MID, and TRIM to locate the comma, get the part before the comma, get the remainder and remove the comma. The pair gets used to generate some text and then the template calls itself with the remaining list. I'll post it Monday, if I remember.


I found my old post. You must set the File Extensions set to ".idl" w/o the quotes. The leading dot is required. IOW "idl" won't work. It looks like out-of-the-box, the value is ";", for some reason. Use Tools-Options to permanently change the file extensions. Note that there are two places to specify: one is for extension to add when creating files and a separate one is for importing from source. The one for creating files must be dot-less and the import one must have the dot.

I remember that there is a trick to this. I'm remembering that it is necessary to open the code template editor (Ctrl+Shift+P). Does the IDL template show up in the Language pulldown?

Also, does the language show up in the language attribute for a class? If so, try doing a forward code-gen. After doing the phony, see if IDL shows up in the list of Source Types for importing source.

Sorry that I cannot remember the exact trick.

Automation Interface, Add-Ins and Tools / Re: Code with quotes
« on: May 01, 2013, 03:16:24 am »
Ha! \" works. Amazing how I can overlook the obvious.

Something I realized along the way is that I'm free to process %opCode% in the code template. That could come in handy for parsing AAL or text DSM from the PIM.

Thank you,

Automation Interface, Add-Ins and Tools / Code with quotes
« on: April 30, 2013, 06:45:18 am »
My model template needs to set the code attribute for an operation. The following intermediate does not parse because of nested quotes.

Code: [Select]
  code=" std::cout << "Hello, from aFoo" << std::endl;"

%qt% gets expanded and produces the same thing. I tried %pc%qt%pc% but of course the C++ code gen template doesn't convert that to ".

I will probably postpone the code snippet insertion to code-gen time and just insert a tag at this point. Still, it would be better if I could localize this special logic to the model transform, however.

Now that you say that, I must have gotten confused. I thought that the code generator was skipping the packages that had the wrong language. For example, if I used the C++ template on a Package with language="IDL" I thought it was skipping the code gen was skipping the folder. I just tried again and, as you say, Package language doesn't seem to affect anything code gen.

Operator error. :-[

Thanks for checking.


Thanks, GŁnther. The language attribute is supported for Class but not Package. See the Special Cases subsection of the Objects topic in the Write Transformations section of the User Guide. It makes no sense because the language attribute is used to select elements for the M2T transformations. It is unnecessarily awkward to use the  same PIM to generate two complementary PSMs for the same system.

FWIW, I made a feature request.

Pages: 1 ... 9 10 [11] 12 13