JasonTaylor Posted October 19, 2017 Share Posted October 19, 2017 Anybody know if it is possible to set the call out active database for the current file by the API (python)? Quote Link to comment
Pat Stanford Posted October 19, 2017 Share Posted October 19, 2017 I don't believe this is directly accessible via Vectorscript or Pythonscript. A potential work around would be a multi-file system and use the OS to make the switch. Set VW to us MyActiveDatabase.XML When you need to switch databases, use the standard Python file handling routines to save MyActiveDatabase as DatabaseOne and then rename (or copy) DatabaseTwo to MyActiveDatabase. Or this might not work as MyActiveDatabase might be one of those things that is only read in at initial load time or when manually changed. Probably worth the 15 minutes to try it. Quote Link to comment
JasonTaylor Posted November 23, 2017 Author Share Posted November 23, 2017 Got an official response import vs import os import webbrowser from tkinter import Tk def execute(): vs.AlrtDialog( 'This script will set a different Callout database per Vectorworks file. Specify xml file in the next dialog.' ) title = 'Select xml database file...'; defaultFolder = vs.GetFolderPath(14) + 'Notes'; mask = 'xml'; ok, fileName = vs.GetFileN(title, defaultFolder, mask) if ok: gObjName = 'Callout' h = vs.GetObject(gObjName) vs.SetRField( h, gObjName, 'Link To Database', 'True' ) vs.SetRField( h, gObjName, '__dbName', fileName ) vs.SetRField( h, gObjName, '__dbUUID', '{F2920FA1-ADE2-4ECA-A796-71FA67CD89E7}') vs.AlrtDialog( 'Assigned an xml file as Callout database per Vectorworks file' ) execute() 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.