Adding document properties

How can I add a new custom document property? (In this case, to a draft file). I'm using C++ (VC++2010).

 

I wanted to use

 

SolidEdgeFramework::PropertyPtr pNewProperty;

pNewProperty->Name = newPropertyName;

 

but there is no put method associated with the Property interface. I have to do this on an open document, since the file will be cached from Teamcenter.

 

Posted by: Paul Dobson
Post date: 3/5/2012 9:46:06 AM

1 REPLY

Re: Adding document properties

Should have tried a bit harder before posting!

 

For anyone who also wants to know, the solution is:

 

SolidEdgeFramework::PropertySetsPtr pPropertySets = NULL;
SolidEdgeFramework::PropertiesPtr pProperties = NULL;
SolidEdgeFramework::PropertyPtr pProperty = NULL;

pPropertySets = pDoc->Properties;
pProperties = pPropertySets->Item(_T("Custom"));

pProperty = pProperties->Add(_T("Property Name"), _T("Property Value"));

 

Posted by: Paul Dobson
Post date: 3/5/2012 10:12:07 AM