Jump to content
Developer Wiki and Function Reference Links ×

Create a text on the active view


Recommended Posts

Hello everyone,

I need to create, through script, a generic text on the active view.

I enclose a sample script of what I would do

Procedure LoadFile;

VAR

boolResult:BOOLEAN;

inserimento :POINT;

objectHandle :HANDLE;

OX, OY, OZ, RX, RY, RZ :real;

BEGIN

boolResult:= GetViewMatrix(ActLayer, OX, OY, OZ, RX, RY, RZ);

message (OX,'*', OY,'*', OZ,'*******',RX,'*', RY,'*', RZ,' risul=', boolResult);

GetPt(inserimento.x, inserimento.y);

TextOrigin(inserimento.x, inserimento.y);

BeginText;

'Testo_1'

EndText;

objectHandle := LNewObj;

SetObjectVariableBoolean(objectHandle, 684, true);

SetObjectVariableBoolean(objectHandle, 1160, false);

boolResult := SetEntityMatrix(objectHandle, OX, OY, OZ, RX, RY, RZ);

Redrawall;

END;

Run(LoadFile);[/color]

Thanks to all and happy new year

Piero Molinengo

Link to comment

Hello Piero,

This line puts the text on the Layer Plane (Ground Plane):

???SetObjectVariableBoolean(objectHandle, 1160, false);

which may not be visible when you click in a 3D view.

If you set it to TRUE it will draw on the Screen Plane and show where you click:

???SetObjectVariableBoolean(objectHandle, 1160, false);

If you DO want it to move with the view then you DO want it on the Layer Plane. I haven't figured out how to do that yet. Can you explain how you want it to look?

Raymond

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