怎样获取选中对象
通过Editor的GetSelection的方法可以获取用户选择,但是要弹出选择提示,然后用户手动选择一下对象,怎样在不弹出用户选择的情况下,获取界面上已经选择的对象呢。谢谢!Autodesk.AutoCAD.EditorInput.Editor.SelectPrevious 2楼 可以详细点吗,我也很想知道~ guohq 发表于 2015-2-6 10:28 static/image/common/back.gif
Autodesk.AutoCAD.EditorInput.Editor.SelectPrevious
姐姐可以详细点吗?谢谢!我用了你说的,不过panel都没有显示出来,可以教教我吗?
Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
PromptSelectionResult i = ed.SelectPrevious();
if (i.Status == PromptStatus.OK)
{
this.panel1.Location = new Point(0,0);
this.panel1.Visible = true;
}
else
{
this.panel1.Location = new Point(-10000,-10000);
} public PromptSelectionResult SelectImplied();
雪山飞狐_lzh 发表于 2015-4-15 08:04 static/image/common/back.gif
public PromptSelectionResult SelectImplied();
飞狐哥哥,请问我还能做什么,才能让panel在先选中了对象后显示出来,就用这个方法先选择后命令的
public static void CheckForPickfirstSelection()
{
int nMaxSort = System.Convert.ToInt32(Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("PICKFIRST"));
Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog(nMaxSort.ToString());//测试
Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("PICKFIRST", 1);
Editor acDocEd = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
PromptSelectionResult acSSPrompt;
acSSPrompt = acDocEd.SelectImplied();
if (acSSPrompt.Status == PromptStatus.OK)
{
UserControl4 uc4 = new UserControl4();
uc4.panel1.Visible = true;
uc4.panel1.Location = new Point(0, 0);
}
else
{
UserControl4 uc4 = new UserControl4();
uc4.panel1.Location = new Point(-1000, -10000);
}
} 你可以先做简单的测试 把你的问题分成几个小问题来解决 本帖最后由 糕笔仔 于 2015-4-17 11:15 编辑
雪山飞狐_lzh 发表于 2015-4-17 09:53 static/image/common/back.gif
你可以先做简单的测试 把你的问题分成几个小问题来解决
先用土方法把问题暂时解决了,不过操作麻烦了一步,谢谢飞狐哥的指导! 嗯 先把你能够理解的部分搞清楚,界面上面的后期去处理
说实话面板我没有做过呵呵,暂时没这方面的需求
页:
[1]