Visual Basic Acil Yardım Lütfen

Bu konuyu okuyanlar

nfrgvn

Öğrenci
Katılım
6 Şubat 2016
Mesajlar
1
Reaksiyon puanı
0
Puanları
0
Hazırladığım Bir progrmada bir dll dosyası kullanıyorum. o dll dosyasında da aşağıdaki fonksyon var.

Public Declare Sub CadSetCmdParam Lib "vecad.dll" (ByVal hDwg As Long, ByVal Command As Long, ByVal pData As Any)

Bu fonksyona veri göndermeye çalışıyorum. Aşağıya kodları ekleyeyim.

öncelikle şöyle bi class oluşturdum


Private Class CMDPRM_INSERT_BLOCK
Public bShowDialog As Integer ' if TRUE - "Insert Block" dialog will be shown, if FALSE - no
Public idBlock As Integer ' identifier of block
Public bCoord As Integer ' if TRUE - InsPnt is used, if FALSE - specify coords on-screen
Public InsPntX As Double ' insertion point
Public InsPntY As Double
Public InsPntZ As Double
Public bScale As Integer ' if TRUE - Scale is used, if FALSE - specify scale on-screen
Public bUniScale As Integer ' same scale as X for Y, Z
Public ScaleX As Double ' scale
Public ScaleY As Double
Public ScaleZ As Double
Public bAngle As Integer ' if TRUE - Angle is used, if FALSE - specify angle on-screen
Public Angle As Double ' rotation angle
Public bExplode As Integer ' if TRUE - explode block after insertion
Public RowDist As Double ' distance between rows. (0 for no array)
Public ColDist As Double ' distance between columns. (0 for no array)
Public NumRows As Integer ' number of rows. (1 for no array)
Public NumCols As Integer ' number of columns. (1 for no array)
End Class

sonrasında da aşağıdaki kod ile fonksyona değer gönderiyorum

Dim hBlock As Integer = AxVecad1.GetBlockByName("Data Priz")
Dim prm As New CMDPRM_INSERT_BLOCK
If (hBlock) Then
prm.bShowDialog = 0 ' hide the "Insert Block" dialog
prm.idBlock = hBlock ' identifier of block
prm.bCoord = 0 ' specify coordinates "on-screen"
prm.InsPntX = 0.0 ' insertion point coordinates
prm.InsPntY = 0.0
prm.InsPntZ = 0.0
prm.bScale = 1 ' use the specified scale
prm.bUniScale = 0
prm.ScaleX = 2.0 ' block scale
prm.ScaleY = 2.0
prm.ScaleZ = 2.0
prm.bAngle = 1 ' specify angle "on-screen"
prm.Angle = 0.0 ' rotation angle
prm.bExplode = 0
prm.RowDist = 1.0
prm.ColDist = 1.0
prm.NumRows = 1
prm.NumCols = 1
AxVecad1.SetCmdParam(252, prm) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
AxVecad1.Execute(252)
End If


prm yazdığım yere yazdıysam kabul ettiremedim. bu class bir komutun ayar değerlerini tutuyor ve ben bunu fonksyona göndermek istiyorum. Yardımcı olursanız sevinirim.
 
Üst