Jump to content
Sign in to follow this  
ionw

resetting a mirrored PIO

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

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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.

Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...