postcommand and sendmessage mistake in Autocad LT

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I really need some help. I have been programming in VB to send commands to Autocad for over 10 years. I have been able to send to Autocad (using postcommand) and Autocad LT (using sendmessage & DDE). The code has not changed in quite awhile, but now I need to use it with in Autocad LT 2015 and 2016, and it doesn't pause for the user to select the insertion point.
It works as it always has, in full Autocad 2007-2016 and Autocad LT 2010, but does not work well with Autocad LT 2015 & 2016.
If I send two items to LT, the first item does not wait for user input for the insetion point. The commands of the second item interrupt the input and only the first item shows up.
Sub SendToCad()
Dim sCmdEsc as String
sCmdEsc = Chr(27)
SendToCommandPrompt2 sCmdEsc & sCmdEsc _GRAPHSCR ATTREQ 0 PROXYNOTICE 0 _-INSERT "C:\MIdwgs\CLS48p.dwg" & vbCr & "S" & vbCr & "1" & vbCr
SendToCommandPrompt2 _-INSERT "C:\MIdwgs\HLS84p.dwg" & vbcr & "@48,0,0" & vbCr & "1" & vbCr & "1" & vbCr & "0" & vbCr
'This gets sent to another sub which sends it to the command prompt using "postcommand" if to Auutocad or " " if Autocad LT
'Works fine for Autocad and Autocad LT 2010, but NOT for Autocad LT 2015 & 2016
End Sub
**Commands as received by Autocad
Command: *Cancel*
Command: *Cancel*
Command: _GRAPHSCR
Command: ATTREQ
Enter new value for ATTREQ <0>: 0
Command: PROXYNOTICE
Enter new value for PROXYNOTICE <0>: 0
Command: _-INSERT Enter block name or [?]: C:\VB6\2015\Multiteria\MIdwgs\CLS48p.dwg
Units: Unitless Conversion: 1.00000
Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate]: S
Specify scale factor for XYZ axes <1>: 1
Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate]:
Specify rotation angle <0>:
Command: _-INSERT Enter block name or [?] <CLS48p>: C:\VB6\2015\Multiteria\MIdwgs\HLS84p.dwg
Duplicate definition of block AX0002P ignored.
Units: Unitless Conversion: 1.00000
Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate]: @48,0,0
Enter X scale factor, specify opposite corner, or [Corner/XYZ] <1>: 1
Enter Y scale factor <use X scale factor>: 1
Specify rotation angle <0>: 0
Command: *Cancel*
Command: *Cancel*
Command:
**Commands as received by Autocad LT
Command: *Cancel*
Command: *Cancel*
Command: _GRAPHSCR
Command: ATTREQ
Enter new value for ATTREQ <0>: 0
Command: PROXYNOTICE
Enter new value for PROXYNOTICE <0>: 0
Command: _-INSERT Enter block name or [?]: C:\Users\jeff\AppData\Local\DesignAQuote\DesignAQuoteMI\MIdwgs\CLS48p.dwg
Units: Unitless Conversion: 1.00000
Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate]: S
Specify scale factor for XYZ axes <1>: 1
Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate]: _-INSERT '**This is the problem area**
Point or option keyword required.
Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate]: C:\Users\jeff\AppData\Local\DesignAQuote\DesignAQuoteMI\MIdwgs\HLS84p.dwg
Point or option keyword required.
Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate]: @48,0,0
Specify rotation angle <0>: 1
Command: 1
Unknown command "1". Press F1 for help.
Command: 0
Unknown command "0". Press F1 for help.
Command: *Cancel*
Command: *Cancel*
Command:
It works as it always has, in full Autocad 2007-2016 and Autocad LT 2010, but does not work well with Autocad LT 2015 & 2016.
Thank you for your help!