vb.net - Editor.GetEntity 不等待用户输入(点击)
问题描述
我有两个 dwg 文件:PID.dwg & 3D.dwg
用例是在 PID.dwg 上运行一个函数,然后在 3D.dwg 上运行——尤其是按这个顺序。
下面 SendCommand 中使用的命令来自一个单独的 DLL 文件,我在执行此函数之前使用 NETLOAD 加载该文件。
Dim app As AcadApplication = CType(Application.AcadApplication, AcadApplication)
' Ctype( Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication,
' Autodesk.AutoCAD.Interop.AcadApplication )
If isPidAnd3dOpened() Then
' Activate PID document
app.ActiveDocument = acDocPid
'acDocPid.Activate()
acDocPid.SendCommand("DOSOMETHINGONPID" & vbCrLf)
' Activate 3D document
app.ActiveDocument = acDoc3d
'acDoc3d.Activate()
acDoc3d.SendCommand("DOSOMETHINGON3D" & vbCrLf)
End If
"DOSOMETINGON3D"
用户使用的要求和输入的功能Editor.GetEntity
。
但是,当acDoc3d.SendCommand("DOSOMETHINGON3D" & vbCrLf)
执行时,它不会暂停等待用户输入。
我错过了什么?
解决方案
可能您必须等到命令DOSOMETHINGONPID
完成。
在 ARX 中会是这样的:
CString activeCMDName = _T("DOSOMETHINGONPID");
bool EOL = false;
while (!EOL)
{
CString cmds = Variable::Get(_T("CMDNAMES") );
if (cmds.Find( activeCMDName ) > 0 ) {
Command::Wait();
}
else {
EOL = true;
}
}
在哪里
CString Variable::Get( CString name )
{
CString OutVal;
resbuf rb ;
acedGetVar(name, &rb);
OutVal.SetString(rb.resval.rstring);
acutDelString(rb.resval.rstring);
return OutVal ;
}
void Command::Wait()
{
ResBuf rb;
rb.Add(RTSTR , _T("\\"));
int ret = acedCmd(rb.GetFirst());
}
对不起,我没有这个代码.net
。希望你能处理好这个。
推荐阅读
- python - 如何将源参数和目标参数定义为 shortest_path 的数组?
- c - 当系数可能为 0 时求解二次方程
- json - 使用 Codable 解析 JSON 对象数组但跳过损坏的元素
- arm - 在向量区执行时,Cortex-m0 pop 指令失败?
- android - 在堆栈颤动中使页面下方可点击
- c# - 使用 Windows Form 作为 Arduino Uno 的串行通信器
- python - 如何覆盖第三方库使用的方法
- angular - 模块解析失败:保留关键字“private”
- wordpress - 通过自定义插件创建分类时如何创建分类术语?
- php - PHP 读取本地 .sq3 文件以在网页上使用