阅读:1790回复:5
[求助]ISelection 不能copy paste,只能SelectAll<DIV>请指教,谢谢!<BR>下列代码只有CanSelectAll()返回为true,可以执行SelectAll(),屏幕显示SelectAll操作正常,其他CanCopy,CanPaste均返回为false,如果强行执行pSelection.Copy();就抛出异常,为什么?<BR><BR> IActiveView pActiveView = MainMap.ActiveView<BR> IViewManager pViewManager = pActiveView as IViewManager;<BR> ISelection pSelection = pViewManager.ElementSelection;<BR> if (pSelection.CanSelectAll())<BR> {<BR> pSelection.SelectAll();<BR> }<BR> if (pSelection.CanClear())<BR> {<BR> pSelection.Clear();<BR> }<BR> if (pSelection.CanCopy() == true)<BR> {<BR> pSelection.Copy();<BR> }<BR> if (pSelection.CanPaste() == true)<BR> {<BR> pSelection.Paste();<BR> }</DIV><BR > |
|
1楼#
发布于:2007-10-18 10:40
<P>检查了一下Exception,如下信息;<BR>是否说明ae9.1尚未实现此功能,需要自己编写功能代码?</P>
<P><BR>e<BR>{"尚未实现" }<BR> [System.NotImplementedException]: {System.NotImplementedException}<BR> System.Object: {System.NotImplementedException}<BR> _className: null<BR> _COMPlusExceptionCode: -532459699<BR> _exceptionMethod: <未定义的值><BR> _exceptionMethodString: null<BR> _helpURL: null<BR> _HResult: -2147467263<BR> _innerException: { }<BR> _message: "尚未实现"<BR> _remoteStackIndex: 0<BR> _remoteStackTraceString: null<BR> _source: null<BR> _stackTrace: {System.Array}<BR> _stackTraceString: null<BR> _xcode: -532459699<BR> _xptrs: 0<BR> HelpLink: null<BR> HResult: -2147467263<BR> InnerException: { }<BR> Message: "尚未实现"<BR> Source: "ESRI.ArcGIS.Carto"<BR> StackTrace: " at ESRI.ArcGIS.Carto.ISelection.Copy()\r\n at test.cs:line 294"<BR> TargetSite: {System.Reflection.RuntimeMethodInfo}<BR></P> |
|
2楼#
发布于:2007-10-18 10:14
<P>是否类似feature的编辑操作,有一个edit session 需要关闭之后才能进行copy paste操作</P>
|
|
3楼#
发布于:2007-10-18 10:01
<DIV class=quote><B>以下是引用<I>gzstyxb</I>在2007-10-18 9:47:30的发言:</B><BR>它不肯工作,就不要勉强吧。对于这样不老实的接口,我的应对办法是,下它的课,然后自己来完成要做的事情。</DIV>
<P>好歹人家也是国家干部,正式编制,俺是新人,不敢让它随便下课,所以问问各位xd |
|
4楼#
发布于:2007-10-18 09:49
<P>是想对IGraphicsContainer中的Element进行CanCopy,Paste操作,</P>
<P><BR> </P> <DIV>按照help中的例子(如下),Set pViewManager = pPageLayout<BR>是否pViewManager 只能从pPageLayout中转换而来?<BR><BR>Public Sub ClipboardGraphicSelection()<BR> Dim pMxDocument As IMxDocument<BR> Dim pMap As IMap<BR> Dim pPageLayout As IPageLayout<BR> <BR> Set pMxDocument = Application.Document<BR> Set pMap = pMxDocument.FocusMap<BR> Set pPageLayout = pMxDocument.PageLayout<BR> <BR> Dim pViewManager As IViewManager<BR> Set pViewManager = pPageLayout<BR> <BR> Dim pSelection As ISelection<BR> Set pSelection = pViewManager.ElementSelection<BR> <BR> Dim sMsg As String<BR> sMsg = "Can Select All = " + Str(pSelection.CanSelectAll)<BR> sMsg = sMsg + vbNewLine + "Can Copy = " + Str(pSelection.CanCopy)<BR> sMsg = sMsg + vbNewLine + "Can Paste = " + Str(pSelection.CanPaste)<BR> MsgBox sMsg<BR> <BR> pSelection.SelectAll<BR> pSelection.Copy<BR> <BR> sMsg = "Can Select All = " + Str(pSelection.CanSelectAll)<BR> sMsg = sMsg + vbNewLine + "Can Copy = " + Str(pSelection.CanCopy)<BR> sMsg = sMsg + vbNewLine + "Can Paste = " + Str(pSelection.CanPaste)<BR> MsgBox sMsg<BR> <BR>End Sub</DIV> <P><BR both"> </P> |
|
5楼#
发布于:2007-10-18 09:47
它不肯工作,就不要勉强吧。对于这样不老实的接口,我的应对办法是,下它的课,然后自己来完成要做的事情。
|
|
|