×
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

Bounding box in NXOpen

Bounding box in NXOpen

Bounding box in NXOpen

(OP)
Hi,

I'm trying to get the bounding box around a part (or component, I've tried both) with the following code:

Imports System
Imports NXOpen
Imports NXOpen.Assemblies
Imports NXOpen.UF
Imports System.IO

Module NXJournal
Sub Main

Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()

Dim workPart As Part = theSession.Parts.Work

dim tggg as tag = workpart.tag
dim b(5) as double

ufs.modl.askboundingbox(tggg,b)

end sub
end module


When I run the code (I've tried single parts and assemblies) I get a memeory access violation saying that it attempted to read or write protected memory.  Does anyone know what can be done to fix this?

Thanks.
 

RE: Bounding box in NXOpen

I have used this function successfully in a journal, I'm pretty sure you have to pass a tag of a body. I don't believe the workpart.tag is valid input for the function (the workpart may contain multiple bodies).

RE: Bounding box in NXOpen

(OP)
I see.  Thanks for the help, that makes sense.  Do you know of a way to get the bounds of an asseembly using NXOpen (VB)?

Thanks.

RE: Bounding box in NXOpen

I've never tried to get the bounds of an assembly. Do you have the 'wrap assembly' function available? Perhaps you can use the 'wrapped assembly' body with the bounding box function.

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