2006-02-24 06:38 AM - last edited on 2023-08-07 11:21 AM by Doreena Deng
err = ACAPI_Element_Get(&element); if(err == noErr) { element.object.visibility.showRelAbove = 1; element.object.visibility.showRelAbove = 1; ACAPI_ELEMENT_MASK_SET(mask, API_ObjectType, visibility); err = ACAPI_Element_Change(&element, mask, nil, 0, true); if(err == noErr) { err = ACAPI_Element_Get(&element); if(err == noErr) { // The function gets here, but showRelAbove & showRelAbove are set back to zero } } } } }As a test I tried this (which also doesn't work):
err = ACAPI_Element_Get(&element); if(err == noErr) { element.object.visibility.showRelAbove = 1; element.object.visibility.showRelAbove = 1; ACAPI_ELEMENT_MASK_SETFULL(mask); err = ACAPI_Element_Change(&element, mask, nil, 0, true); if(err == APIERR_BADPARS) { // The function gets here and I can't see what would casue this } }The only way I can think to do it is to deletes and recreate the element. It seems vey ineffecient. If I am forced to use this method I will have to do lots of extra work to recreate links to this element from dimensions, etc.
2006-02-24 09:04 AM
adambutler wrote:The error APIERR_BADPARS can be returned if you haven't preceeded ACAPI_Element_Change with ACAPI_OpenUndoableSession. Could this be the problem?
I've updated my code to work with the ArchiCAD 9 API_StoryVisibility structure. Its working fine for slabs, but not for objects.err = ACAPI_Element_Change(&element, mask, nil, 0, true); if(err == APIERR_BADPARS) { // The function gets here and I can't see what would casue this }
2006-02-27 01:54 AM