willcfg Posted September 16, 2014 Share Posted September 16, 2014 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? Quote Link to comment
willcfg Posted September 18, 2014 Author Share Posted September 18, 2014 Downloaded the Vectorworks 2015 trial to see if the above still happened and unfortunately it does. Quote Link to comment
Vectorworks, Inc Employee Alexandra Beshevlieva Posted September 23, 2014 Vectorworks, Inc Employee Share Posted September 23, 2014 Which FileMaker driver do you use? I cannot see the problem with FM12. Quote Link to comment
willcfg Posted September 23, 2014 Author Share Posted September 23, 2014 Filemaker Pro 13. For your reference, I was following this guide when setting up the connections. It works fine with fewer than 6 characters. ODBC Connectivity in Vectorworks Quote Link to comment
Vectorworks, Inc Employee Alexandra Beshevlieva Posted September 25, 2014 Vectorworks, Inc Employee Share Posted September 25, 2014 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? Quote Link to comment
Vectorworks, Inc Employee Alexandra Beshevlieva Posted September 25, 2014 Vectorworks, Inc Employee Share Posted September 25, 2014 (edited) By the way, in the FileMaker 13's package is the ODBC driver version 13. That is yours, right? You can check it by clicking the About button in the "FileMaker DSN Configuration" dialog. Edited September 25, 2014 by Sasha Quote Link to comment
willcfg Posted September 25, 2014 Author Share Posted September 25, 2014 Ah, mine is showing version 12.3.103, same as yours. I'll try and find version 13 and see if that works. Quote Link to comment
willcfg Posted September 26, 2014 Author Share Posted September 26, 2014 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? Quote Link to comment
Vectorworks, Inc Employee Alexandra Beshevlieva Posted September 30, 2014 Vectorworks, Inc Employee Share Posted September 30, 2014 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. Quote Link to comment
willcfg Posted October 1, 2014 Author Share Posted October 1, 2014 So it is theoretically possible, but only with a custom script? Quote Link to comment
Vectorworks, Inc Employee Alexandra Beshevlieva Posted October 2, 2014 Vectorworks, Inc Employee Share Posted October 2, 2014 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. Quote Link to comment
Vectorworks, Inc Employee Alexandra Beshevlieva Posted October 21, 2014 Vectorworks, Inc Employee Share Posted October 21, 2014 Hi willcfg! I tried to create IFC records from Filemaker database using ODBC and it works! Quote Link to comment
willcfg Posted October 21, 2014 Author Share Posted October 21, 2014 Oh excellent. Please could you tell me how you managed to do it? Quote Link to comment
Vectorworks, Inc Employee Alexandra Beshevlieva Posted November 11, 2014 Vectorworks, Inc Employee Share Posted November 11, 2014 (edited) 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 menuCommand.execute() 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 ) vs.ProgressDlgEnd vs.AlrtDialog('Ready.') else: vs.AlrtDialog('Failed.') 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: . And that's all. Enjoy! Edited November 12, 2014 by Sasha Quote Link to comment
willcfg Posted December 2, 2014 Author Share Posted December 2, 2014 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. Quote Link to comment
Vectorworks, Inc Employee Alexandra Beshevlieva Posted December 3, 2014 Vectorworks, Inc Employee Share Posted December 3, 2014 What kind of data do you want link? The attached IFC data? 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.