TheSwamp
Code Red => .NET => Topic started by: dawido000 on July 22, 2014, 02:47:14 PM
-
Is there any way to get from user both Point3d or String value in EntityJig object? I would like to reach such effect as in attachment?
I tried something like here:
protected override SamplerStatus Sampler(JigPrompts prompts)
{
JigPromptStringOptions prOptions3 = new JigPromptStringOptions();
JigPromptPointOptions prOptions2 = new JigPromptPointOptions("\n");
prOptions2.Keywords.Add("Koniec");
prOptions2.Keywords.Add("Zamień");
prOptions2.Keywords.Default = "Zamień";
prOptions2.BasePoint = mPunkt1Biezacy;
prOptions2.UseBasePoint = true;
prOptions2.UserInputControls =
UserInputControls.Accept3dCoordinates |
UserInputControls.AcceptOtherInputString |
UserInputControls.GovernedByOrthoMode |
UserInputControls.GovernedByUCSDetect |
UserInputControls.UseBasePointElevation |
UserInputControls.AnyBlankTerminatesInput |
UserInputControls.InitialBlankTerminatesInput |
UserInputControls.NullResponseAccepted;
prOptions3.UserInputControls =
UserInputControls.Accept3dCoordinates |
UserInputControls.GovernedByOrthoMode |
UserInputControls.GovernedByUCSDetect |
UserInputControls.UseBasePointElevation |
UserInputControls.AnyBlankTerminatesInput |
UserInputControls.InitialBlankTerminatesInput |
UserInputControls.NullResponseAccepted;
PromptResult prResult3 = prompts.AcquireString(prOptions3);
PromptPointResult prResult2 = prompts.AcquirePoint(prOptions2);
if (prResult3.Status == PromptStatus.OK)
{
strTekst = prResult3.StringResult;
return SamplerStatus.NoChange;
}
//if (prResult2.Status == PromptStatus.Cancel) return SamplerStatus.Cancel;
if (prResult2.Status == PromptStatus.Keyword)
{
//Jeżeli naciśnięto Zamień
if (prResult2.StringResult == "Zamień")
{
if (mPunktChwilowy == mPunkt1Biezacy)
{
mStartPoint = mPunkt2Biezacy;
mPunktChwilowy = mPunkt2Biezacy;
}
else
{
mStartPoint = mPunkt1Biezacy;
mPunktChwilowy = mPunkt1Biezacy;
}
}
return SamplerStatus.OK;
}
if (prResult2.Status == PromptStatus.None)
{
return SamplerStatus.NoChange;
}
if (prResult2.Status == PromptStatus.Other)
{
return SamplerStatus.NoChange;
}
if (prResult2.Status == PromptStatus.Cancel)
{
return SamplerStatus.NoChange;
}
else
{
mEndPoint = prResult2.Value;
return SamplerStatus.OK;
}
}
-
If you aren't happy with the answers here :-
http://forums.autodesk.com/t5/NET/bd-p/152
then you will need to be more explicit with your question.
-
Sorry for my English. I am from Poland :). I try to get from User point3d (as in attachment), but I want to be possibility to get string also. I succeeded, but during entering the string, Editor Input is falshing every inputed letter. I used two functions at the same time.
prompts.AcquireString();
prompts.AcquirePoint();
I admit that I experiment now, because I have no ideas anymore.