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

Pages: 1 ... 151 152 [153] 154 155 ... 171
2281
Automation Interface, Add-Ins and Tools / Re: Use of AddIn search
« on: September 13, 2011, 05:19:46 pm »
There's not much in the help because there's not much to say. I have only ever used it once in an add-in. I put the name of a search in the first parameter and left the other three parameters as empty strings. It opens up the Model Search tab and performs the search (the same as if you go Edit > Model Search, choose from the Search list and press Run).

2282
If you try to define more than one «stereotype» class with the same name in the same profile, the profile save command will only process the first one it finds and ignore the rest.

However, you can define a stereotype that extends multiple metaclasses (that is, one «stereotype» class with multiple outgoing «extends» associations to multiple «metaclass» classes).

2283
The dotted line is part of the "normal" way of drawing the constraint, but the shape script doesn't know how to override it. So EA thinks you've overridden it with... nothing.

The only work-around I can think of is to put a drawNativeShape() at the beginning of your shape script to force the normal drawing instructions, and then superimpose your own shapes on top of that. drawNativeShape() will draw the dotted line, but will also draw the default constraint shape, so it will only work well if the shape you are creating fills the whole drawing area else bits of constraint will be poking out from underneath your custom shape. So this will look OK:
Code: [Select]
shape main
{
      drawnativeshape();
      setfillcolor(128,255,128);
      rectangle(0,0,100,100);
}

but this will look messy:
Code: [Select]
shape main
{
      drawnativeshape();
      setfillcolor(128,255,128);
      ellipse(0,0,100,100);
}

2284
Automation Interface, Add-Ins and Tools / Re: Building Sql Profile
« on: September 01, 2011, 12:07:17 pm »
If you set an element's stereotype using the Stereotype field on their Properties dialog, the tagged values associated with that stereotype don't get added until you synchronize the stereotype (find the stereotype in the Toolbox, right-click and "Synchronize Stereotype" which will update the tagged values for all elements in the model with that stereotype).

To apply the stereotype and tagged values in one go, you can drag and drop the stereotype from the Toolbox onto a diagram object.

2285
Can't you just set the values of EA.DiagramObject.Left and EA.DiagramObject.Top?

2286
Quote
Does anybody know how to disable Shape Scripts based on some diagram property or custom tag?
There is a shape script command: drawNativeShape()

Quote
How to access current diagram properties in a Shape Script? No documentation found
On this page there is a list of properties you can test against in shape scripts. Look at those beginning "diagram."

2287
Automation Interface, Add-Ins and Tools / Re: Shape script Problem
« on: August 01, 2011, 09:36:29 am »
Try this:

Code: [Select]
label middletoplabel
{
      print("@");
}

label middlebottomlabel
{
      // hide the stereotype label
}

2288
Here's one way (not the only way, but it works for me):

Give your stereotype class an attribute named "_image". Click the "..." button next to the Initial Value field in the attribute's properties dialog and enter the following shape script:

Code: [Select]
shape main
{
    image("mypicture.jpg",0,0,100,100);
}
Then save your profile and deploy. The image named in the shape script must exist in the model at the time that you use it: Settings > Images... to add it, although I think the tidiest solution is to have an add-in that installs the profile (as part of a technology) and the images (as reference data) automagically.

2289
I think your technology needs to be the active one for the common toolboxes to show. Go Settings > MDG Technologies, select your technology from the list and press the "Set Active" button (there is a list box on the main menu toolbar, just to the left of the Help button, that does the same thing).

2290
Quote
However, it seems that ExtendedStyle is empty when the diagram is first created by the AI, so it is necessary to set the complete ExtendedStyle string
I don't think that's true. Try just setting the value or values that you are interested in, and EA will add the rest.

2291
Automation Interface, Add-Ins and Tools / Re: More than one toolbox
« on: July 28, 2011, 09:21:31 am »
You can only have one toolbox profile per custom diagram type, but each toolbox profile can have multiple toolbox pages. Have a look at the BPMN 1.1 toolbox for an illustration: "BPMN 1.1 Core", "BPMN 1.1 Relationships" and "BPMN 1.1 Types" are each defined in the BPMN toolbox profile as a stereotype that extends "ToolboxPage".

So in your toolbox profile, you would have your own ToolboxPage stereotype as before, plus a couple of stereotypes named "UML Class" and "UML Class Relationships" that also extend ToolboxPage. These would have attributes named "UML::Package", "UML::Class", "UML::Interface" etc, you can figure out the rest from the help file: Elements Used in Toolboxes and Connectors Used in Toolboxes. Ask Support if you get stuck...

HTH

2292
Quote
i got it i use the connectors.stereotype that gave me the includes and extends value when the connectors.type = UseCase  and from there i was able to find out the extended and included use cases using the supplier id and client id attribute.

Thanks,
Safer to check Connector.Subtype (possible values: "Extends" or "Includes")

2293
Automation Interface, Add-Ins and Tools / Re: Hidden Toolbox Icon
« on: July 20, 2011, 10:41:11 am »
It certainly can be made to work: check out the BPMN toolbox where Start Event, Intermediate Event and End Event all lead to hidden toolbox pages and have custom icons.

The hidden toolbox page must be a «stereotype» class with the exact same name as the attribute in the calling toolbox page, it must extend «metaclass»ToolboxPage and «metaclass»ToolboxItemImage, it must have an attribute "isHidden" with initial value set to "true" and it must have an attribute "Icon" with initial value set to the full pathname of the 16x16 bitmap file.

One final thing I notice from looking at the source diagram for the BPMN toolbox profile: the name of the stereotype class and its matching attribute are prefixed with the technology name (BPMN1.1::StartEvent). That may or may not be important, but I have vague memories that it might be.

After you've checked out all those things, if you still can't get it working then pop a bug report in to Sparx Support with your technology file attached and someone will have a closer look...

2294
Try:

Code: [Select]
SELECT ea_guid FROM t_diagram

2295
Add something like this to the end of your shape script:

Code: [Select]
decoration composite
{
      orientation="SE";
      if(hasproperty("iscomposite","true"))
      {
            ellipse(0,40,40,60);
            ellipse(60,40,100,60);
            moveto(30,50);
            lineto(70,50);
      }
}

Pages: 1 ... 151 152 [153] 154 155 ... 171