Jump to content

Callout Active Database by API

Recommended Posts

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.

Share this post

Link to post

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' )


Share this post

Link to post

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.

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.


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.

  • Create New...