AVAX-software.com Forums: Predefined shapes - AVAX-software.com Forums

Jump to content

Page 1 of 1

Predefined shapes

#1 User is offline   hamipers Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 50
  • Joined: 06-May 05
  • Location:Ker
  • Interests:ASP.NET<br />C#.NET<br />MS SQL Server 2000<br />Delphi<br />.<br />.<br />.<br />Painting<br />Sculpture<br />Music<br />Thinking

Posted 29 May 2005 - 06:23 PM

Hi there

I need to let the end user draw some predefined shapes that are compound actually. For example two small crossing lines (like + sign). How could I do this? By the way I need to know how I can customize the default icons that you have used in Avax, like Osnap icons on the bottom-left corner or shape icons on the top-right corner. Once i change one of them, everything stops working. By the way I would like to know what the usage of 'Select Add' option in 'Select' menu is.

Thank you

#2 User is offline   Athanasios Gardos Icon

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

Posted 30 May 2005 - 06:27 AM

Hi,

Example on how to make a cross line.

Option Explicit

Dim R As Single

Private Sub cAvax1_SelectedPoints(SelectId As String, lPointNumber As Long, x1() As Single, y1() As Single, z1() As Single)
   If SelectId = "Select 1 point" Then
      If lPointNumber = 1 Then
         Call cAvax1.Add_Line(x1(1), y1(1) - R, z1(1), x1(1), y1(1) + R, z1(1))
         Call cAvax1.Add_Line(x1(1) - R, y1(1), z1(1), x1(1) + R, y1(1), z1(1))
      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 = "Select 1 point"
   lPointToSelect = 1
   Call cAvax1.SelectPoints(sSelectID, lPointToSelect, x(), y(), z())
End Sub

Private Sub Form_Load()
   Command1.Caption = "Select 1 point"
   Call cAvax1.StartAvax
   R = 5
End Sub

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


About 'Select Add': When the end user wants to select more than one object he has to press Ctrl button while he is selecting the object. This works when the 'Select Add' operation is enable (cAvax1.Command = SelectAdd_c).
When the 'Select Add' operation is not enable (cAvax1.Command = SelectSub_c) then AVAX unselects the selected objects.
Athanasios Gardos
Avax-Software.com

#3 User is offline   hamipers Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 50
  • Joined: 06-May 05
  • Location:Ker
  • Interests:ASP.NET<br />C#.NET<br />MS SQL Server 2000<br />Delphi<br />.<br />.<br />.<br />Painting<br />Sculpture<br />Music<br />Thinking

Posted 30 May 2005 - 07:37 AM

Thank you for your response. But how am I gonna use cAvax1_SelectedPoints? You have retrieved the selected points by selectpoints sub. But you havent used the point coordinates (x, y, z) in any code.

#4 User is offline   hamipers Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 50
  • Joined: 06-May 05
  • Location:Ker
  • Interests:ASP.NET<br />C#.NET<br />MS SQL Server 2000<br />Delphi<br />.<br />.<br />.<br />Painting<br />Sculpture<br />Music<br />Thinking

Posted 30 May 2005 - 09:35 AM

I assume 'Selectpoints' gets me the coordinates of the selected points. But each time I try it, it seems it fails to evaluate x,y and z. So when I try to use the coordinates after 'Call Selectpoints(...)', an error message dialog appears saying I'm using Null references. Also when I use 'Selectpoints' with one point to select and click on the screen, the crossing extended lines of selection remain on the screen and when I use another command or click on any icon, they disappear without setting the coordinates in x,y and z arrays. Would you please tell me what can be wrong with my code?

#5 User is offline   Athanasios Gardos Icon

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

Posted 30 May 2005 - 11:10 AM

Hi,

cAvax1_SelectedPoints is an event.
In VB.NET appears like this:
Private Sub cAvax1_SelectedPoints(ByVal sender As Object, ByVal e As AxAvax.__cAvax_SelectedPointsEvent) Handles cAvax1.SelectedPoints

    End Sub

About the x(),y(),z() coordinates, please have a look at:Topic 10
You can also send me by e-mail a small example which is not working to see what is going on.
Athanasios Gardos
Avax-Software.com

#6 User is offline   hamipers Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 50
  • Joined: 06-May 05
  • Location:Ker
  • Interests:ASP.NET<br />C#.NET<br />MS SQL Server 2000<br />Delphi<br />.<br />.<br />.<br />Painting<br />Sculpture<br />Music<br />Thinking

Posted 30 May 2005 - 12:00 PM

Thank u again.
When I use Selectpoints method, 2 crossing lines appear to let me select a point. But once I click on the screen, they stop moving without drawing any shape. I wonder what can be wrong. Also i debugged it. In the lines after Selectpoints, the values of x, y and z arrays are 'Nothing'.

#7 User is offline   hamipers Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 50
  • Joined: 06-May 05
  • Location:Ker
  • Interests:ASP.NET<br />C#.NET<br />MS SQL Server 2000<br />Delphi<br />.<br />.<br />.<br />Painting<br />Sculpture<br />Music<br />Thinking

Posted 30 May 2005 - 12:05 PM

Right now I noticed another method. Getselectedpoints. How would I use this? Is it what I actually need to use? I used it after Selectpoints method, but the values are still Null!

#8 User is offline   Athanasios Gardos Icon

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

Posted 30 May 2005 - 01:27 PM

Hi,

I've made an example in VB.NET and it is working. The only way to find out what is happening is to send me a small example of your code by e-mail.
Athanasios Gardos
Avax-Software.com

Page 1 of 1


Fast Reply

  

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