Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Reading File Custom Properties in VB.net

Status
Not open for further replies.

beachcomber

Mechanical
Jan 19, 2005
1,488
0
0
GB
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?
 
Replies continue below

Recommended for you

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
 
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?
 
Status
Not open for further replies.
Back
Top