Ok i made some advancements and I almost got it I think.
so first off i use the event handler FileSaveAsNotify2 to get the name of the file being saveased and then i use FileSavePost to get the new document name. I am trying to use this code to input my new comment but its not working.
So i am trying to wright to the comments part of the custom property but intstat = CustMgr.Set2("Comments", "Hellow World"); equats to 1 which means Custom property does not exist and my PropNamesList which im trying to use to verify the names of the custom properties comes back null
int errors = 0;
int warnings = 0;
object PropNames = null;
object PropTypes = null;
object PropValues = null;
object Resolved = null;
object PropNamesList = null;
ModelDoc2 Comp = iSwApp.OpenDoc6(filename, SWType, (int)swOpenDocOptions_e.swOpenDocOptions_Silent, "", ref errors, ref warnings);
Configuration config = (Configuration)Comp.GetActiveConfiguration();
CustomPropertyManager CustMgr = config.CustomPropertyManager;
/* 0 = Success
* 1 = Custom property does not exist
* 2 = Specified value has an incorrect type
intstat = CustMgr.Set2("Comments", "Hellow World");
PropNamesList = (object)CustMgr.GetNames();
intstat = CustMgr.GetAll2(ref PropNames, ref PropTypes, ref PropValues, ref Resolved);
foreach (string Name in (string)PropNames)
string CName = Name;
Editing the items in the Summary tab apparently need a different method. I could also not set it using a ModelDoc2 CustomPropertyManager. This worked:
Dim swApp As SldWorks.SldWorks
Dim swModel As ModelDoc2
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
swModel.SummaryInfo(4) = "W00T"
More info here:
I am trying to add that into but code but I'm having issues understanding the structure of how to use the SummaryInfo in C#. How do I invoke the get set to accomplish this in C#.