Michael Gilbert Posted February 24, 2017 Share Posted February 24, 2017 I have just been opening some very old files created in I think VW 10. 2017 appears to open no problem but we have some scripts for which I get error message. If I open the plug-in using Textwrangler the following jumps off the screen: #show dialog here question = 'Python module ' + missingLib + ' is not installed. Would you like to download and install it now?' res = vs. AlertQuestion(question,'', 1,'','','','') if res == 1 : if sys.platform == 'win32': piploc = 'Python33\Scripts\pip.exe' pathpip = 'Python33\Scripts' cdpath = os.path.join(appfolder, pathpip) cmdpip = os.path.join(appfolder, piploc) wd = os.getcwd() if os.path.exists(cmd) and os.path.exists(cmdpip): os.chdir(cdpath) ret_code = subprocess.call([cmdpip, 'install', missngLibURL, '-t', cmd ]) if ret_code > 0: vs.AlrtDialog('Module ', missingLib, ' cannot be downloaded.'); exit_code = False else: exit_code = True sys.path.append(cmd) os.chdir(wd) elif sys.platform == 'darwin': import pip import urllib.request pos1 = missngLibURL.rfind('/') pos2 = missngLibURL.rfind('whl') downloadedfile = missngLibURL[pos1+1:pos2] downloadedfile = downloadedfile+'whl' urllib.request.urlretrieve(missngLibURL, appuserfldr + downloadedfile) ret_code = pip.main(['install', appuserfldr + downloadedfile, '-q', '--target', cmd ]) if ret_code > 0: vs.AlrtDialog('Module ', missingLib, ' cannot be downloaded.'); exit_code = False else: Anyone advise as to how, what, where "Python module ' + missingLib + " Many thanks Michael Quote Link to comment
JBenghiat Posted February 24, 2017 Share Posted February 24, 2017 This appears to be a bit of helper code to download a missing module passed to this function. I don't think this is the source of your issues. What error messages are you receiving? -Josh Quote Link to comment
DomC Posted February 24, 2017 Share Posted February 24, 2017 This looks as a part of the Marionette method to automatically install a used python module. Quote Link to comment
Pat Stanford Posted February 24, 2017 Share Posted February 24, 2017 And neither makes sense from a VW10 file as Python was not introduced until VW2012(?). It must be from a newer version than you think to have Python. Quote Link to comment
Michael Gilbert Posted March 5, 2017 Author Share Posted March 5, 2017 Hi think I messed up versions as nomenclature confuses me. We are still using old PPC's and are making the "Great Leap Forward" to 2017! New OS, new VW, new everything. VW Room Script is what I am trying to get working. Any advice much appreciated. Also, are there any script developers for VW on this or any other site? Thanks Michael VW Room Script.txt Quote Link to comment
MullinRJ Posted March 5, 2017 Share Posted March 5, 2017 (edited) Hi Michael, The main problem with the script is all the Classic Dialog calls (the ones in this script) are now obsolete. All dialogs must now use Modern Dialog calls. Here's a list of the Classic Dialog calls on the left and the corresponding Modern Dialog calls on the right. If you plan to do all of the edits yourself, you will need to get familiar with the VS Function Reference, which can be found in your VW application folder in the VWHelp>Script Reference folder, or online at http://developer.vectorworks.net/index.php/VS:Function_Reference CLASSIC MODERN AddButton CreatePushButton, CreateCheckBox, CreateRadioButton AddChoiceItem CreatePullDownMenu AddField CreateStaticText, CreateEditText, CreateEditTextBox, CreateEditInteger, CreateEditReal AddGroupBox CreateGroupBox, CreateCheckBoxGroupBox, CreateRadioButtonGroupBox AddHelpItem SetHelpText BeginDialog CreateLayout ClrDialog --- DelChoice RemoveChoice DialogEvent RunLayoutDialog DrawDialog --- EndDialog --- GetChoiceStr GetChoiceText GetDialog --- GetField GetItemText, GetMultilineText GetSelChoice GetSelectedChoiceInfo InsertChoice AddChoice ItemSel GetBooleanItem NumChoices GetChoiceCount SelChoice SelectChoice SelField SelectEditText SetField SetItemText SetHelpString SetHelpText SetItem SetBooleanItem SetItemEnable EnableItem SetTextEditable EnableTextEdit SetTitle --- You'll also need to write a dialog event handler procedure. When you get that far, write back and I or someone else will help you with it. If you want help offline, PM me. HTH, Raymond Edited March 5, 2017 by MullinRJ Quote Link to comment
Recommended Posts
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.