Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

double arrow leader

36 REPLIES 36
Reply
Message 1 of 37
molokaiboy
17134 Views, 36 Replies

double arrow leader

Is there a way to draw a leader with an arrow head on both sides?

TIA

Collin
36 REPLIES 36
Message 21 of 37
Anonymous
in reply to: molokaiboy

Or, do you always WANT it to snap to nearest and perpendicular, to put this kind of thing perpendicularly from one line/pline over to another parallel one, or something? If so, and you're doing it by having Nea & Per set as running Osnap modes, I think Nea is always going to win out over Per (the Nearest point on the line/pline will always be closer to the pick location than the point that's Perpendicular from the previous point, unless they happen to be the same). [The one exception would be if you're picking a little beyond the end of the line/pline but its endpoint is still within the Osnap target -- then Per COULD win out over Nea, but only if the resulting perpendicular location falls beyond that endpoint. (And not TOO far beyond that endpoint, or the endpoint itself will be Nearer.) That's one of the VERY few situations in which Nea wouldn't win out over virtually any other Osnap option, so I don't know that it's ever much good to set Nearest as a running Osnap mode, unless it's the only one you have running. (There ARE very few such situations, but not none. If you had Nea and Ins running, and picked around a piece of text, Nea would lose, because there's no such thing as the Nearest point on a piece of text. And Nea could lose out to Cen on a circle or arc if the Osnap target was big enough in relation to the radius that the target could pick up the curve with the pick location actually closer to the center.)] If that's what you want, you could do the following, with running Osnap disabled one way or another: (setq arrowhead1 (getpoint "Pick one Endpoint: ") "nea") (setq arrowhead2 (getpoint "Pick other Endpoint: ") "per") (command "LEADER" arrowhead1 arrowhead2 "" "" "N") (command "LEADER" arrowhead2 arrowhead1 "" "" "N") The last line should also be replaceable by (command "LEADER" "@" arrowhead1 "" "" "N") Or without disabling Osnap, maybe: (setq arrowhead1 (getpoint "Pick one Endpoint: ")) (setq arrowhead2 (getpoint "Pick other Endpoint: ")) (command "LEADER" "nea" arrowhead1 "per" arrowhead2 "" "" "N") (command "LEADER" "@" "nea" arrowhead1 "" "" "N") Kent Cooper, AIA "molokaiboy" wrote... > this works as well, but why does it snap to certain points when I have my osnaps set to nearest and perpendicular? > > Collin
Message 22 of 37
Anonymous
in reply to: molokaiboy

See my second response to your previous message (we crossed in the mail) -- I suspect Nea is beating out Per. Kent Cooper, AIA "molokaiboy" wrote... > No go...After I select the first point, the second point snaps to a perpendicular point which is not perpendicular to the first point selected. Any ideas? > > Collin
Message 23 of 37
Anonymous
in reply to: molokaiboy

I take part of it back. Use the first version. In the second version, (command "LEADER" "@" "nea" arrowhead1 "" "" "N") could go wrong because the first leader would now be there, and the "nea" point to the arrowhead1 pick-location might be on that leader, not on the line where the first end (i.e., the arrowhead point) of that leader would now be. Kent Cooper, AIA
Message 24 of 37
molokaiboy
in reply to: molokaiboy

I just need the line to be parallel from the first point that I selected. Which one should I go with?

Collin
Message 25 of 37
Anonymous
in reply to: molokaiboy

If you mean PERPENDICULAR (to something) from the first point you selected, without any Nearest part muddying up the first point, this should work, with Osnap disabled one way or another: (setq arrowhead1 (getpoint "Pick one Endpoint: ")) (setq arrowhead2 (getpoint "Pick other Endpoint: ") "per") (command "LEADER" arrowhead1 arrowhead2 "" "" "N") (command "LEADER" arrowhead2 arrowhead1 "" "" "N") Kent Cooper, AIA "molokaiboy" wrote... > I just need the line to be parallel from the first point that I selected. Which one should I go with? > > Collin
Message 26 of 37
molokaiboy
in reply to: molokaiboy

I still need to have the user select a point using the nearest osnap, then perpendicular to that first point selected.

Collin
Message 27 of 37
molokaiboy
in reply to: molokaiboy

I got it to work. I have to do a series of turning off osnaps.

Thanks

Collin
Message 28 of 37
Anonymous
in reply to: molokaiboy

Following is sort of a generic solution. Sometimes I need an arrow on the end of an arc or open pline. Joe Burke ;; JB 7/16/2003 ;; Place an arrow (solid) at one end of the object types ;; listed below. Arrow is placed on the same layer as ;; the selected object. Arrow size is based on dimscale. ;; Note: closed objects and short segments are rejected. (defun c:ArrowEnd ( / Doc Mspace Pspace Space TypLst Ent Vobj PkPt DimScl StPt EnPt Len Dist CurvePt Ang p1 p2 p3 Solid ) (vl-load-com) (setq Doc (vla-get-ActiveDocument (vlax-get-acad-object)) Mspace (vla-get-ModelSpace Doc) Pspace (vla-get-PaperSpace Doc) DimScl (getvar "dimscale") ) (if (= 1 (vlax-get Doc 'ActiveSpace)) (setq Space Mspace) (setq Space Pspace) ) (setq TypLst '("AcDbLine" "AcDbArc" "AcDbPolyline" "AcDb2dPolyline" "AcDbSpline" "AcDbEllipse")) (sssetfirst) (while (or (not (setq Ent (entsel "\nSelect object near end to place arrow: "))) (not (setq Vobj (vlax-ename->vla-object (car Ent)))) (not (vl-position (vlax-get Vobj 'ObjectName) TypLst)) (if (vlax-property-available-p Vobj 'Closed) (= -1 (vlax-get Vobj 'Closed)) ) ) (princ "\nWrong object type or closed object selected. ") ) (setq PkPt (trans (cadr Ent) 1 0)) (setq Len (vlax-curve-getDistAtParam Vobj (vlax-curve-getEndParam Vobj) ) ) (setq StPt (vlax-curve-getStartPoint Vobj)) (setq EnPt (vlax-curve-getEndPoint Vobj)) (if (< (distance StPt PkPt) (distance EnPt PkPt)) ;from start point (setq Dist (* DimScl 0.15625) p1 StPt) ;from end point (setq Dist (- Len (* DimScl 0.15625)) p1 EnPt) ) (setq CurvePt (vlax-curve-getPointAtDist Vobj Dist)) (if CurvePt (progn (setq Ang (angle p1 CurvePt)) (setq p2 (polar CurvePt (+ Ang (/ pi 2)) (* DimScl 0.02604))) (setq p3 (polar CurvePt (- Ang (/ pi 2)) (* DimScl 0.02604))) (setq Solid (vlax-invoke Space 'AddSolid p1 p2 p3 p3)) (vlax-put Solid 'Layer (vlax-get Vobj 'Layer)) ) (princ "\nCannot place arrow on object. ") ) (princ) ) ;end
Message 29 of 37
cab2k
in reply to: molokaiboy

I like the LEADER method, here is my offering.
[code]
;;; dubleader.lsp
;;; C. Alan Butler July 4, 2004
;;; Draw a double headed leader, 2 point or 4 point
;;; Creates two leader objects, via LEADER command
;;;
;;; Pick p1 p2 Enter for 2 point leader
;;; Pick p1 p2 p3 p4 for 4 point leader
(defun c:dbl(/ usercmd useros useror p1 p2 p3 p4)
(setq usercmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq useros (getvar "osmode"))
(setvar "osmode" 0) ; osnaps off
(setq useror (getvar "orthomode"))
(setvar "orthomode" 0) ; trun ortho off for segment p1 p2
(if (and (setq p1 (getpoint "\n*-Pick arrow point."))
(null(initget 32))
(setq p2 (getpoint p1 "\n**-Pick arrow point or 2nd point of 4 point arrow."))
(null(grdraw p1 p2 7 1))
(setvar "orthomode" 1) ; trun ortho on for segment p2 p3
)
(if (and (null(initget 32))
(setq p3 (getpoint p2 "\n***-Pick 3rd point or enter for 2 point arrow."))
(null(grdraw p2 p3 7 1))
(null(initget 32))
(setvar "orthomode" 0) ; trun ortho off for segment p3 p4
(setq p4 (getpoint p3 "\n****-Pick last arrow point."))
)
(progn ; 4 point arrow
(setvar "osmode" 0) ; osnaps off
(command "leader" p1 p2 p3 "" "" "n")
(command "leader" p4 p3 p2 "" "" "n")
(redraw)
)
(progn ; 2 point arrow
(setvar "osmode" 0) ; osnaps off
(command "leader" p1 p2 "" "" "n")
(command "leader" p2 p1 "" "" "n")
(redraw)
)
); endif
); endif
(setvar "cmdecho" usercmd)
(setvar "osmode" useros)
(setvar "orthomode" useror)
); defun
[/code]
Message 30 of 37
Anonymous
in reply to: molokaiboy

Or just put '\H' as the prefix and the text is not displayed. "Kent Cooper, AIA" wrote in message news:40e56bb8$1_2@newsprd01... > Yes, but you'd still have to give it the space-only text override when you > used it. > > Kent Cooper, AIA > > > "Warren Trost" wrote... > > Would creating a dimstyle with arrows at both ends and no extension lines > > work? > >
Message 31 of 37
Anonymous
in reply to: molokaiboy

Using the attached dimension style (within the attached drawing) just use dimaligned. "CAB2k" wrote in message news:22230917.1088980654788.JavaMail.jive@jiveforum1... > I like the LEADER method, here is my offering. > [code] > ;;; dubleader.lsp > ;;; C. Alan Butler July 4, 2004 > ;;; Draw a double headed leader, 2 point or 4 point > ;;; Creates two leader objects, via LEADER command > ;;; > ;;; Pick p1 p2 Enter for 2 point leader > ;;; Pick p1 p2 p3 p4 for 4 point leader > (defun c:dbl(/ usercmd useros useror p1 p2 p3 p4) > (setq usercmd (getvar "cmdecho")) > (setvar "cmdecho" 0) > (setq useros (getvar "osmode")) > (setvar "osmode" 0) ; osnaps off > (setq useror (getvar "orthomode")) > (setvar "orthomode" 0) ; trun ortho off for segment p1 p2 > (if (and (setq p1 (getpoint "\n*-Pick arrow point.")) > (null(initget 32)) > (setq p2 (getpoint p1 "\n**-Pick arrow point or 2nd point of 4 point arrow.")) > (null(grdraw p1 p2 7 1)) > (setvar "orthomode" 1) ; trun ortho on for segment p2 p3 > ) > (if (and (null(initget 32)) > (setq p3 (getpoint p2 "\n***-Pick 3rd point or enter for 2 point arrow.")) > (null(grdraw p2 p3 7 1)) > (null(initget 32)) > (setvar "orthomode" 0) ; trun ortho off for segment p3 p4 > (setq p4 (getpoint p3 "\n****-Pick last arrow point.")) > ) > (progn ; 4 point arrow > (setvar "osmode" 0) ; osnaps off > (command "leader" p1 p2 p3 "" "" "n") > (command "leader" p4 p3 p2 "" "" "n") > (redraw) > ) > (progn ; 2 point arrow > (setvar "osmode" 0) ; osnaps off > (command "leader" p1 p2 "" "" "n") > (command "leader" p2 p1 "" "" "n") > (redraw) > ) > ); endif > ); endif > (setvar "cmdecho" usercmd) > (setvar "osmode" useros) > (setvar "orthomode" useror) > ); defun > [/code]
Message 32 of 37
Anonymous
in reply to: molokaiboy

Interesting thought, but it didn't work for me. It only removed the first character of the default text. I tried it both as an override prefix before the default (giving it an override text value of "\H<>") [which is much more complicated than giving it a plain old space anyway], and as a prefix in the Primary Units part of the dimension style definition. Both had the same result. How do you apply that to make it cause the text not to be displayed? (My trials were in Architectural units, with the default text consisting of feet-inches-fractions. I tried it in both 2000 & 2004.) Kent Cooper, AIA "Casey" wrote... > Or just put '\H' as the prefix and the text is not displayed. > > "Kent Cooper, AIA" wrote... > > Yes, but you'd still have to give it the space-only text override when you > > used it. > > > > Kent Cooper, AIA > > > > "Warren Trost" wrote... > > > Would creating a dimstyle with arrows at both ends and no extension > lines > > > work?
Message 33 of 37
Anonymous
in reply to: molokaiboy

I abandoned you last Friday at a quarter to six because, hey, it was a holiday weekend, and I assume you're in Hawaii or something (what's that, about six hours earlier than we are on the east coast?). Because of your still needing to turn off osnaps to make it work, I wondered about the syntax of using them within lisp code, so I looked back at some other routines I've done to compare. I find I might have (heaven forbid!) steered you wrong there, and maybe with it done right you can go into it with any running Osnap modes you want, so you don't have to turn them off. I think the correct way to say it is to change (setq arrowhead1 (getpoint "Pick one Endpoint: ") "nea") (setq arrowhead2 (getpoint "Pick other Endpoint: ") "per") to (setq arrowhead1 (osnap (getpoint "Pick one Endpoint: ") "nea")) (setq arrowhead2 (osnap (getpoint "Pick other Endpoint: ") "per")) I haven't tested it. The other routines I looked at are in macro screen/tablet/pull-down format rather than command-defun format, i.e. <...preceding stuff...>+ (setq arrowhead1 (osnap (getpoint "Pick one Endpoint: ") "nea")) \+ (setq arrowhead2 (osnap (getpoint "Pick other Endpoint: ") "per")) \+ <...etc...> so I'm not positive the same explicit osnap call is right for the command-defun format. But see if changing that makes it work for you even WITH running Osnap modes on. Kent Cooper, AIA "molokaiboy" wrote... > I got it to work. I have to do a series of turning off osnaps. > > Thanks > > Collin
Message 34 of 37
Anonymous
in reply to: molokaiboy

Oh yeah...don't use architectural units, use decimal or something else... Casey "Kent Cooper, AIA" wrote in message news:40eaa733_2@newsprd01... > Interesting thought, but it didn't work for me. It only removed the first > character of the default text. I tried it both as an override prefix before > the default (giving it an override text value of "\H<>") [which is much more > complicated than giving it a plain old space anyway], and as a prefix in the > Primary Units part of the dimension style definition. Both had the same > result. How do you apply that to make it cause the text not to be > displayed? > > (My trials were in Architectural units, with the default text consisting of > feet-inches-fractions. I tried it in both 2000 & 2004.) > > Kent Cooper, AIA > > > "Casey" wrote... > > Or just put '\H' as the prefix and the text is not displayed. > > > > "Kent Cooper, AIA" wrote... > > > Yes, but you'd still have to give it the space-only text override when > you > > > used it. > > > > > > Kent Cooper, AIA > > > > > > "Warren Trost" wrote... > > > > Would creating a dimstyle with arrows at both ends and no extension > > lines > > > > work? > >
Message 35 of 37
Kent1Cooper
in reply to: molokaiboy

13 years is a long time, but this was such a "perfect fit" find that I can't resist:

It's not "supposed" to be possible with a linetype definition, but check out the drawing attached  >>here<<,  and the discussion in several Posts following it.  I don't know how it's done, and unless someone can reverse-engineer the definitions it's probably not possible to substitute different arrowheads than are in those linetypes, but you can copy those out and paste them into your drawings, and have the use of them.

Kent Cooper, AIA
Message 36 of 37
pumaturniton
in reply to: molokaiboy

Isn't it a dimension can slove this ?

1. To draw a dimension; then
2. hide all of the lines but the main dim line, and both sides of arrowheads; then
3. choose the "CLosed filled" style for the arrowhead (it looks like an arrow most, for me);
4. then text whatever you like (or nothing) on this dimension mark.

Message 37 of 37
Kent1Cooper
in reply to: pumaturniton


@pumaturniton wrote:

Isn't it a dimension can slove this ?
....


[That was already thoroughly discussed in the first batch of Replies.]

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost