Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SE & VB How i can save properties

Status
Not open for further replies.

rocknrol

Mechanical
Feb 1, 2004
21
0
0
EE
i be able read the property with VB but i can't save it.

I want save with VB the custom property
for exsample "Long" = 100.0

Can someone help me?
In solid edge SDK is not example for this.
I try it write like this:
Code:
Sub Main()
        Dim objApp As SolidEdgeFramework.Application
        Dim objDoc As SolidEdgePart.PartDocument
        Dim objProp As SolidEdgeFileProperties.Properties
        ' Report errors
        Const PI = 3.14159265358979
        ' Create/get the application with specific settings
        On Error Resume Next
        objApp = GetObject(, "SolidEdge.Application")
        If Err.Number Then
            Err.Clear()
            objApp = CreateObject("SolidEdge.Application")
            objDoc = objApp.Documents.Add("SolidEdge.PartDocument")
            objApp.Visible = True
        Else
            objDoc = objApp.ActiveDocument
        End If
        ' getting the properties object of the part document
        objProp = objDoc.Properties
        Call objProp.Add("Long", 100.0)
        Call objProp.Save()
        ' Release objects
        objApp = Nothing
        objDoc = Nothing
        objProp = Nothing
    End Sub
Please help me?

 
Replies continue below

Recommended for you

It looks ok to me apart from I have specified custom.

i.e.

objProp = objDoc.Properties("Custom")

I have done this for draft files so not sure if it will work in the part properties.

Hope this helps.

Craig
 
Status
Not open for further replies.
Back
Top