Jump to content
Sign in to follow this  
Musisback

External Python Packages

Recommended Posts

Hello,

I use external packages in python. I'm wondering what's the best way to distribute them to the plug-ins users. It's apparently bad to place them in the plug-ins folder because Vectorworks goes through all the subfolders of "Plug-ins" at startup looking for plug-ins files

I think I could create a Python folder in the user application folder.

Do you think it can be damaging to the application to have an extra folder full of subfolders in the user's application folder (next to Plug-ins, Libraries, Workspaces, ...) ?

Do you have better ways to distribute external python packages ?

Thank you,

Regards,

Share this post


Link to post

Short answer -- yes, you can provide a directive to VW's encryption process to include modules. Just as with encrypting VS, the module gets sucked into to the distributed plug-in.

They key is including an xml file with the same name and in the same location as the plug-in you wish to package.




{full path to plug-in to encrypt}
{relative path to module file 1}
{relative path to module file 2}


Notes:

- The xml flags are case sensitive

- Use the Path parameter if you are packaging a file the resides outside of your plug-ins folder (I keep all my code files in Dropbox and manage with git

Example:

I have a project in:

Users/myname/Projects/Project 1

In the Project 1 folder I have:

|_ _Encrypt

|_ thePlugin.vso

|_ thePlugin.xml

|_ lib

|_ __.init__.py

|_ piolib.py

|_ thePlugin

|_ __.init__.py

|_ _main.py

The xml looks like:




/Users/myname/Projects/Project 1/_Encrypt/
thePlugin/_main.py
lib/piolib.py


It's been a while since I got this working smoothly, so feel free to contact me privately with questions.

-Josh

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×