TBC Macros and Extensions

 View Only
Expand all | Collapse all

TBC macros - documentation, printout etc

  • 1.  TBC macros - documentation, printout etc

    Posted 07-30-2020 05:30

    Hello,

     

    Im quite new to TBC macros and im not very used to working with MS visual Studio.

    Can i try my macros without launching TBC? It takes a while to restart tbc after every edit

     

    Is there a documentation for the tbc macro commands?

    For example if i want to access and print out the string withing a textbox i use the following command:

    MessageBox.Show(self.testText.Text) where the name of the textbox is set to "testText".

    But i dont know how to access the value from(for example) AngularEdit. For this reason a documetntation would be helpful.

     

    Also, where can i find a terminal in MS visual studio? For example if i do a print("hello world"). Where can i se the printout?



  • 2.  Re: TBC macros - documentation, printout etc

    Posted 07-31-2020 11:05

    Hi witold,

     

    Glad to hear you're trying out TBC macro commands (or TMLs for short).

     

    Question 1: Restart needed on each edit?

     

    If your TML uses a plain .py file (Python file), you don't have to restart TBC for your edits to take effect.  Every time you run a .py TML, the TBC command engine will check to see if the .py file has changed, and if it has, it will re-load the .py file.

     

    If you are compiling your .py file into a .pydll file, or you are changing a .dll file (compiled .NET assembly) that your .py file uses, you'll have to restart TBC to pick up the changes to your .pydll or .dll file.

     

    Question 2: TBC platform documentation?

     

    Unfortunately, the TBC dev team has not made formal, searchable documentation available for the TBC Platform.  This is a challenge for even experienced former TBC developers.

     

    If you have questions about using a particular TBC control, like the AngularEdit, you can use the Object Browser in Visual Studio to look at the interface (list of properties and methods) available for that control.

     

    I think the Getting Started pages in the TML forums mention this.

     

    In Visual Studio, click on the View menu, and choose Object Browser (in 2nd group of items).  Click the ... button at the top of the browser to choose a DLL from the C:\Program Files (x86)\Trimble\Macros SDK\ folder.  Choose Trimble.Vce.UI.Controls.dll. , click the Add (down arrow) button, Click OK.

     

    Then in the Object Browser, you can search for "AngularEdit", choose the one in Trimble.Vce.UI.Controls.Wpf (WPF controls are the ones used by TMLs).

     

    For AngularEdit, the raw value of the angle (I believe this is in radians) is in the Angle property.

     

    You can also post a question on the TML forums

     

    Question 3: Console output?

     

    I have not experimented with this myself - but I think if you launch TBC via VS as a debugger (Debug menu > Start Debugging), you can see console output in the Output pane of VS (Debug menu > Windows > Output).

     

    I know @Gary Lantaff has used the Debugger this way - maybe he can give some tips.

     

    Hope that helps - at least to get you started,

     

    Quan

     

    Revenant Solutions | Trimble Community
    Independent TML Development - Build. Share. Grow.



  • 3.  Re: TBC macros - documentation, printout etc

    Posted 09-01-2020 00:44

    Hello Quan,

     

    Thank you very much for the detailed explanation. It was really helpful 

    Sry for the delayed reply but i have been on a longer vacation.

     

    I think i will try this out the uppcomming week. 

     

    Have a great day!

     

    Best regards Witold



  • 4.  Re: TBC macros - documentation, printout etc

    Posted 09-30-2020 09:19

    Glad it was helpful!  How has your development been going?  Have you been able to put some TMLs together?



  • 5.  Re: TBC macros - documentation, printout etc

    Posted 09-30-2020 09:24

    Oh, just saw your other forum posts (been off the forums for a few weeks) - I'll have to check those out later on this week!



  • 6.  Re: TBC macros - documentation, printout etc

    Posted 10-01-2020 22:51

    Hello,

     

    I am doing some basic tests. I have created one small macro so far  

    I want to explore how jobReportGenerator can be used. Im having problems understadning exacly how it works.

     

    Ill keep on trying and hopefully ill get the hang of it

     

    Best regards