Jump to content

Dimension for arc lenghts?


Hugo

Recommended Posts

Hey Hugo,

Here's little script I dreamed up to place a text object along an arc. The text value is the arc's length. Hope it helps.

V-G

{--------------------------------------------------------}

Procedure arccalc;

{?2007 VectorGeek Corporation}

{places text string(s) stating arc length on selected arc object(s)}

VAR

Radius,ArcLength,startAngleR,arcAngleR,CenterX,CenterY,PrimaryAngle : REAL;

Procedure arcer(h : HANDLE);

BEGIN

GetArc(h,startAngleR,arcAngleR);

ArcLength := HPerim(h);

Radius := ArcLength/Deg2Rad(arcAngleR);

HCenter(h,CenterX,CenterY);

PrimaryAngle := (startAngleR+(arcAngleR/2));

IF PrimaryAngle > 360 THEN

PrimaryAngle := PrimaryAngle-360;

TextSpace(2);

TextJust(2);

IF (PrimaryAngle>=0) AND (PrimaryAngle<=180) THEN

TextRotate(startAngleR+(arcAngleR/2)-90)

ELSE

TextRotate(startAngleR+(arcAngleR/2)+90);

MoveTo(CenterX,CenterY);

AngleVar;

Move(Radius,#PrimaryAngle);

NoAngleVar;

BeginText;

Concat('L= ',Num2Str(3,ArcLength))

EndText;

SetFPat(LNewObj,0);

END;

BEGIN

ForEachObject(arcer,(((T=ARC) & (SEL=TRUE))));

END;

Run(arccalc);

{--------------------------------------------------------}

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...