Mike.
"It's time to throw all their damn tea in the harbor again!"
We did that for a while but found that the arrows caused us problems
later. I don't recall the exact problem but when later changing some
property of the arrows or the layer they are on they behaved in a
strange manner.
We now use the following routine. I created this lisp routine and
assigned it to a button. Seems to work well for us. only minor
annoyance is that the line and the head are two separate entities
and need to be erased separately if no longer needed.
;;;ARROW will allow arrows to be drawn quickly and easily.
;;;Written by PJS 9/95
(defun C:arrow ()
(command "undo" "be")
(initget 1)
(setq p1 (getpoint "\nLeader start point:"))
(initget 1)
(setq p2 (getpoint p1 "\nNext point:"))
(setq ang (angle p1 p2))
(setq sf (getint "\nEnter Scale factor or \"0\" to pick an actual size for
arrow head. <48> :"))
(if (= sf nil)(setq sf 48))
(if (= sf 0)
(setq asize(getdist "Enter or pick a distance for arrow size: "))
(setq asize (* sf 0.125))
)
(command "SOLID" p1 (polar p1 (+ ang 0.165) asize)
(polar p1 (- ang 0.165) asize) "" "")
(command "LINE" p1 p2 "")
(command "redraw")
(command "undo" "end")
(princ)
)
(princ)
>Michael D. Sohn wrote:
>>
>> I just can't seem to figure out how to insert an arrow at the end of a
>> line/pline. I'm using R12. Can anyone help me?
>>
>> Mike.
Another way is to creat a simple shape and insert that at the appropriate
scale. From the shape and a little lisp programmimg you can do all kinds of
leaders and even change the dimarrow. A third way is to use a neat little
arrow block.
If you can write lisp then use a ployline that is in two parts
where the first part has its starting width at zero and its ending
width at the arrow width size, length of this segment is the arrow
length. continue with the polyline back at width zero.
This will give you a single entity that can be rotated easily.
(a problem with dim leaders).
as this quick & dirty routine shows..
;; Simple arrow head and polyline drawing routine.
(defun c:aline ()
(setq pt1 (getpoint "\nStart of arrow line: "))
(setq pt2 (getpoint pt1 "\nLine junction/end: "))
(setq ang (angle pt1 pt2)
arr_width 2.5 ; Change to suit
arr_length 6 ; or set to DIMASZ
pt3 (polar pt1 ang arr_length) ; arrow base position
);setq
(setvar "cmdecho" 0) ; Save setting & restore?
(command "pline" pt1 "w" 0 arr_width pt3 "w" 0 0 pt2)
(while
(setq pt1 (getpoint pt2 "\nLine junction/end: "))
(command pt1)
(setq pt2 pt1)
);while
(command)
(princ)
);defun
Dave.
What about taking this little exercise a step further: arrows, leaders
and blocks that are scaled relative to the *current* viewport where
multiple viewports of various scale exist in the drawing. I suppose
setting a USERRx variable to the effective sheet height when a border is
inserted in paper space, then using something like:
(defun C:XLEAD ()
(setvar DIMSCALE (/ (getvar "VIEWSIZE")(getvar "USERRx"))
(some_leader_and_or_block_insertion_routine_that_uses_dimscale)
(setvar "DIMSCALE" 0)
)
[crude, I know, but it gets the point across]
An additional plus would be creating these by layers by viewport so that
vplayer can be used to toggle their visibility. It would probably be a
bit much to ask to have the ability to resize them if the viewport zoom
factor is changed, but...
--
Jim Schroff j...@schroff.sat.tx.us jsch...@texas.net
--
Or, just type "Dim1" rtn "L" rtn use the object snap "endpoint" to
select the endpoint of the pline, then to get the leader, you need to
pick a point far out enough to allow the leader to be drawn. it doesn't
matter where you pick the point, as long as it at the correct angle. Now
after you pick your point type "U", then cancel out of the command. this
will undo the line that always gets drawn and exits the command.
you can even write a lisp routine or even a script file would work
have fun. . .
Desi Moreno
Engineering Tech.
Modesto Irrigation District
Modesto, Calif.
E-Mail de...@mid.org
***************************************************
* Peter Staehling pst...@aplcomm.jhuapl.edu *
* or stae...@jhuapl.edu *
***************************************************
Paul Chapman
just to throw my two bits in, I include the following simple routine.
(defun c:aro ()
(command "undo" "m")
(setq end1 0)
(while (/= end1 nil)
(setq end1 nil)
(setvar "osmode" 1)
(setq end1 (getpoint "\nPick point near end "))
(setvar "osmode" 512)
(if (/= end1 nil)
(progn
(setvar "osmode" 0)
(setq end2 (getpoint end1 "\nPick 2nd point in dir away from arrow "))
(command ".dim1" "lea" end1 end2 ^c)
(command ".erase" "l" "")
);progn
); if
(setvar "osmode" 0)
);while
(princ)
)
Cheers,
**********************************************************************
*** Cliff W. Estes ces...@seanet.com ***
*** BaseLine Technology ph (206)882-7317 ***
*** 15834 NE 67th Place fax (206)882-7327 ***
*** Redmond, WA 98052 http://www.basline.com/basline ***
*** Home of BaseLine II, THE interactive hull fairing system ***
**********************************************************************
BaseLine II Demo available http://www.bateau.com
BaseLine Technology is now on the Web at http://www.basline.com/basline