.NET

Reply
Valued Contributor
andred
Posts: 89
Registered: ‎10-17-2003
Message 1 of 5 (238 Views)
Accepted Solution

AutoCAD command prompt text disapear

238 Views, 4 Replies
04-18-2014 11:39 AM

Hi everybody,

 

I've developed a custom insert block command. The first one insert a block from a dialog box like the INSERT command. Everything work fine. Now I created a palette with a list of block. When I click one, my custom insertion command is issue. The block is insert correctly but after insert, the text "Command:" is not displaying at the command line (I see only the text issue by my command with WriteMessage) but I can type another command with no problem.

 

If I send an escape string, the text is back again but I see *cancel* at command line, so it is not very elegant.

 

Anybody have an idea?

 

Regards,

 

André

 

Hi,

 

depending on the AutoCAD release, for newer ones:

        Autodesk.AutoCAD.Internal.Utils.PostCommandPrompt

if that does not exist, then for older releases

        <DllImport("acad.exe", CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Unicode, EntryPoint:="?acedPostCommand@@YAHPB_W@Z")> _
        Public Function acedPostCommand32(ByVal CommandStr As String) As Integer
        End Function
        <DllImport("acad.exe", CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Unicode, EntryPoint:="?acedPostCommand@@YAHPEB_W@Z")> _
        Public Function acedPostCommand64(ByVal CommandStr As String) As Integer
        End Function

HTH, - alfred -

*Expert Elite*
Alfred.NESWADBA
Posts: 9,563
Registered: ‎06-29-2007
Message 2 of 5 (224 Views)

Re: AutoCAD command prompt text disapear

04-18-2014 01:37 PM in reply to: andred

Hi,

 

depending on the AutoCAD release, for newer ones:

        Autodesk.AutoCAD.Internal.Utils.PostCommandPrompt

if that does not exist, then for older releases

        <DllImport("acad.exe", CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Unicode, EntryPoint:="?acedPostCommand@@YAHPB_W@Z")> _
        Public Function acedPostCommand32(ByVal CommandStr As String) As Integer
        End Function
        <DllImport("acad.exe", CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Unicode, EntryPoint:="?acedPostCommand@@YAHPEB_W@Z")> _
        Public Function acedPostCommand64(ByVal CommandStr As String) As Integer
        End Function

HTH, - alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Valued Contributor
andred
Posts: 89
Registered: ‎10-17-2003
Message 3 of 5 (223 Views)

Re: AutoCAD command prompt text disapear

04-18-2014 02:25 PM in reply to: Alfred.NESWADBA

You're a king!!!!

 

Best regards,

 

André

*Expert Elite*
norman.yuan
Posts: 1,062
Registered: ‎04-27-2009
Message 4 of 5 (203 Views)

Re: AutoCAD command prompt text disapear

04-18-2014 08:58 PM in reply to: andred

Well, doing the P/Invoke gets what you want, you can do it even easier with the managed API equivalent directly:

 

Autodesk.AutoCAD.Internal.Utils.PostCommandPrompt();

*Expert Elite*
Alfred.NESWADBA
Posts: 9,563
Registered: ‎06-29-2007
Message 5 of 5 (197 Views)

Re: AutoCAD command prompt text disapear

04-18-2014 10:02 PM in reply to: norman.yuan

Hi Norman,

 

>> you can do it even easier with

have you seen my first option in my post?

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.