|
在任何需要选择的情况下都可以用pr或last来选择,但我做的ads命令,在普通的命令比如copy下输入'p1,可以获得保存的选择集,但在lisp命令中比如ssget却不能获得选择集。有办法解决吗?
static int ads_p1(void)
{
long len;
int ret=acedSSLength(DocVars.docData().myss1,&len);
if(ret!=RTNORM) return RTERROR;
if (len==0) return RTERROR;
ret=acedRetName(DocVars.docData().myss1,RTPICKS);
if (ret==RTNORM)
{
acutPrintf(_T(""));
}
return (RSRSLT) ;
}
ACED_ADSCOMMAND_ENTRY_AUTO(CBYApp, p1, true)
比如这个Lisp命令:
(setq b (ssget))回车后,输入'P1,会出现:
cannot reenter Lisp(无法重复进入 LISP。)
的提示.
在VB下编程可以这样做,但只能针对这个应用,不能对ssget有效:
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Dim Opts As New PromptSelectionOptions()
Opts.Keywords.Add("myFence")
Opts.Keywords.Add("myWindow")
Opts.Keywords.Add("myWpoly")
Opts.Keywords.Add("myLastSel"
Opts.Keywords.Add("myPrevSel")
AddHandler Opts.KeywordInput, AddressOf handle_KeywordInput
.....
If e.Input.CompareTo("myPrevSel") = 0 Then Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor Dim res As PromptSelectionResult = ed.SelectPrevious() If res.Status = PromptStatus.Error Then Return End If Dim SS As Autodesk..EditorInput.SelectionSet = res.Value Dim idarray As ObjectId() = SS.GetObjectIds() e.AddObjects(idarray)End If
|
|