Home -
Scripting /
All posts - Import Drawing from SQL via vbscript
gpsit 30 post(s) |
Hi, Does anyone know how to import a drawing from SQL server 2008 as a drawing? I can't use UI scripting as I am running the script outside of manifold. What I have working at the moment is importing the data as a table then linking a drawing to the table. The import script I am using is as follows: //vbscript Set SQLImport=doc.NewImport("SQL Server") SQLImport.ConnectionString = "XXXXXXXX" TableName= "SQLTable" SQLImport.import (TableName) Looking at manifold's object model and browsing the forum it appears that importing a drawing from SQL using NewImport is not possible. Hopefully someone can prove me wrong!
|
|
I don't know how to do it in detail, and I might be wrong, but I think you want Document.NewDataSource() which returns a DataSource object, then DataSource.ConnectionType ["SQL Server"] DataSource.ConnectionString then one of DataSource.ImportDrawing DataSource.LinkDrawing
|
gpsit 30 post(s) |
Cheers this works perfectly! Set SQLImport=doc.NewDataSource() SQLImport.ConnectionString = "XXXXXXX" SQLImport.ConnectionType ="SQL Server" TableName= "dbo.TableName.Geometry" <= needs ".Geometry" added to the tablename SQLImport.ImportDrawing (TableName)
|