×
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

The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
Hi

please help understand the uf_ref doc.
the doc say:
<OutAttribute> ByRef item_type As String

how I declare this in vb journal ==>> ( Dim ByRef item_type As String ) ?
Because ==>> Dim item_type As String this not work.


CODE -->

UFClone.AskItemType Method  

Wrapper method for UF_CLONE_ask_item_type

Public Sub AskItemType ( 
	input_part_name As String,
	<OutAttribute> ByRef item_type As String
) 



CODE -->

'-------------------------------------------------------------
   Dim item_type As String  <<== Not works

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

   Dim input_part_name As String
   Dim ByRef item_type As String    <<== (ByRef) Do this possible

  ufs.clone.AskItemType(input_part_name, item_type) 

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
Shortly

This throw compile error keyword not valid
Dim ByRef item_type As String


and this not work
Dim item_type As String

( Return item_type = null <<== ufs.clone.AskItemType(input_part_name, item_type) )

Thank you.

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

The "OutAttribute ByRef" just means that the method you are calling is going to modify the value of that variable; it will essentially become the output of the method. You declare the variable normally, but note that its value will be modified by the method.

CODE

Dim input_part_name As String = "some input part name"
Dim item_type As String = ""

ufs.clone.AskItemType(input_part_name, item_type) 

After the code runs, the "item_type" variable will contain the item type of the given input part.

www.nxjournaling.com

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
Cowski
I'm very much thank you

Because I have understood and did as you posted.

But askitemtype (current clone operation part name, part item type) in my journal
Iteration always return null.
The assembly that I iterated have some items types.

Please can you give me a clue why so.

I'm very much thank you.

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

The doc says if the item type is null ("Empty String") default behavior will be applied.

Suresh
www.technisites.com.au

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
Hi ufsure and thank you.

Yes I know that.
So
What happened if I remove the
This statement
ufs.Clone.SetDefItemType("")
Then what will the default.

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
My clone operation is clone some components
And retain the rest.
And for them I set the above default
Statement.

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
Another question
If I have this
ufs.Clone.SetDefItemType("")

And I use also this
ufs.Clone.SetItemType("some type")
Is this statement do nothing
Because of the previous statement.

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
Hi ufsure.
After rereading the doc
And deeply thinking
I come to feel that you are right.

Tomorrow I will have access to nxmanager
And I will test it.

Because immediately after the statement
ufs.Clone.SetDefItemType("")
Nx set all the parts in the clone operation
To item type null.
And when I asked the item type for
A part i get null and that makes
My journal to go wrong.

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
Hi

I'm disappointed.

I removed ufs.Clone.SetDefItemType("")
From my journal.
and still I got null in askitemtype
Do someone have a thought about
This.
Why askitemtype always return null.

Thanks in advanced.

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

Can you post the complete code and let me know what you are trying to clone?

Suresh
www.technisites.com.au

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
Hi ufsure and thank you for your wanting to help me.

'The code wrote in my company and I can not bring it out from company. (restriction issue)
'but this is the relevent recoded for the problem issue
'--------------------------------------------------------------

Dim pnItemType As String = Nothing
Dim addAssemblyPart As String = Nothing

ufs.Clone.Terminate()
ufs.Clone.Initialise(UFClone.OperationClass.CloneOperation)
Dim status As UFPart.LoadStatus = Nothing
ufs.Clone.SetDefFolder(":Cloned Parts")

'ufs.Clone.SetDefItemType("") ' with / without this still return nothing
'ufs.Clone.SetDefItemType("som_string") ' I tryied this and still return nothing

addAssemblyPart = "@DB/" & display_part.FullPath
ufs.Clone.AddAssembly(addAssemblyPart , status)

ufs.Clone.SetDefAction(UFClone.Action.Retain)

ufs.Clone.SetLogfile("c:\clone_log_file.txt")

' . . . . . . .

ufs.Clone.StartIteration()
Do
ufs.Clone.Iterate(prt_name)
If(prt_name = Nothing) Then Continue Do
If prt_name.Contains("/specification/") Then Continue Do

ufs.Clone.AskItemType(prt_name, pnItemType) ' this alwaisreturn nothing

If pnItemType = "UserPart" Then
ufs.Clone.SetItemType(prt_name, "UserPart")
else
ufs.Clone.SetItemType(prt_name, "ExtPart")
End If

Loop While (prt_name <> Nothing)

Dim faile As UFClone.NamingFailures = Nothing
Try
ufs.Clone.PerformClone(faile)
Catch e As Exception
lw.WriteFullLine("NX Exception = " & e.ToString)
End Try
ufs.Clone.Terminate()

'--------------------------------------------------------------
'I replaced these statements:

If pnItemType = "UserPart" Then
ufs.Clone.SetItemType(prt_name, "UserPart")
else
ufs.Clone.SetItemType(prt_name, "ExtPart")
End If

'by this statements:

ufs.Clone.SetItemType(prt_name, "UserPart")

'To check if SetItemType works and indeed works




CODE -->

'The code wrote in my company and I can not bring it out from company. (restriction issue)
   'but this is the relevent recoded for the problem issue
   '--------------------------------------------------------------

   Dim pnItemType As String = Nothing 
   Dim addAssemblyPart As String = Nothing
 

   ufs.Clone.Terminate()
   ufs.Clone.Initialise(UFClone.OperationClass.CloneOperation)
   Dim status As UFPart.LoadStatus = Nothing 
   ufs.Clone.SetDefFolder(":Cloned Parts")

   'ufs.Clone.SetDefItemType("")                               ' with / without this still return nothing 
   'ufs.Clone.SetDefItemType("som_string")                     ' I tryied this and still return nothing 

   addAssemblyPart = "@DB/" & display_part.FullPath
   ufs.Clone.AddAssembly(addAssemblyPart , status)
   
   ufs.Clone.SetDefAction(UFClone.Action.Retain)

   ufs.Clone.SetLogfile("c:\clone_log_file.txt")

' . . . . . . .

   ufs.Clone.StartIteration()
   Do
     ufs.Clone.Iterate(prt_name)
     If(prt_name = Nothing) Then Continue Do
     If prt_name.Contains("/specification/") Then Continue Do
                
     ufs.Clone.AskItemType(prt_name, pnItemType)                ' this alwaisreturn nothing

     If pnItemType = "UserPart" Then
       ufs.Clone.SetItemType(prt_name, "UserPart")
     else
       ufs.Clone.SetItemType(prt_name, "ExtPart")
     End If
 
   Loop While (prt_name <> Nothing)

   Dim faile As UFClone.NamingFailures = Nothing
   Try
     ufs.Clone.PerformClone(faile)    
   Catch e As Exception
     lw.WriteFullLine("NX Exception  =  " & e.ToString)
   End Try
   ufs.Clone.Terminate()

   '--------------------------------------------------------------
   'I replaced these statements:

   If pnItemType = "UserPart" Then
     ufs.Clone.SetItemType(prt_name, "UserPart")
   else
     ufs.Clone.SetItemType(prt_name, "ExtPart")
   End If

   'by this statements:

   ufs.Clone.SetItemType(prt_name, "UserPart")

   'To check if SetItemType works and indeed works 

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
Note that the complete journal
Works as expected.

Except that it's recording the wrong
Item type. ( Not the one I want )

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

Sorry, please contact GTAC for help.

Suresh
www.technisites.com.au

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
I'm thank both
For training to help me.

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
I'm thank both
For trying to help me.


RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
I'm thank both of you.
For trying to help me.

RE: The Doc say: <OutAttribute> [b]ByRef[/b] item_type As String How to declare this in vb

(OP)
Sorry ny English
Is not my first language.

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

White Paper – Your Construction ERP RFP Checklist
Selecting business software for a medium to enterprise-sized construction concern is extremely challenging in large part because most enterprise resource planning (ERP) suites originated in the world of repetitive manufacturing and are therefore a poor fit for a project and asset-centric business. However, midsize to large contractors need the predictable, auditable processes that ERP delivers. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close