技术文章 - CS370585
在 Creo View WebGL Toolkit 示例“web-application-example”中,通过 StructureEdit.InsertBranches() 添加一些组件然后删除其中一些组件后,在树中选择一些新添加的节点不会在图形窗口中选择正确的模型。
已修改: 01-Jul-2022
适用于
- 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