- UID
- 658062
- 积分
- 2147
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2008-10-22
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
// Replace "accore.dll" by "acad.exe" for AutoCAD versions prior to 2013
[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("acad.exe", EntryPoint = "acedCmd", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
extern static private int acedCmd(IntPtr resbuf);
[CommandMethod("offpl")]
public void cmdOffset()
{
ResultBuffer rb = new ResultBuffer();
// RTSTR = 5005
rb.Add(new TypedValue(5005, "_.OFFSET"));
// start the insert command
acedCmd(rb.UnmanagedObject);
bool quit = false;
// loop round while the insert command is active
while (!quit)
{
// see what commands are active
string cmdNames = (string)Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("CMDNAMES");
// if the INSERT command is active
if (cmdNames.ToUpper().IndexOf("OFFSET") >= 0)
{
// then send a PAUSE to the command line
rb = new ResultBuffer();
// RTSTR = 5005 - send a user pause to the command line
rb.Add(new TypedValue(5005, "\\"));
acedCmd(rb.UnmanagedObject);
}
else
// otherwise quit
quit = true;
}
} |
|