xxsimExport3DScenery - Export a 3D scenery from a 3D animation plot. If the plot is not a 3D plot, then nothing will be done. Syntax: retval = xxsimExport3DScenery(sceneryFileName,plotWindow,plot) Inputs: sceneryFileName = Location and name of the scenery file to be exported. plotWindow = The plot window in which the 3D plot is located (name or id). plot = The 3D plot of which the scenery file should be exported (name or id). Outputs: retval = True in case the scenery file is succesfully exported (or the plot is not a 3D plot), false otherwise. Example: retval = xxsimExport3DScenery('C:\\Temp\\test.scn',1,2) - Exports the scenery of the 3D plot 2 in plot window 1 to the location specified. - retval is true when this scenery file is exported or when plot 2 in plot window 1 is not a 3D plot. See also: xxsimImport3DScenery Author: Controllab Products B.V. email: info@controllab.nl Website: http://www.controllab.nl March 2019
0001 function retval = xxsimExport3DScenery(sceneryFileName,plotWindow,plot) 0002 % xxsimExport3DScenery - Export a 3D scenery from a 3D animation plot. If the plot is not a 3D plot, then nothing will be done. 0003 % 0004 % Syntax: 0005 % retval = xxsimExport3DScenery(sceneryFileName,plotWindow,plot) 0006 % 0007 % Inputs: 0008 % sceneryFileName = Location and name of the scenery file to be exported. 0009 % plotWindow = The plot window in which the 3D plot is located (name or id). 0010 % plot = The 3D plot of which the scenery file should be exported (name or id). 0011 % 0012 % Outputs: 0013 % retval = True in case the scenery file is succesfully exported (or the plot is not a 3D plot), false otherwise. 0014 % 0015 % Example: 0016 % retval = xxsimExport3DScenery('C:\\Temp\\test.scn',1,2) 0017 % 0018 % - Exports the scenery of the 3D plot 2 in plot window 1 to the location specified. 0019 % - retval is true when this scenery file is exported or when plot 2 in plot window 1 is not a 3D plot. 0020 % 0021 % See also: xxsimImport3DScenery 0022 % 0023 % Author: Controllab Products B.V. 0024 % email: info@controllab.nl 0025 % Website: http://www.controllab.nl 0026 % March 2019 0027 0028 %------------- BEGIN CODE -------------- 0029 0030 % Check if the window and plot are a number or string 0031 if(~isnumeric(plotWindow) && ~ischar(plotWindow)) 0032 error('Please specify the ID of the plot window (numeric) or its name (a string).'); 0033 elseif(~ischar(plot) && ~isnumeric(plot)) 0034 error('Please specify a string as name for the plot (a string) or its ID (numeric).'); 0035 end; 0036 0037 % Check if the scenery file name is a string. 0038 if(~ischar(sceneryFileName)) 0039 error('Please specify the path and name of the to be generated scenery file as a string.'); 0040 end; 0041 0042 % Get the IDs if the input is a string. 0043 windowID = xxsimGetPlotWindowIDFromName(plotWindow); 0044 plotID = xxsimGetPlotIDFromName(plotWindow,plot); 0045 0046 % And make the actual call to 20-sim 0047 retval = xrlinvoke('xxsim.plot.export3DScenery', struct('windowID',int32(windowID),'plotID',int32(plotID),'sceneryFileLocation',sceneryFileName)); 0048 0049 end 0050 %------------- END OF CODE --------------