2024-11-06 06:47 PM
Hi,
I have a problem retreiving element data (ACAPI_Element_Get and ACAPI_Element_GetMemo).
With the following steps you can set up a problematic case.
First create a simple wall.
Then create a unique design option with name something like “window1“.
Switch to this new design option, not just “viewing“ it but in “edit mode“.
Create a window into the simple wall. It has to be visible only in the design option “window1“ and not in the main model.
Switch to main model, the window will disappear. That is OK.
Now, in this plan, with inactivated design options, you will still receive the element data for the invisible window. It will be in the MEMO of the wall, it will be in the array of guids if you ask ACAPI_Element_GetElemList() for windows.
My question is: how can you check with an API function if an element is active or hidden in the actual design option? This info seems not available for an Addon developer, which is a really big problem. If the user has many design options and he/she uses them extensively, element data will be totally messed up.
Or is there a solution to check element existense check with design options?
TIA,
Geza
2024-11-12 02:43 PM
Hi Geza,
Yeah I'm also not too happy with the available functionality regarding design options. I've just recently worked on it the first time so I might not have a full understanding of the possibilities yet.
Anyway what seems to work for me is to use the built-in properties "Design Option Set Name" and "Design Option Set". With that you can get the design option an element is associated with.
Then remains the question how to check the current design option settings. I didn't use it yet, but I think you can get the settings for specific views with GetDesignOptionCombinationSettingsOf(). Not sure if/how this would work with e.g. the story viewpoints or if it needs to really be a view in the view map.
HTH,
Bernd
2025-01-21 04:17 AM
Hi Geza
I am having this same issue.
GS should have added a simple visibility flag like we can with Renovation filters and such ( ie
APIFilt_IsVisibleByRenovation)
Have you or Bernd had any success with this?
The issue seems to be determining if the design option set is visible or not..
2025-01-28 03:50 PM
@Ben Cohen nothing new from my side yet unfortunately.
3 weeks ago
- last edited
2 weeks ago
by
Laszlo Nagy
Hi,
I had to make a feature that keeps the design option when my add on splits an object (a wooden plank in this case). Was good to find the tip of built-in properties here (thank you!) and to my surprise you can assign the design option to another element and it works!
The code that sets it only if it differs to avoid editing elements when not necessary:
// 8/2025: From AC28 up: Copy also the original design option status. Its guid was the same in INT and FIN versions so guess it is fixed.
// The guid is 5C3FB768-C349-49E7-B6E6-7675A26A2AEC
static const API_Guid guidDesignStatus = { 0x5C3FB768, 0xC349, 0x49E7, 0xB6, 0xE6, 0x76, 0x75, 0xA2, 0x6A, 0x2A, 0xEC };
API_Property propDesignStatusSource, propDesignStatusDest;
err = ACAPI_Element_GetPropertyValue(sourceElem, guidDesignStatus, propDesignStatusSource);
if (!err && propDesignStatusSource.status == API_Property_HasValue && propDesignStatusSource.value.variantStatus != API_VariantStatusNull && propDesignStatusSource.value.singleVariant.variant.type == API_PropertyGuidValueType)
{
err = ACAPI_Element_GetPropertyValue(destElem, guidDesignStatus, propDesignStatusDest);
if (err || propDesignStatusSource.value.singleVariant.variant.guidValue != propDesignStatusDest.value.singleVariant.variant.guidValue)
{
err = ACAPI_Element_SetProperty(destElem, propDesignStatusSource);
}
}
However, no answer to the original question of how to check if the element is visible currently from Design Options.