Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: Glassboy on October 01, 2018, 09:24:56 am
-
Does anyone have a resizable pipe shape script like the Visio network icon?
If so can you post it here as I can't reach a lot of the file sharing sites from my work network.
-
You mean a cylinder?
shape main
{
setfixedregion(0,0,0,20);
startpath();
moveto(0,10);
setfixedregion(0,80,0,100);
lineto(0,90);
arcto(0,80,100,100,0,90,100,90);
setfixedregion(0,0,0,20);
lineto(100,10);
endpath();
FillAndStrokePath();
ellipse(0,0,100,20);
addsubshape("top",0,0,100,20);
}
Changing the height of your object changes the length of the pipe. Changing the width changes the view angle.
-
Hmmm yes but going the other way. That looks like a database :-)
-
Hmmm yes but going the other way. That looks like a database :-)
Which other way? I can think of three obvious ones.
-
Bottom
shape main
{
setfixedregion(0,80,0,100);
startpath();
moveto(100,90);
setfixedregion(0,0,0,20);
arcto(0,00,100,20,100,10,0,10);
setfixedregion(0,80,0,100);
lineto(0,90);
endpath();
FillAndStrokePath();
ellipse(0,80,100,100);
}
Left
shape main
{
setfixedregion(0,0,20,0);
startpath();
moveto(10,100);
setfixedregion(80,0,100,0);
arcto(80,0,100,100,90,100,90,0);
setfixedregion(0,0,20,0);
lineto(10,0);
endpath();
FillAndStrokePath();
ellipse(0,0,20,100);
}
Right
shape main
{
setfixedregion(80,0,100,0);
startpath();
moveto(90,0);
setfixedregion(0,0,20,0);
arcto(0,0,20,100,10,0,10,100);
setfixedregion(80,0,100,0);
lineto(90,100);
endpath();
FillAndStrokePath();
ellipse(80,0,100,100);
}
Note: I removed the redundant lineto from before arcto in these scripts.
I just noticed that the arc portion of the script doesn't appear to obey the fixed region. To get it working nicely you would convert the scripts to use two bezier sections.
-
Thanks. Right looks best with the existing deployment view shapes. I noticed in the example you use an unspecialised node resized to be a rectangle but it doesn't look that great or really fit in on a nice tidy diagram :-)
-
Here's a version of right where the left edge scales in the same way as the right.
shape main
{
setfixedregion(80,0,100,0);
startpath();
moveto(90,0);
setfixedregion(0,0,20,0);
//arcto(0,0,20,100,10,0,10,100);
lineto(10,0);
bezierto(4,0,0,28,0,50);
bezierto(0,72,4,100,10,100);
setfixedregion(80,0,100,0);
lineto(90,100);
endpath();
FillAndStrokePath();
ellipse(80,0,100,100);
}
-
Something about that approach makes the name subshape I added print at top left. Any idea what?
AddSubShape("name", "center");
text name
{
h_align = "center";
v_align = "center";
PrintWrapped("#NAME#");
}
}
-
I'd say that when you copied the rest of my script you lost the following from the top of your script.
layouttype="border";
I would also add the following to center the text within the face.
AddSubShape("padding","e");
shape padding
{
preferredWidth=20;
}
-
I'd say that when you copied the rest of my script you lost the following from the top of your script.
layouttype="border";
Ahh yes, obviously. Thanks.
I've been busy translated Visio fruit salad into proper deportment diagrams so it's been a bit hard to get my head properly into shape script mode. :-)
-
I'd say that when you copied the rest of my script you lost the following from the top of your script.
layouttype="border";
Ahh yes, obviously. Thanks.
I've been busy translated Visio fruit salad into proper deportment diagrams so it's been a bit hard to get my head properly into shape script mode. :-)
OK, I'll bite... What's a deportment diagram? ;) ;)
Paolo
-
Try Google it has lots of colored pictures.
q.
-
OK, I'll bite... What's a deportment diagram? ;) ;)
It's an orderly deployment diagram.
-
OK, I'll bite... What's a deportment diagram? ;) ;)
It's an orderly deployment diagram.
Does it have a "book" widget at the top to ensure it's smooth passage?
Paolo
-
Does it have a "book" widget at the top to ensure it's smooth passage?
I'm telling you man, I'm blowing vendor diagrams up to 300% to work out where their lines are running. I'm on the edge.