Jump to content
Sign in to follow this  

Manage Database Column Names

Recommended Posts

When connecting a Record Format to a ODBC shared Filemaker Database, Vectorworks is only showing the first 6 characters of the databases column names. See attached screenshots for details.

This is causing an error to appear further down the line as Vectorworks can't find the column names.

Is there a way for Vectorworks to read the whole name and not just the first 6 characters?

Share this post

Link to post

That's strange, there is no limitation of column name length in Vectorworks. Vectorworks uses the driver limitations. Filemaker does have limitations, but what I see from the screen shots this is not the case. The maximum column length of text is 1 million characters, unless you specify a smaller Maximum number of characters for the text field in FileMaker. FileMaker returns empty strings as NULL. For more details see here.

Are there any limits for text length?

Share this post

Link to post

Hi Sasha, I updated to 13.0.12 and it seems to be displaying correctly now. Thanks for your help!

On a related note; I wonder if you have had any success with linking a Filemaker Database with IFC data attached to items in Vectorworks via the same ODBC method?

Share this post

Link to post

Speaking in general they could be connected. IFC data is a record, attached to the object So there shouldn't be a problem to connect them. It is not visible in the "Record Format Connection" dialog because it is hidden record. But with script you can reach each record.

The thing is that you have to know which field should be used as key column.

Share this post

Link to post

Since Vectorworks 2015 - yes. Only parametric and user defined records are visible in the "Record Formaat Connection" dialog. IFC records are not available for users to be edited directly.

Share this post

Link to post

Sure! :)

The tricky part was to find out which Psets do I need. The judgment should be made depending on the data in the datable. For my case I used furniture elements.

I wrote a script in Python. It works over selected objects in a document. It traverses the selected objects and creates a IFC and COBie psets for the current object. Fills the values from database table and continues with next selected object. If you select 100 objects you need at least 100 records in the database. If there are less records the script will complete successfully - the IFC records will be created, but the values will be empty.

Why Python? Because it is object oriented (it is easier to write on it), I am able to debug it and has intelli sence option in the most environments. I used Aptana studio ( here and here are articles how to configure the environment. All you need is to debug and write a plugin for Vectorworks is to add these two lines on the top of the page:

import pydevd; pydevd.settrace(suspend=False)
import vs

In Aptana if you write vs. the list of all available functions are listed:


If you create a plugin (e.g. I created a menu command) it should be in the Plugins folder of Vectorworks. Both *.vsm and the *.py files.

In *.vsm file you have to include the Python file:

import menuCommand

where menuCommand.py is the name of the script file.

Here is described how to create a custom menu command.

The entry point of the script is the function:

def execute():
cntObjs	= vs.NumSelectedObjects()
vs.ProgressDlgOpen( 'Create IFC record with data from "' + Data.dsn + '".', False )
vs.ProgressDlgSetMeter( 'Processing ' + str(cntObjs) + ' objects...' )
vs.ProgressDlgStart( 100.0, cntObjs )

# 1. Connect
Data.ok  = vs.DBDocAddConn(Data.dsn, Data.user, Data.password)

# 2. Get CData from DB
query	= 'SELECT * FROM "' + Data.tableName + '"'
Data.ok, Data.cntCols, Data.resultSet = vs.DBSQLExecuteDSN(Data.dsn, Data.user, Data.password, query)
if Data.ok:
	# 2. Generate records
	vs.ForEachObjectInLayer(ProcessObject, 2, 2, 1)

	# Clear values
	vs.DBSQLExecuteDelete( Data.resultSet )


I used the following class as global class to represents the data, required for the database connection:

class Data:
# CUSTOMIZE THESE: database and table data 
dsn			= 'FM'
user			= 'admin'
password		= ''		
tableName		= 'Stockpile'

# DO NOT CHANGE!!! IFC record data
recordName		= 'IfcFurnishingElement'

# DO NOT CHANGE!!! traverse variables
row			= 0
ok			= False
cntCols			= 0
resultSet		= 0
cntObjs			= 0
dbNext			= True

Here is the last function who does the main part of the job.

def ProcessObject(h):
Data.row	= Data.row + 1
if Data.row > 1:
	Data.dbNext = vs.DBSQLExecuteNext( Data.resultSet )

#	1. Create IFC records
Data.ok	= vs.IFC_SetIFCEntity(h, Data.recordName)
if Data.ok :
	Data.ok	= vs.IFC_AttachPset(h,	'Pset_ManufacturerTypeInformation')
	Data.ok	= vs.IFC_AttachPset(h,	'Pset_ManufacturerOccurrence')
	Data.ok	= vs.IFC_AttachPset(h,	'COBie_Asset')
	Data.ok	= vs.IFC_SetPsetProp(h,	'COBie_Asset',	'AssetType',	'Movable')
	Data.ok	= vs.IFC_AttachPset(h,	'COBie_Specification')

	for col in range(1, Data.cntCols):
		Data.ok, colName, colValue	= vs.DBSQLExecuteGet( Data.resultSet, col )

		if colName == 'Item':
			Data.ok	= vs.IFC_SetEntityProp(h,	'Name', 		colValue)
			Data.ok	= vs.IFC_SetEntityProp(h,	'ObjectType',	colValue)
			Data.ok	= vs.IFC_SetPsetProp(h,		'Pset_ManufacturerTypeInformation',	'ModelLabel',	colValue)

		elif colName == 'Part Number':
			Data.ok	= vs.IFC_SetEntityProp(h,	'Tag',			colValue)
			Data.ok	= vs.IFC_SetPsetProp(h,		'Pset_ManufacturerTypeInformation',	'ArticleNumber',	colValue) 

		elif colName == 'Model Year':
			 Data.ok	= vs.IFC_SetPsetProp(h,	'Pset_ManufacturerTypeInformation',	'ProductionYear',	colValue)

		elif colName == 'Manufacturer':
			 Data.ok	= vs.IFC_SetPsetProp(h,	'Pset_ManufacturerTypeInformation',	'Manufacturer',	colValue)

		elif colName == 'Bar Code':
			Data.ok	= vs.IFC_SetPsetProp(h,	'Pset_ManufacturerOccurrence',	'BarCode',	colValue)

		elif colName == 'Dimensions':
			Data.ok	= vs.IFC_SetPsetProp(h,	'COBie_Specification',	'Size',	colValue)
	vs.ProgressDlgYeld( 1 )

Mine test database is Filemaker database and the DSN name I used is called "FM". My table is called "Stockpile" and here is the structure: view?usp=sharing.

And that's all. Enjoy! :)

Edited by Sasha

Share this post

Link to post

Hi Sasha, thanks for all of the above. I have managed to get it to work successfully now, however I am struggling to see how you attach specific Filemaker records to a specific symbol in Vectorworks.

All of our items have a unique reference number which should be able to act as the key to link the Filemaker record to the relevant symbol in VWKs.

I wonder if this is something that can be done?

Thanks again.

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.

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.

  • Create New...