Cancel
Showing results for 
Search instead for 
Did you mean: 

Get source body from wave link builder or extract face class

Valued Contributor
Valued Contributor

On my workpart I have many LINKED_BODY features from the wave geometry linker tool. My goal is to get a reference to the body (and likewise component) from which the wave-linked body originated from.

 

My current process is to take the LINKED_BODY feature and cast it to an ExtractFace class, from the extractFace class I can create an ExtraceFaceBuilder class. Then I access the ExtractBodyCollector property and call GetObjects(), which returns a body. However, this body does not have the same tag as the source body OR the wave-linked body, nor does it have an owning component. 

 

 

Thanks,

jgolen

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015
8 REPLIES

Re: Get source body from wave link builder or extract face class

Honored Contributor
Honored Contributor

Have you searched the solution center? Here is one example I found with a quick search:

http://solutions.industrysoftware.automation.siemens.com/view.php?si=nx_api4833

Highlighted

Re: Get source body from wave link builder or extract face class

Valued Contributor
Valued Contributor

Yes I did search the solution center, but did not find what I was looking for. The journal you linked is great at finding the source part (part file), but I was looking to find the occurrence source body within the assembly!

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015

Re: Get source body from wave link builder or extract face class

Honored Contributor
Honored Contributor

The .AskLinkSource method (used in the code above) is supposed to return the "tag of the source geometry entity". A null tag may be returned if the link is broken or the file cannot be loaded. What is it returning for you?

 

It's been a while since I last used this method, so I don't remember if it returns the occurrence or prototype object tag.

Re: Get source body from wave link builder or extract face class

Valued Contributor
Valued Contributor

I believe it is returning the prototype object tag. The previous method descrbed in the original post was also returning the prototype object. (ExtractFaceBuilder)

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015

Re: Get source body from wave link builder or extract face class

Honored Contributor
Honored Contributor

The ExtractFaceBuilder's .SourcePartOccurrence property looks promising.

 

If that does not work, perhaps the .AskLinkedFeatureMap or .MapLinkGeomToSource methods will give something useful.

Re: Get source body from wave link builder or extract face class

Valued Contributor
Valued Contributor

I tried the sourcePartOccurrence with no luck. The SourcePartOccurrence property was nothing and returned nothing.

 

I've tried MapLinkGeomToSource, which returned the source body, but it was a prototype not an occurrence. 

 

Perhaps something is incorrect in my initialization? I'm taking an extraceFace class (temp) and passing it into the CreateExtraceFaceBuilder method and then attempting to access the sourcePartOccurrence property.

                    Dim extractFaceBuilder As ExtractFaceBuilder = wrkPrt.Features.CreateExtractFaceBuilder(temp)
                    Dim bodOcc As Body = extractFaceBuilder.SourcePartOccurrence
NX 9.0.3.4 MP13
VB.net
Visual Studio 2015

Re: Get source body from wave link builder or extract face class

Honored Contributor
Honored Contributor

Maybe the .AskAssyCtxtPartOcc method will be of use. Here is a link with some source code showing its use:

http://nxjournaling.com/comment/2269#comment-2269

The journal specifically works with linked mirrored bodies, but I think it can also be made to work with "regular" linked bodies.

Re: Get source body from wave link builder or extract face class

Valued Contributor
Valued Contributor

The .AskAssyCtxtPartOcc method was a winner! (.AskLinkXform method is used as well). This is exactly what I needed, the component used to make a linked feature.

 

Thanks so much,

jgolen

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015