Hello,
With the following code using GETSTRING I can show the user an input box for text entry.
The question is: How can I decide which position in the drawing this text edit box appears ? I would like to be able to pass a geometry.point3d as a parameter pbut I do not find where to pass thisparameter.
Thanks for your help.
myDWG = ApplicationServices.Application.DocumentManager.MdiActiveDocument
myDB = myDWG.Database
myEd = myDWG.Editor
PSO.AllowSpaces =
"EnterStringA")> Public Sub EnterStringA()Dim myDB As DatabaseServices.DatabaseDim myDWG As ApplicationServices.DocumentDim myEd As EditorInput.EditorDim myPSR As EditorInput.PromptResultDim PSO As New EditorInput.PromptStringOptions(vbCrLf & vbTab & "Enter MText text")True
myPSR = myEd.GetString(PSO)
MsgBox(myPSR.StringResult)
Take a look at this page
~'J'~
Sorry I do not have VS installed on this computer or the ObjectARX download so I am going off of memory.
I thought the GetString method returned the string from the command prompt.
What edit box are you talking about?
Do you mean the input box when dynamic input is active
ie the prompt box that opens at the cursor location ??
// Called Kerry in my other life.
Everything will work just as you expect it to, unless your expectations are incorrect.
class keyThumper<T> : Lazy<T>; another Swamper
>What edit box are you talking about?
>Do you mean the input box when dynamic input is active>ie the prompt box that opens at the cursor location ??
Yes the inbut box of getstring opens at cursor location. So I suppose that if I change cursor location I will be changing the position of this input box, which is what I want.
The problem is I don't know how to choose cursor location. So the question could be rewriten: How can I change cursor location ?
To better explain what input box I am referring to, you can copy and paste the following routine which asks for a string and then it shows the string in a message box:
Thanks for your help
Jose Maria
Imports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD Imports Autodesk.AutoCAD.DatabaseServices Imports Autodesk.AutoCAD.EditorInput 'añadido Imports Autodesk.AutoCAD.Windows 'añadido Imports Autodesk.AutoCAD.ApplicationServices <CommandMethod("EnterStringA")> Public Sub EnterStringA() Dim myDB As DatabaseServices.Database Dim myDWG As ApplicationServices.Document Dim myEd As EditorInput.Editor Dim myPSR As EditorInput.PromptResult myDWG = ApplicationServices.Application.DocumentManager.MdiActiveDocument myDB = myDWG.Database myEd = myDWG.Editor Dim PSO As New EditorInput.PromptStringOptions("Enter String") PSO.AllowSpaces = True myPSR = myEd.GetString(PSO) MsgBox(myPSR.StringResult) End Sub
Your code will NOTshow an 'input box' if the user does not have dynamic input toggled on.
If you want to use an input box your best solution is to write one using the Forms namespace classes.
// Called Kerry in my other life.
Everything will work just as you expect it to, unless your expectations are incorrect.
class keyThumper<T> : Lazy<T>; another Swamper
In response to:
> Your code will NOTshow an 'input box' if the user does not have dynamic input toggled on.
So I suppose the user has dynamic input on because when I run the command EnterStringA I get an input box requesting a string. You can try that yourself by copying and pasting the code below. The only problem is that I don't know how to choose the position of this input box.
Given the fact that the input box seems to appear where the cursor was, maybe the solution is to change the cursor position. The problem is I don't know how to change cursor position either.
Imports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD Imports Autodesk.AutoCAD.DatabaseServices Imports Autodesk.AutoCAD.EditorInput 'añadido Imports Autodesk.AutoCAD.Windows 'añadido Imports Autodesk.AutoCAD.ApplicationServices <CommandMethod("EnterStringA")> Public Sub EnterStringA() Dim myDB As DatabaseServices.Database Dim myDWG As ApplicationServices.Document Dim myEd As EditorInput.Editor Dim myPSR As EditorInput.PromptResult myDWG = ApplicationServices.Application.DocumentManager.MdiActiveDocument myDB = myDWG.Database myEd = myDWG.Editor Dim PSO As New EditorInput.PromptStringOptions("Enter String") PSO.AllowSpaces = True myPSR = myEd.GetString(PSO) MsgBox(myPSR.StringResult) End Sub
Can't find what you're looking for? Ask the community or share your knowledge.