Does the ArchiCAD Connector V3 have the capability for incremental model upload?

Hello Speckle Team!

I’ve encountered two issues with model processing while using ArchiCAD Connector V3, and I’d like to share them with you:

  1. For model uploads, this version doesn’t have the incremental upload functionality that Revit offers;
  2. During model comparison, even when I make no changes to the model, the viewer shows that all models have been modified. This doesn’t match the actual situation.

To find the cause, I debugged the code and noticed that the “applicationId” of data with the type speckleType="Objects.Geometry.Mesh" keeps changing. So I modified the TraverseBase function in the BaseObjectSerializer.cpp file by adding the following code:

std::pair<std::string, nlohmann::json> BaseObjectSerializer::TraverseBase(const nlohmann::json& base)
{
	auto lineageId = Base64GuidGenerator::NewGuid();
	lineage.push_back(lineageId);
	bool isDetached = false;

	if (!detachLineage.empty())
	{
		isDetached = detachLineage.top();
		detachLineage.pop();
	}

	auto traversedBase = nlohmann::json::object();
	if (!base.contains("speckle_type") || !base["speckle_type"].is_string())
	{
		throw "speckle tpye not found or was not a string";
	}
	traversedBase["speckle_type"] = base["speckle_type"];
	TraverseBaseProps(base, traversedBase);

	auto closure = nlohmann::json::object();
	auto parent = lineage.back();
	lineage.pop_back();

	auto it = familyTree.find(parent);
	if (it == familyTree.end())
	{
		// Initialize if parent is not found
		familyTree[parent] = nlohmann::json::object();
	}
	else
	{
		// Access the existing parent's items
		for (const auto& [ref, depth] : it->second.items())
		{
			closure[ref] = depth - detachLineage.size();
		}
	}

	nlohmann::json tempForId = traversedBase;
	if (tempForId.contains("applicationId"))
	{
		tempForId.erase("applicationId");
	}

	std::string id = MD5::hash(tempForId.dump());

	traversedBase["id"] = id;
	if (!closure.empty())
	{
		traversedBase["__closure"] = closure;
	}

	if (isDetached)
	{
		objects[id] = traversedBase;
	}

	return {id, traversedBase};
}

This code eliminates the impact of applicationId on the MD5 hash, which fixes the issue of false model modification alerts. However, in subsequent tests, I found that ArchiCAD Connector V3 still lacks incremental upload functionality when sending models.

Looking forward to your reply. Thank you for your support!

Hey @pusen

Thanks for checking out the code and suggesting a solution! :slightly_smiling_face:
As you noticed, the root of the issue is that the applicationId of the Mesh changes. This happens because Archicad doesn’t provide a Mesh ID, so we generate a random one each time data is sent. We can address this if we find a way to generate a stable, consistent ID for the Mesh — we’ll look into that.

However, to add incremental upload functionality, we’d first need to implement change tracking for 3D objects. This feature did exist in the v3 codebase at one point, but subscribing to a large number of change events in Archicad proved to be very expensive performance-wise, especially on large models. Because of that, we had to remove it.

For now, adding incremental upload functionality isn’t planned in the near future.

Best regards,
David

Hello, thank you very much for your response. Going forward, I will continue to look into better solutions for implementing incremental uploads in ArchiCAD, and I will consult you on the feasibility should I have new findings.