• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Valued Contributor
    Posts: 65
    Registered: ‎10-07-2008

    SendStringToExecute brings up the text window 2012 64bit

    233 Views, 6 Replies
    10-18-2011 08:36 AM

    everytime i use the sendStringToExecute command it brings up the text window( F2 ).  i have Echocomand set to false.  Annoying for the most part, is there a setting somewhere to stop this from happening.

     

     

    SendStringToExecute(

    "-units" & vbCr & "2" & vbCr & "4" & vbCr & "1" & vbCr & "8" & vbCr & "" & vbCr & vbCr, False, False, False)

     

     

     

    Please use plain text.
    *Expert Elite*
    Posts: 3,052
    Registered: ‎07-22-2003

    Re: SendStringToExecute brings up the text window 2012 64bit

    10-18-2011 08:47 AM in reply to: bill.salling

    That command always brings up the text window since there is a lot of text to display for the user to respond to. Why use SendStringToExecute for this? Just set the appropriate Sysvars directly.....

    Jeff_M, also a frequent Swamper
    Please use plain text.
    Valued Contributor
    Posts: 65
    Registered: ‎10-07-2008

    Re: SendStringToExecute brings up the text window 2012 64bit

    10-18-2011 08:50 AM in reply to: bill.salling

    That is what i have done.  This old code, i am having to convert and the creator of the old stuff liked to see the actuall commands i guess.  i just want to see if there was a setting besides graphscr.

     

    thanks

    Please use plain text.
    *Expert Elite*
    chiefbraincloud
    Posts: 736
    Registered: ‎02-13-2008

    Re: SendStringToExecute brings up the text window 2012 64bit

    10-18-2011 11:36 AM in reply to: bill.salling

    I think the real point, as Jeff indicated, is that you are calling the command line version of the command, so autocad expects to be prompting the user, so it has to force the text screen to be shown so the user can see the prompts.

     

    I had a hunch, and tested it, and I was correct.  (I do agree that in 99% of circumstances, I would just set the properties directly instead of sending a command) But if you are forced to use SendString...  You can send it as a lisp command. The string at the command line should be (vl-cmdf "-units" "2" "4" "1" "8" "" "")  with a space or carriage return at the end.  Then AutoCAD knows that it is in Automation mode, and does not force open the Textscreen.

    Dave O.                                                                                Sig-Logos32.png
    Please use plain text.
    Mentor
    Posts: 241
    Registered: ‎05-12-2009

    Re: SendStringToExecute brings up the text window 2012 64bit

    10-18-2011 12:08 PM in reply to: chiefbraincloud

    As Jeff_M and Chief pointed out you can set them directly using properties of the Database class

     

     

    Database.Lunits

    Database.Luprec

    Database.Aunits

    etc....

     

     

    At this Link at the bottom expand the System Variables '+' box and I think that covers all the properties

     

     

    You can also find your answers @ TheSwamp
    Please use plain text.
    Valued Contributor
    Posts: 65
    Registered: ‎10-07-2008

    Re: SendStringToExecute brings up the text window 2012 64bit

    10-19-2011 05:30 AM in reply to: jeff

    The whole goal is to get it converted as quick as possible to limit the down time.  Once it was up and running, i made it work better and written more productly.

     

    Question do either of you guys know what how to read the current coordinate system?  in VBA it was currentprojection.  i have been looking and cannot find the calls for it.

     

    Thanks

    Please use plain text.
    *Expert Elite*
    chiefbraincloud
    Posts: 736
    Registered: ‎02-13-2008

    Re: SendStringToExecute brings up the text window 2012 64bit

    10-19-2011 12:12 PM in reply to: bill.salling

    Editor.CurrentUserCoordinateSystem will return a Matrix3d, but that would be comparable to the ActiveUCS property in VBA.

     

    I searched my VBA reference for currentprojection, and I don't see it at all, so I can't tell if we're speaking the same language or not.

    Dave O.                                                                                Sig-Logos32.png
    Please use plain text.