Jump to content
Developer Wiki and Function Reference Links ×

Text Size Control Part2


Recommended Posts

On testing my text size control object is not working on insert.

The text is defaulting to being sized in relation to the layer it is inserted on. On editing the PIO it works perfect.

I think I read somewhere that PIO's don't get a layer handle until after they have been insert. If so this would explain the behavior, as my calling getlayer will be NIL until after it has completed the insert... is there a way around this?.

Link to comment

When this tool is inserted into layers larger than 1-10 the text looks bad. I used to include a

If layerscale<10 THEN

textprocedure.

I have revised the tool using the textPIO code in last post to sets the text to be 3mm for ViewPort scales 1-5. BUT, as above, when inserting it inserts the text is too big again.

To work around this I included

if IsNewCustomObject(pioHandle)=False Then

TextProcedure.

_____________________

PROCEDURE SECTIONFRAMING;

Var

layerhandle,

pioHandle,

pioRecordHandle,

PioWallHandle: Handle;

PIOlayerscale:Integer;

pioName: String;

text:boolean;

Radius: Real;

width: Integer;

Depth: Integer;

BEGIN;

pushattrs;

Nameclass('Section-Framing');

If (getcustomobjectinfo(pioName,pioHandle,pioRecordHandle,PioWallHandle)=True) THEN

BEGIN;

width:=pframewidth;

depth:=pframedepth;

layerhandle:=getlayer(pioHandle);

PIOlayerscale:=getlscale(layerhandle);

RRect(0,0,width,depth,5,5);

setclass(lnewobj,'Section-Framing');

radius:=1;

Moveto(radius,radius);Lineto(width-radius,depth-radius);

setclass(lnewobj,'Section-Framing');

setlw(lnewobj,2);

IF (plength='Continious') THEN

BEGIN;

Moveto(radius,depth-radius);

Lineto(width-radius,radius);

setlw(lnewobj,2);

setclass(lnewobj,'Section-Framing');;

END;

{----TEXT------------------------------}

text:= ptext;

IF(text=true) THEN

IF IsNewCustomObject(pioName)=False THEN

BEGIN;

textsize(5*5/PIOlayerscale);

TextFont(GetFontID('Arial'));

TextFace([]);

TextFlip(0);

TextRotate(0);

TextSpace(2);

TextJust(2);

TextVerticalAlign(5);

TextOrigin(width/2,0);

BEGINTEXT;

num2str(0,width)

ENDTEXT;

SetTextWidth(LNewObj,width);

SetTextSize(lnewobj,0,50,5*5/PIOlayerscale);

Setfpat(lnewobj,0);

TextRotate(90);

TextOrigin(width,depth/2);

BEGINTEXT;

num2str(0,depth)

ENDTEXT;

SetTextWidth(LNewObj,depth);

Setfpat(lnewobj,0);

END;

END;

popattrs;

resetobject(piohandle);

END;

Run (SECTIONFRAMING);

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