Dynamic Draft File

Hi,

I am writing a program in VBA 2003 for Solid Edge V20 files.  My vision for this program is that by inputting the dimensions in the excel spread sheet, then clicking a control button in the excel sheet it will open the part file the excel sheet is driving.  The part file is updated then saved, and the code also saves a copy in a designated folder.  Then the program opens a draft file which produces a draft of the excel driven part. The draft automatically updates most of the dimensions in the draft, but I used call outs and variables for dimensions on some holes.  These variables are linked to the dimensions put in the driving excel sheet.  The problem is that these call outs are not updating when the draft file opens.  My code is pasted below.  This would really help me out a lot.

Thanks in advance

 

 

 

Dim objApp As SolidEdgeFramework.ApplicationDim objDoc As SolidEdgePart.PartDocumentOn Error Resume NextSet objApp = GetObject(, "SolidEdge.Application")If Err ThenErr.ClearSet objApp = CreateObject("SolidEdge.Application")Set objDoc = objApp.Documents.Add("SolidEdge.PartDocument")objApp.Visible = TrueElseSet objDoc = objApp.ActiveDocumentEnd IfCall objDoc.CloseSet objDoc = objApp.Documents.Open("W:\JohnCrane\JMOR\MFGENG\CAD-CAM\Templates\Collar_Template\COLLAR_FILE.par")Call objDoc.SaveCopyAs("W:\JohnCrane\JMOR\MFGENG\CAD-CAM\Saved_Parts\Collar_Files\Part_Files\Collar_" & Name & ".par")objDoc.SaveCall objDoc.CloseSet objApp = NothingSet objDoc = Nothing

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Dim jApp As SolidEdgeFramework.ApplicationDim jDoc As SolidEdgeDraft.DraftDocumentOn Error Resume NextSet jApp = GetObject(, "SolidEdge.Application")If Err ThenErr.ClearSet jApp = CreateObject("SolidEdge.Application")Set jDoc = jApp.Documents.Add("SolidEdge.DraftDocument")ElseSet jDoc = jApp.ActiveDocumentEnd If

Set jDoc = jApp.Documents.Open("W:\JohnCrane\JMOR\MFGENG\CAD-CAM\Templates\Collar_Template\Dynamic_Draft_Collar_0001.dft")

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Dim oSEAppa As SolidEdgeFramework.ApplicationDim objDoca As SolidEdgeDraft.DraftDocumentDim objSheeta As SolidEdgeDraft.SheetDim objlinea As SolidEdgeFrameworkSupport.Line2d

Dim objModelLinkab As SolidEdgeDraft.ModelLinkDim objModelLinka As SolidEdgeDraft.ModelLinkSet oSEAppa = GetObject(, "SolidEdge.application")Set objDoca = oSEAppa.ActiveDocumentSet objSheeta = objDoca.ActiveSheet

Set objModelLinkab = objDoca.ModelLinks(1)Set objModelLinka = objDoca.ModelLinks(2)objModelLinkab.UpdateViewsobjModelLinka.UpdateViews

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Call jDoc.SaveCopyAs("W:\JohnCrane\JMOR\MFGENG\CAD-CAM\Saved_Parts\Collar_Files\Draft_Files\Collar_" & Name & ".dft")jDoc.SaveCall jDoc.CloseSet jApp = NothingSet jDoc = Nothing

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Dim jAppa As SolidEdgeFramework.ApplicationDim jDoca As SolidEdgeDraft.DraftDocumentOn Error Resume NextSet jAppa = GetObject(, "SolidEdge.Application")If Err ThenErr.ClearSet jAppa = CreateObject("SolidEdge.Application")Set jDoca = jAppa.Documents.Add("SolidEdge.DraftDocument")ElseSet jDoca = jAppa.ActiveDocumentEnd IfSet jDoca = jAppa.Documents.Open("W:\JohnCrane\JMOR\MFGENG\CAD-CAM\Saved_Parts\Collar_Files\Draft_Files\Collar_" & Name & ".dft")Call jDoca

jDoca.Save

 

Posted by: jason Haslag
Post date: 8/11/2011 8:46:54 AM