Rubberband between GETPOINTS?

Rubberband between GETPOINTS?

Anonymous
Not applicable
761 Views
12 Replies
Message 1 of 13

Rubberband between GETPOINTS?

Anonymous
Not applicable

So I've got my custom leader command almost perfect
(or perfect enough) but I'm missing one thing - that nice rubber band between my
getpoints.

 

The way I'm doing it is to prompt the user for a
StartPoint, a NextPoint and a LastPoint:

 

StartPoint = ThisDrawing.Utility.GetPoint(, vbcr
& "Select leader start point: ")

NextPoint =
ThisDrawing.Utility.GetPoint(StartPoint, "Select next leader point:
")

LastPoint = ThisDrawing.Utility.GetPoint(NextPoint,
"Select last leader point: ")

 

Then these go into an array for the
AddLeader...

 

Its a little unnerving that once you pick the
NextPoint, the "line" between StartPoint and NextPoint disappears. Any ideas for
keeping it or am I going about the whole gepoint thing wrong?

 

Thanks in advance for any help!

 
0 Likes
762 Views
12 Replies
Replies (12)
Message 2 of 13

Anonymous
Not applicable
That is the way the GetPoint method is meant to work. It will only rubberband from the point supplied to where there cursor is until the user selects a point. To do what I think you want you could once NextPoint is selected draw a line between StartPoint & NextPoint and once LastPoint is selected delete the line.

Regards - Nathan
0 Likes
Message 3 of 13

Anonymous
Not applicable
You might be able to access the grdraw lisp function
using the VL.APPLICATION
--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"pkirill" wrote in message
news:4833983@discussion.autodesk.com...
So I've got my custom leader command almost perfect (or perfect enough) but
I'm missing one thing - that nice rubber band between my getpoints.

The way I'm doing it is to prompt the user for a StartPoint, a NextPoint and
a LastPoint:

StartPoint = ThisDrawing.Utility.GetPoint(, vbcr & "Select leader start
point: ")
NextPoint = ThisDrawing.Utility.GetPoint(StartPoint, "Select next leader
point: ")
LastPoint = ThisDrawing.Utility.GetPoint(NextPoint, "Select last leader
point: ")

Then these go into an array for the AddLeader...

Its a little unnerving that once you pick the NextPoint, the "line" between
StartPoint and NextPoint disappears. Any ideas for keeping it or am I going
about the whole gepoint thing wrong?

Thanks in advance for any help!
0 Likes
Message 4 of 13

Anonymous
Not applicable
That's what I was afraid of. You don't happen to know of a way to "tag" the
line(s) drawn so they can be quickly erased just prior to the creation of
the leader do you?

Thanks for the fast response!

wrote in message news:4834009@discussion.autodesk.com...
That is the way the GetPoint method is meant to work. It will only
rubberband from the point supplied to where there cursor is until the user
selects a point. To do what I think you want you could once NextPoint is
selected draw a line between StartPoint & NextPoint and once LastPoint is
selected delete the line.

Regards - Nathan
0 Likes
Message 5 of 13

Anonymous
Not applicable
The only way to 'tag' them, AFAIK, would be attaching XData, or some such
method, which is certainly overkill. Just keep the object and delete when
you're done.....something like

StartPoint = ThisDrawing.Utility.GetPoint(, vbcr & "Select leader start
point: ")
NextPoint = ThisDrawing.Utility.GetPoint(StartPoint, "Select next leader
point: ")
set objLine = ThisDrawing.ModelSpace.AddLine(StartPoint, NextPoint)
LastPoint = ThisDrawing.Utility.GetPoint(NextPoint, "Select last leader
point: ")
'Draw your leader
objLine.Delete

I've seen posts here about some way of getting the GRDRAW lisp functionality
via a class that you can get off the web from one of the regulars, here, I
think. I've never gotten into it, but I know some others here have, if you
really want to get into that, search the group for GRDRAW.

"pkirill" wrote in message
news:4834268@discussion.autodesk.com...
That's what I was afraid of. You don't happen to know of a way to "tag" the
line(s) drawn so they can be quickly erased just prior to the creation of
the leader do you?

Thanks for the fast response!

wrote in message news:4834009@discussion.autodesk.com...
That is the way the GetPoint method is meant to work. It will only
rubberband from the point supplied to where there cursor is until the user
selects a point. To do what I think you want you could once NextPoint is
selected draw a line between StartPoint & NextPoint and once LastPoint is
selected delete the line.

Regards - Nathan
0 Likes
Message 6 of 13

Anonymous
Not applicable
....I should have read your response before I posted....;)

"Jorge Jimenez" wrote in message
news:4834011@discussion.autodesk.com...
You might be able to access the grdraw lisp function
using the VL.APPLICATION
0 Likes
Message 7 of 13

Anonymous
Not applicable

I would forget the getpoint method and just draw
the lines.

Now you have the lines and the points.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


So I've got my custom leader command almost
perfect (or perfect enough) but I'm missing one thing - that nice rubber band
between my getpoints.

 

The way I'm doing it is to prompt the user for a
StartPoint, a NextPoint and a LastPoint:

 

StartPoint = ThisDrawing.Utility.GetPoint(, vbcr
& "Select leader start point: ")

NextPoint =
ThisDrawing.Utility.GetPoint(StartPoint, "Select next leader point:
")

LastPoint =
ThisDrawing.Utility.GetPoint(NextPoint, "Select last leader point:
")

 

Then these go into an array for the
AddLeader...

 

Its a little unnerving that once you pick the
NextPoint, the "line" between StartPoint and NextPoint disappears. Any ideas
for keeping it or am I going about the whole gepoint thing wrong?

 

Thanks in advance for any help!


size=2>
 
0 Likes
Message 8 of 13

Anonymous
Not applicable
I'm not familiar with VL.APPLICATION - know where I can find more info or
examples on that?

I was able to get grdraw to work using ThisDrawing.SendCommand ("(grdraw...
and following it up later with a ThisDrawing.SendCommand("redraw" & vbcr)

Is there a way to send a REDRAW via VBA? I've search the help and this NG
and no luck...

Thanks for your help!


"Jorge Jimenez" wrote in message
news:4834011@discussion.autodesk.com...
You might be able to access the grdraw lisp function
using the VL.APPLICATION
--
0 Likes
Message 9 of 13

Anonymous
Not applicable
>I was able to get grdraw to work using ThisDrawing.SendCommand ("(grdraw...
>and following it up later with a ThisDrawing.SendCommand("redraw" & vbcr)

In this case just use SendCommand with "LEADER"...?

"pkirill" wrote in message
news:4834353@discussion.autodesk.com...
I'm not familiar with VL.APPLICATION - know where I can find more info or
examples on that?

I was able to get grdraw to work using ThisDrawing.SendCommand ("(grdraw...
and following it up later with a ThisDrawing.SendCommand("redraw" & vbcr)

Is there a way to send a REDRAW via VBA? I've search the help and this NG
and no luck...

Thanks for your help!


"Jorge Jimenez" wrote in message
news:4834011@discussion.autodesk.com...
You might be able to access the grdraw lisp function
using the VL.APPLICATION
--
0 Likes
Message 10 of 13

Anonymous
Not applicable
This post may be of interest to you. http://discussion.autodesk.com/thread.jspa?messageID=3955682
I don't think VBA has a REDRAW method. Another alternative is to evaluate the lisp redraw function with VL.APPLICATION.
Regards - Nathan
0 Likes
Message 11 of 13

Anonymous
Not applicable
This looked like fun, so taking a bit of code from that link I came up with
this:
[code]
Sub grdraw_test()
Dim pt1, pt2
Dim VL As Object
Dim VLF As Object
Dim VLO As Object
Dim drawList As String

Set VL = GetInterfaceObject("VL.Application.1") 'or .16 for 2004+
Set VLF = VL.ActiveDocument.Functions

On Error GoTo Resume_here 'this is just a quick way of handling an "enter"
to _
end the point selection process. A more robust
handler _
shoud be used
pt1 = ThisDrawing.Utility.GetPoint(, vbCr & "Start point: ")
Do Until Err.Number <> 0
pt2 = ThisDrawing.Utility.GetPoint(pt1, vbCr & "Next point: ")
drawList = "(grdraw " & pt_list(pt1) & " " & pt_list(pt2) & " 7)"
Set VLO = VLF.Item("read").funcall(drawList)
VLF.Item("eval").funcall VLO
pt1 = pt2
Loop

Resume_here:
'do stuff for leader
Set VLO = VLF.Item("read").funcall("(redraw)")
VLF.Item("eval").funcall VLO
End Sub

Private Function pt_list(pt) As String
Dim newStr As String
newStr = "'(" & pt(0) & " " & pt(1) & ")"
pt_list = newStr
End Function


wrote in message news:4835322@discussion.autodesk.com...
This post may be of interest to you.
http://discussion.autodesk.com/thread.jspa?messageID=3955682
I don't think VBA has a REDRAW method. Another alternative is to evaluate
the lisp redraw function with VL.APPLICATION.
Regards - Nathan
0 Likes
Message 12 of 13

Anonymous
Not applicable
Kewl little piece of code, muckracker..........thanks, much, for posting.
Very nice example of solving several issues I've had.

"muckraker" wrote in message
news:4835378@discussion.autodesk.com...
This looked like fun, so taking a bit of code from that link I came up with
this:
[code]
Sub grdraw_test()
Dim pt1, pt2
Dim VL As Object
Dim VLF As Object
Dim VLO As Object
Dim drawList As String

Set VL = GetInterfaceObject("VL.Application.1") 'or .16 for 2004+
Set VLF = VL.ActiveDocument.Functions

On Error GoTo Resume_here 'this is just a quick way of handling an "enter"
to _
end the point selection process. A more robust
handler _
shoud be used
pt1 = ThisDrawing.Utility.GetPoint(, vbCr & "Start point: ")
Do Until Err.Number <> 0
pt2 = ThisDrawing.Utility.GetPoint(pt1, vbCr & "Next point: ")
drawList = "(grdraw " & pt_list(pt1) & " " & pt_list(pt2) & " 7)"
Set VLO = VLF.Item("read").funcall(drawList)
VLF.Item("eval").funcall VLO
pt1 = pt2
Loop

Resume_here:
'do stuff for leader
Set VLO = VLF.Item("read").funcall("(redraw)")
VLF.Item("eval").funcall VLO
End Sub

Private Function pt_list(pt) As String
Dim newStr As String
newStr = "'(" & pt(0) & " " & pt(1) & ")"
pt_list = newStr
End Function
0 Likes
Message 13 of 13

Anonymous
Not applicable
Very nice - great education. Thank for posting the code!

Paul


"muckraker" wrote in message
news:4835378@discussion.autodesk.com...
This looked like fun, so taking a bit of code from that link I came up with
this:
[code]
Sub grdraw_test()
Dim pt1, pt2
Dim VL As Object
Dim VLF As Object
Dim VLO As Object
Dim drawList As String

Set VL = GetInterfaceObject("VL.Application.1") 'or .16 for 2004+
Set VLF = VL.ActiveDocument.Functions

On Error GoTo Resume_here 'this is just a quick way of handling an "enter"
to _
end the point selection process. A more robust
handler _
shoud be used
pt1 = ThisDrawing.Utility.GetPoint(, vbCr & "Start point: ")
Do Until Err.Number <> 0
pt2 = ThisDrawing.Utility.GetPoint(pt1, vbCr & "Next point: ")
drawList = "(grdraw " & pt_list(pt1) & " " & pt_list(pt2) & " 7)"
Set VLO = VLF.Item("read").funcall(drawList)
VLF.Item("eval").funcall VLO
pt1 = pt2
Loop

Resume_here:
'do stuff for leader
Set VLO = VLF.Item("read").funcall("(redraw)")
VLF.Item("eval").funcall VLO
End Sub

Private Function pt_list(pt) As String
Dim newStr As String
newStr = "'(" & pt(0) & " " & pt(1) & ")"
pt_list = newStr
End Function


wrote in message news:4835322@discussion.autodesk.com...
This post may be of interest to you.
http://discussion.autodesk.com/thread.jspa?messageID=3955682
I don't think VBA has a REDRAW method. Another alternative is to evaluate
the lisp redraw function with VL.APPLICATION.
Regards - Nathan
0 Likes