.NET

Reply
Active Contributor
huaxiamengqing
Posts: 35
Registered: ‎05-23-2012
Message 1 of 2 (162 Views)

Mysterious Case about "GetKeywords"

162 Views, 1 Replies
08-20-2012 09:53 PM

 MPlot(Mypointlist, Mnamestr, Mpoint3dL)
                    ' MsgBox(Realplot & "--" & iStep & "---" & Mss.Count)
                    ' Pause(5)
                    If Not Realplot Then
                        If iStep < Mss.Count Or (iStep = Mss.Count And Listdwg.Count > 0) Then

                            Dim pKeyOpts As PromptKeywordOptions = New PromptKeywordOptions("")
                            pKeyOpts.Message = vbLf & "是否预览下一张? "
                            pKeyOpts.Keywords.Add("Y(是)")
                            pKeyOpts.Keywords.Add("N(否)")
                            pKeyOpts.Keywords.Default = "Y(是)"
                            pKeyOpts.AllowNone = True
                            ' MsgBox("ddd")
                            Dim pKeyRes As PromptResult = ed.GetKeywords(pKeyOpts)
                            ' MsgBox("ddd")
                            Dim Mopstr As String = pKeyRes.StringResult
                            If Mopstr = "" Then Mopstr = "N(否)"
                            If Mopstr = "N(否)" Then
                                Previewnext = False
                                Exit For
                            Else
                                Previewnext = True
                            End If

                        End If
                    End If
                    PBar.Value = iStep
                    Label3.Text = (PBar.Value / PBar.Maximum).ToString("#0%", CultureInfo.InvariantCulture)
                    System.Windows.Forms.Application.DoEvents()
                Next
            Catch ex As Exception
                Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog(ex.Message & vbCr & ex.StackTrace & vbCrLf & "程序出错请联系作者!")
            End Try

Above is the  small part of my code. The code work well in the CAD 2008 , Well ,in the CAD2012

                            ' MsgBox("ddd")
                            Dim pKeyRes As PromptResult = ed.GetKeywords(pKeyOpts)
                            ' MsgBox("ddd")

this code just doesn't work. In fact it worked but  Canceled by the CADself !! Just like I put in the ESC key!   It doesn't stop to let you choose Y or N just be Canceled , It's so weird!!   I  Get the code out of my programm and debug the part code alone It just work well !  

  All the code works well in the CAD2008!  Just CAD2012, do you have run into the same problem ? Can you give some suggtions? Thank you !

ADN Support Specialist
Balaji_Ram
Posts: 663
Registered: ‎03-21-2011
Message 2 of 2 (97 Views)

Re: Mysterious Case about "GetKeywords"

08-28-2012 06:48 AM in reply to: huaxiamengqing

Hi,

 

Such automatic cancelling of input or commands is usually associated with fiber switching in AutoCAD.

Fibers are being removed in a phased manner in AutoCAD in the recent releases and this could be reason for the same code to work in AC 2008 while it does not in AC 2012. 

 

Can you please provide us a sample buildable project that has the same structure of your application ?

For example, how is the code snippet that you have shown get called in your actual app and so on ?

 

This will help us reproduce the issue and try and find another way to get the whole thing working.

 

Also, you may try creating a command out of the code that you have shown and then invoke it using "SendStringToExecute" in your main application.

 

Also, is it specific to the use of chinese characters ? From the description that you provided, I guess it is not.

 

 

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community