TiTaNiuM sAMuRai Posted June 11, 2002 Share Posted June 11, 2002 There is the automatic 'LineLength', but can I access the PIO's rotation value (as established by the axis poinst) from within the script? Quote Link to comment
Alexandre Villares Posted June 12, 2002 Share Posted June 12, 2002 IF GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand) THEN MyPIORot:=GetSymRot(objectHand); Quote Link to comment
TiTaNiuM sAMuRai Posted June 12, 2002 Author Share Posted June 12, 2002 Can I modify the appearance of the symbol based on this value? BTW, thanks. Quote Link to comment
Zeibin Posted May 12, 2005 Share Posted May 12, 2005 Of course. The way I've done it involves getting that value, truncating any decimal, running the result through a case statement, and performing tasks based on the angle. ------- RotationINT := Trunc(GetSymRot(gMyObjHd)) MOD 360; {fix rotation value for case statement} CASE RotationINT OF -90..90: BEGIN {your commands here} END; 91..180, -180..-91: BEGIN {your commands here} END; END; {CASE} --------- Quote Link to comment
Alexandre Villares Posted May 16, 2005 Share Posted May 16, 2005 You should test for IsObjectFlipped() otherwise you get strange behavior if the user uses the mirror tool on your PIO. code: {--- some old code chunk I've found as example----} LRot:=GetSymRot(objectHand); f:=1; IF (LRot >#90d) THEN f:=-f; IF (LRot <-#90d) AND (LRot >(-#180d)) THEN f:=-f; IF PFLIP THEN f:=-f; IF f=1 THEN TextJust(1) ELSE TextJust(3); Ltexto:= PLineOffset*mm; f2:=1; IF IsObjectFlipped(objectHand) THEN BEGIN LRot:=-LRot; f2:=-f2; END; IF PTEXTO1<>'' THEN BEGIN TextVerticalAlign(3+(2*f2)); TextOrigin(PLineLength+PLineOffset*mm*f,0.5*mm*f2); TextSize(Str2Num(PC1)); BeginText; PTEXTO1 EndText; Ltexto:=HWidth(LNewObj)+PLineOffset*mm; END; MoveTo(PLineLength,0); LineTo(PLineLength+(Ltexto*f),0); RotatePoint(PLineLength,0, -LRot); [/code] Quote Link to comment
Zeibin Posted August 7, 2005 Share Posted August 7, 2005 I've been having some problems with exactly that, Alexandre. but I can't figure out when/how the PIO checks for a flip. If I flip it, and IsObjectFlipped returns TRUE, when I adjust the length with my mouse IsObjectFlipped returns to FALSE. But if I adjust the length in the OIP, it retains the TRUE value. How does this work? (The code you supplied here seems to do the same thing. Typically the line is always under the text, but if you flip it vertically (so the line's on top) the line flips back down to the bottom if you adjust the length... What I need is something that retains the line above the text after the flip and after a length adjustment.) Quote Link to comment
Alexandre Villares Posted September 8, 2005 Share Posted September 8, 2005 Hi, After the user flipped the object using the mirror tool IsObjectFlipped will return TRUE and your code should counter-act it (the result is a flipped object as expected by the user). Then if the user reshapes the line, the PIO is 'magically' unflipped, and your code gets back to the normal mode (and no one should notice the difference). But again, I can't remember if I coded for the over/under the line difference. My sample code acts differently acording to angles in certain quadrants, and a manual OIP pFlip parameter to override it (that's the 'f' flag). IsObjectFlipped will be dealt by the 'f2' flag (to set Text Vertical Alignment and Y origin position) and will also invert LRot angle (LROt:=-LROt). This is the critical stuff. [ 09-08-2005, 01:58 PM: Message edited by: Alexandre B A Villares ] Quote Link to comment
Recommended Posts
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.