Skip to content

Commit

Permalink
Fix: Corrects serialised data from Archicad (macOS) (#3587)
Browse files Browse the repository at this point in the history
GS::ObjectState::Add interprets C string as char array rather than string in Xcode - explicit string conversion is applied to prevent this
  • Loading branch information
r-wessel authored Jul 24, 2024
1 parent fe0c923 commit 536941b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,10 @@ namespace {
API_Attribute attribute{};
attribute.header.index = materialIndex;
attribute.header.typeID = API_BuildingMaterialID;
auto error = ACAPI_Attribute_Get (&attribute);
auto error = ACAPI_Attribute_Get(&attribute);
if (error != NoError)
return error;
serialiser.Add(FieldNames::Material::Name, attribute.header.name);
serialiser.Add(FieldNames::Material::Name, GS::UniString{attribute.header.name});
return NoError;
} //exportMaterial

Expand All @@ -366,13 +366,13 @@ namespace {
const auto& serialMaterialQuants = serialiser.AddList<GS::ObjectState> (FieldNames::ElementBase::MaterialQuantities);
for (auto& quantity : materialQuants) {
GS::ObjectState serialMaterialQuant, serialMaterial;
auto error = exportMaterial (quantity.materialIndex, serialMaterial);
auto error = exportMaterial(quantity.materialIndex, serialMaterial);
if (error != NoError)
return error;
serialMaterialQuant.Add(FieldNames::ElementBase::Quantity::Material, serialMaterial);
serialMaterialQuant.Add(FieldNames::ElementBase::Quantity::Volume, quantity.volume);
serialMaterialQuant.Add(FieldNames::ElementBase::Quantity::Area, quantity.surfaceArea);
serialMaterialQuant.Add(FieldNames::ElementBase::Quantity::Units, "m");
serialMaterialQuant.Add(FieldNames::ElementBase::Quantity::Units, GS::UniString{"m"});
serialMaterialQuants(serialMaterialQuant);
}
return NoError;
Expand Down Expand Up @@ -733,7 +733,7 @@ GS::ObjectState GetDataCommand::Execute (const GS::ObjectState& parameters,
err = SerializeElementType (element, memo, os);
if (err != NoError)
continue;

listAdder (os);
}

Expand Down

0 comments on commit 536941b

Please sign in to comment.