Register
 
DoubleCAD XT v5 has released

(PRO only) Another script - the all important enterprise tool
Read 2485 times
May 14, 2009, 12:44:57 PM
Ok, ok - so, maybe I have Star Trek on the brain, and I am a bit of a nerd so I wrote this little script. While I did it for fun it does illustrate some of the power of the PPM and the abiity to generate complex objects.

Anyway - Enjoy! (maybe next time I'll add phasers)

// Draw Enterprise

//Create Saucer

c0 = Polyline(
    Point(-4.97,1.15),
    Arc0(0,0),
    Point(-4.97,-1.15));

c1 = Polyline(
    Point(-4.87,1.13),
    Arc0(0,0),
    Point(-4.87,-1.13));

c2 = Polyline(
    Point(-3.88,0.99),
    Arc0(0,0),
    Point(-3.88,-0.99));

c3 = Circle(2.9);
c4 = Circle(1.9);
c5 = Circle(1.3);
c6 = Circle(1);
l1 = Polyline(Point(1,0),Point(5,0));
l2 = RotateZ(l1,22.5,0,0,7);
l3 = RotateZ(l1,-22.5,0,0,7);
l4 = Polyline(Point(-1,0),Point(-3,0));

B = Polyline(
   Point(0.25,0.6),
   Arc0(0.25,0),
   Point(0.25,-0.6),
   Point(-0.4,-0.4),
   Arc0(-0.25,0),
   Point(-0.4,0.4),
   Point(0.25,0.6)
   );

I = Polyline(
   Point(-4,1),
   Arc0(-4,0),
   Point(-4,-1),
   Point(-5,-1.15),
   Point(-5.5,-1),
   Point(-5.5,1),
   Point(-5,1.15),
   Point(-4,1)
   );

I2 = Circle(0.75,-4,0);
I3 = Circle(0.15,-4,0);
I5 = Circle(0.1,-4,0);
I4 = Circle(0.8,-4,0);
IL1 = Polyline(Point(-3.85,0),Point(-3.25,0));
IL2 = RotateZ(IL1,11.25,-4,0,32);

Bridge1 = Circle(0.4,0.25);

G1 = Group(c0,c1,c2,c3,c4,c5,c6,l1,l2,l3,l4,
Bridge1,B,I,I2,I3,I4,I5,IL1,IL2);


//Create Nacelles
N = Polyline(
Point(-7.53, 4.01),
Arc1(-8.32,3.82),
Point(-8.32,4.63),
Point(-9.91,4.63),
Arc1(-9.91,3.95),
Point(-10.24,4.54),
Point(-15.11,4.54),
Arc1(-16.06,-7.52),
Point(-18.82,4.26),
Arc1(-18.69,3.85),
Point(-19.09, 4.01)
);

N2 = RotateX(N,180,4.01,0);
NW = Polyline(
Point(-15.87,4.57),
Point(-15.98,4.67),
Point(-18.07,4.67),
Point(-18.39,4.35)
);

NV = Polyline(
Point(-7.66,4.29),
Point(-7.98,4.29),
Point(-8.06,4.14),
Point(-10.08,4.14),
Point(-10.08,4.07),
Point(-7.5471,4.07)
);
NV2 = RotateX(NV,180,4.01,0);

NN = Polyline(
Point(-10.14,4.01),
Point(-10.14,4.11),
Point(-10.49,4.39),
Point(-15.11,4.39),
Arc1(-15.25,-1),
Point(-16.72,4.22),
Arc1(-16.63,3.8),
Point(-17,4.01)
);
NN2 = RotateX(NN,180,4.01,0);

NNN = Polyline(
Point(-10.3535,4.2809),
Point(-13.1452,4.2809),
Arc1(-13.1452,1.6294),
Point(-14.0042,4.1379),
Arc1(-13.9371,3.942),
Point(-14.1318,4.01)
);
NNN2 = RotateX(NNN,180,4.01,0);

NNNN = Polyline(
Point(-10.1674,4.1309),
Point(-12.6447,4.1309),
Arc1(-12.6447,3.3526),
Point(-12.9682,4.0604),
Arc1(-12.9461,4.0119),
Point(-12.9993,4.01)
);
NNNN2 = RotateX(NNNN,180,4.01,0);

NC = Circle(0.0605,-18.5501,4.01);
NL1 = Polyline(Point(-17.00,4.01),Point(-18.489,4.01));
NL2 = Polyline(Point(-18.61,4.01),Point(-19.085,4.01));

G2 = Group(N,N2,NW,NV,NV2,NN,NN2,NC,NL1,NL2,NNN,
NNN2,NNNN,NNNN2);

G3 = RotateX(G2,180,0,0);

// Creat Primary Hull & Pylons

P = Polyline(
Point(-4.7441,1.8753),
Arc1(-6.4966,-15.8782),
Point(-10.2943,1.849)
);

PP = Polyline(
Point(-11.1305,1.6631),
Arc0(-13.5319,13.6748),
Point(-13.5319,1.4254),
Arc1(-13.5319,0),
Point(-14.9573,0)
);

PPP = Polyline(
Point(-5.5,0.3734),
Point(-6.8276,0.3734),
Arc1(-6.8276,0),
Point(-7.201,0)
);

PPPP = Polyline(
Point(-7.201,0),
Point(-13.9072,0)
);

PPPPP = Polyline(
Point(-13.9072,0),
Arc0(-13.5319,0),
Point(-13.6286,0.363),
Point(-13.8536,1.2027),
Arc1(-13.5319,0),
Point(-14.7769,0)
);

WW = Polyline(
Point(-11.2359,3.48),
Point(-10.071,1.4623),
Arc0(-10.1792,1.3998),
Point(-10.1792,1.2748),
Point(-10.6904,1.2748),
Arc0(-10.6904,1.3114),
Point(-10.7788,1.3114),
Point(-12.9474,3.48)
);

G4 = Group(P,PP,PPP,PPPP,PPPPP,WW);
G5 = RotateX(G4,180,0,0);


//Draw

Output(G1,G2,G3,G4,G5);

« Last Edit: May 14, 2009, 03:00:02 PM by wmanning »

Logged


May 14, 2009, 01:37:18 PM
#1
What does the smiley do?  I was not aware DCAD supported smiley faces.   ;D

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 14, 2009, 03:01:49 PM
#2
  :D Thanks Nick - Forum automation is nice but it can also be a pain.

Logged


May 14, 2009, 03:08:38 PM
#3
In case anyone else runs into that problem -- Brian had "3.48)" in the script and it converted the 8) into a smiley -- you can click on Additional Options below and check "Don't use smileys" for the particular post (as I've done here).

Logged
DoubleCAD XT Pro on XP Pro...