Hatch palette dialog

Hatch palette dialog

Anonymous
Not applicable
589 Views
1 Reply
Message 1 of 2

Hatch palette dialog

Anonymous
Not applicable

On the blog "Through the interface", I saw it was possible to call the hatch palette dialog through .Net or VB.Net. I need to do the same thing in VBA. Unfortuneraly, VBA does not seem to accept IntPtr as a type, so the function doesn't work.

Private Declare Function acedHatchPalletteDialog Lib "acad.exe" Alias "?acedHatchPalletteDialog@@YA_NPB_W_NAAPA_W@Z" (ByVal currentPattern As String, ByVal showcustom As Boolean, ByRef newpattern As IntPtr) As Boolean

Private Sub CGFMHATCH_Click()
Dim sHatchType As String
sHatchType = "ANGLE"
Dim ptr As IntPtr
Dim bRet As Boolean
If acedHatchPalletteDialog(sHatchType, True, ptr) Then
    TGFMHATCH.Text = sHatchType
End If
'ThisDrawing.SendCommand "BHATCH" & vbCr
End Sub

 

Does anybody know a way to make this action work with VBA?

 

THanks,

Maxime

0 Likes
590 Views
1 Reply
Reply (1)
Message 2 of 2

truss_85
Advocate
Advocate

is that what you want or am I missing something?

 

Sub call_hatch_dialog()

Dim sysVarName As String
Dim sysVarData As Variant
Dim intData As Integer
sysVarName = "HPDLGMODE"
intData = 1
sysVarData = intData
ThisDrawing.SetVariable sysVarName, sysVarData

ThisDrawing.SendCommand "BHATCH" & vbCr

End Sub

 

0 Likes