Skip to content

Commit

Permalink
Добавлена синхронизация параметров ограждений
Browse files Browse the repository at this point in the history
  • Loading branch information
kuvbur committed Aug 18, 2024
1 parent 320368b commit c263cf6
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 26 deletions.
33 changes: 27 additions & 6 deletions Sources/AddOn/CommonFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1047,12 +1047,12 @@ void GetGDLParametersHead (const API_Element & element, const API_Elem_Head & el
elemGuid = element.cwPanel.symbolID;
elemType = API_ObjectID;
break;
case API_RailingBalusterID:
elemGuid = element.railingBaluster.symbID;
case API_CurtainWallJunctionID:
elemGuid = element.cwJunction.symbolID;
elemType = API_ObjectID;
break;
case API_RailingHandrailID:
elemGuid = element.railingHandrail.symbID;
case API_CurtainWallAccessoryID:
elemGuid = element.cwAccessory.symbolID;
elemType = API_ObjectID;
break;
default:
Expand All @@ -1079,10 +1079,31 @@ GSErrCode GetGDLParameters (const API_ElemTypeID & elemType, const API_Guid & el
BNZeroMemory (&apiOwner, sizeof (API_ParamOwnerType));
BNZeroMemory (&apiParams, sizeof (API_GetParamsType));

if (elemType == API_RailingToprailID
|| elemType == API_RailingHandrailID
|| elemType == API_RailingRailID
|| elemType == API_RailingPostID
|| elemType == API_RailingInnerPostID
|| elemType == API_RailingBalusterID
|| elemType == API_RailingPanelID
|| elemType == API_RailingNodeID
|| elemType == API_RailingToprailEndID
|| elemType == API_RailingHandrailEndID
|| elemType == API_RailingRailEndID
|| elemType == API_RailingToprailConnectionID
|| elemType == API_RailingHandrailConnectionID
|| elemType == API_RailingRailConnectionID
|| elemType == API_RailingEndFinishID) {
API_ElementMemo memo = {};
err = ACAPI_Element_GetMemo (elemGuid, &memo, APIMemoMask_AddPars);
params = memo.params;
return err;
}

#if defined(AC_27) || defined(AC_28)
if (elemType == API_ExternalElemID) {
API_ElementMemo memo = {};
err = ACAPI_Element_GetMemo (elemGuid, &memo);
err = ACAPI_Element_GetMemo (elemGuid, &memo, APIMemoMask_AddPars);
params = memo.params;
return err;
}
Expand Down Expand Up @@ -1196,7 +1217,7 @@ GSErrCode GetRElementsForRailing (const API_Guid & elemGuid, GS::Array<API_Guid>
API_Element element = {};
element.header.guid = elemGuid;
GSErrCode err = ACAPI_Element_Get (&element);
if (err != NoError || !element.header.hasMemo) {
if (err != NoError) {
return err;
}
API_ElementMemo memo = {};
Expand Down
54 changes: 38 additions & 16 deletions Sources/AddOn/Helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ bool CheckElementType (const API_ElemTypeID& elementType, const SyncSettings& sy
elementType == API_ZoneID ||
elementType == API_LampID))
return true;
if (syncSettings.objS &&
if (syncSettings.cwallS &&
(elementType == API_RailingID || elementType == API_RailingToprailID || elementType == API_RailingHandrailID ||
elementType == API_RailingRailID || elementType == API_RailingPostID || elementType == API_RailingInnerPostID ||
elementType == API_RailingBalusterID || elementType == API_RailingPanelID || elementType == API_RailingSegmentID ||
Expand Down Expand Up @@ -2496,7 +2496,25 @@ void ParamHelpers::Read (const API_Guid& elemGuid, ParamDictValue& params, Param
if (param.fromGDLdescription || param.fromCoord || param.fromMorph || param.fromMaterial || param.fromAttribDefinition) {
needGetElement = true;
}
if (eltype == API_CurtainWallPanelID || eltype == API_RailingBalusterID || eltype == API_RailingHandrailID) {
if (eltype == API_CurtainWallPanelID || eltype == API_CurtainWallFrameID
|| eltype == API_CurtainWallJunctionID
|| eltype == API_CurtainWallAccessoryID
|| eltype == API_RailingToprailID
|| eltype == API_RailingHandrailID
|| eltype == API_RailingRailID
|| eltype == API_RailingPostID
|| eltype == API_RailingInnerPostID
|| eltype == API_RailingBalusterID
|| eltype == API_RailingPanelID
|| eltype == API_RailingNodeID
|| eltype == API_RailingToprailEndID
|| eltype == API_RailingHandrailEndID
|| eltype == API_RailingRailEndID
|| eltype == API_RailingToprailConnectionID
|| eltype == API_RailingHandrailConnectionID
|| eltype == API_RailingRailConnectionID
|| eltype == API_RailingEndFinishID
) {
needGetElement = true;
}
if (param.fromProperty && !param.fromPropertyDefinition && !param.fromAttribDefinition) needGetAllDefinitions = true; // Нужно проверить соответсвие описаний имени свойства
Expand Down Expand Up @@ -3101,6 +3119,10 @@ bool ParamHelpers::ReadGDLValues (const API_Element& element, const API_Elem_Hea
#else
eltype = elem_head.typeID;
#endif
// Обрабатываем только вложенные элементы иерархических структур (навесных стен и ограждений)
if (eltype == API_RailingID || eltype == API_CurtainWallID || eltype == API_CurtainWallID) {
return false;
}
ParamDictValue paramBydescription;
ParamDictValue paramByName;
GS::HashTable<GS::UniString, GS::Array<GS::UniString>> paramnamearray;
Expand Down Expand Up @@ -3738,10 +3760,10 @@ bool ParamHelpers::ConvertToParamValue (ParamValueData& pvalue, const API_AddPar
#endif
param_real = param_int / 1.0;
pvalue.formatstring = FormatStringFunc::ParseFormatString ("0m");
} else {
} else {
return false;
}
}
}
}
pvalue.boolValue = param_bool;
pvalue.doubleValue = param_real;
Expand Down Expand Up @@ -3983,7 +4005,7 @@ bool ParamHelpers::ConvertToParamValue (ParamValue& pvalue, const API_Property&
pvalue.definition = property.definition;
pvalue.property = property;
return true;
}
}

// -----------------------------------------------------------------------------
// Конвертация определения свойства в ParamValue
Expand Down Expand Up @@ -4327,7 +4349,7 @@ bool ParamHelpers::ComponentsCompositeStructure (const API_Guid& elemguid, API_A
ParamHelpers::CompareParamDictValue (paramlayers, params);
ACAPI_DisposeAttrDefsHdls (&defs);
return true;
}
}

// --------------------------------------------------------------------
// Получение данных из сложного профиля
Expand Down Expand Up @@ -4459,8 +4481,8 @@ bool ParamHelpers::ComponentsProfileStructure (ProfileVectorImage& profileDescri
lines.Get (*cIt->key).cut_start = cutline.c2;
lines.Get (*cIt->key).cut_direction = Geometry::SectorVector (cutline);
#endif
}
}
}
}
bool hasData = false;
ConstProfileVectorImageIterator profileDescriptionIt1 (profileDescription);
while (!profileDescriptionIt1.IsEOI ()) {
Expand Down Expand Up @@ -4513,16 +4535,16 @@ bool ParamHelpers::ComponentsProfileStructure (ProfileVectorImage& profileDescri
existsmaterial.Add (constrinxL, true);
}
hasData = true;
}
}
}
}
}
} else {
} else {
DBPrintf ("== SMSTF ERR == syHatch.ToPolygon2D ====================\n");
}
}
}
break;
}
}
++profileDescriptionIt1;
}
if (hasData) {
Expand All @@ -4544,18 +4566,18 @@ bool ParamHelpers::ComponentsProfileStructure (ProfileVectorImage& profileDescri
GS::Array<ParamValueComposite> paramout;
for (std::map<double, ParamValueComposite>::iterator k = comps.begin (); k != comps.end (); ++k) {
paramout.Push (k->second);
}
}
#if defined(AC_28)
paramlayers.Get (cIt->key).composite = paramout;
#else
paramlayers.Get (*cIt->key).composite = paramout;
#endif
}
}
}
ParamHelpers::CompareParamDictValue (paramlayers, params);
}
return hasData;
}
return hasData;
}
#endif

// --------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions Sources/AddOnResources/RINT/AddOn.grc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/* [ 4] */ "Обрабатывать стены/перекрытия^E3^ES^EE^ED^EW^EL^32605"
/* [ 5] */ "Обрабатывать окна/двери^E3^ES^EE^ED^EW^EL^32606"
/* [ 6] */ "Обрабатывать объекты/зоны^E3^ES^EE^ED^EW^EL^32607"
/* [ 7] */ "Обрабатывать элементы навесных стен^E3^ES^EE^ED^EW^EL^32612"
/* [ 7] */ "Обрабатывать элементы навесных стен и ограждений^E3^ES^EE^ED^EW^EL^32612"
/* [ 8] */ "Перенумеровать выделенные^E3^ES^EE^ED^EW^EL^S^R^T^32608"
/* [ 9] */ "Просуммировать выделенные^E3^ES^EE^ED^EW^EL^S^R^T^32609"
/* [ 10] */ "Запустить скрипт параметров выделенных^E3^ES^EE^ED^EW^EL^S^R^T^32613"
Expand All @@ -31,7 +31,7 @@
/* [ 4] */ "Обрабатывать стены/перекрытия"
/* [ 5] */ "Обрабатывать окна/двери"
/* [ 6] */ "Обрабатывать объекты/зоны"
/* [ 7] */ "Обрабатывать элементы навесных стен"
/* [ 7] */ "Обрабатывать элементы навесных стен и ограждений"
/* [ 8] */ "Перенумеровать выделенные"
/* [ 9] */ "Просуммировать выделенные"
/* [ 10] */ "Запустить скрипт параметров выделенных"
Expand Down Expand Up @@ -87,7 +87,7 @@
/* [ 4] */ "Processing walls/slabs^E3^ES^EE^ED^EW^EL^32605"
/* [ 5] */ "Processing windows/doors^E3^ES^EE^ED^EW^EL^32606"
/* [ 6] */ "Processing objects/zones^E3^ES^EE^ED^EW^EL^32607"
/* [ 7] */ "Processing curtain wall elements^E3^ES^EE^ED^EW^EL^32612"
/* [ 7] */ "Processing curtain wall and railing elements^E3^ES^EE^ED^EW^EL^32612"
/* [ 8] */ "Renumber the selections^E3^ES^EE^ED^EW^EL^S^R^T^32608"
/* [ 9] */ "Sum the selections^E3^ES^EE^ED^EW^EL^S^R^T^32609"
/* [ 10] */ "Run the script for the parameters of the selections^E3^ES^EE^ED^EW^EL^S^R^T^32613"
Expand All @@ -105,7 +105,7 @@
/* [ 4] */ "Processing walls/slabs"
/* [ 5] */ "Processing windows/doors"
/* [ 6] */ "Processing objects/zones"
/* [ 7] */ "Processing curtain wall elements"
/* [ 7] */ "Processing curtain wall and railing elements"
/* [ 8] */ "Renumber the selections"
/* [ 9] */ "Sum the selections"
/* [ 10] */ "Run the script for the parameters of the selections"
Expand Down

0 comments on commit c263cf6

Please sign in to comment.