smuthuc Posted July 14, 2018 Posted July 14, 2018 (edited) Please the below VBA code not working please correct this one Public Sub Draw_Bpoly() Dim p As Variant p = ThisDrawing.Utility.GetPoint(, "First the Point:") Dim p1(1) As Double p1(0) = p(0) p1(1) = p(1) ThisDrawing.SetVariable "osmode", 0 ThisDrawing.SendCommand "_.-boundary" & vbCr & "_A" & vbCr & "_I" & vbCr & "_N" & vbCr & vbCr & vbCr & p1 & vbCr End Sub thanking you... Edited July 16, 2018 by SLW210 Code Tags Quote
lrm Posted July 14, 2018 Posted July 14, 2018 I'm not an AutoCAD VBA user and do not have it installed but I would think that p should be dimensioned as an array and not a plain variant. For example, Dim p(0 To 2) As Double Quote
maratovich Posted July 14, 2018 Posted July 14, 2018 Public Sub Draw_Bpoly() Dim p As Variant Dim pstr As String p = ThisDrawing.Utility.GetPoint(, "Pick the inner point of boundary") pstr = Replace(CStr(p(0)), ",", ".") & "," & Replace(CStr(p(1)), ",", ".") ThisDrawing.SendCommand Chr(3) & Chr(3) & "_.-boundary" & vbCr & pstr & vbCr & vbCr End Sub Quote
smuthuc Posted July 16, 2018 Author Posted July 16, 2018 (edited) Thanking you.... i used yours code. but i is showing invalid input.... but i changed little things and it will work well once again thanking.... Public Sub Draw_Bpoly() Dim p As Variant Dim pstr As String p = ThisDrawing.Utility.GetPoint(, "Pick the inner point of boundary") pstr = Replace(CStr(p(0)), ",", ".") & "," & Replace(CStr(p(1)), ",", ".") ThisDrawing.SendCommand "_.-boundary" & vbCr & pstr & vbCr & vbCr End Sub Edited July 16, 2018 by SLW210 Code Tags Quote
smuthuc Posted July 16, 2018 Author Posted July 16, 2018 (edited) Thanking you for your kind replys....... i used your advice even i will show type mismatch then i got solution from others like you i will work well Public Sub Draw_Bpoly() Dim p As Variant p = ThisDrawing.Utility.GetPoint(, "First the Point:") ThisDrawing.SetVariable "osmode", 0 ThisDrawing.SendCommand "_.-boundary" & vbCr & "_A" & vbCr & "_I" & vbCr & "_N" & vbCr & vbCr & vbCr & p(0) & "," & p(1) & vbCr & vbCr End Sub thanking you... Edited July 16, 2018 by SLW210 Code Tags Quote
SLW210 Posted July 16, 2018 Posted July 16, 2018 Please read the Code Posting Guidelines and have your Code to be included in Code Tags.[NOPARSE] Your Code Here[/NOPARSE] = Your Code Here Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.