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!

Reading properties from Solid Edge ST4 parts

Status
Not open for further replies.

Chronik

Mechanical
Sep 22, 2010
12
0
0
CA
Hi,

I've searched around a bit and could not find what i am looking for. (ref :
On the long run I want to create a database with all the properties of the files on our server. To do so, i would like to write a program that reads the parts and send the data to the database.

I think i can handle the database part of the project, but I do not know how to link Visual Basic to the SE properties. I've searched over the web and either the version of Solid Edge (ST4) is not working the with code i found that were written over 5 years ago, or i can't figure out how to link VB and SE together. I consider myself an OK programmer (let's just say i'm good for a mech eng.), but when it comes to use stuff such as #include in a VB code it's not my cup of tea.

I would really appreciate if you could point out how to link VB and SE together (libraries, SDK, etc..) in details or with a quick exemple that would read for instance the Material property from a part located in C:\PART.par for exemple.

Thank you,
 
Replies continue below

Recommended for you


Update:
I just checked all the SE references I could find (maybe i skipped a couple) and manage to run the following code. It does crash at some point :
Run-time error '-2147467259 (80004005)':
Method 'Value' of object 'IJProperty' failed

The code allows me to get
SummaryInformation : Title, Subject, Author, Keywords, Comments, Template, Last Author, Revision Number and crashes at Total Editing Time.

I would like to read an exposed variable that is in the "Custom" tab of the File Properties, and most importantly, the Material in the Material Table. I can't find out how to get those two properties.

Thanks

Code:
Sub GetFileProps()
Dim objPropSets As PropertySets
Dim objProps As Properties
Dim objProp As Property
Dim x As Integer
x = 1

Set objPropSets = CreateObject("SolidEdge.FileProperties")
Call objPropSets.Open("C:\PU-B015.par")

Debug.Print "Test"

For Each objProps In objPropSets
Sheets("Sheet2").Range("A" & x).Value = objProps.Name
    'For Each objProp In objProps
    '    Sheets("Sheet1").Range("A" & x).Value = objProps.Name
    '    Sheets("Sheet1").Range("B" & x).Value = objProp.Name
     '   Sheets("Sheet1").Range("C" & x).Value = objProp.Value
     '   x = x + 1
     'Debug.Print objProps.Name & ": " & objProp.Name & " = " & objProp.Value
   ' Next
   x = x + 1
Next

End Sub
 
Look in Help for the .Net programmers guide, there is a lot of code in there and it shows how to connect VB.Net to Solid Edge.
There is also a chapter on File Properties - how to access them without having to open the file in Solid Edge, what the properties are and how to get/change the values.
There are also references to the 'old' VB6 type of connection - which is what you appear to have.

I will try to post some of my code later.

bc.
2.4GHz Core2 Quad, 4GB RAM,
Quadro FX4600.

Where would we be without sat-nav?
 
Status
Not open for further replies.
Back
Top