×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Reading properties from Solid Edge ST4 parts

Reading properties from Solid Edge ST4 parts

Reading properties from Solid Edge ST4 parts

(OP)
Hi,

I've searched around a bit and could not find what i am looking for. (ref :http://www.eng-tips.com/viewthread.cfm?qid=218229&tmac=fav&val=1,218229)

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,

RE: Reading properties from Solid Edge ST4 parts

(OP)

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 --> VB

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

RE: Reading properties from Solid Edge ST4 parts

http://www.jasonnewell.net

RE: Reading properties from Solid Edge ST4 parts

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?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources