Skip to content

Instantly share code, notes, and snippets.

@dalenicholls
Created May 15, 2017 07:10
Show Gist options
  • Save dalenicholls/851f643c52e1bcc3349d731bae832adf to your computer and use it in GitHub Desktop.
Save dalenicholls/851f643c52e1bcc3349d731bae832adf to your computer and use it in GitHub Desktop.
public static class Extensions
{
public enum Variables
{
CLASS_ATTR,
FINISH
}
public static string GetReportProperty(this TSM.Part part, Variables variable)
{
string value = "";
part.GetReportProperty(variable.ToString(), ref value);
return value;
}
}
// usage...
private void demo()
{
ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects();
while (modelObjectEnum.MoveNext())
{
if (modelObjectEnum.Current is TSM.Part)
{
TSM.Part part = (TSM.Part)modelObjectEnum.Current;
Console.WriteLine(part.GetReportProperty(Extensions.Variables.CLASS_ATTR));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment