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-14 08:56 PM
I've written a few objects that I think do what you're after, but I'm not sure I fully get what you are trying to achieve. Could you post a sketch or something? Or if you want to pm me I could give you my email and we can chat. I've been helping a few others that way recently.
2023-03-14 11:58 PM
@SenecaDesignLLC Thanks. The object I have needs to be linked to an upper story. There are three main parameters 1. The object height, 2. The linked story elevation, 3. an offset value from the link. I am happy with all those. What I am looking for is the correct process to update the height & offset if the home story offset is changed. As per my opening post if I change the [Offset from Home Story] in the common interface the object and SYMB_POS_Z change, but I can't see how to use that change with GLOB_MODPAR_NAME. I guess I am asking is there an AC parameter I am missing?
2023-03-16 02:03 AM
Could you put the SYMB_POS_Z in a parameter. Each time script is run it checks if this has changed and then action accordingly. After action update parameter again.
2023-03-16 02:56 AM - edited 2023-03-16 03:13 AM
Object Height, ZZYZX,
Linked Story Elevetion, GLOB_HSTORY_ELEV,
and Offset from selected story, y?
So your target is that when you change something such as your projects Story Settings, the Offset parameter of your object will automatically update?
I do not believe you can use a global for glob_modpar_name... and even if there is some alternate way, you would need to save out the current state in order to reference any changes. This cannot be done via parameters and globals and most requests do not work is the parameter script, and it cannot be done via an i/o operation as those only occur on object generation / refresh.
|AC22-23 AUS 7000||Help Those Help You - Add a Signature|
|Self-taught, bend it till it breaks||Creating a Thread|
|Win10 | R5 2600 | 16GB | GTX1660|
2023-03-16 10:15 AM
Thanks for the interest. I have taken this as far as I want for now. It was a test to establish the viability of adding the function to one of my other objects. The confusing part was the relationship of the Top & Bottom settings in the common UI. From what I can determine they are used to set SYMB_POS_Z (Offset from Home) and ZZYZX (Object height). The comments regarding having a saved state are correct.
I have attached the GSM file, which was built in AC24. I doubt it has much use as an object on its own, but I am happy to share my findings. The object has minimal settings and for the purists, please forgive the capitalisation, that was how I learnt GDL.
Any comments or feedback on possible improvements are welcome.
2023-03-16 01:03 PM
I am not sure you solved what you needed, anyway, here is a tutorial about a top-anchored lamp: https://gdl.graphisoft.com/tips-and-tricks/how-to-create-a-hanging-lamp
Generally scripts are re-run when global variables/requests contained in them change. Unless you need to list these values, there should be no need to store them in parameters. If there is a need to know how much they changed, that sounds like a substitute for a missing information, these behaviours might always change in a future release.
2023-03-16 01:29 PM
Thanks for the link Peter, I will download the sample. I hadn't thought about the object in context of a lamp! The ultimate objective is to control a framed wall object as some of my clients like to change story heights and floor depths. The sample above was part of the learning curve as to how this might be managed.
2023-03-16 05:58 PM
Not sure if it's relevant but the elevator object has a good example of getting all the stories and their info into some arrays.
I use this so that I can specify which stories I want to see my objects on as well.
2023-03-16 10:55 PM
The elevator was a bit more relevant. 👍
I think I have used the relevant parts to gather the story data, but the final array management looked a bit more complex than I needed.