Quantcast
Channel: NX Journaling - SNAP
Viewing all 30 articles
Browse latest View live

NX SNAP opening assembly parts

$
0
0
Forums: 

New to SNAP, Trying to open all the parts in an assembly;

ForEach child As NX.Component In children
 
InfoWindow.WriteLine(child.Name.ToString) 
    InfoWindow.WriteLine(child.Name.ToString&" : Leaf : "& child.IsLeaf.ToString)
    InfoWindow.WriteLine(child.Name.ToString&" : Hidden : "& child.IsHidden.ToString)
    InfoWindow.WriteLine(child.Name.ToString&" : NXOpenTag : "& child.NXOpenTag.ToString)
    InfoWindow.WriteLine(child.Name.ToString&" : FullPath : "& child.Prototype.FullPath.ToString)
    InfoWindow.WriteLine(child.Name.ToString&" : Prototype.NXOpenTag : "& _ child.Prototype.NXOpenTag.ToString) 
next

I get results for everything except for prototype. Which crashes the program when a part is not loaded.

The error message : "Input tag is NXOpen.Tag.Null"

I need to know how to make sure all the parts in the assembly is loaded and how to avoid crashing the program if a part was not loaded. I tried by getting the NXOpen.Tag value. but refering to the prototype causes same problem.

Anyone knows how to get this information with having the user opening the assembly first?

Thanks in advance

Stan


SNAP Programming - Save as

$
0
0
Forums: 

Hi All,

I am trying to save an existing part As another name. The idea is to change the parts name or to rename the part. I found this;

Dim instance As Part
Dim pathName As String
Dim returnValue As PartSaveStatus

returnValue = instance.SaveAs(pathName)

This only lets you save the part in another folder, as opposed to letting you change the filename. Has anyone had any idea what else I can do to do this task? I don't find a rename option there either.

SNAP and UI Blocks

$
0
0
Forums: 

Is there an example anywhere showing how to create UI groups in SNAP? Most of the UI blocks have a .BeginGroup property, but I would like to group several blocks together in the same group. I would like to avoid having two files (.vb and .dlx).

combining two codes

$
0
0
Forums: 

hello there,
i have two codes, which are based on SNAP. The 1st one extracts the data from the line & curve. The second one asks user to enter data , shown by 1st code. The second code has some formulas, which generates circle. I want to combine these two codes i.e I want second code to directly take values given by 1st code. sending both the codes here with, please help

1st code

Option Infer OnImports Snap, Snap.Create 
' This is a very simple example showing you how to use a Snap.UI.BlockForm' to create a dialog. You may add and remove blocks to suit your needs.' Please see SNAP Getting Started Guide for an introduction ' to the related concepts. 
PublicClass SnapBlockFormApplication61 : Inherits UI.BlockForm 
    ' Declarations of the blocks on a SnapBlockFormApplication61 dialogDim Linex As UI.Block.SelectObjectDim arc1 As UI.Block.SelectObjectDim Liney As UI.Block.SelectObjectDim arc2 As UI.Block.SelectObjectDim Linez As UI.Block.SelectObject' Constructor for a SnapBlockFormApplication61 dialog objectPublicSubNew() 
        Me.Title="SnapBlockFormApplication61"' Text to be shown in title bar of dialogMe.Cue="Please enter information"' Text to be shown in cue line 
        ' Create an Enumeration block (for example)
        Linex =New UI.Block.SelectObject
        Linex.LabelString="Linex"
        Linex.SetFilter(Snap.NX.ObjectTypes.Type.Line)
        Linex.MaximumScope= UI.Block.SelectionScope.AnyInAssembly 
        arc1 =New UI.Block.SelectObject
        arc1.LabelString="Arc1"
        arc1.SetFilter(Snap.NX.ObjectTypes.Type.Arc)
        arc1.MaximumScope= UI.Block.SelectionScope.AnyInAssembly 
        ' Create an Integer block (for example)
        Liney =New UI.Block.SelectObject
        Liney.LabelString="Liney"
        Liney.SetFilter(Snap.NX.ObjectTypes.Type.Line)
        Liney.MaximumScope= UI.Block.SelectionScope.AnyInAssembly
        arc2 =New UI.Block.SelectObject
        arc2.LabelString="Arc2"
        arc2.SetFilter(Snap.NX.ObjectTypes.Type.Arc)
        arc2.MaximumScope= UI.Block.SelectionScope.AnyInAssembly 
        ' Create a Button block (for example)
        Linez =New UI.Block.SelectObject
        Linez.LabelString="Linez"
        Linez.SetFilter(Snap.NX.ObjectTypes.Type.Line)
        Linez.MaximumScope= UI.Block.SelectionScope.AnyInAssembly 
 
        ' Create addition blocks here, as you wish, and delete' any of the ones above, if you don’t need them. 
        ' Add all the blocks to the BlockFormMe.AddBlocks(Linex, arc1, Liney, arc2, Linez) 
    EndSub 
    PublicSharedSub Main() 
        ' Create and display a SnapBlockFormApplication61 dialogDim myForm =New SnapBlockFormApplication61()
        myForm.Show() 
    EndSub 
    PublicOverridesSub OnShow()' Code for when dialog is displayedEndSub 
    PublicOverridesSub OnOK()' Code for when user clicks OKEndSub 
    PublicOverridesSub OnApply()Dim x As NX.Line= Linex.SelectedObjects(0)Dim y As NX.Line= Liney.SelectedObjects(0)Dim z As NX.Line= Linez.SelectedObjects(0)Dim a1 As NX.Arc= arc1.SelectedObjects(0)Dim a2 As NX.Arc= arc2.SelectedObjects(0)Dim p1 As Position = x.StartPointDim PX1 AsDouble= x.StartPoint.XDim L1 AsInteger= x.ArcLength
        InfoWindow.WriteLine("L1="& L1.ToString)
        InfoWindow.WriteLine("P1="& p1.ToString)
        InfoWindow.WriteLine("px1="& PX1.ToString)Dim L2 AsInteger= a1.ArcLengthDim R2 AsDouble= a1.Radius
        InfoWindow.WriteLine("L2="& L2.ToString)
        InfoWindow.WriteLine("R2="& R2.ToString)Dim P3 As Position = y.StartPointDim PX3 AsDouble= y.StartPoint.XDim L3 AsInteger= y.ArcLength
        InfoWindow.WriteLine("L3="& L3.ToString)
        InfoWindow.WriteLine("P3="& P3.ToString)
        InfoWindow.WriteLine("PX3="& PX3.ToString)Dim L4 AsInteger= a2.ArcLengthDim R4 AsDouble= a2.Radius
        InfoWindow.WriteLine("L4="& L4.ToString)
        InfoWindow.WriteLine("r1="& R4.ToString) 
        Dim P5 As Position = z.StartPointDim PX5 AsDouble= z.StartPoint.XDim L5 AsInteger= z.ArcLength
        InfoWindow.WriteLine("L3="& L5.ToString)
        InfoWindow.WriteLine("P3="& P5.ToString)
        InfoWindow.WriteLine("p31="& PX5.ToString) 
 
    EndSub 
    PublicOverridesSub OnCancel()' Code for when user clicks CancelEndSub 
    PublicOverridesSub OnUpdate(ByVal changedBlock As UI.Block.General) 
 
    EndSub 
EndClass

2nd code

Option Infer OnImports Snap, Snap.Create, Snap.MathPublicClass SnapBlockFormApplication16 : Inherits UI.BlockForm 
    ' Declarations of the blocks on a SnapBlockFormApplication16 dialogDim L1 As UI.Block.IntegerDim PX1 As UI.Block.IntegerDim L2 As UI.Block.IntegerDim R2 As UI.Block.IntegerDim L3 As UI.Block.IntegerDim PX3 As UI.Block.IntegerDim L4 As UI.Block.IntegerDim R4 As UI.Block.IntegerDim L5 As UI.Block.IntegerDim PX5 As UI.Block.Integer' Constructor for a SnapBlockFormApplication16 dialog objectPublicSubNew() 
        Me.Title="SnapBlockFormApplication16"' Text to be shown in title bar of dialogMe.Cue="Please enter information"' Text to be shown in cue line 
 
        L1 =New UI.Block.Integer
        L1.Label="L1"
        PX1 =New UI.Block.Integer
        PX1.Label="PX1"
        L2 =New UI.Block.Integer
        L2.Label="L2"
        R2 =New UI.Block.Integer
        R2.Label="R2"
        L3 =New UI.Block.Integer
        L3.Label="L3"
        L4 =New UI.Block.Integer
        L4.Label="L4"
        R4 =New UI.Block.Integer
        R4.Label="R4"
        L5 =New UI.Block.Integer
        L5.Label="L5"
        PX5 =New UI.Block.Integer
        PX5.Label="PX5" 
 
 
        Me.AddBlocks(L1, PX1, L2, R2, L3, PX3, L4, R4, L5, PX5) 
    EndSub 
    PublicSharedSub Main() 
 
        Dim myForm =New SnapBlockFormApplication16()
        myForm.Show() 
    EndSub 
    PublicOverridesSub OnShow() 
    EndSub 
    PublicOverridesSub OnOK() 
    EndSub 
    PublicOverridesSub OnApply()Dim a AsInteger= L1.ValueDim a1 AsInteger= PX1.ValueDim X1 AsInteger
        X1 = a1 +0.5* a
        InfoWindow.WriteLine("X1="& X1.ToString)Dim d AsInteger= L2.ValueDim d1 AsInteger= R2.ValueDim X2 AsDouble
        X2 =(a1 -(a1 /180))
        InfoWindow.WriteLine("X2="& X2.ToString)Dim b AsInteger= L3.ValueDim b1 AsInteger= PX3.ValueDim X3 AsInteger
        X3 = b1
        InfoWindow.WriteLine("X3="& X3.ToString)Dim e AsInteger= L4.ValueDim e1 AsInteger= R4.ValueDim X4 AsDouble
        X4 =(b1 -(b1 /180))
        InfoWindow.WriteLine("X4="& X4.ToString)Dim c AsInteger= L5.ValueDim c1 AsInteger= PX5.ValueDim X5 AsInteger
        X5 = c1 +0.5* c
        InfoWindow.WriteLine("X3="& X3.ToString)Dim Xt AsDouble
        Xt =((a * X1)+(b * X3)+(c * X5)+(d * X2)+(e * X4))/(a + b + c + d + e)
        InfoWindow.WriteLine("xt="& Xt.ToString)Dim a11 AsDouble
        a11 =2* System.Math.PI*(a + b + c + d + e)Dim d11 AsDouble
        d11 =2* System.Math.Sqrt(a11 / System.Math.PI)
        InfoWindow.WriteLine("diameter="& d11.ToString)Dim d22 AsDouble=2* d11
        Dim section As NX.Arc=Circle(0, 0, d22)Dim axis As Vector = Vector.AxisZDim length AsDouble=1Dim draft AsDouble=0Dim f As NX.Extrude
        f = Extrude({section}, axis, length, draft)EndSub 
    PublicOverridesSub OnCancel() 
    EndSub 
    PublicOverridesSub OnUpdate(ByVal changedBlock As UI.Block.General) 
 
    EndSub 
EndClass

Combining two codes (transferred)

$
0
0
Forums: 

Here's a slightly tidier version of the code. Posted here since it uses SNAP functions extensively:

Option Infer OnImports Snap, Snap.Create, Snap.Math 
PublicClass MyProgram : Inherits UI.BlockForm 
   ' Declarations of the blocks on a MyProgram dialogDim BlockLineX As UI.Block.SelectObjectDim BlockLineY As UI.Block.SelectObjectDim BlockLineZ As UI.Block.SelectObject 
   Dim BlockArc1 As UI.Block.SelectObjectDim BlockArc2 As UI.Block.SelectObject 
   ' Constructor for a MyProgram dialog objectPublicSubNew() 
      Me.Title="Select Curves"' Text to be shown in title bar of dialogMe.Cue="Please select lines and arcs"' Text to be shown in cue line 
      ' Create three blocks to select lines
      BlockLineX = CreateSelectLineBlock("Linex")
      BlockLineY = CreateSelectLineBlock("Liney")
      BlockLineZ = CreateSelectLineBlock("Linez") 
      ' Create two blocks to select arcs 
      BlockArc1 = CreateSelectArcBlock("Arc1")
      BlockArc2 = CreateSelectArcBlock("Arc2") 
      ' Add all the blocks to the BlockFormMe.AddBlocks(BlockLineX, BlockArc1, BlockLineY, BlockArc2, BlockLineZ) 
   EndSub 
   PublicSharedSub Main() 
      ' Create and display a MyProgram dialogDim myForm =New MyProgram()
      myForm.Show() 
   EndSub 
   PublicOverridesSub OnApply()Dim lineX As NX.Line= BlockLineX.SelectedObjects(0)Dim lineY As NX.Line= BlockLineY.SelectedObjects(0)Dim lineZ As NX.Line= BlockLineZ.SelectedObjects(0) 
      Dim arc1 As NX.Arc= BlockArc1.SelectedObjects(0)Dim arc2 As NX.Arc= BlockArc2.SelectedObjects(0) 
      Dim len1 = lineX.ArcLength     :    InfoWindow.WriteLine(" L1 = "& len1.ToString)Dim p1   = lineX.StartPoint    :    InfoWindow.WriteLine(" P1 = "& p1.ToString)Dim p1x  = p1.X                :    InfoWindow.WriteLine("PX1 = "& p1x.ToString) 
      Dim len2 = arc1.ArcLength      :    InfoWindow.WriteLine(" L2 = "& len2.ToString)Dim r2   = arc1.Radius         :    InfoWindow.WriteLine(" R2 = "& r2.ToString) 
      Dim len3 = lineY.ArcLength     :    InfoWindow.WriteLine(" L3 = "& len3.ToString)Dim p3   = lineY.StartPoint    :    InfoWindow.WriteLine(" P3 = "& p3.ToString)Dim p3x  = p3.X                :    InfoWindow.WriteLine("PX3 = "& p3x.ToString) 
      Dim len4 = arc2.ArcLength      :    InfoWindow.WriteLine(" L4 = "& len4.ToString)Dim r4   = arc2.Radius         :    InfoWindow.WriteLine(" R4 = "& r4.ToString) 
      Dim len5 = lineZ.ArcLength     :    InfoWindow.WriteLine(" L5 = "& len5.ToString)Dim p5   = lineZ.StartPoint    :    InfoWindow.WriteLine(" P5 = "& p5.ToString)Dim p5x  = p5.X                :    InfoWindow.WriteLine("PX5 = "& p5x.ToString) 
      InfoWindow.WriteLine("") 
      ' Do the geometry construction 
      Dim a = len1
      Dim b = len3
      Dim c = len5
      Dim d = len2
      Dim e = len4
 
      Dim X1 = p1x +0.5* a         :   InfoWindow.WriteLine("X1 = "& X1.ToString)Dim X2 =(p1x -(p1x /180))   :   InfoWindow.WriteLine("X2 = "& X2.ToString)Dim X3 = p3x                   :   InfoWindow.WriteLine("X3 = "& X3.ToString)Dim X4 =(p3x -(p3x /180))   :   InfoWindow.WriteLine("X4 = "& X4.ToString)Dim X5 = p5x +0.5* c         :   InfoWindow.WriteLine("X5 = "& X5.ToString) 
      Dim Xt AsDouble=( a*X1 + b*X3 + c*X5 + d*X2 + e*X4 )/(a + b + c + d + e)
      InfoWindow.WriteLine("XT = "& Xt.ToString) 
      Dim d11 AsDouble=2* System.Math.Sqrt(2*(a + b + c + d + e))
      InfoWindow.WriteLine("Diameter = "& d11.ToString) 
      Dim f As NX.Cylinder= Cylinder({0, 0, 0}, Vector.AxisZ, 1, 4* d11) 
   EndSub 
   ' Create a block for selecting a linePrivateFunction CreateSelectLineBlock(label AsString)As UI.Block.SelectObjectDim myBlock =New UI.Block.SelectObject
      myBlock.LabelString= label
      myBlock.SetFilter(Snap.NX.ObjectTypes.Type.Line)
      myBlock.MaximumScope= UI.Block.SelectionScope.AnyInAssemblyReturn myBlock
   EndFunction 
   ' Create a block for selecting an arcPrivateFunction CreateSelectArcBlock(label AsString)As UI.Block.SelectObjectDim myBlock =New UI.Block.SelectObject
      myBlock.LabelString= label
      myBlock.SetFilter(Snap.NX.ObjectTypes.Type.Arc)
      myBlock.MaximumScope= UI.Block.SelectionScope.AnyInAssemblyReturn myBlock
   EndFunction 
EndClass

converting 3D model to 2D sketch

$
0
0
Forums: 

I have certain 3D models if hollow cylindrical shape in sheet metal apllication & i want to convert them to 2D sketch. The sketch shpuld be equivalent to cylinder when it is seen from the front........... can you help

SNAP Blockstyler Error

$
0
0
Forums: 

I have been getting the following error:

Unhandled exception encountered in call back automation code.

This seems to occur if I exit out of the dialog, re-enter the dialog, and then click either OK or apply. If I switch to the modeling application and back to the drafting application, the file will run with no errors.

The NX log shows:

&MACRO OK 0 0 ! OK Callback  
*** EXCEPTION: Error code  3520041 in line 78 of D:\workdir\Reference\NX903_4\src\part\no\ind\jax_property_container.cxx at Thu May 28 10:23:43 2015 Eastern Daylight Time
+++ Property "BlockID" does not exist for block name ""

Any thought to what I did wrong?

The code:

'Program: qPlot'Description: Quickly plot a bannered Checkplot with correctly scaled lineweights for NX9'Creator: T. Mitchell'Creation Date: 16DE14'Version History: 16DE14 - Initial Program'               : 06JL15 - Changed from Registry stored plotter list to DSL Plotter File 
Option Infer OnImports Snap, Snap.CreateImports NXOpen, NXOpen.UFImports System
 
PublicClass qPlot : Inherits Snap.UI.BlockFormDim theSession As Session = Session.GetSession()Dim theUfSession As UFSession = UFSession.GetUFSession()Dim displayPart As Part = theSession.Parts.DisplayDim EV AsString= Environment.GetEnvironmentVariable("UGII_TEMPLATE_DIR")Dim plotterfile AsString= EV &"\available_plotters"Dim myStringElements AsInteger=0Dim strPlotter(0)AsString 
    ' Declarations of the blocks on a qPlot dialogDim blkPlotter As Snap.UI.Block.EnumerationDim blkPaper As Snap.UI.Block.Enumeration 
    ' Constructor for the qPlot dialog objectPublicSubNew()Me.Title="qPlot"' Text to be shown in title bar of dialogMe.Cue="Please select Plotter and Size"' Text to be shown in cue line 
        ' Create an Enumeration blocks (Plotter and Paper)
        blkPlotter =New Snap.UI.Block.Enumeration()
        blkPlotter.Label="Please select a Plotter"Dim ThisPlotter AsString
        Using sr As StreamReader =File.OpenText(plotterfile)
            ThisPlotter = sr.ReadLine()WhileNot ThisPlotter IsNothingReDim Preserve strPlotter(myStringElements)
                strPlotter(myStringElements)= ThisPlotter
                myStringElements +=1
                ThisPlotter = sr.ReadLine()EndWhileEnd Using
        blkPlotter.Items= strPlotter
 
        blkPaper =New Snap.UI.Block.Enumeration()
        blkPaper.Label="Please Select A Plot Scale"
        blkPaper.Items={"Full (1:1)", "Half (2:1)", "Other (11in Roll)"} 
        ' Add all the blocks to the BlockFormMe.AddBlocks(blkPlotter, blkPaper)', blkRefresh) 
    EndSub 
    PublicSharedSub Main() 
        ' Create and display a qPlot dialogDim myForm =New qPlot()
        myForm.Show() 
    EndSub 
    PublicOverridesSub OnShow()' Code for when dialog is displayedEndSub 
    PublicOverridesSub OnOK()' Code for when user clicks OKEndSub 
    PublicOverridesSub OnApply()Try
            PrepPlot()Catch ex As Exception
            InfoWindow.WriteLine(ex.Message)EndTry 
    EndSub 
    PublicOverridesSub OnCancel()' Code for when user clicks CancelEndSub 
    PublicOverridesSub OnUpdate(changedBlock As Snap.UI.Block.General) 
        If changedBlock = blkPlotter ThenElseIf changedBlock = blkPaper ThenEndIf 
    EndSub 
    PublicSub PrepPlot()Dim strPlotter AsString= blkPlotter.SelectedItemDim intSelectedSize AsInteger= blkPaper.SelectedIndex 
        Dim module_id AsInteger=0
        theUfSession.UF.AskApplicationModule(module_id) 
        ' Get user nameDim strUserName AsString=""
        theUfSession.UF.TranslateVariable("USERNAME", strUserName) 
        ' Get current date and timeDim CurDateTime As NXOpen.UF.SystemInfo
        theUfSession.UF.AskSystemInfo(CurDateTime) 
        ' Get current SheetDim tagSheet As Tag
        theUfSession.Draw.AskCurrentDrawing(tagSheet) 
        ' Get sheet dimensionsDim dwgSheet As Drawings.DrawingSheet= displayPart.DrawingSheets().CurrentDrawingSheet 
        Dim dblSheetHeight AsDouble= dwgSheet.HeightDim dblSheetLength AsDouble= dwgSheet.Length 
        Dim dblDistanceFromRight AsDoubleDim dblUserOriginX AsDoubleDim dblUserOriginY AsDouble 
        ' Compute X CoordinatesIf dblSheetLength > 1189Then
            dblDistanceFromRight =330
            dblUserOriginX =101Else
            dblDistanceFromRight =230
            dblUserOriginX =1EndIf 
        ' Compute user Y coordinateIf dblSheetLength > 1Then
            dblUserOriginY =1Else
            dblUserOriginY =0EndIf 
        ' Calculate user note locationDim dblCheckPlotXOrigin AsDouble=(dblSheetLength - dblDistanceFromRight) 
        ' Calculate user coordinatesDim userX AsDouble=(dblSheetLength - dblUserOriginX)Dim userY AsDouble=(dblSheetHeight - dblUserOriginY) 
        ' Add the check plot notesDim strCHKPlot AsString="CHECK PLOT - DO NOT USE TO SOURCE OR MANUFACTURE"Dim strUser AsString= CurDateTime.date_buf&" "& strUserName.ToUpperDim checkPlotNote As Annotations.Note= PlotBanner(dblCheckPlotXOrigin, 12.5, strCHKPlot, 7, 90)Dim userPlotNote As Annotations.Note= PlotBanner(userX, userY, strUser, 3.5, 0)Dim dbl11inScale AsDouble=270/ dblSheetHeight
        Dim dblPlotScale()AsDouble={1, 0.5, dbl11inScale} 
        ' Plot the Sheet
        UFPlotSheet(tagSheet, dblPlotScale(intSelectedSize), strPlotter) 
        ' Delete check plot noteDim DelMark As Session.UndoMarkId= theSession.SetUndoMark(Session.MarkVisibility.Visible, "Delete Notes") 
        Dim Note1 As NXObject =CType(checkPlotNote, NXObject)Dim Note2 As NXObject =CType(userPlotNote, NXObject)
        theSession.UpdateManager.AddToDeleteList(Note1)
        theSession.UpdateManager.AddToDeleteList(Note2)
        theSession.UpdateManager.DoUpdate(DelMark) 
    EndSub 
    PublicSub UFPlotSheet(ByVal sheet As Tag, plotscale AsDouble, strSelPlotter AsString) 
        ' Set Plot Job VariablesDim myJobOptions As UFPlot.JobOptions
        theUfSession.Plot.AskDefaultJobOptions(myJobOptions)
        myJobOptions.colors= UFPlot.Colors.BlackOnWhite
        myJobOptions.use_drawing_sheet_widths=False
        myJobOptions.widths= UFPlot.Widths.Custom3Widths 
        Dim jobName AsString
        theUfSession.Plot.AskDefaultJobName(sheet, jobName) 
        Dim jobUnits As UFPlot.Units= UFPlot.Units.Millimeters 
        Dim jobOrigin()AsDouble={0, 0, 0} 
        Dim jobBannerOptions As UFPlot.BannerOptions
        theUfSession.Plot.AskDefaultBannerOptions(jobBannerOptions) 
        ' Remove defaulted on banner text
        jobBannerOptions.show_banner=False 
        ' Find the default custom pen widthsDim jobDefaultWidths As UFCgm.CustomWidths
        theUfSession.Plot.AskSessionCustomWidths(jobDefaultWidths)
        jobDefaultWidths.use= UFCgm.WidthUse.WidthByWidth
        jobDefaultWidths.units= UFConstants.UF_PART_METRIC 
        ' Variable to hold new custom pen widthsDim CustomWidths()As UFCgm.WidthCustom= jobDefaultWidths.customDim intNumberOfWidths AsInteger= CustomWidths.Length 
        For i =0To intNumberOfWidths -1
            CustomWidths(i).Width= CustomWidths(i).Width* plotscale
        Next 
        jobDefaultWidths.custom= CustomWidths
        ' Actually set Pen widths!!!
        theUfSession.Plot.SetSessionCustomWidths(jobDefaultWidths) 
        Dim jobExtents As UFPlot.Extents 
        ' Add layout to Plot
        theUfSession.Plot.AddJobToPlotLayout(sheet, myJobOptions, jobName, jobUnits, jobOrigin, UFPlot.Rotation.Rotation0, plotscale, jobExtents) 
        ' Plot
        theUfSession.Plot.PrintPlotLayout(jobName, jobBannerOptions, strSelPlotter, "<System Profile>", 1) 
        ' Set widths back to defaultDim SetDefaultWidths As UFCgm.CustomWidths
        theUfSession.Plot.AskDefaultCustomWidths(SetDefaultWidths)
        SetDefaultWidths.use= UFCgm.WidthUse.WidthByWidth
        SetDefaultWidths.units= UFConstants.UF_PART_METRICDim DefaultWidths()As UFCgm.WidthCustom= SetDefaultWidths.custom
        SetDefaultWidths.custom= DefaultWidths
        ' Actually set pen widths!!!
        theUfSession.Plot.SetSessionCustomWidths(SetDefaultWidths) 
    EndSub 
    PublicFunction PlotBanner(ByVal userX AsDouble, _
                    ByVal userY AsDouble, _
                    ByVal BannerText AsString, _
                    ByVal fontheight AsDouble, _
                    ByVal bannerangle AsDouble)As Annotations.Note 
        Dim nullAnnotations_SimpleDraftingAid As Annotations.SimpleDraftingAid=Nothing 
        Dim UserNoteBuilder1 As Annotations.DraftingNoteBuilder
        UserNoteBuilder1 = displayPart.Annotations.CreateDraftingNoteBuilder(nullAnnotations_SimpleDraftingAid)
        UserNoteBuilder1.Origin.Plane.PlaneMethod= Annotations.PlaneBuilder.PlaneMethodType.XyPlane
        UserNoteBuilder1.Origin.SetInferRelativeToGeometry(True)If fontheight =7Then
            UserNoteBuilder1.Origin.Anchor= Annotations.OriginBuilder.AlignmentPosition.BottomLeftDim fontIndex2 AsInteger
            fontIndex2 = displayPart.Fonts.AddFont("lubalins")
            UserNoteBuilder1.Style.LetteringStyle.GeneralTextFont= fontIndex2
        Else
            UserNoteBuilder1.Origin.Anchor= Annotations.OriginBuilder.AlignmentPosition.TopRightEndIf 
        Dim nullView As View =NothingDim notepoint As Point3d =New Point3d(userX, userY, 0.0)
        UserNoteBuilder1.Origin.Origin.SetValue(Nothing, nullView, notepoint)
        UserNoteBuilder1.Style.LetteringStyle.Angle= bannerangle
        UserNoteBuilder1.Style.LetteringStyle.GeneralTextSize= fontheight
        Dim text1(0)AsString
        text1(0)= BannerText
        UserNoteBuilder1.Text.TextBlock.SetText(text1) 
        Dim BannerObject As Annotations.Note
        BannerObject = UserNoteBuilder1.Commit()
        UserNoteBuilder1.Destroy() 
        Return BannerObject
    EndFunction 
EndClass

Bounding Box of component in assembly

$
0
0
Forums: 

Hi,
I need to extract the information about bounding boxes of all components in the assembly. I can iterate through all the bodies inside component, but .Box property does not give the result for component itself (beside that SNAP reference says that Box is a member of Component class). I'm intrested especially in min and max values in z direction in absolute CSYS of assembly.
Here's example code I'm trying to run:

Imports Snap
Public Class ComponentsBB
   Public Shared Sub Main()
      Dim workPart As NX.Part = Snap.Globals.WorkPart
 
      For Each comp As NX.Component In workPart.RootComponent.Descendants
                   InfoWindow.WriteLine(comp.Box.MaxZ & Chr(9) & comp.Box.MinZ)
      Next
 
   End Sub
 
End Class

When you run it, it throws an exception. Any ideas?


MiniSnap & MAX() function with 3 argument?

$
0
0
Forums: 

To all

I am using MiniSnap to access some basic Math function. I do not have the full SNP licence.
I am using SQRT and MAX. Both seem to work OK but I have a problem with the Max() function with 3 arguments as NX crashes. it works with 2 arguments!

I have

 If Math.Max(dXmass,dYmass,dZmass)< TheEffMassThreshold Then....
where the input are Double

Any idea what is the cause of the problem?

Thanks
Regards
JXB

Enabling OK,Apply buttons in UI Styler

$
0
0
Forums: 

Hi,
I have recently started SNAP . I have a problem in Disable and Enable the OK, Apply buttons in UI Styler it seems to be silly but I hope I can get a solution for this!!!

Thanks in Advance

reading Annotation-jog detail from NXopen-cpp

$
0
0
Forums: 

I am reading annotation details from NXOpen-cpp, I tried under leader data and note collection.
If anyone know, please come out with exact function to get jog details under annotation.
I need jog tag especially.

Thank you.

NX SNAP opening assembly parts

$
0
0
Forums: 

New to SNAP, Trying to open all the parts in an assembly;

ForEach child As NX.Component In children
 
InfoWindow.WriteLine(child.Name.ToString) 
    InfoWindow.WriteLine(child.Name.ToString&" : Leaf : "& child.IsLeaf.ToString)
    InfoWindow.WriteLine(child.Name.ToString&" : Hidden : "& child.IsHidden.ToString)
    InfoWindow.WriteLine(child.Name.ToString&" : NXOpenTag : "& child.NXOpenTag.ToString)
    InfoWindow.WriteLine(child.Name.ToString&" : FullPath : "& child.Prototype.FullPath.ToString)
    InfoWindow.WriteLine(child.Name.ToString&" : Prototype.NXOpenTag : "& _ child.Prototype.NXOpenTag.ToString) 
next

I get results for everything except for prototype. Which crashes the program when a part is not loaded.

The error message : "Input tag is NXOpen.Tag.Null"

I need to know how to make sure all the parts in the assembly is loaded and how to avoid crashing the program if a part was not loaded. I tried by getting the NXOpen.Tag value. but refering to the prototype causes same problem.

Anyone knows how to get this information with having the user opening the assembly first?

Thanks in advance

Stan

Snap BlockForm. NXObject conversion to Line

$
0
0
Forums: 

Hey everyone. Just joined the Snap Community. I really like the simple functionality it offers but I encountered my first Problem. I have some basic knowledge in Visual Basic but still need to get into it.

To my Problem: I want to have the later user draw a rectangle before starting the Programm. When he starts the Programm there will Pop up a window asking the user to select two orthogonal lines. I wanna use those lines later to calculate two direction vectors and also the lengths of the selected lines. Ive gotten so far that i created the Dialog but i cant seem to convert the SelectedObject type or NXObject type into a line so i can look at the length and direction. Im also asking myself how i can take out the selected lines of the Blockform class to use it for later purposes. This is how ive gotten so far. Any tips on the conversions or return of the desired objects ?

Imports Snap, Snap.Create, Snap.NX.ObjectTypes, Snap.Compute, Snap.UI.Input, Snap.NXImports Snap.UI 
PublicClass MyProgram
 
    PublicSharedSub Main() 
        Dim menustart AsNew Squaremenu
 
        menustart.Show() 
 
    EndSub 
 
EndClass 
PublicClass Squaremenu : Inherits Snap.UI.BlockForm 
    ' Declarations of the blocks on a SnapBlockFormApplication1 dialogDim line1block As Snap.UI.Block.SelectObjectDim line2block As Snap.UI.Block.SelectObject 
 
 
 
 
 
    ' Constructor for a SnapBlockFormApplication1 dialog objectPublicSubNew() 
        Me.Title="Define your cubicle area geometry"' Text to be shown in title bar of dialogMe.Cue="Select relevant points"' Text to be shown in cue line 
        line1block =New Snap.UI.Block.SelectObject()
        line1block.SetCurveFilter()
        line1block.LabelString="Select Line 1 (left)" 
        line2block =New Snap.UI.Block.SelectObject()
        line2block.SetCurveFilter()
        line2block.LabelString=" Select Line 2 (right)" 
 
 
        ' Create addition blocks here, as you wish, and delete' any of the ones above, if you don’t need them. 
        ' Add all the blocks to the BlockFormMe.AddBlocks(line1block, line2block) 
    EndSub 
    PublicSharedSub Main() 
 
        Dim myForm =New Squaremenu()
        myForm.Show() 
    EndSub 
    PublicOverridesSub OnShow()' Code for when dialog is displayedEndSub 
    PublicOverridesSub OnOK() 
        'I know i must do the conversion and return here but the conversion doesnt work  
 
         Dim line1 as Line
 
         line1 = line1block.SelectedObjects 
    EndSub 
    PublicOverridesSub OnApply() 
 
    EndSub 
    PublicOverridesSub OnCancel()' Code for when user clicks CancelEndSub 
    PublicOverridesSub OnUpdate(changedBlock As Snap.UI.Block.General) 
    EndSub 
EndClass

Any help is much appreciated since there isnt alot of info on the web except for the Snap Guide.

Cheers

Extracting or merging bodies

$
0
0
Forums: 

Hey everyone it is me again. I was wondering if there is a good way to get multiple bodies into one with Snap. Much like the "Extract geometry" function. What im doing is, im checking the distance for bodies and if they are inside a Body im trimming them. Ofc i get a trim Body for each trim, so i would like to add some cleaning up.

I tried to add all of them to an Array and orphan them so i can at least delete the extrude and the outside bodies but it doesnt seem to work. Somehow bodies with distance > 0 get inside my Array. Dunno why.

Heres the code:

    Public Shared Function Extrudearc(ByRef curvestoextrude() As NX.Curve)
 
        Arraysortarc(curvestoextrude)
        exbody = Snap.Create.ExtrudeSheet(curvestoextrude, exvector, exlength, 0)
 
        Dim selectbodymenu As New Trimmenu
        selectbodymenu.Show()
        Dim bodyhold() As NX.Body
        Dim bodycount As Integer = 0
 
 
        For Each body As Object In exbody.Bodies
 
            If Compute.Distance(body, selectedbody) = 0 Then
                Snap.Create.TrimBody(body, selectedbody, False)
            End If
        Next
 
 
    End Function
 
 
End Class

Problem about compile SNAP Blockform

$
0
0
Forums: 

After compile my code to .Dll and subsequently sign it, this .DLL can work well with my computer but with another computer it have an error as shown below according to NX log:

====================================================================
*** EXCEPTION: Error code 3520048 in line 643 of o:\ugnx110\ip33\src\nxblockstyler\no\ind\BlockStyler_DialogCreator.cxx at Fri Mar 03 19:07:51 2017 SE Asia Standard Time
+++ Error occurred. The Snap dialog is NULL in Snap dialog wrap.
====================================================================

The .dll file can found here:
https://drive.google.com/open?id=0B_zaO-dsz3ZmelBCQ0NZYmpVdkU

What can I do to solve this issue? Thanks.


Copying Text to Other Sheets

$
0
0
Forums: 

This Snap program works and came from the Snap Reference Guide. Everything is all right with one exception. When running this journal the fruits are straight across on a "D" size drawing and price, interest, and vendor are away and form a general note. My objective is to have what is run on the 1st sheet and only the fruits (Apple, Banana, and Cherry) take over on the rest of the sheets in the NX9 spec file.I could have a 100 sheets so who cares how many sheets there are.

Could somebody help me with the rest of the puzzle.

Imports Snap, Snap.Create

Public Class MyProgram

Public Shared Sub Main()

' Create a very simple one-line note.
' We pass "Nothing", so formatting will be controlled by preferences
Dim p As New Position(30, 65)
Note(p, Nothing, "Hello")

' A more interesting three-line note,
' again using formatting from annotation preferences
Dim lines As String() = New String(3) {}
lines(0) = "Price: €247 ± €5 for 25cm³"
lines(1) = "Interest: about ¼% per month"
lines(2) = "Vendor: Nuñez Mfg, Grüberstraße"
Note(New Position(10, 10), Nothing, lines)

' Create a TextStyle object representing annotation preferences,
' and modify a few things about it (color, font, size)
Dim blueCambria12 As New NX.TextStyle()
blueCambria12.Color = System.Drawing.Color.Blue
blueCambria12.FontName = "Cambria"
blueCambria12.FontSize = 12

' Now use this TextStyle to create three notes
Note(New Position(10, 20), blueCambria12, "Apple")
Note(New Position(20, 20), blueCambria12, "Banana")
Note(New Position(30, 20), blueCambria12, "Cherry")

End Sub

End Class

Using Snap Text

$
0
0
Forums: 

Below is a simple snap Journal placing The text on the Drawing sheet. My problem is the text ends up being a PMI note and want this to be a TEXT note. Any suggestions??

Imports Snap, Snap.Create

Public Class MyProgram

Public Shared Sub Main()

Imports Snap, Snap.Create

Public Class MyProgram

Public Shared Sub Main()

Dim blueCambria12 As New NX.TextStyle()
blueCambria12.Color = System.Drawing.Color.Blue
blueCambria12.FontName = "Cambria"
blueCambria12.FontSize = 12

' Now use this TextStyle to create three notes
Note(New Position(10, 20), blueCambria12, "Apple")
Note(New Position(20, 20), blueCambria12, "Banana")
Note(New Position(30, 20), blueCambria12, "Cherry")

End Sub

End Class

Sheet Size

Surface from points help

$
0
0
Forums: 

I am importing points from an Excel file, processing it row by row. Each row contains 3 points. I was going to attempt to surface these points similar to the SNAP sample code below:

Dim p00, p01, p02, p03, p10, p11, p12, p13, p20, p21, p22, p23 As Position
 
      p00 ={0, 0, 0}   :   p01 ={0, 3, 1}   :   p02 ={0, 6, 1}  :  p03 ={0, 9, 0}
      p10 ={3, 0, 1}   :   p11 ={3, 3, 2}   :   p12 ={3, 6, 2}  :  p13 ={3, 9, 1}
      p20 ={6, 0, 0}   :   p21 ={6, 3, 1}   :   p22 ={6, 6, 2}  :  p23 ={6, 9, 0} 
      Dim thruPoints As Position(,)={{p00, p01, p02, p03}, {p10, p11, p12, p13}, {p20, p21, p22, p23}} 
      ' Create Bezier patch using default nodes
      BezierPatchThroughPoints(thruPoints)

I am getting stuck on the thruPoints variable though. How do I properly create thruPoints from:

For i AsInteger= intStartingRow To intLastRow
 
                    Dim ptStart AsNew Position With{.X= xlsWorkSheet.Cells(i, "A").Value,
                        .Y= xlsWorkSheet.Cells(i, "B").Value,
                        .Z= xlsWorkSheet.Cells(i, "C").Value}Dim ptMid AsNew Position With{.X= xlsWorkSheet.Cells(i, "D").Value,
                        .Y= xlsWorkSheet.Cells(i, "E").Value,
                        .Z= xlsWorkSheet.Cells(i, "F").Value}Dim ptEnd AsNew Position With{.X= xlsWorkSheet.Cells(i, "D").Value,
                        .Y= xlsWorkSheet.Cells(i, "E").Value,
                        .Z= xlsWorkSheet.Cells(i, "F").Value}Next

face names

$
0
0
Forums: 

Hi all,

I'm new in journaling.
I'm looking for a journal example for editting the face/edge names.

This if for that we are able to set our legacy data to named faces/edges.
Making it better possible to replace components and still get the Assembl contrains right

So i hope that any one can help me with this.
i have created the Dialog that i want to use.

'==============================================================================
' WARNING!! This file is overwritten by the Block UI Styler while generating
' the automation code. Any modifications to this file will be lost after
' generating the code again.
'
' Filename: C:\Users\Ruud van den Brand\Desktop\TFS\Dialog\Face_edge_Names.vb
'
' This file was generated by the NX Block UI Styler
' Created by: Ruud van den Brand
' Version: NX 11
' Date: 03-18-2019 (Format: mm-dd-yyyy)
' Time: 13:37 (Format: hh-mm)
'
'==============================================================================

'==============================================================================
' Purpose: This TEMPLATE file contains VB.NET source to guide you in the
' construction of your Block application dialog. The generation of your
' dialog file (.dlx extension) is the first step towards dialog construction
' within NX. You must now create a NX Open application that
' utilizes this file (.dlx).
'
' The information in this file provides you with the following:
'
' 1. Help on how to load and display your Block UI Styler dialog in NX
' using APIs provided in NXOpen.BlockStyler namespace
' 2. The empty callback methods (stubs) associated with your dialog items
' have also been placed in this file. These empty methods have been
' created simply to start you along with your coding requirements.
' The method name, argument list and possible return values have already
' been provided for you.
'==============================================================================

'------------------------------------------------------------------------------
'These imports are needed for the following template code
'------------------------------------------------------------------------------
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.BlockStyler

'------------------------------------------------------------------------------
'Represents Block Styler application class
'------------------------------------------------------------------------------
Public Class Face_edge_Names
'class members
Private Shared theSession As Session
Private Shared theUI As UI
Private theDlxFileName As String
Private theDialog As NXOpen.BlockStyler.BlockDialog
Private group3 As NXOpen.BlockStyler.Group' Block type: Group
Private AlignFace As NXOpen.BlockStyler.FaceCollector' Block type: Face Collector
Private group2 As NXOpen.BlockStyler.Group' Block type: Group
Private TouchFace As NXOpen.BlockStyler.FaceCollector' Block type: Face Collector
Private group1 As NXOpen.BlockStyler.Group' Block type: Group
Private InnerEdge As NXOpen.BlockStyler.CurveCollector' Block type: Curve Collector
Private group As NXOpen.BlockStyler.Group' Block type: Group
Private OuterEdge As NXOpen.BlockStyler.CurveCollector' Block type: Curve Collector

#Region "Block Styler Dialog Designer generator code"
'------------------------------------------------------------------------------
'Constructor for NX Styler class
'------------------------------------------------------------------------------
Public Sub New()
Try

theSession = Session.GetSession()
theUI = UI.GetUI()
theDlxFileName = "Face_edge_Names.dlx"
theDialog = theUI.CreateDialog(theDlxFileName)
theDialog.AddApplyHandler(AddressOf apply_cb)
theDialog.AddOkHandler(AddressOf ok_cb)
theDialog.AddUpdateHandler(AddressOf update_cb)
theDialog.AddInitializeHandler(AddressOf initialize_cb)
theDialog.AddDialogShownHandler(AddressOf dialogShown_cb)

Catch ex As Exception

'---- Enter your exception handling code here -----
Throw ex
End Try
End Sub
#End Region

'------------------------------- DIALOG LAUNCHING ---------------------------------
'
' Before invoking this application one needs to open any part/empty part in NX
' because of the behavior of the blocks.
'
' Make sure the dlx file is in one of the following locations:
' 1.) From where NX session is launched
' 2.) $UGII_USER_DIR/application
' 3.) For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly
' recommended. This variable is set to a full directory path to a file
' containing a list of root directories for all custom applications.
' e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_BASE_DIR\ugii\menus\custom_dirs.dat
'
' You can create the dialog using one of the following way:
'
' 1. Journal Replay
'
' 1) Replay this file through Tool->Journal->Play Menu.
'
' 2. USER EXIT
'
' 1) Create the Shared Library -- Refer "Block UI Styler programmer's guide"
' 2) Invoke the Shared Library through File->Execute->NX Open menu.
'
'------------------------------------------------------------------------------
Public Shared Sub Main()
Dim theFace_edge_Names As Face_edge_Names = Nothing
Try

theFace_edge_Names = New Face_edge_Names()
' The following method shows the dialog immediately
theFace_edge_Names.Show()

Catch ex As Exception

'---- Enter your exception handling code here -----
theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
Finally
If theFace_edge_Names IsNot Nothing Then
theFace_edge_Names.Dispose()
theFace_edge_Names = Nothing
End If
End Try
End Sub
'------------------------------------------------------------------------------
' This method specifies how a shared image is unloaded from memory
' within NX. This method gives you the capability to unload an
' internal NX Open application or user exit from NX. Specify any
' one of the three constants as a return value to determine the type
' of unload to perform:
'
'
' Immediately : unload the library as soon as the automation program has completed
' Explicitly : unload the library from the "Unload Shared Image" dialog
' AtTermination : unload the library when the NX session terminates
'
'
' NOTE: A program which associates NX Open applications with the menubar
' MUST NOT use this option since it will UNLOAD your NX Open application image
' from the menubar.
'------------------------------------------------------------------------------
Public Shared Function GetUnloadOption(ByVal arg As String) As Integer
'Return CType(Session.LibraryUnloadOption.Explicitly, Integer)
Return CType(Session.LibraryUnloadOption.Immediately, Integer)
' Return CType(Session.LibraryUnloadOption.AtTermination, Integer)
End Function
'------------------------------------------------------------------------------
' Following method cleanup any housekeeping chores that may be needed.
' This method is automatically called by NX.
'------------------------------------------------------------------------------
Public Shared Sub UnloadLibrary(ByVal arg As String)
Try

Catch ex As Exception

'---- Enter your exception handling code here -----
theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
End Try
End Sub

'------------------------------------------------------------------------------
'This method shows the dialog on the screen
'------------------------------------------------------------------------------
Public Sub Show()
Try

theDialog.Show

Catch ex As Exception

'---- Enter your exception handling code here -----
theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
End Try
End Sub

'------------------------------------------------------------------------------
'Method Name: Dispose
'------------------------------------------------------------------------------
Public Sub Dispose()
If theDialog IsNot Nothing Then
theDialog.Dispose()
theDialog = Nothing
End If
End Sub

'------------------------------------------------------------------------------
'---------------------Block UI Styler Callback Functions--------------------------
'------------------------------------------------------------------------------

'------------------------------------------------------------------------------
'Callback Name: initialize_cb
'------------------------------------------------------------------------------
Public Sub initialize_cb()
Try

group3 = CType(theDialog.TopBlock.FindBlock("group3"), NXOpen.BlockStyler.Group)
AlignFace = CType(theDialog.TopBlock.FindBlock("AlignFace"), NXOpen.BlockStyler.FaceCollector)
group2 = CType(theDialog.TopBlock.FindBlock("group2"), NXOpen.BlockStyler.Group)
TouchFace = CType(theDialog.TopBlock.FindBlock("TouchFace"), NXOpen.BlockStyler.FaceCollector)
group1 = CType(theDialog.TopBlock.FindBlock("group1"), NXOpen.BlockStyler.Group)
InnerEdge = CType(theDialog.TopBlock.FindBlock("InnerEdge"), NXOpen.BlockStyler.CurveCollector)
group = CType(theDialog.TopBlock.FindBlock("group"), NXOpen.BlockStyler.Group)
OuterEdge = CType(theDialog.TopBlock.FindBlock("OuterEdge"), NXOpen.BlockStyler.CurveCollector)

Catch ex As Exception

'---- Enter your exception handling code here -----
theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
End Try
End Sub

'------------------------------------------------------------------------------
'Callback Name: dialogShown_cb
'This callback is executed just before the dialog launch. Thus any value set
'here will take precedence and dialog will be launched showing that value.
'------------------------------------------------------------------------------
Public Sub dialogShown_cb()
Try

'---- Enter your callback code here -----

Catch ex As Exception

'---- Enter your exception handling code here -----
theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
End Try
End Sub

'------------------------------------------------------------------------------
'Callback Name: apply_cb
'------------------------------------------------------------------------------
Public Function apply_cb() As Integer
Dim errorCode as Integer = 0
Try

'---- Enter your callback code here -----

Catch ex As Exception

'---- Enter your exception handling code here -----
errorCode = 1
theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
End Try
apply_cb = errorCode
End Function

'------------------------------------------------------------------------------
'Callback Name: update_cb
'------------------------------------------------------------------------------
Public Function update_cb(ByVal block As NXOpen.BlockStyler.UIBlock) As Integer
Try

If block Is AlignFace Then
'---- Enter your code here -----

ElseIf block Is TouchFace Then
'---- Enter your code here -----

ElseIf block Is InnerEdge Then
'---- Enter your code here -----

ElseIf block Is OuterEdge Then
'---- Enter your code here -----

End If

Catch ex As Exception

'---- Enter your exception handling code here -----
theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
End Try
update_cb = 0
End Function

'------------------------------------------------------------------------------
'Callback Name: ok_cb
'------------------------------------------------------------------------------
Public Function ok_cb() As Integer
Dim errorCode as Integer = 0
Try

'---- Enter your callback code here -----
errorCode = apply_cb()

Catch ex As Exception

'---- Enter your exception handling code here -----
errorCode = 1
theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
End Try
ok_cb = errorCode
End Function

'------------------------------------------------------------------------------
'Function Name: GetBlockProperties
'Returns the propertylist of the specified BlockID
'------------------------------------------------------------------------------
Public Function GetBlockProperties(ByVal blockID As String) As PropertyList
GetBlockProperties = Nothing
Try

GetBlockProperties = theDialog.GetBlockProperties(blockID)

Catch ex As Exception

'---- Enter your exception handling code here -----
theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
End Try
End Function

End Class

Viewing all 30 articles
Browse latest View live


Latest Images