Reply

How to get the mirror plane of a part copy?

[ Edited ]

 

Hello

I have a part that has a "Part Copy" link to another part but mirrored along some plane.

See attached image to see how I created the mirrored link.

My question is how can I get that plane in the code?

So far, I only managed to get the linked part using RevisionManager but I didn't find a way to get the mirror plane.

Here is a snippet of my C# code that gets the linked part:

RevisionManager.Application revisionManagerApplication = new RevisionManager.Application();

RevisionManager.Document revisionManagerDocument = (RevisionManager.Document)revisionManagerApplication.Open(m_document.FullName, RevisionManager.RevisionRuleType.LatestRevision, true);

RevisionManager.LinkedDocuments linkedDocuments = (RevisionManager.LinkedDocuments)revisionManagerDocument.get_LinkedDocuments(RevisionManager.LinkTypeConstants.seLinkTypeAll);

 if (linkedDocuments.Count > 0)

 {

    RevisionManager.Document linkedDocument = (RevisionManager.Document)linkedDocuments.get_Item(1);

    string linkedPartFullName = linkedDocument.FullName;

}

Help will be appreciated.

Thanx

Adar

 

Posted by: Adar Shtainhart
Post date: 2/16/2009 2:17:33 AM

2 REPLIES

RE: How to get the mirror plane of a part copy?

[ Edited ]

Adar,

 

If you will .zip for me an example .par with the part copy, I will take a look at it. Sorry, I would do it myself but I would rather see your example because I'm not that great at working in SE.

 

Posted by: Jason Newell
Post date: 2/17/2009 1:44:16 PM

RE: How to get the mirror plane of a part copy?

[ Edited ]

Hi Jason

 

I had two answers that helped me do it

 

One from solid_edge.programming forum:

 

"

Adar,

 

I don't believe you will the plane information in RevisionManager. If you could

run your program in Part environment, you might look for the Plane property of the

CopiedPart object:

 

e.g. pApp.ActiveDocument.Models.Item(1).CopiedParts.Item(1).Plane

"

and the second from an answer of an IR I opened:

 

"There is no way to obtain infomation on Solid Edge objects by opening the part file in Revision Manager. Revision Manager only deals with links and not Solid Edge objects inside the file in question. For access to Solid Edge objects you have to actually open the part file in Solid Edge itself (Of course you can do this by your code).

 

If you open the part in SE then you can do something like following in your code to get to the plane that was used to mirror.

 

'Assuming the part with mirror part copy is currently open in SE

 

Set objApp = GetObject(, "SolidEdge.Application") Set objDoc = objApp.ActiveDocument Set objModel = objDoc.Models(1)

 

Set objCopiedPart = objModel.Features.Item(1) Set objRefPlane = objCopiedPart.Plane '

"

 

Here is the code in C# that worked for me:

 

SolidEdgePart.PartDocument part = (SolidEdgePart.PartDocument)m_document;

 

SolidEdgePart.Models models = (SolidEdgePart.Models)part.Models;

SolidEdgePart.Model model = (SolidEdgePart.Model)models.Item(1);

 

SolidEdgePart.CopiedParts copiedParts = (SolidEdgePart.CopiedParts)model.CopiedParts;

foreach (SolidEdgePart.CopiedPart copiedPart in copiedParts)

{

SolidEdgePart.RefPlane plane = (SolidEdgePart.RefPlane)copiedPart.Plane;

string str = copiedPart.FileName + ", " + plane.EdgebarName;

MessageBox.Show(str);

}

 

The part copy can be created by pressing the "Clipboard" button.

 

Thanx

Adar

 

Posted by: Adar Shtainhart
Post date: 2/24/2009 10:18:40 PM