cwcookman
Newbie

Posts: 47
|
 |
« Reply #1 on: August 01, 2009, 12:56:24 pm » |
|
I was able to figure it out and thought I would post the solution.
Run this in an Excel VBA module with a reference set to TurboCad v4.1 programmable objects.
Sub Drawing_Extents() 'Gets the full drawing extents in world coordinates 'Declare variables Dim TurboCad_Application As IMSIGX.Application Dim Bounding_Box As IMSIGX.BoundingBox Dim Drawing_Graphics As IMSIGX.Graphics 'Create a reference to the current instance of TurboCad Set TurboCad_Application = GetObject(, "TurboCAD.Application") 'Create a reference to the Graphics Collection of the Active Drawing Set Drawing_Graphics = TC_app.ActiveDrawing.Graphics 'Create a reference to the Bounding Box that encompasses theGraphics Collection of the 'Active Drawing Set Bounding_Box = Drawing_Graphics.CalcBoundingBox 'Print the bounding box limits to the debug window Debug.Print "min: " & Bounding_Box.Min.X & ", " & Bounding_Box.Min.Y & ", " &_ Bounding_Box.Min.Z Debug.Print "max: " & Bounding_Box.Max.X & ", " & Bounding_Box.Max.Y & ", " &_ Bounding_Box.Max.Z 'Set all references to nothing Set Bounding_Box = Nothing Set Drawing_Graphics = Nothing Set TurboCad_Application = Nothing End Sub
|