×
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

CHECK IF DRAWING IS OUT OF DATE

CHECK IF DRAWING IS OUT OF DATE

CHECK IF DRAWING IS OUT OF DATE

(OP)
I made a program in Vb but I don't know how to tell << if drawing is out of date>>,<< then do something else>>. I need this part of the code. Does anyone know how can I make this check? Please help!

RE: CHECK IF DRAWING IS OUT OF DATE

There is a wrapper method for UF_Draw_is_object_out_of_date.

The method is

Public Sub IsObjectOutOfDate ( _
    _object As Tag, _
    <OutAttribute> ByRef out_of_date As Boolean _
)

The object can be a drawing or a view.

Hope this helps.

Frank Swinkels

RE: CHECK IF DRAWING IS OUT OF DATE

(OP)
Thanks I'll try it  

RE: CHECK IF DRAWING IS OUT OF DATE

You'll also have to add

CODE

Imports NXOpen.UF
if it isn't already in your code.

RE: CHECK IF DRAWING IS OUT OF DATE

Hello,

I try:
  Dim view1 As Drawings.DraftingView
  Dim baseView1 As Drawings.BaseView = CType(workPart.DraftingViews.FindObject("TOP@3"), Drawings.BaseView)
  view1 = baseView1
  Dim boolOutOfDate As Boolean
  IsObjectOutOfDate(view1, boolOutOfDate)
  If boolOutOfDate Then msgbox("Outofdate!")

but it reports to me: "Name "IsObjectOutOfDate" is not declared!

If I use:
  view1.IsObjectOutOfDate(view1, boolOutOfDate)
it reports to me: "IsObjectOutOfDate" is not a member of ...DraftingView....

1) Where can I find this method?

2) How can I get the view object from the Drawings object?

3) Where can I find the declaration syntax of the Objects in NXOpen?

Please advise...

Thank you

RE: CHECK IF DRAWING IS OUT OF DATE

The important point to understand is that a Method belongs to a specific Class. Firstly to list all methods belonging to a Class in the NXOpen.Net API Reference in this case you want to search for UFDrf Class.  That is looking for any specific ufunc equivalent then for this the user functions for drafting are UF_DRF. The methods in .Net are in UFDrf.

To access our specific method we need to identify the class the method belongs to.  You should be able to see this in the simple program below.

Finally all wrapper function methods use tags to identify objects so that when we have an object we must get the object tag property. That is  "object.Tag".

OK here is a simple program to demonstrate what you are looking for.

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module drgSheets
  Sub Main()
    Dim s As Session = Session.GetSession()
    Dim ufs As UFSession = UFSession.GetUFSession()
    Dim displayPart As Part = s.Parts.Display
    Dim dwgs As Drawings.DrawingSheetCollection
    dwgs = displayPart.DrawingSheets
    Dim outOfDate As Boolean
    For Each drg As Drawings.DrawingSheet In dwgs
       ufs.Drf.IsObjectOutOfDate(drg.Tag, outOfDate)
       MsgBox(drg.Name & " out of date: " & outOfDate.ToString)
    Next
  End Sub
End Module

Hope this helps

Frank Swinkels

RE: CHECK IF DRAWING IS OUT OF DATE

Dear Frank,

It works!

Thank you! for your time!

RE: CHECK IF DRAWING IS OUT OF DATE

If I want for a specific sheet to find which of the views are OutOfDate.... what is the property of the DrawingSheet object which contains the views collection?
How can I read the OutOfDate flag?

Thank you

RE: CHECK IF DRAWING IS OUT OF DATE

I have added checking for views on a sheet.  The only difference is that you must open a sheet to get access to the view objects.  Note I simply cycle but you should be able to see how to get a sheet by testing the name.  Here is the revised program.

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module drgSheets
  Sub Main()
    Dim s As Session = Session.GetSession()
    Dim ufs As UFSession = UFSession.GetUFSession()
    Dim displayPart As Part = s.Parts.Display
    Dim dwgs As Drawings.DrawingSheetCollection
    dwgs = displayPart.DrawingSheets
    Dim views() As Drawings.DraftingView = Nothing
    Dim outOfDate As Boolean
     For Each sheet As Drawings.DrawingSheet In dwgs
       ufs.Drf.IsObjectOutOfDate(sheet.Tag, outOfDate)
       MsgBox(sheet.Name & " out of date: " & outOfDate.ToString)
       sheet.Open()
       views = sheet.GetDraftingViews()
       For Each vw1 As View In views
         ufs.Drf.IsObjectOutOfDate(vw1.Tag, outOfDate)
  MsgBox("   " & vw1.Name & " out of date: " & outOfDate.ToString)
       Next
     Next
  End Sub
End Module

Frank Swinkels

RE: CHECK IF DRAWING IS OUT OF DATE

Thank you!

This is what I was looking for...!

Thank you!

One more question if you can help me...

I am new to Visual Studio (2010) IDE and I am missing some tips:
1) In the code editor, I write the object name and after the "." I must write the property or the method... What shortcut do I have to use in order to get a list with all the available properties and methods of this object?
2) In code editor, I am (the cursor) on a specific object name or object type.... What shortcut do I have to use in order to open the relative code file (with declaration and code)?
3) In code editor, I am (the cursor) on a specific object name or object type.... What shortcut do I have to use in order to open the help for this object?

Thank you in advance!

RE: CHECK IF DRAWING IS OUT OF DATE

agorts,

Did you sort out your issues with the Visual Studio IDE?

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