22 lines
645 B
TypeScript
22 lines
645 B
TypeScript
|
import { CADFiler, Database, DuplicateRecordCloning, PhysicalMaterialRecord } from "webcad_ue4_api";
|
||
|
|
||
|
export function MaterialOut(material: PhysicalMaterialRecord): string
|
||
|
{
|
||
|
let db = new Database();
|
||
|
debugger;
|
||
|
db.WblockCloneObejcts(
|
||
|
[material],
|
||
|
db.MaterialTable,
|
||
|
new Map(),
|
||
|
DuplicateRecordCloning.Ignore
|
||
|
);
|
||
|
return JSON.stringify(db.FileWrite().Data);
|
||
|
}
|
||
|
|
||
|
export function MaterialIn(fileData: Object[]): PhysicalMaterialRecord
|
||
|
{
|
||
|
let f = new CADFiler(fileData);
|
||
|
let db = new Database().FileRead(f);
|
||
|
db.hm.Enable = false;
|
||
|
return db.MaterialTable.Symbols.entries().next().value[1];
|
||
|
}
|