Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

IF SYMB_MIRRORED.....THEN CHANGE PARAMETER

Anonymous
Not applicable
Hi All,

I've scripted a simple, office standard casement window. It works perfectly except for one thing. The user has the option to choose: Left, Right of Fixed as the opening direction. The problem is that if the window is mirrored it still shows the original opening direction parameter even though the opening line is correct. The script below shows an attempt to fix this but it doesn't work. Any thoughts?


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! OPENING LINE !!!!!!!!!!!!!!!!!
IF OP_DIR="Fixed" THEN END
IF OP_DIR="Left" THEN
ADDX A-7.5"
MULX -1
IF SYMB_MIRRORED THEN PARAMETERS OP_DIR = "Right"
ENDIF
ADDZ .25"
LIN_ 0, 0, 0, A-7.5", (B-7.5")/2, 0
LIN_ A-7.5", (B-7.5")/2, 0, 0, B-7.5", 0
IF SYMB_MIRRORED THEN PARAMETERS OP_DIR = "Left"

Thanks,
Doug
19 REPLIES 19
Erich
Booster
Doug,

It sounds as though you just aren't getting the parameter change, is that correct? If so, I have always written this as:
OP_DIR = "Right"
PARAMETERS OP_DIR = OP_DIR
Does this make any difference for you?
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
Anonymous
Not applicable
Hello Doug,
Your snippet of code appears to be in the 3D script.
The SYMB_MIRRORED global is only recognized in the 2D script.
Also the PARAMETERS command only works in the
master script or the parameters script.

Would the following simplified code work ?
The PARAMETERS command is not used at all.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! OPENING LINE !!!!!!!!!!!!!!!!!
IF OP_DIR="Fixed" THEN END

IF OP_DIR="Left" THEN
ADDX A-7.5"
ADDZ .25"
MULX -1
LIN_ 0, 0, 0, A-7.5", (B-7.5")/2, 0
LIN_ A-7.5", (B-7.5")/2, 0, 0, B-7.5", 0
DEL 3
ENDIF

IF OP_DIR="Right" THEN
ADDX A-7.5"
ADDZ .25"
LIN_ 0, 0, 0, A-7.5", (B-7.5")/2, 0
LIN_ A-7.5", (B-7.5")/2, 0, 0, B-7.5", 0
DEL 2
ENDIF

Peter Devlin
Anonymous
Not applicable
Thanks for your replies. I've posted a picture of this issue to simplify things (should have posted it originaly but didn't have time). Peter, your script is pretty much what I started with. The problem is that when the window is mirrored the opening dirction parameter still reads Left (see below). I'd like it to change atomatically.

Doug
Mirrored window.PNG
Anonymous
Not applicable
Hello Doug,
I don't know whether the PARAMETERS command works on
value lists but if you put your lines that contain the PARAMETERS
command into the master script we will both find out.
Please let us know how it works out.
Peter Devlin
Anonymous
Not applicable
This is not true..I think. It is working in 3D and even in listing.
The SYMB_MIRRORED global is only recognized in the 2D script.
Best regards, Juha
Anonymous
Not applicable
The SYMB_MIRRORED global is only recognized in the 2D script.
I put: IF SYMB_MIRRORED THEN END in the master script and it seemed to work..nothing but an empty hole in the wall. So I tried this in the master script:

IF SYMB_MIRRORED THEN
IF OP_DIR="Left" THEN OP_DIR="Right"
PARAMETERS OP_DIR="Right"
ENDIF

IF SYMB_MIRRORED THEN
IF OP_DIR="Right" THEN OP_DIR="Left"
PARAMETERS OP_DIR="Left"
ENDIF

!!!!!!!!!3D Sript:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

IF OP_DIR="Fixed" THEN END
IF OP_DIR="Right" THEN
ADDX A-7.5"
MULX -1
ENDIF
ADDZ .51"
LIN_ 0, 0, 0, A-7.5", (B-7.5")/2, 0
LIN_ A-7.5", (B-7.5")/2, 0, 0, B-7.5", 0

Still no luck.
Anonymous
Not applicable
At the last line of the code you always had the OP_DIR to "Left" therefore it is static (in your 1st example).

It might work arranging the code like;


!--Master or value script
IF OP_DIR="Fixed" THEN END

IF SYMB_MIRRORED THEN
	OP_DIR = "Right" 
ELSE
	OP_DIR = "Left" 
ENDIF
PARAMETERS OP_DIR = OP_DIR



!--3D script
IF OP_DIR="Left" THEN 
	ADDX A-7.5" 
	MULX -1 
ENDIF

ADDZ .25" 
LIN_ 0, 0, 0, A-7.5", (B-7.5")/2, 0 
LIN_ A-7.5", (B-7.5")/2, 0, 0, B-7.5", 0

DEL (OP_DIR="Left")*2 + 1


Hope this helps and works.
Anonymous
Not applicable
Hello Juha,
I believe you are right.
I realized that since SYMB_MIRRORED is a global
it should be recognized in any script.
Thank you,
Peter Devlin
Anonymous
Not applicable
Hi Juha,
Thanks for ypur code. I don't know if I'm missing something but I've tried it along with several variations but can't get exactly what I'm after. I'd like to be able to place a window, Left or Right and mirror either one and have the op_dir parameter change accordingly. I've attatched a zip of the part so if you guys have a minute you can look at it. I tried to find a similar parameter in the AC11 casement windows but couldn't. My thought is that more that likely it will be scheduled using the ID so the user will have to change the opening direction in the ID manually anyway (or place the window using favorites). Either way I might be wasteing your time with this issue. I'll keep digging.

Thanks again,
Doug