We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Can I adjust a variable that reads from another variable?

JGoode
Expert
I need to edit the variable A but still be able to set it up so that when the object changes it 'A' will revert back to a set value. I can only manage to get 'A' to read from another parameter that I have made but this does not allow 'A' to be edited. Is there a way around this? In my case there are 2 variations of the objects where the width changes so I need A to reset to a default.
ArchiCAD 23

Windows 10
3 REPLIES 3
Erwin Edel
Rockstar
Sounds like you'd need a toggle switch for each of the instances.

So if you want A to define the width, that's situation 1. If you want other variables to determine A and this in turn defines the width, that's situation 2.

That way the two instances shouldn't interfere or exclude eachother.
Erwin Edel, Project Lead, Leloup Architecten
www.leloup.nl

ArchiCAD 9-26NED FULL
Windows 10 Pro
Adobe Design Premium CS5
JGoode
Expert
Erwin wrote:
Sounds like you'd need a toggle switch for each of the instances.

So if you want A to define the width, that's situation 1. If you want other variables to determine A and this in turn defines the width, that's situation 2.

That way the two instances shouldn't interfere or exclude eachother.
The issue comes when I change one of the widths. Because it scales with B, when I change the width of one then change to a different variation, either the B or one of the width variables will stay the same and not scale correctly until a value is re-entered in. Here is a part of the master script
if (show_text) then
	if GLOB_MODPAR_NAME = "text_width_2" then 
		 B=text_width_2*(2/3)
	  endif 
	
	  if GLOB_MODPAR_NAME = "B" then 
		 text_width_2=B/(2/3)
	  endif 
endif

if (show_text = 0) then
	if GLOB_MODPAR_NAME = "text_width" then 
    	B=text_width/0.88 
  	endif 

  	if GLOB_MODPAR_NAME = "B" then 
     	text_width=B*0.88
  	endif 
endif

PARAMETERS A=A, B=B

if (show_text = 0) then
	A = text_width
endif

if (show_text) then
	A = text_width_2
endif
and here is a part of the 2D mul2 calculation
 if (show_text) then 
	mul2 text_width_2/0.075, B/0.05
else 
	mul2 text_width/0.0441, B/0.05
endif
ArchiCAD 23

Windows 10
Erwin Edel
Rockstar
Maybe split things up into callable subroutines and run them in order that is needed to keep the variables scaled as needed?
Erwin Edel, Project Lead, Leloup Architecten
www.leloup.nl

ArchiCAD 9-26NED FULL
Windows 10 Pro
Adobe Design Premium CS5