Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CHECK IF DRAWING IS OUT OF DATE 1

Status
Not open for further replies.

johnnyalexandr22

Mechanical
Sep 7, 2011
5
0
0
GR
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!
 
Replies continue below

Recommended for you

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
 
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
 
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
 
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
 
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
 
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!
 
Status
Not open for further replies.
Back
Top