AVAX-software.com Forums: Insert Block - AVAX-software.com Forums

Jump to content

Page 1 of 1

Insert Block

#1 User is offline   MarioRainer Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 43
  • Joined: 11-May 08
  • Location:Germany

Posted 14 May 2008 - 11:54 AM

Hello,

one Question more...

I would like to insert a BLOCK. The block is selected in a Preview-Form.
I only find the function…

AvaxHandle = cAvax1.Add_Block(sBlockName, x1, y1, z1, vItemProperties, sScale, sAngle)


I would like to position the block with the mouse and not by code.

Can someone help me?

Thank you

Mario Rainer

#2 User is offline   Athanasios Gardos Icon

  • Administrator
  • Icon
  • Group: Admin
  • Posts: 333
  • Joined: 21-March 05
  • Gender:Male

Posted 14 May 2008 - 01:09 PM

Please, have a look at the following VB6 example:
Option Explicit

Private Sub cAvax1_SelectedPoints(SelectId As String, lPointNumber As Long, x1() As Single, y1() As Single, z1() As Single)
  Dim sBlockName As String, AvaxHandle As Long, sProp() As String
  Dim sScale As Single, sAngle As Single
  If SelectId = "Insert Block" Then
     If lPointNumber = 1 Then
        sBlockName = "test"
        sScale = 1
        sAngle = 0
        AvaxHandle = cAvax1.Add_Block(sBlockName, x1(1), y1(1), z1(1), sProp(), sScale, sAngle)
        If AvaxHandle = 0 Then
           MsgBox "Block " & sBlockName & " not found", vbCritical, ""
           cAvax1.Command = Redraw_c
        End If
     End If
  End If
End Sub

Private Sub Command1_Click()
  Dim sSelectID As String
  Dim lPointToSelect As Long
  Dim x() As Single, y() As Single, z() As Single
  sSelectID = "Insert Block"
  lPointToSelect = 1
  Call cAvax1.SelectPoints(sSelectID, lPointToSelect, x(), y(), z())
End Sub

Private Sub Form_Load()
  Command1.Caption = "Insert Block"
  Call cAvax1.StartAvax
End Sub

Private Sub Form_Unload(Cancel As Integer)
  Call cAvax1.EndAvax
End Sub

Athanasios Gardos
Avax-Software.com

#3 User is offline   MarioRainer Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 43
  • Joined: 11-May 08
  • Location:Germany

Posted 14 May 2008 - 01:58 PM

Hello Sir,

thank you for the fast help, it´s great...

Mario Rainer

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users