Jump to content
Developer Wiki and Function Reference Links ×

Text size inside PIO changes when inside a Symbol


Assembly

Recommended Posts

The tool below draws a timber frame in section and add the size of the frame.

It includes a note for treatment.

The procedure gets the layer scale and adjusts the text size to suit.

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

This works fine for me most of the time.

BUT

When if this is used inside a Symbol the text resizing part gets overridden.

Anyone know why this would be?.

How to work around?.

PROCEDURE SECTIONFRAMING;

Var

layerhandle,

pioHandle,

pioRecordHandle,

PioWallHandle: Handle;

PIOlayerscale:Integer;

Layerscale:Integer;

ClassName:String;

pioName: String;

text:boolean;

Radius: Real;

framewidth: Integer;

Depth: Integer;

BEGIN;

pushattrs;

SetLScale(GetLayer(pioHandle),5);

Nameclass('Sec-Framing');

FPatByClass;

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

Layerscale:=GetLScale(ActLayer);

SetLScale(GetLayer(pioHandle),5);

BEGIN;

framewidth:=pframewidth;

depth:=pframedepth;

layerhandle:=getlayer(pioHandle);

PIOlayerscale:=getlscale(layerhandle);

BeginGroup;

RRect(0,0,framewidth,depth,5,5); SetFPatByClass(lnewobj);

radius:=1;

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

setlw(lnewobj,2);

IF (plength='Continious') THEN

BEGIN;

Moveto(radius,depth-radius);

Lineto(framewidth-radius,radius);

setlw(lnewobj,2);

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(framewidth/2,0);

BEGINTEXT;

num2str(0,framewidth)

ENDTEXT;

SetTextWidth(LNewObj,framewidth);

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

Setfpat(lnewobj,0);

TextRotate(90);

TextOrigin(framewidth,depth/2);

BEGINTEXT;

num2str(0,depth)

ENDTEXT;

SetTextWidth(LNewObj,depth);

Setfpat(lnewobj,0);

IF (pTreatment<>'None') Then

BEGIN;

TextRotate(90);

TextOrigin(0,depth/2);

TextVerticalAlign(1);

BEGINTEXT;

ptreatment

ENDTEXT;

SetTextWidth(LNewObj,depth);

Setfpat(lnewobj,0);

END;

END;

END;

EndGroup;

if pflip=true then Hmove(LNewObj,0,-depth);

if pinsertline='Centre' then Hmove(LNewObj,-framewidth/2,0);

if pinsertline='Right' then Hmove(LNewObj,-framewidth,0);

message(layerscale);

SetLScale(GetLayer(pioHandle),layerscale);

popattrs;

resetobject(piohandle);

END;

Run (SECTIONFRAMING);

Link to comment
  • 2 months later...

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