×
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

ufs.Modl.UniteBodies

ufs.Modl.UniteBodies

ufs.Modl.UniteBodies

(OP)
I want to programmatically subtract a collection of solid bodies from a block. I am looking at using ufs.Modl.UniteBodies which an example is found on the GTAC solution center (https://solutions.industrysoftware.automation.siem...)

However, this only gives the boolean operation of two bodies. I need to cycle through a collection of bodies and perform a boolean operation.

Any ideas?

RE: ufs.Modl.UniteBodies

Set up a simple example file and record a journal while performing the desired operation. The code NX generates should give you a good starting point.

www.nxjournaling.com

RE: ufs.Modl.UniteBodies

If you record a journal,the recorded code will make use of a BooleanBuilder object, so you will see how these work. The BooleanBuilder has a ToolBody Builder, which lets you specify several tool bodies.

Or you can call NXOpen.UF.UFModl.SubtractBodies several times.

Or, if you have a SNAP license, just call Snap.Create.Subtract -- it allows you to input several tool bodies. Here's some example code:

CODE --> vb

Imports Snap, Snap.Create

Public Class MyProgram

   Public Shared Sub Main()

      Dim d As Double = 10

      Dim ball  As NX.Body = Sphere(0, 0 ,0, d)
      Dim left  As NX.Body = Sphere(-d/2, 0, 0, 9)
      Dim right As NX.Body = Sphere( d/2, 0, 0, 9)

      ' Subtract the two smaller spheres from the larger one
      Dim cut As NX.Boolean = Subtract(ball, left, right)

   End Sub

End Class 

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