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

SYMB_MIRRORED in X or Y direction

Anonymous
Not applicable
Hi All,

I have a bit of a problem. I have an object that I need to look the same, no matter whether I mirror it in the X or Y direction

In my 2D script I have added the following script, which works well when mirrored over the X axis.

IF SYMB_MIRRORED THEN
MUL2 1,-1
ENDIF

However this will not work if the same object is mirrored in the Y axis instead

Is this a limitation of ArchiCAD, or just my ability
13 REPLIES 13
Anonymous
Not applicable
Hi Tom

Best bet by far mate is to do it via rotation not through mul.
Say if it's rotated 90 degrees in the symb_rotangle then rotate it back.
Then if it's mirrored in any way rotate it back also.
Something like
If symb_mirrored then
rot2 symb_rotangle
else rot2 -symb_rotangle
Anonymous
Not applicable
Thanks Kristian,
I think I will try your solution with future objects, but I ended up doing a combination of both, which worked well with the text in this object


if symb_rotangle >= 0 and symb_rotangle < 90 then
rot2 0
endif

if symb_rotangle >= 90 and symb_rotangle < 180 then
rot2 -90
endif

if symb_rotangle >= 180 and symb_rotangle < 270 then
rot2 -180
endif

if symb_rotangle >= 270 and symb_rotangle < 360 then
rot2 -270
endif

IF SYMB_MIRRORED THEN
MUL2 1,-1
else
mul2 1,1
ENDIF

pen outlinepen
poly2_b 5,3,0,0,
-0.3,-0.3,1,
0.3,-0.3,1,
0.3,0.3,1,
-0.3,0.3,1,
-0.3,-0.3,1
pen innerline
line2 -0.3,-0.3,0.3,0.3

del 1
If symb_mirrored then
rot2 symb_rotangle
mul2 -1,1
else
rot2 -symb_rotangle
endif
rot2 symb_rotangle

pen waa_text_pen
text2 -0.135,0.1, "A"
text2 0.155,-0.125, "P"
Barry Kelly
Moderator
Tom,
You actually had it almost right in your first post except you are un-mirroring it by MULing the Y-axis instead of the X-axis.

I have a hotplate object that I never want to be mirrored so I have added this at the beginning of the 2D script (similar is needed for the 3D as well).

IF symb_mirrored = 1 THEN
ADD2 a,0
MUL2 -1, 1
ENDIF


The only reason I have the ADD2 in there is because to object is not centred on the origin - it is modelled with the leftside of the object on the origin.
If your object is centred on the origin then you could delete that line.

This will allow the object to be rotated at any angle but it can never be mirrored.
If you don't want it to rotate either then you will need to start using your SYMB_ROTANGLE.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Anonymous
Not applicable
Thanks Barry,
But I actually needed my object not to be mirrored in either x or y directions.
The code is a tad long, but works quite well

The image below shows 4 versions of the old object before I added the MUL2 and ROT2 commands. The top right image is the non mirrored object, where the other 3 are mirrored in various ways
Barry Kelly
Moderator
Try this for a simpler code.
if symb_mirrored = 1 then 
	MUL2 -1, 1 
endif 

if symb_rotangle <> 0 then
	ROT2 -symb_rotangle
endif

 pen outlinepen 
 poly2_b 5,3,0,0, 
 -0.3,-0.3,1, 
 0.3,-0.3,1, 
 0.3,0.3,1, 
 -0.3,0.3,1, 
 -0.3,-0.3,1 
 pen innerline 
 line2 -0.3,-0.3,0.3,0.3 

 pen waa_text_pen 
 text2 -0.135,0.1, "A" 
 text2 0.155,-0.125, "P"  

if symb_mirrored = 1 then 
	DEL 1 
endif 

if symb_rotangle <> 0 then
	DEL 1
endif
This won't allow you to rotate it any angle at all where as yours only un-rotates if at 0, 90, 180 or 270.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Anonymous
Not applicable
That's good, that's a nice way of rotating it correctly all the time. I will use that in the future.
For this case though I only want mine at 90 degree intervals just encase we need to rotate an access panel on an angle
Anonymous
Not applicable
and for the shorter and faster code you can use this (without IF conditions):


MUL2 1 - 2 * symb_mirrored, 1
ROT2 -symb_rotangle * (symb_rotangle <> 0)

...........................
...........................
...........................
...........................

DEL 2
sinceV6
Advocate
ila2 wrote:
and for the shorter and faster code you can use this (without IF conditions):


MUL2 1 - 2 * symb_mirrored, 1
ROT2 -symb_rotangle * (symb_rotangle <> 0)

...........................
...........................
...........................
...........................

DEL 2
That's nice!
The bold part is evaluating as a boolean right?, so in this case the parenthesis work as an IF statement? Maybe I have missed that use in the documentation... or is it not documented? Never picked up that syntax before... pretty efficient!
Anonymous
Not applicable
sinceV6 wrote:
ila2 wrote:
and for the shorter and faster code you can use this (without IF conditions):


MUL2 1 - 2 * symb_mirrored, 1
ROT2 -symb_rotangle * (symb_rotangle <> 0)

...........................
...........................
...........................
...........................

DEL 2
That's nice!
The bold part is evaluating as a boolean right?, so in this case the parenthesis work as an IF statement? Maybe I have missed that use in the documentation... or is it not documented? Never picked up that syntax before... pretty efficient!
Yes, it is. The value of the bold part is 1 if the statement is true and 0 if is is not true. I don't know that it is documented or not. I don't remember where/when I learned it.