See the top rated post in this thread. Click here

Results 1 to 6 of 6

Thread: Where is routine generating the arrowhead

  1. #1
    I could stop if I wanted to
    Join Date
    2004-12
    Location
    California
    Posts
    283
    Login to Give a bone
    0

    Default Where is routine generating the arrowhead

    Can someone take a look at the following Lisp routine and tell me where in the lisp its actually generating the arrowhead??

    The lisp works great and will draw an arc'd leader but I want to copy the lisp and modify it to create another lisp that will do the same but insert or draw in a different symbol, rather than the arrowhead.

    Any help would be greatly appreciated!
    Attached Files Attached Files

  2. #2
    I could stop if I wanted to
    Join Date
    2004-12
    Location
    California
    Posts
    283
    Login to Give a bone
    0

    Default Re: Where is routine generating the arrowhead

    OK....nevermind. I see that it actually draws the arrow using the pline with one end at a 0 width and it calculates the other width and location.

    So my question is...

    How can I do this with another symbol? I've attached a screen shot of what I am looking to accomplish. Maybe someone has some ideas?
    Attached Images Attached Images

  3. #3
    Member
    Join Date
    2001-11
    Location
    Manchester, UK
    Posts
    47
    Login to Give a bone
    0

    Default Re: Where is routine generating the arrowhead

    If it was me and assuming you want to do exactly the same thing but just the symbols be different. i would modify this function so that you pass a block name to it which can then be inserted after the polyline is drawn. This way you don't require two lisp files.

  4. #4
    I could stop if I wanted to
    Join Date
    2004-12
    Location
    California
    Posts
    283
    Login to Give a bone
    0

    Default Re: Where is routine generating the arrowhead

    OK but how do I get the object to rotate to the proper angel of the arc?

  5. #5
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,103
    Login to Give a bone
    0

    Default Re: Where is routine generating the arrowhead

    Quote Originally Posted by fletch97
    OK but how do I get the object to rotate to the proper angel of the arc?
    If you already know the start/end angle of the arc then you should know the angle for the object.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  6. #6
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    1

    Default Re: Where is routine generating the arrowhead

    Quote Originally Posted by fletch97
    Can someone take a look at the following Lisp routine and tell me where in the lisp its actually generating the arrowhead??

    The lisp works great and will draw an arc'd leader but I want to copy the lisp and modify it to create another lisp that will do the same but insert or draw in a different symbol, rather than the arrowhead.

    Any help would be greatly appreciated!
    Hi fletch97

    Play with this one (I'm not sure that there is what you need exactly,
    I had take this from my old library and changed slightly)
    After block insertion you need to align this block
    and only after it you can specify end point of an arc
    Tested on A2005 only
    Thank you

    f.

    Code:
    ;; 		ARC LEADER WITH USER'S BLOCK		;;
    (defun rtd (a)
      (* 180.0 (/ a pi))
    )
    ;;							;;
    
    ;; where 1,2,3 - there are block name, change by your needs
    (defun C:AAB (/	*error*	an ang blk cent	mpt oad	ocm osm	pnt1 pnt2 pnt3
    	      pta tmp tmp1 typ)
    
    ;error tile based on by J.Burke's rouitine   
      (defun *error* (msg)
        (cond
          ((or (not msg)
    	   (member msg
    		   '("console break"
    		     "Function cancelled"
    		     "quit / exit abort"
    		    )
    	   )
           )
          )
          ((princ (strcat "\nError: " msg)))
        )
        (command "undo" "e")
        (command "ucs" "p")
        (setvar "cmdecho" ocm)
        (setvar "osmode" osm)
        (setvar "attdia" oad)
        (princ)
      )
    
      (command "undo" "e")
      (command "undo" "be")
      (setq ocm (getvar "cmdecho"))
      (setq osm (getvar "osmode"))
      (setq oad (getvar "attdia"))
      (setvar "attdia" 1)
      (command "ucs" "w")
    
      (setq typ (getstring T "\nEnter arrow type block 1/2/3 <1>\n"))
      (if (eq typ "")
        (setq typ "1")
      )
      (if typ
        (progn
          (setvar "osmode" 703)
          (setq pnt1 (getpoint "\nStart Point: "))
          (setvar "cmdecho" 0)
          (command "-insert" typ '(0. 0. 0.) 1. 1. 0.)
          (setq blk (entlast))
          (command "move" blk "" '(0. 0. 0.) pnt1)
          (command
    	"rotate"
    	"L"
    	""
    	pnt1
    	(rtd
    	  (angle
    	    pnt1
    	    (setq pta (getpoint pnt1 "\nAlign block how you need : "))
    	  )
    	)
          )
          (setq ang (angle pta pnt1))
          (setq pnt2 (getpoint pnt1 "\nEnd Point: "))
          (setq an (angle pnt1 pnt2))
          (setvar "osmode" 0)
          (setq mpt (mapcar '/ (mapcar '+ pnt1 pnt2) '(2 2 2)))
          (setq tmp (polar mpt (+ an (/ pi 2)) 10.))
          (setq tmp1 (polar pnt1 (+ ang (/ pi 2)) 10.))
          (setq cent (inters pnt1 tmp1 mpt tmp nil))
          (if
    	(> (angle cent pnt2) (angle cent pnt1))
    	 (command "arc" "c" cent pnt1 pnt2)
    	 (command "arc" "c" cent pnt2 pnt1)
          )
          (setq pnt1 nil
    	    pnt2 nil
    	    pnt3 nil
    	    mpt	 nil
          )	;for debug only
        )
      )
      (*error* nil)
      (princ)
    )
    ;TesT:(repeat 16 (C:AAB))

Similar Threads

  1. Generating Views using the API
    By rbruins in forum Robot Structural Analysis
    Replies: 0
    Last Post: 2009-12-18, 08:44 AM
  2. generating boundary
    By mdsalman2003 in forum AutoLISP
    Replies: 2
    Last Post: 2009-12-03, 01:28 PM
  3. Generating spaces using SQ.FT.
    By kevin.198825 in forum ACA General
    Replies: 1
    Last Post: 2009-01-19, 12:35 PM
  4. Generating Elevations
    By BCrouse in forum ACA General
    Replies: 1
    Last Post: 2006-06-26, 04:20 PM
  5. Generating Contours
    By randyspear in forum AutoCAD General
    Replies: 4
    Last Post: 2005-03-16, 04:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •