PDA

View Full Version : drawing temporary lines



san_k4
2005-01-13, 05:20 AM
Is it possible to draw temporary lines in drawing,through vba (which can
be removed later by redraw/regen)
thanks in advance

SANTHOSH

Ed Jobe
2005-01-13, 04:04 PM
VBA doesn't give you the ability to create any new types of lines. What you could do is draw the lines on a certain layer and then redefine redraw and regen commands so that they delete anything on the temp layer.

ntaylor
2005-01-13, 10:03 PM
VBA does not but lisp does. Here is a simple VBA example that calls the grvecs lisp function to draw a line from 0,0 to 1,1. The line will disappear as soon as you Zoom, Redraw, etc.

Public Sub DrawToScreen()
Dim strGRVECS As String
Dim varReturned As Variant
strGRVECS = "(grvecs '(-7 (0 0)(1 1))) "
varReturned = EvalLisp(strGRVECS)
End Sub

Public Function EvalLisp(strLisp As String) As Variant
Dim objVL As Object
Dim objVLF As Object
Dim objVLO As Object
Set objVL = ThisDrawing.Application.GetInterfaceObject("VL.Application.16")
Set objVLF = objVL.ActiveDocument.Functions
Set objVLO = objVLF.Item("read").funcall(strLisp)
EvalLisp = objVLF.Item("eval").funcall(objVLO)
End Function

Regards - Nathan

Robert.Hall
2005-01-14, 01:51 PM
Hmmm, never thought of temporary lines......can you give an example of what you might want to use TLs for???

Ed Jobe
2005-01-14, 04:23 PM
I've never had a need to use that lisp command. VBA can draw graphics too. But I was assuming that he needed to use temporary lines for constructing other geometry, snapping, etc. Does grvecs create lines that are snappable? or just graphic? Help doesn't indicate whether or not it can.

ntaylor
2005-01-17, 01:49 AM
I've never had a need to use that lisp command. VBA can draw graphics too. But I was assuming that he needed to use temporary lines for constructing other geometry, snapping, etc. Does grvecs create lines that are snappable? or just graphic? Help doesn't indicate whether or not it can. just a graphic

san_k4
2005-01-17, 04:19 AM
Oops!it would have been better if I had revealed my intentions in the first place!!..i am trying Out a routine to view revisions from session to session. I need to see only the
Text modifications.the purpose is to draw rectangles around text which are modifiied.
Ofcourse highlighting the entities will work fine. But I feel drawing rectangles around
The text will give more clarity…

Thank u all for showing lot of interest…

santhosh

Coolmo
2005-01-17, 04:16 PM
If you're doing this for tracking revisions... rather, if I were doing this for tracking revisions, I would create permanent lines, not temporay lines, around the text objects changed and place the newly created boxes on a "REV-01-17-05" layer with the current date displayed in the layer. That way I could really track what has changed by just turning off and on all the REV-Date layers according to date.