Insert Assembly

 

Hi there.  I'm using VB 6 for and Solid Edge Version 19.  I want to be able to open up a Weldment template and insert an existing Assembly file.  Here is the code I am trying to use

Set objApp = GetObject(, "SolidEdge.Application"

 

            If Err Then

                Err.Clear

                Set objApp = CreateObject("SolidEdge.Application"

                Set objDoc = CreateObject("SolidEdge.WeldmentDocument"

                objApp.Visible = True

            Else

                Set objDoc = objApp.ActiveDocument

            End If

            Set objDoc = objApp.Documents.Open("\\engserver\Templates\Normal.pwd"

            Call objDoc.Add("C:\Temp\asm2.asm"

I'm getting an error "Object doesn't support this property or method"

I'm obviously missing something or the add method doesn't work with the document object but I've never tried to do this before and examples that come in the programming help for SE are pretty much non-existant for this type of thing.

 

Posted by: sean tormey
Post date: 8/20/2007 6:46:09 AM

4 REPLIES

RE: Insert Assembly

 

 

Try this code.

 Dim asm as SolidEdgeAssembly.AssemblyDocument

Set asm=objApp.Documents.Add("SolidEdge.AssemblyDocument","\\engserver\templates\normal.asm")

asm.WeldmentAssembly=True

asm.Occurrances.AddByFilename("C:\Temp\asm2.asm")

 

Posted by: Brian Magill
Post date: 8/20/2007 8:10:26 AM

RE: Insert Assembly

 

Thanks for the reply, unfortunatly I'm getting the same error on the last line.

"Object doesn't support this property or method"

 

Posted by: sean tormey
Post date: 8/20/2007 8:44:16 AM

RE: Insert Assembly

Occurrences not Occurrances

 

Posted by: Jason Newell
Post date: 8/21/2007 7:31:08 AM

RE: Insert Assembly

Spelling has never been my strong suite.

 

And the Compile should have caught it.

 

Posted by: Brian Magill
Post date: 8/21/2007 7:35:08 AM