Results 1 to 6 of 6

Thread: Notch detail

  1. #1
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Notch detail

    Is there a way, via lisp, to create the following notch detail????

    The lines are drawn in as shown and then the radii added.

    The angles of the 2 lines vary across drawings.
    Attached Images Attached Images

  2. #2
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Notch detail

    didn't see this in the new posts so I am trying to bump it up

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

    Default Re: Notch detail

    Quote Originally Posted by rhall.72202
    Is there a way, via lisp, to create the following notch detail????

    The lines are drawn in as shown and then the radii added.

    The angles of the 2 lines vary across drawings.
    I am positive this will not work in all instances, but it is a start. I do not know all of your parameters or how your entities are drawn.

    This program assumes the two lines are "LINE" entities. No error checking is provided.
    Code:
    (defun C:TEST (/ NOTCH:ASC NOTCH:DTR BPNT BRAD INTPICK INTPICK1 INTPICK2 L1 L1-2INT L1ANG L1ANG90 L1E L1S L2 L2ANG L2ANG90 L2E L2S L3 L3-4INT L3E L3S L4E L4S LPNT LRAD TEMP1)
      (defun NOTCH:DTR (A) (* pi (/ A 180.0)))
    ;;; utility to convert decimal degrees to radians
      (defun NOTCH:ASC (ELEMENT ENTITY /)
    ;;; retrieve assoc data from entity
        (cdr (assoc ELEMENT ENTITY))
      )
      (defun MAKEARC (PNT RAD START END / ECODES)
        (setq ECODES (list (cons 0 "ARC")
    		       (cons 8 (getvar "clayer"))
    		       (cons 10 PNT)
    		       (cons 40 RAD)
    		       (cons 50 START)
    		       (cons 51 END)
    		 )
        )
        (entmake ECODES)
      )
    
      (setq	L1     (entget (car (entsel "\nSelect Line 1: ")))
    	L2     (entget (car (entsel "\nSelect Line 2: ")))
    	INTPick (getpoint "\nPick point in interior of angle: "))
      (if (not lrad) ; set little radius if not already set
        (setq lrad 0.125))
      (if (not brad) ; set big radius if not already set
        (setq brad 0.5))
      (setq	L1S (cdr (assoc 10 L1)) ; get line 1 start point
    	L1E (cdr (assoc 11 L1)) ; get line 1 end point
    	L2S (cdr (assoc 10 L2)) ; get line 2 start point
    	L2E (cdr (assoc 11 L2)) ; get line 2 end point
      )
      (setq L1-2INT (inters L1S L1E L2S L2E NIL)) ; get line intersection point
      (setq	L1ANG	(angle L1S L1E) ; get line angles
    	L2ANG	(angle L2S L2E)
    	L1ANG90	(- L1ANG (DTR 90.0)) ; get temporary perpendicular angles
    	L2ANG90	(+ L2ANG (DTR 90.0))
      )
      (setq	INTPICK1 (inters L1S L1E INTPICK (polar INTPICK L1ANG90 1.0) NIL) ; get interior angle intersection points
    	INTPICK2 (inters L2S L2E INTPICK (polar INTPICK L2ANG90 1.0) NIL)
      )
      (if (/= (angle INTPICK1 L1-2INT) L1ANG) ; verify line1 angle
        (setq TEMP1	L1S
    	  L1S L1E
    	  L1E TEMP1
    	  temp1 nil
    	  L1ANG	(angle L1S L1E) ; get line angles
    	
        )
      )
      (if (/= (angle INTPICK2 L1-2INT) L2ANG) ; verify line2 angle
        (setq TEMP1	L2S
    	  L2S L2E
    	  L2E TEMP1
    	  temp1 nil
    	  L2ANG	(angle L2S L2E)
        )
      )
      (setq	L1ANG90	(angle INTPICK1 INTPICK) ; get perpendicular angles
    	L2ANG90	(angle INTPICK INTPICK2)
      )
      (setq	L3S	(polar L1S L1ANG90 LRAD) ; get temp line 3 start
    	L3E	(polar L1E L1ANG90 LRAD) ; get temp line 3 end
    	lpnt	(inters L2S L2E L3S L3E NIL) ; get little arc radius
      )
      (setq	L3s (polar LpNT (+ L1ANG90 (dtr 180.0)) LRAD)
    	L3E LpNT
      )
      ;(command "line" l3s l3e "")
      (setq	L4S	(polar L2S L2ANG90 BRAD)
    	L4E	(polar L2E L2ANG90 BRAD)
    	L3-4INT	(inters L3S L3E L4S L4E NIL)
      )
    
      (entdel (asc -1 l1)) ; delete original line 1
      (entdel (asc -1 l2)) ; delete original line 2
      
      (entmake (subst (cons 11 l3s)(assoc 11 l1) l1)) ; make new line 1
      
      (setq l3s (polar lpnt l2ang lrad) ; new start point for line 3
    	l3e l2e) ; new end point for line 3
      (setq l3 (subst (cons 10 l3s)(assoc 10 l2) l2) ; line 3
    	l3 (subst (cons 11 l3e)(assoc 11 l3) l3))
      
      (setq	BPNT ; radius point of big arc
    	 (polar	(polar
    		  lpnt
    		  (- L2ANG (dtr 180.0))
    		  (* (+ BRAD LRAD) (cos (ASIN (/ BRAD (+ BRAD LRAD)))))
    		)
    		L2ANG90
    		BRAD
    	 )
      )
      (setq l2 (subst (cons 11 (inters l2s l2e bpnt (polar bpnt l2ang90 1.0) nil))(assoc 11 l2)l2) ; modify line 2
    	l2 (subst (cons 10 l2s)(assoc 10 l2)l2))
       
      (entmake l2) ; make new line 2
      (entmake l3) ; make new line 3
      (MAKEARC BPNT
    	   BRAD
    	   (angle BPNT lpnt)
    	   (angle BPNT
    		  (inters BPNT (polar BPNT L2ANG90 1.0) L2S L2E NIL)
    	   )
      )
      (MAKEARC LPNT
    	   LRAD
    	   (angle LPNT BPNT)
    	   (angle LPNT
    		  (inters LPNT (polar LPNT L1ANG90 1.0) L1S L1E NIL)
    	   )
      )
    )
    
    (defun ASIN (X /)
      ;;arcsine= arctan(X/Sqrt(1.0-(X^2)))
      (cond	((= X 1) (setq R (/ pi 2)))
    	((= X -1) (setq R (/ (* pi -1) 2)))
    	(t (setq R (atan (/ X (sqrt (- 1.0 (expt X 2)))))))
      ) ;_ end of cond
    ) ;_ end of defun
    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

  4. #4
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Notch detail

    I tried your routine and I am getting "error no function definition: dtr".

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

    Default Re: Notch detail

    Quote Originally Posted by rhall.72202
    I tried your routine and I am getting "error no function definition: dtr".
    In my code change the following line
    Code:
    (defun NOTCH:DTR (A) (* pi (/ A 180.0)))
    to read
    Code:
    (defun DTR (A) (* pi (/ A 180.0)))
    sorry
    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
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Notch detail

    That works great if the geometry of edge one heads towards the vertex and edge 2 heads away from the vertex. Any geometry that doesn't meet that condition will not work.
    Still an excellent routine, as I can simply fix the line directions.

    Can I throw a kink in there???? How about doing similar with an arc and a line?
    Attached Images Attached Images

Similar Threads

  1. Can't Notch or Trim
    By kikky in forum Inventor - General
    Replies: 1
    Last Post: 2008-10-21, 12:39 PM
  2. Foundation Wall Notch
    By sroy in forum ACA General
    Replies: 3
    Last Post: 2005-09-19, 07:43 PM
  3. Notch in Wall
    By kwong in forum Revit Architecture - General
    Replies: 14
    Last Post: 2005-07-22, 01:22 AM
  4. Create This Notch
    By robert.1.hall72202 in forum AutoCAD General
    Replies: 5
    Last Post: 2005-03-02, 09:53 PM
  5. Rafter notch?
    By gjburkett in forum Revit Architecture - General
    Replies: 8
    Last Post: 2005-01-07, 10:37 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
  •