Transparent commands don't work with editorinput.getxxxx acad2015

Transparent commands don't work with editorinput.getxxxx acad2015

gpq
Enthusiast Enthusiast
2,408 Views
18 Replies
Message 1 of 19

Transparent commands don't work with editorinput.getxxxx acad2015

gpq
Enthusiast
Enthusiast

I have my application that work correctly with acad2014 and now I have installed Acad2015 and I have see that now the transparent command don't work with all editorinput.getxxxx function.

I have already try to recompile with the new managed library 2015 but it's the same problem.

Someone have already solved?

Thanks.

 

Dim ReqPnt As AcEd.PromptPointOptions

ReqPnt = New AcEd.PromptPointOptions(ControlChars.Lf & "Select point : "********* HERE I GIVE 'OSMODE 512

ReqPnt.AllowArbitraryInput = True

ReqPnt.AllowNone = False

Dim ValPnt As AcEd.PromptPointResult

ValPnt = Ed.GetPoint(ReqPnt)

If ValPnt.Status <> AcEd.PromptStatus.OK Then

Return

End If

0 Likes
2,409 Views
18 Replies
Replies (18)
Message 2 of 19

Anton_Huizinga
Advocate
Advocate

I can confirm that transparent commands don't work in 2015 with the editor.getxxx functions. In 2014 it does work.

 

Don't know why, maybe because 2015 works different with documents. And Editor belongs to a Document.

 

The snap codes "end" and the others do work.

0 Likes
Message 3 of 19

FRFR1426
Collaborator
Collaborator

May be it's a problem with fiber removal. Try to set the NEXTFIBERWORLD system variable to 0, restart AutoCAD and try your command. If it works, it's a problem with fiber. Don't forget to restore NEXTFIBERWORLD to 1 after you're done.

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Message 4 of 19

FRFR1426
Collaborator
Collaborator

Just tried, transparent commands are working for me on 2015 with a GetPoint call.

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Message 5 of 19

gpq
Enthusiast
Enthusiast
Exactly what happens to me.
0 Likes
Message 6 of 19

gpq
Enthusiast
Enthusiast
Setting NEXTFIBERWORLD variable to 0 or 1 does not change anything.
0 Likes
Message 7 of 19

gpq
Enthusiast
Enthusiast

Sorry it's only to understand , do you have try with this code and at the request input point yoy give by hand -->  'osmode 512 ? thanks in advance for your help.

 

Dim ReqPnt As AcEd.PromptPointOptions

ReqPnt = New AcEd.PromptPointOptions(ControlChars.Lf & "Select point : "********* HERE I GIVE 'OSMODE 512

ReqPnt.AllowArbitraryInput = True

ReqPnt.AllowNone = False

Dim ValPnt As AcEd.PromptPointResult

ValPnt = Ed.GetPoint(ReqPnt)

If ValPnt.Status <> AcEd.PromptStatus.OK Then

Return

End If

0 Likes
Message 8 of 19

FRFR1426
Collaborator
Collaborator

This code works for me on AutoCAD 2015:

 

<CommandMethod("TRANSTEST")>
Public Sub TransparentCommandTest()
    Dim Ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
    Dim ReqPnt As PromptPointOptions
    ReqPnt = New PromptPointOptions(ControlChars.Lf & "Select point : ")
    ReqPnt.AllowArbitraryInput = True
    ReqPnt.AllowNone = False
    Dim ValPnt As PromptPointResult
    ValPnt = Ed.GetPoint(ReqPnt)
    If ValPnt.Status <> PromptStatus.OK Then
        Return
    End If
    Ed.WriteMessage(ValPnt.Value.ToString())
End Sub

 I'm able to enter 'OSMODE<Return>512<Return> when AutoCAD ask me for the point.

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Message 9 of 19

Anton_Huizinga
Advocate
Advocate

A new test here and I am able to use 'Osnap during a Point Prompt. I don't know why it didn't work last week.

 

Though I noticed that if you have a floating commandline, entering a ' followed by a space (else it would result in ó with my keyboard), is seen as an Enter. If you have a docked commandline, it is no problem to enter 'osmode. The same will happen with Dynamic Input on.

0 Likes
Message 10 of 19

gpq
Enthusiast
Enthusiast




In the 2014 version of AutoCAD commands transparent in my application to work fine .
Using my application in Autocad 2015 do not work .
Following the suggestion of FRFR1426 I tried the code and it works.
I realized that to work in my application should I have all the Form displayed with "ShowModalDialog" .
Form1 call form2 that calls the form3 cascade .
If I put all the forms in a manner " ShowModalDialog " I can not minimize and interact with Autocad , which in Autocad2014 could do.
Any idea ? Thank you.
0 Likes
Message 11 of 19

gpq
Enthusiast
Enthusiast
In the 2014 version of AutoCAD commands transparent in my application to work fine .
Using my application in Autocad 2015 do not work .
Following the suggestion of FRFR1426 I tried the code and it works.
I realized that to work in my application should I have all the Form displayed with "ShowModalDialog" .
Form1 call form2 that calls the form3 cascade .
If I put all the forms in a manner " ShowModalDialog " I can not minimize and interact with Autocad , which in Autocad2014 could do.
Any idea ? Thank you.
0 Likes
Message 12 of 19

FRFR1426
Collaborator
Collaborator

You are using Editor.StartUserInteraction?

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Message 13 of 19

Gdiael
Enthusiast
Enthusiast

Are you using Editor.StartUserInteraction?

(presuming you are calling the getxxx function when a form is active)

 

edit: sorry I had not seen the post above.

0 Likes
Message 14 of 19

gpq
Enthusiast
Enthusiast

I have try to use ed.StartUserInput but i don't solve my problem.

I don't understand why my application work correctly in Acad2014 and not in Acad2015.

What ist changed?

 

For me there are same changements in getxxx function because also in this simplex command I have problem on getString.

Sometime don't accept enter and I must repeat more time.

 

  <AcRt.CommandMethod("GPQ", "HmSolle", AcRt.CommandFlags.Session)> _
        Public Sub cmd_HmSolle()
            Dim M As AcAs.Document = Nothing
            Dim Ed As AcEd.Editor = Nothing
            Try
                Dim NameFile As String ="c:\cam\pippo.dwg"

                If System.IO.File.Exists(NameFile) = False Then
                     Exit Sub
                End If
                Dim acDocMgr As AcAs.DocumentCollection = AcAs.Application.DocumentManager
                M = AcAs.DocumentCollectionExtension.Open(acDocMgr, NameFile, False, Nothing)
                M.LockDocument(AcAs.DocumentLockMode.AutoWrite, Nothing, Nothing, True)
                Ed = HmDotNet.HmTool.Editor 'tassativo serve per rileggere doc corrente
                Dim PrStrOpt As New AcEd.PromptStringOptions("Press ENTER to continue ")
                PrStrOpt.AllowSpaces = False
                Dim PrStrRes As AcEd.PromptResult = Ed.GetString(PrStrOpt)
            Catch ex As System.Exception
                Ed.WriteMessage(String.Format("{0}", ex.Message))
            Finally
                M.LockDocument.Dispose()
                AcAs.DocumentExtension.CloseAndDiscard(M)
            End Try
        End Sub

 

 

Thanks in advance.

 

 

 

 

0 Likes
Message 15 of 19

FRFR1426
Collaborator
Collaborator

When you can, avoid using the Session flag because it can lead to a ton of problems. And why are you locking your document this way? Why not use the LockDocument method overload which take no argument?

 

M.LockDocument()
Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Message 16 of 19

gpq
Enthusiast
Enthusiast

I remind you that this application is working properly since 2003 is not a new development .

For me have been any changes to the functions of getInput .

I need the Session flag because fro one Dwg I open another and after I press enter return to the original one .

0 Likes
Message 17 of 19

Virupaksha_aithal
Autodesk Support
Autodesk Support

Hi

 

I feel your issue is related to fiber removal in AutoCAD 2015. This is because you are trying to move from one document to another inside a command wants to take inputs.

Try below steps in AutoCAD (not through code) in AutoCAD 2015 & 2014. You will identify the difference.

  1. Open 2 drawing in AutoCAD.
  2. Start circle command
  3. Make the second drawing as active and start Line command

Now, make the first drawing as active. You will observe that in 2015, the circle command is automatically cancelled but not in 2014.



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 18 of 19

gpq
Enthusiast
Enthusiast

I observed the difference in behavior between version Acd2014 and 2015, but I think it is not my case .
I launch a command that opens in a cascading series of windows in modeless mode ( modeless because that way I can iconify and interact with autocad giving other commands ) .
Since the last open window wonder , with the function editor.getpoint , some points and if I use the osnap _end , _near works fine, but if I want to use transparent commands , such as ' OSMODE 512 , does not accept them .
With the release of Autocad2014 everything worked well .
To solve the problem I should open all the forms in cascade mode with ModalDialog .
This will not interrupt my initial command and transparent commands work .
In this case , however, lose the ability to interact with Acad because the initial command is always active .

I trust in iin your help.

Thanks for your attention

0 Likes
Message 19 of 19

FRFR1426
Collaborator
Collaborator
When you interact with AutoCAD, always do it in the context of a command and avoid using modeless dialog. I know it worked on 2014, but it smells bad. Does AutoCAD use modeless dialogs? No because AutoCAD does not work this way. Session flag, modeless dialog, application context? -> buggy app
Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes