SendStringToExecute brings up the text window 2012 64bit

SendStringToExecute brings up the text window 2012 64bit

Anonymous
Not applicable
1,084 Views
6 Replies
Message 1 of 7

SendStringToExecute brings up the text window 2012 64bit

Anonymous
Not applicable

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)

 

 

 

0 Likes
1,085 Views
6 Replies
Replies (6)
Message 2 of 7

Jeff_M
Consultant
Consultant

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
EESignature
0 Likes
Message 3 of 7

Anonymous
Not applicable

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

0 Likes
Message 4 of 7

chiefbraincloud
Collaborator
Collaborator

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
0 Likes
Message 5 of 7

jeff
Collaborator
Collaborator

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
0 Likes
Message 6 of 7

Anonymous
Not applicable

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

0 Likes
Message 7 of 7

chiefbraincloud
Collaborator
Collaborator

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
0 Likes