Author Topic: SentString Example  (Read 119 times)

0 Members and 1 Guest are viewing this topic.

FriendFromArea51

  • Swamp Rat
  • Posts: 675
  • Mars sucks!
SentString Example
« on: November 07, 2017, 03:31:53 am »
I've never used the sendstringtoexecute, and probably never will again.  After all I've done (several hundred thousand lines of code), this sentence turned out to the be the biggest pain in the rear to figure out, I fail miserably at scripting in net  :crazy2:

Code - C#: [Select]
  1. SendStringToExecute("_.justifytext\n" + "P\n\n" + decision + "\n" + "jt\n" + "\x03", false, false, true)

MexicanCustard

  • Swamp Rat
  • Posts: 675
Re: SentString Example
« Reply #1 on: November 07, 2017, 12:48:03 pm »
Looks like you're trying to use end of line characters to represent the enter key.  Just use spaces where you want the enter key.  If your input includes spaces then just wrap it in single quotes inside your double quote string.

Code - C#: [Select]
  1. SendStringToExecute($"_.justifytext P \n {decision} jt ", false, false, true)
« Last Edit: November 07, 2017, 12:55:04 pm by MexicanCustard »
Revit 2018, AMEP 2018 64bit Win 10

FriendFromArea51

  • Swamp Rat
  • Posts: 675
  • Mars sucks!
Re: SentString Example
« Reply #2 on: November 08, 2017, 12:03:31 am »
Thanks! The toughest part was figuring out a way so that when i hit enter or return is repeated my command rather than justifytext