.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AcquirePoint Problem

2 REPLIES 2
Reply
Message 1 of 3
lapiseast
637 Views, 2 Replies

AcquirePoint Problem

when override drawjig::sampler() function, i use the AcquirePoint() to get the point. The problem is that the 3dcoordinate point input from keyboard doesn't works, anyone knows what's wrong?
My code snippet list as below:

protected override SamplerStatus Sampler(JigPrompts prompts)
{

JigPromptOptions jigOpts = new JigPromptOptions();
jigOpts.UserInputControls = (UserInputControls.Accept3dCoordinates|UserInputControls.AcceptMouseUpAsPoint | UserInputControls.NoZeroResponseAccepted | UserInputControls.NoNegativeResponseAccepted
);
jigOpts.Message = "input the point:";
PromptPointResult dres = prompts.AcquirePoint(jigOpts);// just here the keyboard doesn't work

if (dres.Status == PromptStatus.Cancel)
{
return SamplerStatus.Cancel;
}

if (ToSymbolCreateData(m_CreateData).Position != dres.Value)
{
ToSymbolCreateData(m_CreateData).Position = dres.Value;
return SamplerStatus.OK;
}
else
{
return SamplerStatus.NoChange;
}
}
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: lapiseast

Have you tried removing UserInputControls.AcceptMouseUpAsPoint ?

That would only make sense if the call to AquirePoint() was
issued while the mouse button is currently down, no?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5337772@discussion.autodesk.com...
when override drawjig::sampler() function, i use the AcquirePoint() to get the point. The problem is that the 3dcoordinate point input from keyboard doesn't works, anyone knows what's wrong?
My code snippet list as below:

protected override SamplerStatus Sampler(JigPrompts prompts)
{

JigPromptOptions jigOpts = new JigPromptOptions();
jigOpts.UserInputControls = (UserInputControls.Accept3dCoordinates|UserInputControls.AcceptMouseUpAsPoint | UserInputControls.NoZeroResponseAccepted | UserInputControls.NoNegativeResponseAccepted
);
jigOpts.Message = "input the point:";
PromptPointResult dres = prompts.AcquirePoint(jigOpts);// just here the keyboard doesn't work

if (dres.Status == PromptStatus.Cancel)
{
return SamplerStatus.Cancel;
}

if (ToSymbolCreateData(m_CreateData).Position != dres.Value)
{
ToSymbolCreateData(m_CreateData).Position = dres.Value;
return SamplerStatus.OK;
}
else
{
return SamplerStatus.NoChange;
}
}
Message 3 of 3
lapiseast
in reply to: lapiseast

thanks tony for your reply.
i removed AcceptMouseUpAsPoint in the UserInputControls,but still doesn't work.
while from keyboard input cordinate of a point in the format of "x,y,z" ,i could find that the dres.status(return value of prompts.AcquirePoint()) is PromptStatus.Ok,but dres.value can not get the keyboard-input value. So.something will be created at the place where the cursor stayed at that time,but not the place what keyboard-input point defined.

another truth is , i have another custom class derived from EntityJig,and in the Sampler override ,i also used AcquirePoint method which is completely the same as that one of DrawJig,from UserInputControls setting to the method make use of dres.value. but here,the user input from keyboard works well.

does that the difference of DrawJig and EntityJig ?
anyone has encountered the same problem?pls. help me

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost