Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Cast a Feature into a Sheet Body

Status
Not open for further replies.

EngProgrammer

Aerospace
Jan 14, 2015
150
US
Dear Forum,

I am trying to cast a feature that was created with the Features.ExtensionBuilder class into a body. The reason why I want to cast it into a body is because I want to sew two sheet bodies that were created from this class using the Features.SewBuilder class. After journaling the sew operation the journal resulted in this following line of code, CType(workpart.Bodies.FindObject("SHEET_BODY(41)"), Body). However, I want to replace this code with the proper casting functionality. I've tried the following to try and cast the feature into a sheet body, CType(NXObjectManager.Get(ExtendLeftBottomSurface.Tag), Body) Where the ExtendLeftBottomSurface is an extension feature object resulting from the creating the surface with the Features.ExtensionBuilder class.

I am always having difficulties with casting within NXOpen.

Any suggestions??
 
Replies continue below

Recommended for you

The ExtensionBuilder's .CommitFeature method will return a reference to the newly created feature. Given that reference, you can use the feature's .GetBodies method to get references to the bodies that the feature created.

Something like this:
Code:
dim theExtensionFeat as features.extension
theExtensionFeat = ExtensionBuilder.CommitFeature

dim extensionBodies() as body
extensionBodies = theExtensionFeat.GetBodies

www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top