Using C#, external application, I'm building an assembly in Solid Edge. I want to be able to later access the parts I put in there to show/hide/delete/resize. What's the best way to do this, without holding on to occurrence objects?
Should I use an assembly path to find the part? Tag part occurrences with an attribute and use an SE search command?
I have used StringAttributes to attach data to objects that I want to identify and access later, typically between Solid Edge sessions. The DynAttrib folder under Custom has a sample program for that.
Typically, the String attribute is added as:
objAttrSet = objObject.AttributeSets.Add("UserDefined")
If objObject.IsAttributeSetPresent("UserDefined") Then...
and the value is extracted as:
txtAttribute.Text = objAttribute.Value
These lines are from the DynAttrib sample.
I used this technique in my application very effectively.
Sorry about not being able to share any of my original code.
Where is this DynAttrib you talk about?
EDIT: oh, there's custom samples included in Solid Edge install directory
A question remains: The sample code is in VB, and trying to convert it to C# is hard. It seems the VB code directly accesses COM and somehow magically knows how to cast Object into the right COM class to access member methods. C# doesn't do that, and I don't know the cast. Is there a trick to this?
Even worse after puzzling how to translate the code, I discovered the VB example itself doesn't work. EDIT: it does if i'm in assembly. In part, it pretends to work but does nothing.
I am available for Skype any time, just name it so I can be there.