Results 1 to 5 of 5
Like Tree4Likes
  • 2 Post By CRapai
  • 1 Post By elton williams
  • 1 Post By CRapai

Thread: Package Management

  1. #1
    Member
    Join Date
    April 30, 2015
    Location
    Michigan
    Posts
    174
    Current Local Time
    10:56 AM

    Package Management

    Wondering what people do for package management around here. Specifically I'm talking about making sure everyone that will be using scripts has the necessary packages to run them. I looked into changing the path to a network location but have heard bad things related to write access that I don't want to deal with. It seems like the best way is to keep the packages on the local drive. I've seen this post about using Inno Setup but to be honest that is over my head. I recently gotten into Python for Dynamo developement and decided I might as well try to do it in a language that I have an understanding of (even if it is very VERY little).

    I plan on compiling this into an .exe and adding it to the login procudure for people. If anyone has a better grasp of python I'd love some input on this because I'm sure I'm doing something wrong. I've tested it on my pc and it appears to work. I also plan to run it on a few people's pcs manually before I deploy it but I'm a bit nervous about implementing my first every working code on a professional level.



    Code:
    import shutil
    import os
    
    # Local standard Packages
    # C:/Users/!!!User Name here!!!/AppData/Roaming/Dynamo/Dynamo Revit/2.0/packages
    
    # Local Prorubim Nodes
    # May need to add later if we start using Dyno for shortcut keys and dynamo script management
    # C:/Program Files/Prorubim Nodes
    
    # !!! Temp Location !!! --Change this to the final location before implementing across company.
    # X:/Revit/Dynamo Dev Temp 19-02-22/Test Python 19-02-22/Packages
    #   X:/Revit/Dynamo Dev Temp 19-02-22/Test Python 19-02-22/Packages/JDRM Packages Version.txt
    
    # Gets current user name fix paths below.
    import getpass
    user_name = getpass.getuser()
    print(user_name)
    
    
    # rmtree delete local
    # copytree copies the directory on network
    def update_package():
        shutil.rmtree("C:/Users/" + user_name + "/AppData/Roaming/Dynamo/Dynamo Revit/2.0/packages")
        shutil.copytree("X:/Revit/Dynamo Dev Temp 19-02-22/Test Python 19-02-22/Packages",
    "C:/Users/" + user_name + "/AppData/Roaming/Dynamo/Dynamo Revit/2.0/packages")
    
    # Checks to see if the version file exists on local drive
    version_local_exists = os.path.isfile("C:/Users/" + user_name + "/AppData/Roaming/Dynamo/Dynamo Revit/2.0/packages/JDRM Packages Version.txt")
    
    
    # If version file doesn't exist it runs update_package function. If it does exist then it checks first line for date.
    if version_local_exists:
        # local version file
        version_local_file = open("C:/Users/" + user_name + "/AppData/Roaming/Dynamo/Dynamo Revit/2.0/packages/JDRM Packages Version.txt", "r")
       version_local_date = version_local_file.read()
       version_local_file.close()
    
        # network version file
        version_network_file = open("X:/Revit/Dynamo Dev Temp 19-02-22/Test Python 19-02-22/Packages/JDRM Packages Version.txt", "r")
       version_network_date = version_network_file.read()
       version_network_file.close()
    
        # print for easier checking in python
        print(version_local_date)
        print(version_network_date)
    
        if version_local_date == version_network_date:
            print("Up to date version on local drive.")
        else:
            update_package()
            print("Upgrade has been run.")
    
    else:
        update_package()
        print("First time install.")
    
    print("C:/Users/" + user_name + "/AppData/Roaming/Dynamo/Dynamo Revit/2.0/packages")
    josephpeel and uaifestival like this.

  2. #2
    Forum Addict elton williams's Avatar
    Join Date
    December 7, 2010
    Location
    Gold Coast
    Posts
    2,502
    Current Local Time
    12:56 AM
    I use a .bat that IT set to run (with group policy or something). It copies packages from network location to users local package folder upon startup.
    johnp likes this.

  3. #3
    Forum Addict josephpeel's Avatar
    Join Date
    May 3, 2012
    Posts
    1,393
    Current Local Time
    03:56 PM
    "Wondering what people do for package management around here."

    Edit node.
    Edit Python.
    Ctrl-C.
    Python from String.
    Ctrl-V.




  4. #4
    Forum Addict josephpeel's Avatar
    Join Date
    May 3, 2012
    Posts
    1,393
    Current Local Time
    03:56 PM
    Serious answer is shared network package folder (No problems so far..) . Or folder in a file synching system like Box if users are offline a lot.
    Maybe someone should make a cloud hosted folder of all packages?
    Last edited by josephpeel; January 30th, 2019 at 03:48 PM.

  5. #5
    Member
    Join Date
    April 30, 2015
    Location
    Michigan
    Posts
    174
    Current Local Time
    10:56 AM
    Quote Originally Posted by josephpeel View Post
    "Wondering what people do for package management around here."

    Edit node.
    Edit Python.
    Ctrl-C.
    Python from String.
    Ctrl-V.



    I've definitely seen post on DynamoBIM about people doing that in fear that a package update will break or remove nodes. I haven't ran into that yet but it lingers in the back of my mind, haunting me.
    josephpeel likes this.

Similar Threads

  1. Replies: 0
    Last Post: June 5th, 2017, 12:45 PM
  2. Replies: 0
    Last Post: October 29th, 2015, 12:15 AM
  3. multiple celings in one ceiling package
    By boriskam1991 in forum Architecture and General Revit Questions
    Replies: 5
    Last Post: August 13th, 2013, 05:54 PM
  4. Moving on to Revit 2013 One box package or not?
    By Parametric Snowman in forum Architecture and General Revit Questions
    Replies: 41
    Last Post: June 25th, 2012, 07:22 PM
  5. Is it possible to accurately import an aerial that comes with a DWG survey package?
    By hclbaumbach in forum Architecture and General Revit Questions
    Replies: 3
    Last Post: February 18th, 2011, 06:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •