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
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
RE: CHECK IF DRAWING IS OUT OF DATE
CODE
RE: CHECK IF DRAWING IS OUT OF DATE
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
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
It works!
Thank you! for your time!
RE: CHECK IF DRAWING IS OUT OF DATE
How can I read the OutOfDate flag?
Thank you
RE: CHECK IF DRAWING IS OUT OF DATE
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
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
Did you sort out your issues with the Visual Studio IDE?
www.nxjournaling.com