Samlight二次開(kāi)發(fā) 導(dǎo)出其他格式

首先,當(dāng)Samlight正確連接USC控制卡并正確啟動(dòng)的情況下,選中一個(gè)實(shí)體,上圖中的“導(dǎo)出”會(huì)變成可以點(diǎn)擊的正常按鈕,否則,這個(gè)USC卡很可能是沒(méi)有“導(dǎo)入導(dǎo)出”的功能授權(quán),這樣的情況下,請(qǐng)聯(lián)系海目公司開(kāi)通功能。
在ClientInterface下,我們可以調(diào)用導(dǎo)出功能,將當(dāng)前文件或?qū)嶓w保存為別的格式,比如本例中,我們介紹導(dǎo)出為PLT格式,代碼(VB)如下:
'ScExport(EntityName As String, FileName As String, Type As String, Resolution As Double, Flags As Long) As Long
‘其中Flags參數(shù)可以參考: C:\scaps\sam2d\tlb_include\sc_layer_file_2d_type_lib.h:
'Export Flags
'const long scComLayerFile2DStyleExportPolyLines = 0x10;
'const long scComLayerFile2DStyleExportLineArrays = 0x20;
'const long scComLayerFile2DStyleCheckOrientation = 0x40;
'const long scComLayerFile2DStyleWritePens = 0x100;
'const long scComLayerFile2DStyleExportOnlySelected = 0x400;
'const long scComLayerFile2DStyleWritePreview = 0x2000;
(There are also import flags:
'Import Flags
'const long scComLayerFile2DStyleImportPolyLines = 0x1;
'const long scComLayerFile2DStyleImportLineArrays = 0x2;
'const long scComLayerFile2DStyleImportAllToLineArrays = 0x8;
'const long scComLayerFile2DStyleReadPens = 0x80;
'const long scComLayerFile2DStyleImportOpenPolyLines = 0x200;
'const long scComLayerFile2DStyleImportToLayer = 0x800;
'const long scComLayerFile2DStyleImportToEntities2D = 0x1000;
'const long scComLayerFile2DStylePointCloud = 0x4000;
'const long scComLayerFile2DStyleHasAdvancedStyles = 0x8000;
'const long scComLayerFile2DStyleImportSetupBitmapDefaultValues = 0x100000;
'const long scComLayerFile2DStyleImportIsBitmap = 0x400000;)
可以使用與運(yùn)算同時(shí)使用多個(gè)Flag,如:
304 = scComLayerFile2DStyleExportPolyLines ( = 0x10 = 16) + scComLayerFile2DStyleExportLineArrays ( = 0x20 = 32) + scComLayerFile2DStyleWritePens ( = 0x100 = 256)
Call ScSamlightClientCtrl1.ScExport("", "C:\Columbia_export_test.plt", "plt", 0.01, 304)
