技术文章 - CS370585

在 Creo View WebGL Toolkit 示例“web-application-example”中,通过 StructureEdit.InsertBranches() 添加一些组件然后删除其中一些组件后,在树中选择一些新添加的节点不会在图形窗口中选择正确的模型。

已修改: 01-Jul-2022   


注意:本文已使用机器翻译软件翻译,以方便非英语客户阅读。但翻译内容可能包含语法错误或不准确之处。请注意, PTC对本文所含信息的翻译准确性及使用后果不承担任何责任。请在 此处 查看本文的英文原始版本以便参考。有关机器翻译的更多详情,请单击 此处
感谢您告诉我们。我们将尽快审阅此译文。

适用于

  • Creo View 8.1
  • Creo View WebGL Toolkit

说明

  • 在 Creo View WebGL Toolkit 示例web-application-example中,通过StructureEdit.InsertBranches()添加一些组件然后删除其中一些组件后,在Structure选项卡的树中选择一些新添加的节点不会在图形窗口中选择正确的模型.
  • StructureEdit.RemoveComps()删除组件时,树和视图数据不一致。
  • $scope.ibDlgInsert()修改如下:
$scope.ibDlgInsert = function() {
	if ($scope.structEdit.ibUrl == "")
		return;
	$scope.hideDialog();

	var se = $scope.session.GetStructureEdit();
	if (se) {
		let it = $scope.selection.nodes.values();
		let idpath = it.next().value;
		if (!idpath) return;
		let node = $scope.idpathMap[idpath];
		if (node) {
			$scope.SetCurrentModel(node.data.modelId);
			if ($scope.model) {
				var strippedIdpath = $scope.StripModelIdFromIdPath(node.data.idpath);

				if (strippedIdpath == ':') {
					// root node
					console.log('You cannot merge into root node.');
				} else {
					var IdNameFileVector = Module.IdNameFileVector.Create();
					IdNameFileVector.InsertIdNameFile(strippedIdpath, $scope.structEdit.ibName == '' ? "option2" : $scope.structEdit.ibName, $scope.structEdit.ibUrl);

					se.InsertBranches(IdNameFileVector, true, true, true, function (success) {
						if (success) {
							console.log('Successfully merged');
						} else {
							console.log('Failed to merge');
						}
					});
					$scope.ClearNodeSelection();

					if (dbRecentPVS == undefined) return;
					var dataSet = dbRecentPVS.transaction("RecentPVSObjectStore", "readwrite").objectStore("RecentPVSObjectStore").get($scope.structEdit.ibUrl);
					dataSet.onsuccess = function(event) {
						if (event.currentTarget.result === undefined) {
							storeRecentUrl($scope.structEdit.ibUrl);
						}
					};
				}
			}
		}
	}
};
这是文章 370585 的 PDF 版本,可能已过期。最新版本 CS370585