AnsweredAssumed Answered

CutList feature CustomPropertyManager has no properties

Question asked by Alexander Zeitler on Feb 7, 2017
Latest reply on Feb 7, 2017 by Keith Rice

I'm trying to access the custom properties of a sheetmetal cutlist feature like this:

 

"Zuschnittslistenelement1" is the german name for "Cut-List-Item1"

 

IModelDoc2 partModel = _solidWorks.OpenDoc6(fileName, (int)swDocumentTypes_e.swDocPART,

  (int)swOpenDocOptions_e.swOpenDocOptions_LoadModel,

  string.Empty, ref loadError, ref loadWarnings);

_solidWorks.ActivateDoc2(fileName, false, loadError);

 

object featuresObject = partModel.FeatureManager.GetFeatures(true);

object[] features = featuresObject as object[];

 

Feature cutList = null;

foreach (object featureObject in features)

{

  Feature feature1 = featureObject as Feature;

  if (feature1.Name == "Zuschnittslistenelement1")

  {

  cutList = feature1;

  }

}

 

if (cutList != null)

{

  CustomPropertyManager propertyManager = cutList.CustomPropertyManager;

  string resolvedRahmenLaenge;

  string rahmenLaenge;

  propertyManager.Get4("Rahmenlänge", false, out rahmenLaenge, out resolvedRahmenLaenge);

 

  string resolvedRahmenBreite;

  string rahmenBreite;

  propertyManager.Get4("Rahmenbreite", false, out rahmenBreite, out resolvedRahmenBreite);

}

 

propertyManager.Count is 0.

Outcomes