Jump to content
Developer Wiki and Function Reference Links ×

resetting a mirrored PIO


ionw

Recommended Posts

I have made my set of custom Annotation PIO's. One issue that has cropped up, is say for a roof slope indicator, the easiest way to lay it out is to place one and then use the mirror & duplicate tool to place the indicator on the other side of the ridge. What happens is that the mirrored version does not display correctly. I am looking for a way to see if the PIO has been Mirrored and then reset it so that it reads correctly. I found ways to mirror, ways to see if something is flipped in a wall, but nothing to deal with a mirroring action.

Thanks in advance for any help that can be offered.

ion

Link to comment

Hi Ion,

No, you would need a mirror or flip function that acts on a handle. I think it is not there.

You can un-mirror the content of the pio like in the code below.

Wouldn't that do?

procedure P_PIO;
var ghParm,gParmRecordHand, gWallHand :handle;
gPIOName : string;
gflag : boolean;

begin {main}
gFlag := GetCustomObjectInfo(gPIOName, ghParm, gParmRecordHand, gWallHand);

setobjectvariableboolean(ghparm,800,true);

textorigin(0,0);
begintext;
'bla bla bla'
endtext;

if IsObjectFlipped(ghParm) then 
begin
Fliphor;
{textflip(1);}{i can't get the text flip working right}
message('flipped');
end
else
begin
message('not flipped');
end;

moveto (0,0);
lineto (-100mm,0);

end;  {main}
run(P_PIO);

Regards,

Gerard

Link to comment

Thanks Gerard,

this is essentially the structure of the code I am using, when I am in the office tomorrow I will make sure the syntax and order are the same.

For some reason I thought this method was failing because it was a 2D object.

thanks for the input, and I will post my results

Link to comment

Gerard,

It appears that I am on the right track now. I think I had two issues when I was trying to make it work: I was using textFlip(); and I was not using setobjectvariableboolean();

I need to come up with some rules for text placement based on mirroring, but it is a great head-start. One question, I attempted to find out what Enabling Font Style (object setting 800) did for the tool here, and was unable to find out anything other than it is a boolean switch, what is this setting actually doing?

Many thanks for your help,

ion

Link to comment

Hi Ion,

Enabling Font Style (object setting 800) did for the tool here, and was unable to find out anything other than it is a boolean switch, what is this setting actually doing?

Always set this to true for your pio if your PIO contains text. The user can then change the pio's text font, size and style as (s)he would for normal text. (but only from the menus, not through the OIP). It is not perfect, I believe alignment won't work.

You can overrule Enabling Font Style by adding for instance the text font in your code. Text size and style are determined by the user, but your code sets the font, if you add this line before the text creation code:

TextFont(GetFontID('Times'));

Have fun,

Gerard

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