首先,当Samlight正确连接USC控制卡并正确启动的情况下,选中一个实体,上图中的”导出”会变成可以点击的正常按钮,否则,这个USC卡很可能是没有”导入导出”的功能授权,这样的情况下,请联系海目公司开通功能。
在ClientInterface下,我们可以调用导出功能,将当前文件或实体保存为别的格式,比如本例中,我们介绍导出为PLT格式,代码(VB)如下:
‘ScExport(EntityName As String, FileName As String, Type As String, Resolution As Double, Flags As Long) As Long
‘其中Flags参数可以参考: C:\scaps\sam2d\tlb_include\sc_layer_file_2d_type_lib.h:
‘Export Flags
’const long scComLayerFile2DStyleExportPolyLines = 0×10;
‘const long scComLayerFile2DStyleExportLineArrays = 0×20;
‘const long scComLayerFile2DStyleCheckOrientation = 0×40;
‘const long scComLayerFile2DStyleWritePens = 0×100;
‘const long scComLayerFile2DStyleExportOnlySelected = 0×400;
‘const long scComLayerFile2DStyleWritePreview = 0×2000;
(There are also import flags:
‘Import Flags
‘const long scComLayerFile2DStyleImportPolyLines = 0×1;
‘const long scComLayerFile2DStyleImportLineArrays = 0×2;
‘const long scComLayerFile2DStyleImportAllToLineArrays = 0×8;
‘const long scComLayerFile2DStyleReadPens = 0×80;
‘const long scComLayerFile2DStyleImportOpenPolyLines = 0×200;
‘const long scComLayerFile2DStyleImportToLayer = 0×800;
‘const long scComLayerFile2DStyleImportToEntities2D = 0×1000;
‘const long scComLayerFile2DStylePointCloud = 0×4000;
‘const long scComLayerFile2DStyleHasAdvancedStyles = 0×8000;
‘const long scComLayerFile2DStyleImportSetupBitmapDefaultValues = 0×100000;
‘const long scComLayerFile2DStyleImportIsBitmap = 0×400000;)
可以使用与运算同时使用多个Flag,如:
304 = scComLayerFile2DStyleExportPolyLines ( = 0×10 = 16) + scComLayerFile2DStyleExportLineArrays ( = 0×20 = 32) + scComLayerFile2DStyleWritePens ( = 0×100 = 256)
Call ScSamlightClientCtrl1.ScExport(“”, “C:\Columbia_export_test.plt”, “plt”, 0.01, 304)