Make Parts visible in Assembly.....?

 

Hi Jason,

i think i am disturbing you almost daily. But i have a problem regarding parts in assembly. i have a assembly, in that parts are hide. i want open that asm and make the parts visible(hide). i tried following code but it is not working. please take a look at it and suggest me the solution

Dim oSEApp As SolidEdgeFramework.Application

Dim oSEAsm As SolidEdgeAssembly.AssemblyDocument

Dim objOccs As SolidEdgeAssembly.Occurrences

Dim objOcc As SolidEdgeAssembly.Occurrence

Dim i as Integer

oSEAsm = oSEApp.Documents.Open(asm_path)

oSEAsm = oSEApp.ActiveDocument

oSEAsm.SaveAs(savepath & "\" & "1212.asm")

objOccs = oSEAsm.Occurrences

     For i = 1 To objOccs.Count

         objOcc = objOccs.Item(i)

         objOcc.Visible = True

     Next

oSEAsm.UpdateDocument()

oSEAsm.Save()

oSEAsm.Close()

Thanks in advance

Prasad Pawar

(Design Automation Engineer)

 

Posted by: Prasad Pawar
Post date: 9/28/2007 12:56:10 AM

5 REPLIES

RE: Make Parts visible in Assembly.....?

 

 

You didn't mention what part was not working, but I noticed the below:

 

Try removing the line:

 

objOcc = objOccs.item(i)

 

and change "objOcc.Visible = True" to "objOccs(i).Visible = True"

 

- Bill

 

Posted by: Bill Ledbetter
Post date: 9/28/2007 4:35:25 AM

RE: Make Parts visible in Assembly.....?

 

Hi Bill,

Thanks for your reply but it is still not working I have attached jpg file so that you will get clear idae.

Thanks again

 

Posted by: Prasad Pawar
Post date: 9/28/2007 5:56:07 PM

RE: Make Parts visible in Assembly.....?

Can you please post your entire code segment, because from what you have in your initial post, you are not even connecting to an instance of Solid Edge. Is this a sub-routine in a bigger program? If so, at what line of code is it failing? I had only looked at your For loop.

 

Posted by: Bill Ledbetter
Post date: 9/29/2007 3:52:36 AM

RE: Make Parts visible in Assembly.....?

Hi Bill,

Yes,it is a sub-routine of a program. The code is working fine without any error but nothing get revealed in the assembly. parts still remain hide.:-(

 

Posted by: Prasad Pawar
Post date: 9/30/2007 5:42:56 PM

RE: Make Parts visible in Assembly.....?

I'm not sure what to tell you. The following code below works for me in V20:

 

Option Explicit

 

Public objApp As SolidEdgeFramework.Application

Public i As Integer

Sub Main()

 

Set objApp = GetObject(, "SolidEdge.Application")

 

With objApp.ActiveDocument.Occurrences

For i = 1 To .Count

.Item(i).Visible = True

Next

End With

End Sub

 

 

 

Posted by: Bill Ledbetter
Post date: 10/1/2007 1:54:47 AM