We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-03-14 01:47 PM
I am looking for the correct equivalent of
if GLOB_MODPAR_NAME = "SYMB_POS_Z" then... which doesn't work.
I need an object to react e.g. to change height, if its [Offset from Home Story] is adjusted in the common interface. Currently the whole object moves and the required parameter updates don't happen.
2023-03-28 01:26 AM - edited 2023-03-28 01:28 AM
Hello!
Sorry I'm a bit late and I didn't see this one sooner to help a bit; but will leave some code for other people to use.
From what I understand, you basically are trying to link an object's height to the next (or another) story, keeping an eye on an offset from said height (on top, based on story settings) and change the object's height if that changes and also take into account the objects home story offset. Correct?
If that's the case, you can use this piece of code (can be used in master):
!=================================================
!--- STORY INFO FOR LINKED HEIGHT-----
!=================================================
!++++++++++++++++
!CAN'T USE GLOB_HSTORY_HEIGHT BECAUSE OF PARAMETER SCRIPT INCOMPATIBILITY
!++++++++++++++++
rrr=REQUEST ("Home_story", "", homeIndex, homeStoryName)
!--- Passing homeIndex value to next REQ
rrr=REQUEST ("Story_info", homeIndex, nStories, storyIndex, storyName, storyElev, storyHeight)
IF heightLink THEN
sizeZ = storyHeight + heightOffset - GLOB_ELEVATION
ZZYZX = sizeZ
PARAMETERS ZZYZX = ZZYZX
LOCK "ZZYZX"
ELSE
sizeZ = ZZYZX
PARAMETERS sizeZ = sizeZ
ENDIF
where "heightLink" is a boolean, "sizeZ" is a hidden length parameter that is used for the 3D block height, and "heightOffset" is the parameter you can control with a hotspot. This is to link it to the next story; if you need another one from the list, you will need the array with the story info to manage that.
Hope that helps.
Best regards.
2023-03-28 10:15 AM
@sinceV6 No need to apologise, and thank you for your input. That would be a simplification of what I am considering e.g. a multi-storey object, but it is also seriously tempting as the number of multi-storey instances in the final application is quite limited. 🤔
2023-03-28 04:59 PM
Hi!
The code is used in a library part as an option to link it to the next storey, but yeah... it is quite simple and basically just for that: next level.
I have a multi-storey object, an elevator, that behaves in the same way, but with the other things for it to work with that goal. The logic is quite the same though. You just need the extra info about storeys for height and display automation.
Best regards.