Editing (comment) Property value with vb.net

Builder
Builder

I need to change the (comments) property value through vb.net. I found how to read it but not how to edit it.

Any usefull examples out there to edit properies?

Thanks.

ST9
Conveyor and industrial equipment designer.
Giving SE a chance.
2 REPLIES

Re: Editing (comment) Property value with vb.net

Builder
Builder
Found this in the .net programmers guide:

... objProperties = ObjPropertySets.Item("Custom") ObjProperty = objProperties.Add("My String", "Hello") etc...
But this adds a custom prop, to edit the (comments)value in the summaryInfp would I use the same type of code?

Confused

And that doesnt seem to work either...

 

ST9
Conveyor and industrial equipment designer.
Giving SE a chance.

Re: Editing (comment) Property value with vb.net

Legend
Legend

Hi Pedneault75,

 

Yes. If the property name exists the Add method edits its value, else the method creates the property. But this only works with Custom Properties Smiley Sad

 

With System Properties you have to assign the value to the specific property.

 

One sample:

 

 

Dim oProps As SolidEdgeFramework.PropertySets = YourSolidEdgeDocument.Properties
oProps.Item("SummaryInformation").Item("Comments").Value = "Your Comment"
or (take a look at Spy for Solid Edge for an open document)
oProps.item(1).Item(4).Value = "Your Comment"

' VERY IMPORTANT
oProps.Save

 

If you are editing the properties from an assembly you have to save the assembly too in order to save the opened files.

 

Best regards,

 

Héctor Pelayo Izquierdo
Engineering Department, JAE Ingeniería y Desarrollos, S.L.
Solid Edge ST9 MP5 | NX 9
Development: VB.NET