Jump to content
Developer Wiki and Function Reference Links ×

Workgroup folder


Recommended Posts

  • 2 weeks later...

Hi

 

As far as I know on Windows it is stored in the Registry in Current User and on Mac in the User/Library/Preferences. I am not sure if this works in your situation. With python I think it is easier to get access to the system files. Maybe this also would work with a pascal script ...

 

Windows:

from winreg import *
aReg = ConnectRegistry(None,HKEY_CURRENT_USER)
aKey = OpenKey(aReg, r"Software\Nemetschek\Vectorworks 24\General")
WGF_Path = QueryValueEx(aKey, "Workgroup Folder 0")
#vs.Message(WGF_Path[0]) 
target = WGF_Path[0]

 

Macintosh:

import plistlib

MacFile = 'Users/userName/Library/Preferences/net.nemetschek.vectorworks.2019.plist'

pl = {}
with open(MacFile, 'rb') as fp:
    pl = plistlib.load(fp)
    

vs.AlrtDialog(str(pl.get("NNA Workgroup Folders")))
vs.AlrtDialog(pl["NNA Workgroup Folders"])

 

I needed this for a quick and dirty job. For sure it could be enhanced as Example by not using a fix path for the user Name:

 

import getpass
var_username = getpass.getuser()

 

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...