2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations
2022-09-29
04:08 AM
- last edited on
2022-10-01
03:25 PM
by
Laszlo Nagy
Hi.. I'm GDL newbie.
I made a skin list label for drawing.
but there is a problem that it's not automatically updated.
After I edit a composite skins, the Skin list label isn't updated.
So I need to click another options for refreshing the object.
I really need to know How to automatically update the skin list label.
I'm happy to know any tips or advise. thank you.
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
this is how i called a composite skin's informations.
[MASTER]
type_Wall = 5
type_Slab = 7
type_Roof = 8
numFinish = 1
if GLOB_ELEM_TYPE = type_Wall then
numFinish = WALL_SKINS_NUMBER
for i = 1 to numFinish
parameters stFinish[i] = WALL_SKINS_BMAT_NAMES[i][1]
parameters thkFinish[i] = WALL_SKINS_PARAMS[i][2]
next i
endif
if GLOB_ELEM_TYPE = type_Slab then
numFinish = SLAB_SKINS_NUMBER
for i = 1 to numFinish
parameters stFinish[i] = SLAB_SKINS_BMAT_NAMES[i][1]
parameters thkFinish[i] = SLAB_SKINS_PARAMS[i][2]
next i
endif
if GLOB_ELEM_TYPE = type_Roof then
numFinish = ROOF_SKINS_NUMBER
for i = 1 to numFinish
parameters stFinish[i] = ROOF_SKINS_BMAT_NAMES[i][1]
parameters thkFinish[i] = ROOF_SKINS_PARAMS[i][2]
next i
endif
[2D]
stContent = "THK" + str("%.1mm", thkFinish[selectTmp]) + stFinish[selectTmp]
Solved! Go to Solution.
2022-09-29 04:54 AM - edited 2022-09-29 04:56 AM
The issue is you are only populating a parameter with the value therefore the GDL object has to go through the step of running the parameter script. The master script, 2D script and 3D scripts are refreshed when you refresh the screen (pan or zoom) but the parameters are only updated when the tool is activated by opening the settings of moving a hotspot.
The solution is to populate the parameter as you are doing BUT ALSO populate what is called a "local variable" as a replica of the parameter. Then use this local variable in your 2D script rather than the parameter it is replicating.
So where you have:
for i = 1 to numFinish
parameters stFinish[i] = SLAB_SKINS_BMAT_NAMES[i][1]
parameters thkFinish[i] = SLAB_SKINS_PARAMS[i][2]
next i
you should have:
dim _stFinish[] !!declaring the mimic local variable
dim _thkFinish[] !!declaring the mimic local variable
for i = 1 to numFinish !!populating the mimic local variable
_stFinish[i] = SLAB_SKINS_BMAT_NAMES[i][1]
_thkFinish[i] = SLAB_SKINS_PARAMS[i][2]
next i
!!now apply the local variable to the parameter
stFinish = _stFinish
thkFinish = _thkFinish
parameters stFinish = stFinish,
thkFinish = _thkFinish
In summary what you now have is both your parameter and a local variable storing the information. Use the local variable in your 2D script, instead of the parameter, for a dynamic response.
2022-09-29 04:19 AM
@soo ,
Sorry if you thought your posts kept deleting, it was because you had already posted in the Design forum (the wrong forum) so I moved that to the Documentation forum and deleted the other posts you made here in the Developers forum as they were the same (we don't want duplicates).
I see know you are asking about a GDL object you have created (that was not apparent before in your other posts).
So I have left this post here in the Developer's forum and removed the others.
Barry.
2022-09-29 04:31 AM
thank you barry. I thought my post kept deleting because I shared the attached file.
2022-09-29 04:54 AM - edited 2022-09-29 04:56 AM
The issue is you are only populating a parameter with the value therefore the GDL object has to go through the step of running the parameter script. The master script, 2D script and 3D scripts are refreshed when you refresh the screen (pan or zoom) but the parameters are only updated when the tool is activated by opening the settings of moving a hotspot.
The solution is to populate the parameter as you are doing BUT ALSO populate what is called a "local variable" as a replica of the parameter. Then use this local variable in your 2D script rather than the parameter it is replicating.
So where you have:
for i = 1 to numFinish
parameters stFinish[i] = SLAB_SKINS_BMAT_NAMES[i][1]
parameters thkFinish[i] = SLAB_SKINS_PARAMS[i][2]
next i
you should have:
dim _stFinish[] !!declaring the mimic local variable
dim _thkFinish[] !!declaring the mimic local variable
for i = 1 to numFinish !!populating the mimic local variable
_stFinish[i] = SLAB_SKINS_BMAT_NAMES[i][1]
_thkFinish[i] = SLAB_SKINS_PARAMS[i][2]
next i
!!now apply the local variable to the parameter
stFinish = _stFinish
thkFinish = _thkFinish
parameters stFinish = stFinish,
thkFinish = _thkFinish
In summary what you now have is both your parameter and a local variable storing the information. Use the local variable in your 2D script, instead of the parameter, for a dynamic response.