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

How to choose position of getstring edit box

8 REPLIES 8
Reply
Message 1 of 9
rebarwin
699 Views, 8 Replies

How to choose position of getstring edit box

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)

8 REPLIES 8
Message 2 of 9
Hallex
in reply to: rebarwin

Take a look at this page

http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html?url=WS1a919382...

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 3 of 9
rebarwin
in reply to: rebarwin

Sorry but I find no information in the link you provide

Message 4 of 9
rebarwin
in reply to: rebarwin

Please, anybody knows how to place the edit box of getstring in a specific point ?

 

Thanks

Jose Maria

Message 5 of 9
Jeffrey_H
in reply to: rebarwin

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?

 

You can also find your answers @ TheSwamp
Message 6 of 9
kdub_nz
in reply to: rebarwin

 

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

Message 7 of 9
rebarwin
in reply to: kdub_nz

>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

 

 

Message 8 of 9
kdub_nz
in reply to: rebarwin

 

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

Message 9 of 9
rebarwin
in reply to: kdub_nz

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.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost