MSPBenson
Mechanical
- Jan 13, 2005
- 190
Another journal question.
I have the following:
Option Strict Off
Imports System
Imports NXOpen
imports nxopen.uf
imports nxopen.utilities
Imports NXOpen.Assemblies
Imports System.Windows.Forms
Imports System.IO
Imports System.Collections
imports System.Drawing
Module NXJournal
Dim nxs As Session = Session.GetSession()
Dim ufs as UFSession = UFSession.GetUFSession()
Sub Main
'....................Select Objects..........................
Dim my_ui As ui = ui.GetUI
Dim message As String = " Select Surfaces To Section"
Dim title As String = "Selection"
Dim scope As Selection.SelectionScope = Selection.SelectionScope.AnyInAssembly
Dim keepHighlighted As Boolean = false
Dim includeFeatures As Boolean = false
Dim response As Selection.Response
Dim selectionAction As Selection.SelectionAction = _
Selection.SelectionAction.ClearAndEnableSpecific
Dim selectionMask_array(1) As Selection.MaskTriple
With selectionMask_array(0)
.Type = UFConstants.UF_solid_type
.Subtype = 0
.SolidBodySubtype = 0
End With
dim selectedobject() as nxobject
response = my_ui.SelectionManager.SelectObjects(message, title, scope, _
selectionAction, includeFeatures, _
keepHighlighted, selectionMask_array, _
selectedObject)
If response = Selection.Response.Cancel Or response = Selection.Response.Back Then
'goto clean_up
End If
'............................................................
'.....Wavelink objects.......
dim cur_part_tag as tag = nxs.parts.work.tag
dim mysurf(selectedobject.length-1) as nxopen.tag
dim wave_objs(selectedobject.length-1) as tag
dim obj as nxobject
'dim mysurf() as nxopen.tag
dim i as integer = 0
for each obj in selectedobject
dim my_null as system.dbnull
dim my_xform as tag
mysurf(0) = obj.tag
messagebox.show(mysurf(0))
ufs.wave.createlinkedbody(mysurf(0),my_xform,cur_part_tag,false,wave_objs(i))
messagebox.show(mysurf(0))
i=i+1
next
'............................
end sub
end module
I can select the objects to wavelink but I get an incorrect first input error when it tries the wavelink command.
Am I passing the wrong tag to this command?
Tho only other area I'm not sure about is the xform.
I don't want to move the wavelink so I've left this null (as per documantation) but I'm not sure Ione this correctly.
Any help with this would be great.
Mark Benson
Aerodynamic Model Designer
I have the following:
Option Strict Off
Imports System
Imports NXOpen
imports nxopen.uf
imports nxopen.utilities
Imports NXOpen.Assemblies
Imports System.Windows.Forms
Imports System.IO
Imports System.Collections
imports System.Drawing
Module NXJournal
Dim nxs As Session = Session.GetSession()
Dim ufs as UFSession = UFSession.GetUFSession()
Sub Main
'....................Select Objects..........................
Dim my_ui As ui = ui.GetUI
Dim message As String = " Select Surfaces To Section"
Dim title As String = "Selection"
Dim scope As Selection.SelectionScope = Selection.SelectionScope.AnyInAssembly
Dim keepHighlighted As Boolean = false
Dim includeFeatures As Boolean = false
Dim response As Selection.Response
Dim selectionAction As Selection.SelectionAction = _
Selection.SelectionAction.ClearAndEnableSpecific
Dim selectionMask_array(1) As Selection.MaskTriple
With selectionMask_array(0)
.Type = UFConstants.UF_solid_type
.Subtype = 0
.SolidBodySubtype = 0
End With
dim selectedobject() as nxobject
response = my_ui.SelectionManager.SelectObjects(message, title, scope, _
selectionAction, includeFeatures, _
keepHighlighted, selectionMask_array, _
selectedObject)
If response = Selection.Response.Cancel Or response = Selection.Response.Back Then
'goto clean_up
End If
'............................................................
'.....Wavelink objects.......
dim cur_part_tag as tag = nxs.parts.work.tag
dim mysurf(selectedobject.length-1) as nxopen.tag
dim wave_objs(selectedobject.length-1) as tag
dim obj as nxobject
'dim mysurf() as nxopen.tag
dim i as integer = 0
for each obj in selectedobject
dim my_null as system.dbnull
dim my_xform as tag
mysurf(0) = obj.tag
messagebox.show(mysurf(0))
ufs.wave.createlinkedbody(mysurf(0),my_xform,cur_part_tag,false,wave_objs(i))
messagebox.show(mysurf(0))
i=i+1
next
'............................
end sub
end module
I can select the objects to wavelink but I get an incorrect first input error when it tries the wavelink command.
Am I passing the wrong tag to this command?
Tho only other area I'm not sure about is the xform.
I don't want to move the wavelink so I've left this null (as per documantation) but I'm not sure Ione this correctly.
Any help with this would be great.
Mark Benson
Aerodynamic Model Designer