Reply

linking an Edge object to my program object

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?

12 REPLIES

Re: linking an Edge object to my program object

[ Edited ]

The last option is what I have used when locating objects between Solid Edge sessions.

 

~Tushar

www.SurfAndCode.in

Re: linking an Edge object to my program object

any pointers to the api's to do that?

Re: linking an Edge object to my program object

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")

 

Checked as:

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.

 

~Tushar

www.SurfAndCode.in

 

Re: linking an Edge object to my program object

[ Edited ]

Where is this DynAttrib you talk about?

 

EDIT: oh, there's custom samples included in Solid Edge install directory

Re: linking an Edge object to my program object

[ Edited ]

C:\Program Files\Solid Edge ST7\Custom\DynAttrib

 

EDIT: Just saw your EDIT. Sorry for the late reply.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: linking an Edge object to my program object

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?

Re: linking an Edge object to my program object

Alan,

 

I'll get on Skype tonight and look at it with you. We'll figure it out ;-)

Jason Newell
Applications Architect
www.jasonnewell.net

Re: linking an Edge object to my program object

I am too interested in learning. can you include me on the Skype call ?

At what time is this planned ?

 

~Tushar

 

Re: linking an Edge object to my program object

[ Edited ]

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.