Jump to content
Developer Wiki and Function Reference Links ×

controlling a mirrored PIO


Recommended Posts

I have a mirrored linear object PIO that is misbehaving. If I change its length in the object info palate it stretches as I would expect, but if I stretch it with the mouse it flips itself over. And if I add an IsObjectFlipped it only responds to that if altered in the object info palate not if stretched by the mouse. Is there some way of correcting the mirror?

Thank you

Fred Perkins

Link to comment

Charles, the Batt Insulation object does this all the time.

- Draw a horizontal length of Batt Insulation.

- Mirror it (either horizontal or vertical will do).

- Stretching it from either end, in or out, will cause it to flip back to its unmirrored state.

At a guess I would say all of the linear PIOs do this. With the insulation PIO it is obvious because the handles are on one edge rather than the centreline.

The Batt Insulation tool has always behaved this way, and it comes up regularly on the Techboard.

Link to comment
....And if I add an IsObjectFlipped it only responds to that if altered in the object info palate not if stretched by the mouse. Is there some way of correcting the mirror?

If you want to use IsObjectFlipped, then you need to activate the option "recalculate after rotation" in the settings of your script. Otherwise it wouldn't recalculate itself when you mirror it.

This script works fine that way (but i'm not sure it's that that you're after...) :

PROCEDURE Test;
VAR
LineR : REAL;

pioName : STRING;
pioHand : HANDLE;
recordHand : HANDLE;
wallHand : HANDLE;
Result : BOOLEAN;	SpieFac : REAL;

Mirror : REAL;

BEGIN
Result:=GetCustomObjectInfo(pioName,pioHand,recordHand,wallHand);
Mirror:=1;
IF IsObjectFlipped(pioHand) THEN Mirror:=-1;

LineR:=PLineLength;
MoveTo(0,0);
LineTo(LineR,0);
Rect(5cm,5cm*Mirror,LineR-10cm,30cm*Mirror);
END;
RUN(Test);

Edited by maarten.
Link to comment

Thanks for the script. I tried it and the mirrored PIO now flips if it is manually stretched or if the length is changed in the OIP so both ways have the same effect which is good. Unfortunately it is the opposite effect from what I'm looking for (I don't want it to flip) and it still doesn't seem to know if it has been manually stretched or stretched through the OIP. If you put a Rotate in an IsObjectFlipped IF THEN statement it will rotate when the length is changed in the OIP but not when it is manually stretched.

Link to comment

@mike: not completely, but if they would put in the IsObjectFlipped, the phenomena described above would not happen anymore... but you wouldn't really mirror the pio when you mirror it.

It probable isn't completely clear what I'm talking about, but try this:

Make a new pio, type is "linear" and paste the above code in it. Make sure the "recalculate after rotation" option is on (see picture below).

If you mirror that pio, you'll see what i mean.

@Fred: I think you don't have the "recalculate after rotation" option active. I don't know if it's called like that in English though. It's this option:

afbeelding2ly0.jpg

I know, it's still not completely what you want, but I have no clew how you can archive that.

So sorry, this is all that i can think of... Maybe a more experienced scripter then me can find a better solution?

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