Results 1 to 5 of 5

Thread: Break and Divide Question

  1. #1
    I could stop if I wanted to sschwartz's Avatar
    Join Date
    2005-04
    Location
    Oakland County, Michigan
    Posts
    424

    Question Break and Divide Question

    OK, Can anyone help me with this? I thought I had seen a break into equal segments (similar to divide, only not with nodes) in some version of autocad. We just recently upgraded to 2006, and I had this request. I have looked on the inet, and have found SOME help, like 'break at point', and am wondering if you could use this inbetween a divide command.

    This is what the break at point looks like:

    Code:
    (defun c:BRP()
      (setq ENTITY (getpoint "\nSpecify break point ON object:"))
      (if (= (ssget ENTITY) nil)
        (progn
          (prompt "\nSelected Point is not on any object. Use 
    OSNAP and try
    again.")
          (c:brp)
          )
        (command "BREAK" ENTITY "@")
      )
      (princ)
    )
    [ Moderator Action = ON ] How to use [ CODE ] tags? [ Moderator Action = OFF ]
    Last edited by Opie; 2006-06-29 at 04:58 PM. Reason: [CODE] tags added, see moderator comment

  2. #2
    Certified AUGI Addict rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Houston
    Posts
    7,520

    Default Re: Break and Divide Question

    I'm not aware of any built-in routine.

    FYI: Toolpac [ http://www.dotsoft.com/toolpac.htm ] includes this functionality.

  3. #3
    100 Club intergrupocr's Avatar
    Join Date
    2006-02
    Posts
    116

    Default Re: Break and Divide Question

    Try this one:

    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;Makes a line between two points
    (defun drline (p1 p2 layer)
      (entmake (list (CONS 0 "LINE")
    		 (CONS 8 layer)
    		 (CONS 10 p1)
    		 (CONS 11 p2)
    	   ) ;_ fin de list
      ) ;_ fin de entmake
    ) ;_ fin de defun
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;Gets the value of an association
    (defun get-as (aso lis /)
      (cdr (assoc aso lis))
    ) ;_ end of defun
    
    (defun c:brline	(/ line-length space-b line-ent line-or line-end line-lay line-ang total-length dist-v pt2)
      (setq line-ent (entget (car (entsel "\nSelect line: "))))
      (setq line-or (get-as 10 line-ent))
      (setq line-end (get-as 11 line-ent))
      (setq line-lay (get-as 8 line-ent))
      (setq line-ang (angle line-or line-end))
      (setq total-length (distance line-or line-end))
      (initget 7)
      (setq line-length (/ total-length (getint "\nNumber of segments: ")))
      (setq dist-v 0)
      (while (< dist-v total-length)
        (setq pt2 (polar line-or line-ang line-length))
        (drline line-or pt2 line-lay)
        (setq line-or pt2)
        (setq dist-v (+ dist-v line-length))
      ) ;_ end of while
      (entdel (get-as -1 line-ent))
      (princ)
    ) ;_ end of defun
    I hope this help you!!
    Last edited by Opie; 2006-06-29 at 09:38 PM. Reason: [CODE] tags added

  4. #4
    I could stop if I wanted to sschwartz's Avatar
    Join Date
    2005-04
    Location
    Oakland County, Michigan
    Posts
    424

    Talking Re: Break and Divide Question

    Quote Originally Posted by sschwartz
    I hope this help you!!
    am in awe.... now I get to test it out! sweet thanks

    You are the AutoLisp God!
    Last edited by Opie; 2006-06-30 at 01:27 PM.

  5. #5
    100 Club intergrupocr's Avatar
    Join Date
    2006-02
    Posts
    116

    Default Re: Break and Divide Question

    I'm glad to help!!
    Let me know if you need something else.

    Julio.

Similar Threads

  1. Annotation - Dynamic Break Line (dyn-break)
    By barry.40197 in forum Dynamic Blocks - Sharing
    Replies: 10
    Last Post: 2011-01-13, 02:41 AM
  2. Divide
    By theshell07 in forum Revit Architecture - General
    Replies: 1
    Last Post: 2010-10-23, 07:27 AM
  3. divide by zero
    By tomcarver in forum AutoLISP
    Replies: 7
    Last Post: 2010-02-05, 04:53 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
  •