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 - bITs.EA

Pages: [1] 2 3 ... 6
1
I found the answer myself:

1) Don't set the color in the ShapeScript
2) Select the stereotype and press "F4" to show the Default Appearance dialog
3) Set the desired default appearance.

--> Now the elements are shown in the default appearance, but the user can change this appearance

2
In case of color queries, you depend completely on the users choice and you can't set a default (or can you?).

What I want is :
- Setting a default myself
- Give the user the opportunity to change that color

3
Hi

In my shapescript, I want to define a default fill color (eg. setFillColor(255,255,255) ) for my shapes, but my users need to be able to change the colors when they design a model. Is there a way to achieve this with shapescript? Or do I need to use the "default" colors and forget about my default fill color?

Thanks

S

4
Check! The startpath()/endpath() solution works like a charm.

5
Thanks Paolo! That's the solution indeed.

I just found the same answer in the MDG documentation :)

Quote
If you have an empty shape routine, it overrides the default; so, a blank 'shape label' prevents the creation of the
normal floating text label for elements that have them

My solution (same idea as Paolo's)
Code: [Select]
shape main {
// main code
}

shape label {
//empty label shape to prevent the name from showing on the diagram
}

6
Hi

I have a simple shapescript for a stereotype with metaclass "ObjectNode":

Code: [Select]
shape main
{
noshadow="true";
fixedAspectRatio="true";

SetFillColor(255,255,255);
defsize(20,20);
startpath();
moveto(50,0);
lineto(75,50);
lineto(50,100);
lineto(25,50);
lineto(50,0);
endpath();
//StrokePath();
FillAndStrokePath();
}

When I use this element, the shape is drawn as expected. BUT the name of the element is shown below the shape. How can I 'hide' the name?

7
Hi

Is it possible to add a gradient property to a "fill-command"? Nativeshapes have gradient in their color, but custom shapes don't...

Thanks

Grts

S

8
Hi

Can anyone explain why the following code isn't working? (the native shape turns red, but the border doesn't change to "dashed")

Do I need to change the function "SetLineStyle"?

Code: [Select]
shape main{
SetLineStyle("dash");
SetFillColor(255,0,0);
DrawNativeShape();
}

Grts

S

9
Thanks for the fast answers!

Currently, I'm working like you, Geert: just try to use what I know :)

10
Hi

I'm creating a new model with MDG, but I was wondering: is there some kind of reference guide explaining all the different metaclasses and the 'consequences' when you chose one of them? Because now it's rather difficult to know what to choose in the long list.

Grts

S

11
Bugs and Issues / Re: SQL search with 'union'
« on: July 14, 2016, 12:59:45 am »
It's SQL Server DB. I've found my error: ORDER BY can't be in the first query.

Working SQL query:
Code: [Select]
SELECT p.Name AS 'Process', o.stereotype AS 'ElementType', o.Name AS 'Element', null AS 'Opgenomen in Project?', null AS 'Owner?'
FROM t_object AS o INNER JOIN t_package AS p ON o.package_ID = p.package_ID
WHERE
o.package_ID IN (SELECT package_ID FROM t_package WHERE parent_ID = (SELECT package_ID FROM t_package WHERE name = 'Bedrijfsleiders'))
AND
o.StereoType <> ''

UNION

SELECT d.Name AS 'Process', 'Document' AS 'ElementType', o.name AS' Element', null AS 'Opgenomen in Project?', null AS 'Owner?'
FROM (t_object AS o INNER JOIN t_diagramobjects AS do ON o.object_ID = do.object_ID) INNER JOIN t_diagram AS d ON do.diagram_ID = d.diagram_ID
WHERE o.package_ID = (SELECT package_ID FROM t_package WHERE name = 'Documenten')

ORDER BY 'Process'

12
Bugs and Issues / SQL search with 'union'
« on: July 14, 2016, 12:15:25 am »
Hi

I'm trying to do a UNION search, but I don't get any results. The 2 separate queries give me the expected results, but using UNION doesn't seem to work. EA isn't giving an error either.

Code: [Select]
(SELECT p.Name AS 'Process', o.stereotype AS 'ElementType', o.Name AS 'Element', null AS 'Opgenomen in Project?', null AS 'Owner?'
FROM t_object AS o INNER JOIN t_package AS p ON o.package_ID = p.package_ID
WHERE
o.package_ID IN (SELECT package_ID FROM t_package WHERE parent_ID = (SELECT package_ID FROM t_package WHERE name = 'Bedrijfsleiders'))
AND
o.StereoType <> ''
ORDER BY 'Process', 'ElementType')

UNION

(SELECT d.Name AS 'Process', 'Document' AS 'ElementType', o.name AS' Element', null AS 'Opgenomen in Project?', null AS 'Owner?'
FROM (t_object AS o INNER JOIN t_diagramobjects AS do ON o.object_ID = do.object_ID) INNER JOIN t_diagram AS d ON do.diagram_ID = d.diagram_ID
WHERE o.package_ID = (SELECT package_ID FROM t_package WHERE name = 'Documenten')
ORDER BY 'Process')

Can someone give me some advice?

Grts

S

13
Ok, I see :) I'll try that too :)

14
Qwerty, Why should I check out the parent package to change a stereotyoe?

Geert, clearing by setting stereotypeEx = "" or = null? (I'll try it tomorrow)

15
I have a problem with my script for converting stereotypes. (see code below)

It seems to work perfectly
  • The package is checked out
  • The stereotype is changed (I immediately see the changen in project browser)
  • The package is check in again

BUT when I click on the changed package (which is already checked in again), the stereotype visibly changes to old+new stereotype. (in the properties, the old and new stereotype are checked)

Can anybody explain why this is happening?? And why it first shows the new stereotype and after selecting the package it adds the old one?? (I tested it several times, always same result!)

Thanks for the help!

Code: [Select]
sub main

dim collection as EA.Collection
dim packageElement as EA.Element
dim package as EA.Package
dim diagram as EA.Diagram
dim sql, count, comment
dim fromStereotype, toStereotype
fromStereotype = "Process L3"
toStereotype = "Process"

sql = "SELECT t_object.Object_ID FROM t_object WHERE t_object.stereotype = '" & fromStereotype & "' AND t_object.name LIKE '268.%'"
count = 0

set collection = Repository.GetElementSet(sql, 2) '= collection of Package ELEMENTS (no collection of packages)

for each packageElement in collection
set package = Repository.GetPackageByGUID(packageElement.ElementGUID)

if package.VersionControlGetStatus = 1 then '1 = package is checkedIn
package.VersionControlCheckout("checkout for stereotype change")
end if

'Change stereotype of package element
packageElement.StereotypeEx = toStereotype
if not packageElement.Update() then
Msgbox packageElement.GetLastError()
end if

'Create a message
comment = "stereotype: " & fromStereotype & " changed to " & toStereotype

'Check in package
package.VersionControlCheckin (comment)

next

Msgbox "# = " & collection.Count

end sub

main

Pages: [1] 2 3 ... 6