Update on save as status ST8

Creator
Creator

Hello everybody,

I checked  Update on save as status on an asm with this code

 

Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objDocuments As SolidEdgeFramework.SolidEdgeDocument = Nothing
Dim objPhyProps As SolidEdgeAssembly.PhysicalProperties = Nothing

objApplication = Activator.CreateInstance(Type.GetTypeFromProgID("SolidEdge.Application"))
objApplication.Visible = True
objApplication.DisplayAlerts = False

objDocuments = objApplication.Documents.Open("C:\test.asm")
objDocuments = objApplication.ActiveDocument
objPhyProps = objDocuments.PhysicalProperties

objPhyProps.UpdateOnFileSaveStatus = True
objPhyProps.UseQuantityOverrideMass = True
objPhyProps.Update() 

'......

but when i save this assembly, mass properties does not update.

 

if I check it with mouse mass properties update well.

 

anybody has an idea?

 

 

9 REPLIES

Re: Update on save as status ST8

Valued Contributor
Valued Contributor

Re: Update on save as status ST8

Creator
Creator
Thank you BalamuruganM But I know how to update physical properties. I'm in ST8 and I need to update physical properties with Solid Edge save. So I checked by code the checkbox : Update on file save in physical Properties windows. with this code objPhyProps.UpdateOnFileSaveStatus = True and it work. the problem is when I checked the checkbox by code and a draftman change asm and save, Solid Edge does not update Mass ???? If I checked the checkbox by mouse click and a draftman change asm and save, Solid Edge update Mass. Why? Thank you

Re: Update on save as status ST8

Creator
Creator
IR number : 7601269 It will be fix on ST9

Re: Update on save as status ST8

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Thanks for filing an IR so that it will get fixed in the future.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Update on save as status ST8

Creator
Creator

Hello everybody!

I know I open it again but I recently instaled ST9 and still doesn't work even if they said it was fix on ST9.

(IR number : 7601269)

 

I submit again to GTAC and they tell  the code is available so they won't go further.

 

Any idea to help me on that?

 

This the code who checked the option Update on save as but doesn`t react as check manually.

 

 

Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objDocuments As SolidEdgeFramework.SolidEdgeDocument = Nothing
Dim objPhyProps As SolidEdgeAssembly.PhysicalProperties = Nothing

objApplication = Activator.CreateInstance(Type.GetTypeFromProgID("SolidEdge.Application"))
objApplication.Visible = True
objApplication.DisplayAlerts = False

objDocuments = objApplication.Documents.Open("C:\test.asm")
objDocuments = objApplication.ActiveDocument
objPhyProps = objDocuments.PhysicalProperties

objPhyProps.UpdateOnFileSaveStatus = True
objPhyProps.UseQuantityOverrideMass = True
objPhyProps.Update() 

'......

 

Re: Update on save as status ST8

Siemens Phenom Siemens Phenom
Siemens Phenom

I think you have the wrong IR number.  When I reviewed IR 7601269 it is for "User Section AD tab is visible with 'Customized Metrics Calculator' not loaded" on another SIemens PLM product line.

Re: Update on save as status ST8

Creator
Creator

oopss ! it's 7601296

Re: Update on save as status ST8

Creator
Creator

 

Hello everybody!
I know I open it again but I recently instaled ST10 and still doesn't work.

I checked Update on file save on an asm in physical Properties windows with this code
This is the code who checked the option Update on file save but doesn`t react as check manually.

 

Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objDocuments As SolidEdgeFramework.SolidEdgeDocument = Nothing
Dim objPhyProps As SolidEdgeAssembly.PhysicalProperties = Nothing

objApplication = Activator.CreateInstance(Type.GetTypeFromProgID("SolidEdge.Application"))
objApplication.Visible = True
objApplication.DisplayAlerts = False

objDocuments = objApplication.Documents.Open("C:\test.asm")
objDocuments = objApplication.ActiveDocument
objPhyProps = objDocuments.PhysicalProperties

objPhyProps.UpdateOnFileSaveStatus = True
objPhyProps.UseQuantityOverrideMass = True
objPhyProps.Update() 

'......

and the check box is checked.

but when i save this assembly, Physical Properties are stil out-of-date.
if I check it by mouse click Physical Properties are up-to-date.

I realy realy need to check (Update on file save) on all old asm by code.

last year I submit to GTAC and they tell the code is available so they won't go further.
If my code is worng, what is the good one?
anybody has an idea?

Thanks in advance.
See attach video

(view in My Videos)

Re: Update on save as status ST8

Creator
Creator

If we check (Update on file save) checkbox  by code with sendkeys, it work.

 

 

   Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objDocuments As SolidEdgeFramework.SolidEdgeDocument = Nothing

        AppActivate("Solid Edge ST8")

        objApplication = Marshal.GetActiveObject("SolidEdge.Application")

        objDocuments = objApplication.Documents.Open("C:\test.asm")

        '==============================================
        'open physical properties windows
        My.Computer.Keyboard.SendKeys("{F12}")
        '==============================================

        If Not (objApplication Is Nothing) Then
            Marshal.ReleaseComObject(objApplication)
            objApplication = Nothing
        End If

        GC.Collect()
        GC.WaitForPendingFinalizers()
        GC.Collect()
        GC.WaitForPendingFinalizers()

        '==============================================
        'position on (Update on file save) checkbox
        For i = 1 To 21
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")

            My.Computer.Keyboard.SendKeys("{TAB}")

            If Not (objApplication Is Nothing) Then
                Marshal.ReleaseComObject(objApplication)
                objApplication = Nothing
            End If

            GC.Collect()
            GC.WaitForPendingFinalizers()
            GC.Collect()
            GC.WaitForPendingFinalizers()
        Next
        '==============================================


        objApplication = Marshal.GetActiveObject("SolidEdge.Application")
        'check (Update on file save) checkbox
        '==============================================
        My.Computer.Keyboard.SendKeys(Chr(32))
        '==============================================

        If Not (objApplication Is Nothing) Then
            Marshal.ReleaseComObject(objApplication)
            objApplication = Nothing
        End If

        GC.Collect()
        GC.WaitForPendingFinalizers()
        GC.Collect()
        GC.WaitForPendingFinalizers()


        'position on close button
        '==============================================
        For i = 1 To 2
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")

            My.Computer.Keyboard.SendKeys("{TAB}")

            If Not (objApplication Is Nothing) Then
                Marshal.ReleaseComObject(objApplication)
                objApplication = Nothing
            End If

            GC.Collect()
            GC.WaitForPendingFinalizers()
            GC.Collect()
            GC.WaitForPendingFinalizers()
        Next
        '==============================================

        objApplication = Marshal.GetActiveObject("SolidEdge.Application")

        'close physical properties windows
        '==============================================
        My.Computer.Keyboard.SendKeys("{ENTER}")
        '==============================================

        objDocuments.Save()
        objDocuments.Close()

        If Not (objApplication Is Nothing) Then
            Marshal.ReleaseComObject(objApplication)
            objApplication = Nothing
        End If

        GC.Collect()
        GC.WaitForPendingFinalizers()
        GC.Collect()
        GC.WaitForPendingFinalizers()

        End