Sorry, the middle line of code should have been:
ThisDrawing.Utility.getEntity ent, basePoint, Prompt
"Norman Yuan" wrote in message
news:5683489@discussion.autodesk.com...
There are many people doing AutoCAD programming with VB/VBA. You may have
better chances to get anwsers to your future questions in
autodesk.autocad.customization.vba NG.
Here is comment on your code.
Since the UserForm in Acad is modal form (by default), meaning when form is
shown, you cannot reach Acad editor to allow user to pick something.
So, you code in cmdSelect_Clcik event handler should be like:
Private Sub cmdSelect_Click()
''Hide the UserForm to allow interactive action to Acad
Me.Hide
''Do the pick
Dim ent As AcadEntity
Prompt = vbCrLf & "Specify line to offset: "
'You need to add "Set" keyword
Set ent = ThisDrawing.Utility.GetEntity(getobj, basePnt, Prompt)
''Do something with the picked Entity
'When done, show the UserForm again
Me.Show
End Sub
wrote in message news:5683407@discussion.autodesk.com...
I was wondering if anyone used VB for Autocad, I have minimal VB training,
but am trying to write a small program. I'm stuck on hgetting user imput,
so if anyone knows what I'm doing wrong, it would be greatly appreciated if
you let me know what it is. I know mt argument is bad, but I'm not sure
what to do to fix it.
Here is the code:
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdNext_Click()
frmROWOFFSET3.Show
End Sub
Private Sub cmdSelect_Click()
Dim ent As AcadEntity
Prompt = vbCrLf & "Specify line to offset: "
ent = ThisDrawing.Utility.GetEntity(getobj, basePnt, Prompt)
End Sub