Register
 
DoubleCAD XT v5 has released

(PRO only) This script creates an ST:TNG LCARS type title block
Read 5249 times
May 21, 2009, 02:06:06 PM
Well I think it's cool. ;)

// Parameters

Height = Parameter("Height", 11, LINEAR);
Width = Parameter("Width", 17, LINEAR);
Bar = Parameter("Top Bar", 0.5, LINEAR);
Talker = Parameter("Side Bar", 2, LINEAR);
Margin = Parameter("Margin", 0.25, LINEAR);
Detail = Parameter("Detail Font Size", 0.5, LINEAR);

Title = Parameter("Title", "ENTERPRISE - 1701-A",TEXT);
Sheet = Parameter("Sheet Number", "A-1",TEXT);
Date = Parameter("Date", "200905.21",TEXT);
RevIss = Parameter("Revision|Issue", "1",TEXT);
Project = Parameter("Project", "Reliant",TEXT);
Scale = Parameter("Scale", "1/1",TEXT);


Firm = Parameter("Firm", "IMSI/Desgin",TEXT);
Address1 = Parameter("Address Line 1", "25 Leveroni Ct.",TEXT);
Address2 = Parameter("Address Line 2", "Novato, CA 94949",TEXT);
Phone = Parameter("Telephone", "415.483.8000",TEXT);
EMail = Parameter("E-Mail", "http://www.doublecad.com",TEXT);
Designer = Parameter("Designer", "Brian Carter",TEXT);

Color1 = Parameter("Bar Color", 0xff007e, COLOR);
Color2 = Parameter("Detail 1 Color", 0x6b238e, COLOR);
Color3 = Parameter("Detail 2 Color", 0x9e5e9e, COLOR);



// Main Bars and Boxes
Spacer = 0.25;
H2 = Height/2;


Bullet = Polyline(
Point(Margin+Bar,Height-Margin),
Point(Margin+Bar/2,Height-Margin),Arc1(Margin+Bar/2,Height-Bar/2-Margin),
Point(Margin+Bar/2,Height-Bar-Margin),
Point(Margin+Bar,Height-Bar-Margin),
Point(Margin+Bar,Height-Margin)
);
Bullet2 = SetProperties(Bullet, "BrushStyle" = "SOLID");
Bullet3 = SetProperties(Bullet2, "PenColor"  = Color1);

B1 = Polyline(
Point(Width-Margin,H2+Margin),
Point(Width-Margin,Height-Margin),Fillet(Talker/2),
Point(TitleExt+Bar/2,Height-Margin),
Point(TitleExt+Bar/2,Height-Bar-Margin),
Point(Width-Talker-Margin,Height-Bar-Margin),Fillet(Talker/4),
Point(Width-Talker-Margin,H2+Margin),Fillet(Talker/16),
Point(Width-Margin,H2+Margin),Fillet(Talker/16)
);

B2 = SetProperties(B1, "BrushStyle" = "SOLID");
B3 = SetProperties(B2, "PenColor"  = Color1);

C1 = Polyline(
Point(Width-Margin,H2-Spacer+Margin),
Point(Width-Margin,H2+Margin-Talker-Spacer),Fillet(Talker/16),
Point(Width-Margin-Talker,H2+Margin-Talker-Spacer),Fillet(Talker/16),
Point(Width-Margin-Talker,H2+Margin-Spacer),Fillet(Talker/16),
Point(Width-Margin,H2-Spacer+Margin),Fillet(Talker/16)
);

C2 = SetProperties(C1, "BrushStyle" = "SOLID");
C3 = SetProperties(C2, "PenColor"  = Color3);

D1 = Move(C3,0,-Talker-Spacer);

D2 = SetProperties(D1, "BrushStyle" = "SOLID");
D3 = SetProperties(D2, "PenColor"  = Color2);

E1 = Polyline(
Point(Width-Margin-Spacer,H2+Margin+Spacer),
Point(Width-Margin-Spacer,H2+Margin+Spacer+Talker/3),Fillet(Talker/16),
Point(Width-Margin+Spacer-Talker,H2+Margin+Spacer+Talker/3),Fillet(Talker/16),
Point(Width-Margin+Spacer-Talker,H2+Margin+Spacer),Fillet(Talker/16),
Point(Width-Margin-Spacer,H2+Margin+Spacer),Fillet(Talker/16)
);

E2 = SetProperties(E1, "BrushStyle" = "SOLID");
E3 = SetProperties(E2, "PenColor"  = 0x1);





// Tezt

TitleExt = ExtentsX2(TitleText2);
Fnt = TextFont(0,Bar*1.5,0,"Swiss911 UCm BT");
Fnt2 = TextFont(0,Detail,0,"Swiss911 UCm BT");
Fnt3 = TextFont(0,Detail*0.5,0,"Swiss911 UCm BT");
Fnt4 = TextFont(0,Detail*0.375,0,"Swiss911 UCm BT");

Fsty = TextStyle(LEFT, TOP);
Fsty2 = TextStyle(MIDDLE, CENTER);

// Title
TitleText = Text(Title, Fnt, Fsty);
TitleText2 = Move(TitleText,Margin+Bar*1.5,Height+Bar/5-Margin);
TitleText3  = Text(Title, Fnt2, Fsty2);
TitleText4 = Move(RotateZ(TitleText3,90),Width-Talker/2-Margin,Height-Height/4);
TitleText5 = SetProperties(TitleText4, "PenColor"  = 0x1);


// Detail 1
ProjectText = Text("Project: "+Project, Fnt3, Fsty);
ProjectText2 = Move(ProjectText,Width-Talker+Spacer-Margin,H2+Margin-1*(Talker/6));
ProjectText3 = SetProperties(ProjectText2, "PenColor"  = 0x1);

//
DateText = Text("Date: "+Date, Fnt3, Fsty);
DateText2 = Move(DateText,Width-Talker+Spacer-Margin,H2+Margin-2*(Talker/6)-Spacer);
DateText3 = SetProperties(DateText2, "PenColor"  = 0x1);

//
ScaleText = Text("Scale: "+Scale, Fnt3, Fsty);
ScaleText2 = Move(ScaleText,Width-Talker+Spacer-Margin,H2+Margin-3*(Talker/6)-Spacer);
ScaleText3 = SetProperties(ScaleText2, "PenColor"  = 0x1);

//
RevText = Text("Revision/Issue : "+RevIss, Fnt3, Fsty);
RevText2= Move(RevText,Width-Talker+Spacer-Margin,H2+Margin-4*(Talker/6)-Spacer);
RevText3 = SetProperties(RevText2, "PenColor"  = 0x1);

DesText = Text("Designer : "+Designer, Fnt3, Fsty);
DesText2= Move(DesText,Width-Talker+Spacer-Margin,H2+Margin-5*(Talker/6)-Spacer);
DesText3 = SetProperties(DesText2, "PenColor"  = 0x1);

// Detail 2
FirmText = Text("Firm : "+Firm, Fnt3, Fsty);
FirmText2= Move(FirmText,Width-Talker+Spacer-Margin,H2+Margin-1*(Talker/6)-Spacer-Talker);
FirmText3 = SetProperties(FirmText2, "PenColor"  = 0x1);

//
Add1Text = Text("Address : "+Address1, Fnt3, Fsty);
Add1Text2= Move(Add1Text,Width-Talker+Spacer-Margin,H2+Margin-2*(Talker/6)-Spacer-Talker);
Add1Text3 = SetProperties(Add1Text2, "PenColor"  = 0x1);

//
Add2Text = Text("               "+Address2, Fnt3, Fsty);
Add2Text2= Move(Add2Text,Width-Talker+Spacer-Margin,H2+Margin-3*(Talker/6)-Spacer-Talker);
Add2Text3 = SetProperties(Add2Text2, "PenColor"  = 0x1);

//
TelText = Text("Tel : "+Phone, Fnt3, Fsty);
TelText2= Move(TelText,Width-Talker+Spacer-Margin,H2+Margin-5*(Talker/6)-Spacer-Talker);
TelText3 = SetProperties(TelText2, "PenColor"  = 0x1);

//
EText = Text("E-Mail : "+EMail, Fnt4, Fsty);
EText2= Move(EText,Width-Talker+Spacer-Margin,H2+Margin-6*(Talker/6)-Spacer-Talker);
EText3 = SetProperties(EText2, "PenColor"  = 0x1);

//Point(Width-Margin-Spacer,H2+Margin+Spacer+Talker/3),Fillet(Talker/16),
ShText = Text("Sheet : "+Sheet, Fnt2, Fsty2);
ShText2= Move(ShText,Width-Margin-Talker/2,H2+Margin+Spacer+Talker/6);
ShText3 = SetProperties(ShText2, "PenColor"  = Color2);

RF = RefPoint(0,0);

Output(B3,Bullet3,TitleText2,C3,D3,E3,TitleText5,ProjectText3,
DateText3,ScaleText3,RevText3,FirmText3,Add1Text3,Add2Text3,TelText3,
EText3,DesText3,ShText3,RF);


//     NOTES


//ttt = Parameter("text", "AAA",TEXT, Set("AAA","BBB","CCC"));
//Swiss 911 Ultra Compressed
//Fnt = TextFont(0,300,0,"Verdana");
//Fnt2 = TextFont(0,250,0,"Verdana");
//Fsty = TextStyle(CENTER, MIDDLE);
//Note = Text("ANG3:"+Acute, Fnt, Fsty);

Logged


May 22, 2009, 08:11:30 AM
#1
I forgot to add the Font needed for this:
I have attached it
 :)

Logged


May 22, 2009, 10:33:47 AM
#2
What's the password to expand the file?

Logged
Cheers
~Nick

Home-Dell T3400 Quad Core Q6600 OC'd 3 GHz., 8 GB RAM, Radeon HD 3870, Windows 7 x64
ACAD 2012, DoubleCAD XT Pro v3, Alibre 2012 Expert, 123D


May 22, 2009, 11:28:26 AM
#3
No password is required, but I have attached the unzipped file.

Logged


May 22, 2009, 01:06:54 PM
#4
Strange... when I try to extract the (zip) file I am asked for a password.

Logged
Cheers
~Nick

Home-Dell T3400 Quad Core Q6600 OC'd 3 GHz., 8 GB RAM, Radeon HD 3870, Windows 7 x64
ACAD 2012, DoubleCAD XT Pro v3, Alibre 2012 Expert, 123D


May 22, 2009, 01:21:16 PM
#5
OK, so I ran into something strange playing with this.  It does not like Architectural US Scales.  Try changing the scale in the properties palette from 1/1 to 1"=20'.

This actually demonstrates a really useful way to use the PPM, but it needs to work properly...

Logged
Cheers
~Nick

Home-Dell T3400 Quad Core Q6600 OC'd 3 GHz., 8 GB RAM, Radeon HD 3870, Windows 7 x64
ACAD 2012, DoubleCAD XT Pro v3, Alibre 2012 Expert, 123D


May 22, 2009, 03:45:07 PM
#6
Yep -

The only workaround is to type 1in = 20ft. I suspect this is a limitation of the PPM trying to embed a Quatation mark in text - Which is always a little finicky in programming.

Logged


May 22, 2009, 04:10:02 PM
#7
Is there a way to specify that field as text (and not code)?  That would fix the problem (I think).

Logged
Cheers
~Nick

Home-Dell T3400 Quad Core Q6600 OC'd 3 GHz., 8 GB RAM, Radeon HD 3870, Windows 7 x64
ACAD 2012, DoubleCAD XT Pro v3, Alibre 2012 Expert, 123D


May 26, 2009, 06:59:52 AM
#8
Actually  , it is set a text, but I think I get the jist of the comment. The text is being passed back parserd, and processed when instead it should not be treated as code, and maybe treated more like commented text would be treated

Is there a way to specify that field as text (and not code)?  That would fix the problem (I think).

Logged