Template Objects
A sample REST API call will need a data object to pass over to the REST API Server. Three template objects conv_extr_request1, conv_extr_request2 and conv_extr_request3 are set up for data extraction, data conversion and CADViewer display.
Template object for data extraction:
This date extractiopn object is coded with a sample file location on the Tailor Made Software demo server.
// DATA EXTRACTION OBJECT
var conv_extr_request1 = new Object();
conv_extr_request1.action = "data_extraction";
conv_extr_request1.converter = "LinkList 2020";
conv_extr_request1.version = "V2.00";
conv_extr_request1.contentType = "file";
conv_extr_request1.contentResponse = "stream";
conv_extr_request1.contentFormat = "DWG";
conv_extr_request1.contentUsername = "";
conv_extr_request1.contentPassword = "";
conv_extr_request1.userLabel = "fromMyApp";
conv_extr_request1.leaveStreamOnServer = 0;
conv_extr_request1.contentLocation = "https://onlinedemo.cadviewer.com/cadviewer_6_5/content%2Fdrawings%2Fdwg%2F1st floor plan.dwg";
conv_extr_request1.parameters = [{"paramName":"json","paramValue":""},{"paramName":"all","paramValue":""}];
Template object for data conversion:
This data conversion object is coded with a sample file location on the Tailor Made Software demo server.
// DATA CONVERSION OBJECT
var conv_extr_request2 = new Object();
conv_extr_request2.action = "svg_creation";
conv_extr_request2.converter = "AutoXchange AX2022";
conv_extr_request2.version = "V2.00";
conv_extr_request2.contentType = "file";
conv_extr_request2.contentResponse = "stream";
conv_extr_request2.contentFormat = "DWG";
conv_extr_request2.contentUsername = "";
conv_extr_request2.contentPassword = "";
conv_extr_request2.userLabel = "fromMyApp";
conv_extr_request2.leaveStreamOnServer = 0;
conv_extr_request2.contentLocation = "https://onlinedemo.cadviewer.com/cadviewer_6_5/content%2Fdrawings%2Fdwg%2F1st floor plan.dwg";
conv_extr_request2.parameters =[{"paramName":"f","paramValue":"svg"},{"paramName":"model","paramValue":""}, {"paramName":"hlall","paramValue":""}, {"paramName":"fpath","paramValue":"c:/cadviewer-conversion-server/converters/ax2020/windows/fonts"}];
Template object for CADViewer display
This CADViewer display object is coded with a sample file location on the Tailor Made Software demo server.
// DATA CONVERSION OBJECT
var conv_extr_request3 = new Object();
conv_extr_request3.action = "cadviewer_display";
conv_extr_request3.converter = "AutoXchange AX2022";
conv_extr_request3.version = "V2.00";
conv_extr_request3.contentType = "file";
conv_extr_request3.contentResponse = "stream";
conv_extr_request3.contentFormat = "DWG";
conv_extr_request3.contentUsername = "";
conv_extr_request3.contentPassword = "";
conv_extr_request3.userLabel = "fromMyApp";
conv_extr_request3.leaveStreamOnServer = 0;
conv_extr_request3.contentLocation = "https://onlinedemo.cadviewer.com/cadviewer_6_5/content%2Fdrawings%2Fdwg%2F1st floor plan.dwg";
conv_extr_request3.parameters =[{"paramName":"f","paramValue":"svg"},{"paramName":"model","paramValue":""}, {"paramName":"hlall","paramValue":""}, {"paramName":"fpath","paramValue":"c:/cadviewer-conversion-server/converters/ax2020/windows/fonts"}];