Jump to content

Alexandra Beshevlieva

Vectorworks, Inc Employee
  • Posts

    41
  • Joined

  • Last visited

Reputation

6 Neutral

Personal Information

  • Location
    Bulgaria

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. The WFS/WMF connectivity issues are addressed for the Vectorworks 2025. Thank you for feedback and reporting!
  2. It seems we have a problem with one of the third party libraries we use to manage GIS data. I'll keep you updated.
  3. Hi Emile, How you have configured the service in "Manage Service or Portal List" dialog - as WMS or WFS?
  4. Yes, in OIP the "-" is treated as separator, but in worksheets it is just a value.
  5. Yes If you are using FileMaker 13, you need the Server edition to use ODBC. If the machine where Vectorworks is not the server machine, you need to enter the IP address to the server in the DSN.
  6. What kind of data do you want link? The attached IFC data?
  7. Hello Mikay! For Filemaker please make sure that you have defined properly the DSN. The file must be opened and shared in Filemaker application. Also, there is default user name 'Admin'.
  8. Hello Mikaymikz! DBObjSQLSetWrite sets the SQL sentence used to update data from object to database. This is not your case. DBObjSQLGetWrite gets the SQL sencente used to update data from object to databsse. This is not your case either. DBSQLExecuteDSN executes a query directly to the specified datasource name. You send the DSN name, username, password and query as input parameters. That is your case Here is and example how to use it. DBSQLExecute is like the function above but you pass as parameter only the datasource name and it must be registered to the ODBC manager earlier.
  9. Actually the worksheet uses the same data which the ODBC uses - the data from the objects. All you need is to connect records you need to the external database.
  10. 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!
  11. Here is a sample how to use it. PROCEDURE Test; VAR ok : BOOLEAN; message, state, internalDesc : DYNARRAY[] OF CHAR; code, colCnt, resSetInst : LONGINT; BEGIN ok := DBDocAddConn( 'MyTestODBCDatabase', '', '' ); ok := DBSQLExecuteDSN( 'MyTestODBCDatabase', '', '', 'SELECT * FROM Spaces', colCnt, resSetInst ); IF NOT ok THEN BEGIN ok := DBSQLExecuteError(message, state, code, internalDesc); AlrtDialog(Concat('state: ', state, Chr(13), 'message: ', message, Chr(13), 'code: ', code, Chr(13), 'intDesc: ', internalDesc)); END; END; RUN(Test);
  12. Hi willcfg! I tried to create IFC records from Filemaker database using ODBC and it works!
  13. 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.
×
×
  • Create New...