×
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 File Custom Properties in VB.net

Reading File Custom Properties in VB.net

Reading File Custom Properties in VB.net

(OP)
I posted this on the Solid Edge cad forum as I am having a problem with a program that edits custom file properties in Solid Edge drawing files, but haven't got an answer yet.
I am able to do all the reading and writing OK but if the property does not exist my program crashes.
I want to add in some code to check that the custom property exists and, if it doesn't, give the user the opportunity to add it.
Any ideas?

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

Where would we be without sat-nav?

RE: Reading File Custom Properties in VB.net

I am well aware of this problem as well. My work around has been to error trap it or list each custom property to see if the name matches.

Example:
With seApp.ActiveDocument.Properties
    For i = 1 To .Item("Custom").Count
        If .Item("Custom").Item(i).Name = "MyCustomProp" Then
            MsgBox "Found it!"
        End If
    Next
End With

In this case, the name property is case sensitive.

Hope this helps

RE: Reading File Custom Properties in VB.net

(OP)
Thanks, I think I can adapt that to do what I want.
I could use an array for the property name strings and check each custom property against that, and if the value isn't found then let the user add it.

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