×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to Cast a Feature into a Sheet Body

How to Cast a Feature into a Sheet Body

How to Cast a Feature into a Sheet Body

(OP)
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??

RE: How to Cast a Feature into a Sheet Body

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources