TBC Macros and Extensions

 View Only
Expand all | Collapse all

TBC v5.90 Prerelease - Own macros not visible / loading?

  • 1.  TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-16-2023 10:27

    Hi guys,

    I just installed the current v5.90 pre-release and not sure whether I oversaw any thread or info if there is any news regarding 3rd party macros or similar, as I don´t see any of my own macros neither as ribbon nor as command.

    Is there anything needed to get them loaded by the v5.90?

    Thanks.

    Regards,

    Fernando



    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------


  • 2.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-16-2023 11:18

    Hi again,

    I found in the meantime a different "MacroCommands" folder called "MacroCommands3" and apparently the macros need to be placed there. Is it new or only for the Beta?

    I get the following error message when trying to load my .pydll:

    Is there any info anywhere indicating what needs to be changed in the code to get the own macros loaded in the v5.90?

    Thanks.

    Fernando



    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------



  • 3.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-16-2023 14:04

    Hi Fernando,

    maybe it has to do with changing Ironpython to version 3.xx



    ------------------------------
    Ronny Schneider
    ------------------------------



  • 4.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-17-2023 08:18

    Hi Ronny,

    thanks for the answer. I have now IronPython 3.4 and the strange thing is that it works for up to v5.81 but with v5.90 it needs to be placed in the mentioned new folder "MacroCommands3" and some imports such us winreg, GlobalSelection, smtplib, email.utils, etc are shown as error with v5.90 so I need to remove them or similar.

    Thanks.

    Regards,

    Fernando



    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------



  • 5.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-17-2023 08:45

    The MacroCommands3 folder was added because a lot of people have multiple versions of TBC installed. As you found out the compiled versions do not work between TBC 5.81 and 5.90. Gary decided the best way to handle this was to add the MacroCommands3 folder. Gary was not happy when the Beta meetings did not mention the changes needed to run TMLs.

    There are several web pages out there explaining what needs to changes between the 2 versions. The main things I have had to change are:

    • dictionary usage, ie keys(), value() and iterating through items in a dictionary
    • except syntax from "except Exception, ex" to "except Exception as ex"
    • .None, .True, and .False for enumeration values are no longer allowed. Replace with ["None"], ["True"], and ["False"]. The are some TBC and Infragistics enumerations that have to be "fixed"
    • put a list() around map()
    • all integers are now long values. Nothing really to change but worth nothing
    • division / operations will result in a float value. If you want to do integer division use //

    There are probably a couple more that I've forgotten and I'm still working on converting all of our TMLs.

    Peter



    ------------------------------
    Peter Kistler
    peter.kistler@rockpilesolutions.com
    ------------------------------



  • 6.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-17-2023 08:50

    Hi Peter,

    really appreciate your whole infos !! Ok, then there are some changes and to be honest, it´s really understandable for me that we don´t get that info directly and automatically from Trimble posted on the Community.

    I also found <> lo longer works and instead != is needed and I´m sure I´ll find more as soon as I start "migrating" all my macros

    Thanks again.

    Regards,

    Fernando



    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------



  • 7.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-17-2023 08:51

    BTW do you mean with "compiled versions" that the .pydll´s no longer work with TBC v5.90? this would be a huge issue as our code would be open for everyone...I hope I understood it false...

    Thanks.



    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------



  • 8.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-17-2023 08:58

    You can create pydll versions that work with 5.90 but they have to be compiled with ironpython 3.4.  Put all your 5.81 compatible pydll files in the MacroCommands folder structure. TBC 5.90 compatible pydll files need to be placed in the MacroCommands3 folder structure.



    ------------------------------
    Peter Kistler
    peter.kistler@rockpilesolutions.com
    ------------------------------



  • 9.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-17-2023 08:59

    ok, thanks so much for the infos !!

    Regards,

    Fernando



    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------



  • 10.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-17-2023 15:26

    The change of the macro folder name is completely understandable. With the change of the python syntax you'd otherwise have to try to cover this within the existing macro, put everything in different subroutines and call those in dependence of the found Python/TBC version, that would totally clutter the code. And it would most likely not even start anyway since the syntax check during load would fail.

    Populating the new folder step by step is the only viable way.

    How comes that certain people/companies get those vital information way ahead of release and the rest of us is left in the dark? Changes like this must be published and documented properly and in public in order for the rest of us to prepare for this in an easy/quick/time saving way. I have around 80 macros to convert and test and I'm really not looking forward to that. 



    ------------------------------
    Ronny Schneider
    ------------------------------



  • 11.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-17-2023 16:20

    In TBC 5.9, GlobalSelection is in the Trimble.Vce.Core namespace

    # GlobalSelection moved to Trimble.Vce.Core in TBC 5.90
    try:
        from Trimble.Vce.Core import GlobalSelection
    except:
        from Trimble.Vce.UI.Controls import GlobalSelection

    This is the only namespace change that I am aware of.



    ------------------------------
    Peter Kistler
    peter.kistler@rockpilesolutions.com
    ------------------------------



  • 12.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-18-2023 00:57

    Thanks for this again Peter ;-)

    I think they changed also somehow "License" (or the functions inside) as it does not longer work for me either and I use it pretty much to check the TBC License details via:

    Trimble.Vce.License

    from Trimble.Vce.TbcLicense import HardenedManager as License

    For example License.GetActiveTrimbleID() is no longer recognised.

    So I need to check what they changed and how to get it working again.

    @Peter: You mentioned there are a few websites explaining what was changed, could you please share where they are? Thanks a lot.!

    Regards,

    Fernando



    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------



  • 13.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-19-2023 22:07

    This one is specific to IronPython:

    https://github.com/IronLanguages/ironpython3/blob/v3.4.0-beta1/Documentation/upgrading-from-ipy2.md

    Python:

    https://docs.python.org/3/howto/pyporting.html

    There are others as well.  Stackoverflow is always a good resource as well.



    ------------------------------
    Peter Kistler
    peter.kistler@rockpilesolutions.com
    ------------------------------



  • 14.  RE: TBC v5.90 Prerelease - Own macros not visible / loading?

    Posted 03-20-2023 00:15

    Hi Peter,

    sorry, I thought you meant websites explaining the changes from Trimble side, not from IronPython itself.

    I´m always checking in Stakoverflow for general programming subjects.

    Thanks again !

    Regards,

    Fernando



    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------