Author Topic: SentString Example  (Read 1646 times)

0 Members and 1 Guest are viewing this topic.

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
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: 705
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 2019, AMEP 2019 64bit Win 10

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
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