问答122 脚本加载(卸载)影像到活动工程-凯发k8国际

 
问答122 脚本加载(卸载)影像到活动工程

问:是否可以通过脚本函数向eps工作空间加载或者卸载tiff影像?




答:支持基于脚本进行tiff影像的加载。


1)加载tiff影像:

strbmpfile = "o:10-dem2917.75-363.50.tif"

ssprocess.mapcallbackfunction "sdlcommand","$sdl,ssimageadapter,insertlargeimage(" & strbmpfile & ")",0


(2)卸载tiff影像:

' 关闭指定tif

strbmpfile = "o:1-存量实体转换样例-广州11-domdom_test_0003.tif"

maphandle = ssproject.getactivemap

datasourcehandle = ssproject.getdatasourcebyname(maphandle, strbmpfile)

ssproject.closedatasource maphandle, datasourcehandle

 

'批量关闭tif

set fso = createobject("scripting.filesystemobject")

maphandle = ssproject.getactivemap

datasourcecount = ssproject.getmapdatasourcecount(maphandle)

for i = datasourcecount-1 to 0 step -1

datasourcehandle = ssproject.getdatasource(maphandle, i)

'获取数据源文件名

strdatafile = ssproject.getdatasourceinfo(datasourcehandle, "name")

if ucase(fso.getextensionname(strdatafile)) = "tif" then

ssproject.closedatasource maphandle, datasourcehandle

end if

ssproject.setactivemap maphandle

next

set fso = nothing


"));
网站地图