Jump to content

point PIO and Linear PIo


Recommended Posts

I have a Point PIO that is behaving so far.

I want to add a Linear PIO into it to finish the script.

All lengths and parameters of the linear PIO are obtained thru the point PIO parameters. How does one call a linear PIO into a point PIO. I have tried numerous way but i get nothing but really hard crashes. I'm not really sure what calls to make and how to set the parameters of the Linear PIO correctly.

My code is working with original PIO file I have been using to build the tool, BUT, if I attempt to create a fresh version... kaboom.

Any suggestions would be helpful.

If more Info is needed I can supply that too.

Thanks in Advance

Jeff Miller

Link to comment

Hi Jeff,

These are the test code that there is LinearPIO in PointPIO.

Please draw PointPIO, after registering PointPIO to Tool Palette.

LinearPIO need not be registered.

<< PointPIO: Point-Plug-in Object >>

PIO-Parameters:

LPIO_Name: {LPIO-Name = 'LinearPIO'}

LPIO_Text: {LPIO-Text}

ControlPoint01X, ControlPoint01Y: {LPIO-StartPoint}

ControlPoint02X, ControlPoint02Y: {LPIO-EndPoint}

procedure PointPIO;
var
h	:handle;
lng, rot	:real;
v	:vector;
begin
Locus(0, 0);

v.X:= pControlPoint02X - pControlPoint01X;
v.Y:= pControlPoint02Y - pControlPoint01Y;
lng:= Norm(v);
rot:= Vec2Ang(v);
h:= CreateCustomObject(pLPIO_Name, pControlPoint01X, pControlPoint01Y, rot);
if h <> nil then begin
	SetRField(h, pLPIO_Name, 'LineLength', Num2Str(-1, lng));
		SetRField(h, pLPIO_Name, 'MyText', pLPIO_Text);
	ResetObject(h);
end;
end;{PointPIO}
Run(PointPIO);

<< LinearPIO: Lenear-Plug-in Object (in PointPIO) >>

PIO-Parameters:

MyText: {LPIO-Text}

procedure LinearPIO;
begin
MoveTo(0, 0);
LineTo(pLineLength, 0);

TextOrigin(pLineLength/2, 0);
TextJust(2);
TextVerticalAlign(3);
if pMy_Text <> '' then
	CreateText(pMy_Text);
end;{LinearPIO}
Run(LinearPIO);

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