JpPhysics
Mechanical
- Mar 25, 2002
- 35
I am trying to automate the process of converting thousands of MDT files to Solidworks. We have already broken down our product lines into part types and have begun the process of creating part files and configurations. What I need now is an automated way to output drawing files. I have a template drawing set up with the dimension scheme that I like. I just need to be able to cycle through the configurations and do a save copy as with the configuration name as the name of the file.
The only part of this routine that I am having problems with is the cycling through the configurations. I cannot seem to grab the available configurations from the view. Am I doing something wrong? Do I need to load the part/assembly file to grab the configurations?
Any Ideas?
My Sample Code:
Option Explicit
Dim swApp As Object
Dim Drawing As SldWorks.DrawingDoc
Sub main()
Dim View As SldWorks.View
Dim Model As String
Dim Configuration As String
Set swApp = CreateObject("SldWorks.Application"
Set Drawing = swApp.ActiveDoc
Set View = Drawing.IGetFirstView()
Set View = View.GetNextView
Model = View.GetReferencedModelName
Configuration = View.ReferencedConfiguration
End Sub
The only part of this routine that I am having problems with is the cycling through the configurations. I cannot seem to grab the available configurations from the view. Am I doing something wrong? Do I need to load the part/assembly file to grab the configurations?
Any Ideas?
My Sample Code:
Option Explicit
Dim swApp As Object
Dim Drawing As SldWorks.DrawingDoc
Sub main()
Dim View As SldWorks.View
Dim Model As String
Dim Configuration As String
Set swApp = CreateObject("SldWorks.Application"
Set Drawing = swApp.ActiveDoc
Set View = Drawing.IGetFirstView()
Set View = View.GetNextView
Model = View.GetReferencedModelName
Configuration = View.ReferencedConfiguration
End Sub