Jump to content

Placing an object in a drawing before end of PIO

Recommended Posts


Can someone help me with the following problem.

I have a PIO (Plug In Object) which draws a rectangle on the drawing. The rectangle appears in the drawing AFTER the end of the PIO. This is a problem for me because I have to attach a record on the rectangle during execution of the PIO.

How can I draw my rectangle during the execution of the PIO?

I will appreciate your help very much and I wish you a very nice day.

Friendly greetings,


Link to comment

Hello Everyone,

Yesterday I posted this problem. In the meantime I found the solution. You will find the code below this text.

First create a record called recTest. Then create 2 fields called width and height. Then create a PIO or a Vectorscript and past the code below. You are ready to run now.

The code draws a rectangle and connect record recTest to it. Also it fills the fields with some example values.

Hope you find some use for it. Have a nice day.

Friendly greetings,


procedure Test; var hndLayer:handle; hndObject:handle; hndRecord:handle; LntPosX:longint; LntPosY:longint; BEGIN { Start main program } hndLayer := ActLayer; hndRecord := GetObject('recTest'); GetVCenter(LntPosX,LntPosY); SetRField(hndRecord,'recTest','width','150'); SetRField(hndRecord,'recTest','height','250'); rect(LntPosX-100,LntPosY-100,LntPosX+100,LntPosY+100); hndObject := LnewObj; { This code does the trick } SetRecord(hndObject,'recTest'); END; { End of script Test } run(Test);

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.

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