You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"I encountered some issues while using the transformer to merge two iModels. When executing the method, I encountered error messages. I tried several approaches to merge, but all of them failed."
Error Message:Error importing schema;
Error Message:attempt to clone with unknown class;
Attempting solutions 2:
async mergeSecond(req: any,res: any): Promise<string>{
IModelHost.startup();constSourceFileName1="C:\\Users\\wwr\\Downloads\\a\\a.bim";constsourceFileName2="C:\\Users\\wwr\\Downloads\\b\\b.bim";constSrouceModel1=SnapshotDb.openFile(SourceFileName1);constSrouceModel2=SnapshotDb.openFile(sourceFileName2);constnum1=awaitthis.count(SrouceModel1,"BisCore.Element");//1194constnum2=awaitthis.count(SrouceModel2,"BisCore.Element");//11943consttargetFileName="C:\\Users\\wwr\\Downloads\\c\\c.bim";if(IModelJsFs.existsSync(targetFileName)){IModelJsFs.removeSync(targetFileName);}consttargetDbProps: CreateIModelProps={rootSubject: {name: "Clone-Target"},ecefLocation: SrouceModel1.ecefLocation,};// Create a readable and writable file using a seedletTargetIModel1=SnapshotDb.createFrom(SrouceModel1,targetFileName);constparentSubject=TargetIModel1.elements.getRootSubject().id;constsubjectId1=Subject.insert(TargetIModel1,parentSubject,"subject1");constsubjectId2=Subject.insert(TargetIModel1,parentSubject,"subject2");if(TargetIModel1.isReadonly){console.log("readable");}else{console.log("readable and writable");}consttransformer=newIModelTransformer(SrouceModel2,TargetIModel1,{targetScopeElementId: subjectId1,});awaittransformer.processSchemas();awaittransformer.processAll();//Error Error: attempt to clone with unknown classTargetIModel1.saveChanges();constnum4=awaitthis.count(TargetIModel1,"BisCore.Element");SrouceModel1.close();SrouceModel2.close();TargetIModel1.close();return"Second";}}
The actual error location is reported when executing the transformer. processAll() method
Error Message:Error Error: attempt to clone with unknown class
"I hope you can help me analyze whether the issue lies in my code or the environment, or if you have a better implementation plan. Thank you."
The file I want to merge is. mergeFile.zip
The text was updated successfully, but these errors were encountered:
"I encountered some issues while using the transformer to merge two iModels. When executing the method, I encountered error messages. I tried several approaches to merge, but all of them failed."
Attempting solutions 1:
Error Message:Error importing schema;
Error Message:attempt to clone with unknown class;
Attempting solutions 2:
The actual error location is reported when executing the transformer. processAll() method
Error Message:Error Error: attempt to clone with unknown class
"I hope you can help me analyze whether the issue lies in my code or the environment, or if you have a better implementation plan. Thank you."
The file I want to merge is.
mergeFile.zip
The text was updated successfully, but these errors were encountered: