Jump to content


timpittser

Member Since 27 Aug 2008
Offline Last Active Nov 05 2014 02:52 PM

Posts I've Made

In Topic: When I exit the CAD screen and then re-enter it there is no functionality

04 November 2014 - 03:27 PM

Have not gotten a response on this matter, it's becoming a critical issue for me, many customers are complaining.  Some assistance would be greatly appreciated.


In Topic: When I exit the CAD screen and then re-enter it there is no functionality

14 July 2014 - 07:22 PM

Not exactly sure what you're needing, but below is the code that loads when I load the screen:


Private Sub StakingCAD_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load

Me.Left = (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - Me.Width) / 2

Me.Top = (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height - Me.Height) / 2

Call InitAvax()

Call ResizeControls()

Call LoadFile("")

Call CAvax1.LoadPalette(My.Application.Info.DirectoryPath & "\color.pal")

CAvax1.SetAvaxProperty(Avax.AvaxProp.ShapeZorderOn_p, True)

CAvax1.SetAvaxProperty(Avax.AvaxProp.TransparentPicOn_p, True)

Using conn = New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & MDIParent1.TextBox2.Text & "\FieldSolutions.ixp;")

Dim dbAdapter2 As New OleDb.OleDbDataAdapter("SELECT * from sketchlayers", conn)

Dim dbDataSet2 As New DataSet

Dim colstyle As New DataGridViewCellStyle

dbAdapter2.Fill(dbDataSet2)

Dim dbDataTable2 As DataTable = dbDataSet2.Tables(0)

If dbDataTable2.Rows.Count > 0 Then

For a = 0 To dbDataTable2.Rows.Count - 1

ComboBox3.Items.Add(dbDataTable2.Rows(a).Item("layer_desc"))

If dbDataTable2.Rows(a).Item("layer_desc") = "General" Then

ComboBox3.Text = "General"

Button2.BackColor = System.Drawing.ColorTranslator.FromWin32(CAvax1.GetPalColor(dbDataTable2.Rows(0)("layer_color")))

TextBox8.Text = dbDataTable2.Rows(0)("layer_color")

If dbDataTable2.Rows(0)("layer_style") = "Solid" Then ComboBox4.Text = "0)" & dbDataTable2.Rows(0)("layer_style")

If dbDataTable2.Rows(0)("layer_style") = "Dashed" Then ComboBox4.Text = "1)" & dbDataTable2.Rows(0)("layer_style")

If dbDataTable2.Rows(0)("layer_style") = "Hidden" Then ComboBox4.Text = "2)" & dbDataTable2.Rows(0)("layer_style")

If dbDataTable2.Rows(0)("layer_style") = "Center" Then ComboBox4.Text = "3)" & dbDataTable2.Rows(0)("layer_style")

If dbDataTable2.Rows(0)("layer_style") = "Phantom" Then ComboBox4.Text = "4)" & dbDataTable2.Rows(0)("layer_style")

If dbDataTable2.Rows(0)("layer_style") = "Dot" Then ComboBox4.Text = "5)" & dbDataTable2.Rows(0)("layer_style")

If dbDataTable2.Rows(0)("layer_style") = "Dot Dashed" Then ComboBox4.Text = "6)" & dbDataTable2.Rows(0)("layer_style")

NumericUpDown7.Value = dbDataTable2.Rows(0)("width")

Color.Text = dbDataTable2.Rows(0)("layer_color")

TextBox8.Text = dbDataTable2.Rows(0)("layer_color")

CAvax1.PenLayer = dbDataTable2.Rows(0)("layer_number")

End If

Next

End If

End Using

Prompt1.EnableInput = True

End Sub


In Topic: using 'CAvax1.SetLayers' vb.net, can't find anything on the subject

09 July 2014 - 07:09 PM

            Dim sLayerNames() As String, iLayerStatus() As Short, iMaxLayers As Short
            Dim lMax As Short
            Dim Index As Short
            Using conn = New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & MDIParent1.TextBox2.Text & "\FieldSolutions.ixp;")
                Dim dbAdapter2 As New OleDb.OleDbDataAdapter("SELECT * from sketchlayers where layer_number = " & DataGridView1.CurrentRow.Cells(1).Value, conn)
                Dim dbDataSet2 As New DataSet
                Dim colstyle As New DataGridViewCellStyle
                dbAdapter2.Fill(dbDataSet2, "sketchlayers")
                Dim dbDataTable2 As DataTable = dbDataSet2.Tables(0)
                If dbDataTable2.Rows.Count > 0 Then
                    If dbDataTable2.Rows(0)("Layer_on_off") = "X" Then
                        Dim imgcell As New DataGridViewImageCell
                        DataGridView1.CurrentRow.Cells(2) = imgcell
                        DataGridView1.CurrentRow.Cells(2).Style.Alignment = DataGridViewContentAlignment.MiddleCenter
                        DataGridView1.CurrentRow.Cells(2).Value = (Image.FromFile(Application.StartupPath & "\off_light.bmp"))
                        dbDataTable2.Rows(0)("Layer_on_off") = ""
                        lMax = StakingCAD.CAvax1.GetLayers(sLayerNames, iLayerStatus)
                        Index = DataGridView1.CurrentRow.Cells(1).Value
                        iLayerStatus(Index) = 1 'iLayerStatus(Index) Or 1 '(Or 1 : Hidden/ Or 2 : Locked / Or 4 : NonPrintable)
                        Call StakingCAD.CAvax1.SetLayers(sLayerNames, iLayerStatus)
                    Else
                        Dim imgcell As New DataGridViewImageCell
                        DataGridView1.CurrentRow.Cells(2) = imgcell
                        DataGridView1.CurrentRow.Cells(2).Style.Alignment = DataGridViewContentAlignment.MiddleCenter
                        DataGridView1.CurrentRow.Cells(2).Value = (Image.FromFile(Application.StartupPath & "\on_light.bmp"))
                        dbDataTable2.Rows(0)("Layer_on_off") = "X"
                        lMax = StakingCAD.CAvax1.GetLayers(sLayerNames, iLayerStatus)
                        Index = DataGridView1.CurrentRow.Cells(1).Value
                        iLayerStatus(Index) = 0 'iLayerStatus(Index) Or 1 '(Or 1 : Hidden/ Or 2 : Locked / Or 4 : NonPrintable)
                        Call StakingCAD.CAvax1.SetLayers(sLayerNames, iLayerStatus)
                    End If
                End If
                Dim builder As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(dbAdapter2)
                dbAdapter2.Update(dbDataSet2, "sketchlayers")
            End Using
            DataGridView1.Refresh()

I finally got it to work, here's the code I used the switch layers on and off from a layer screen.


In Topic: Changing the screen order of objects all ready drawn

09 July 2014 - 01:12 PM

I think I got this working, thanks.


In Topic: using 'CAvax1.SetLayers' vb.net, can't find anything on the subject

09 July 2014 - 12:49 PM

I tried this, and I'm getting an error, where the '()' is underlined and it states 'Number of indices is less than the number of dimensions of the indexed array'.