Results 1 to 7 of 7

Thread: Create circle from information supplied

  1. #1
    Active Member
    Join Date
    2006-10
    Posts
    80
    Login to Give a bone
    0

    Default Create circle from information supplied

    I am trying to create a circle at each tip like in the drawing that I've attached (Eg_00.dwg). I intend to have the user to enter the circle diameter and circle offset distance. The circle offset distance is from end of tip to centre point of the circle. I really need help with this lisp. Any help be greatly appreciated!
    Attached Files Attached Files

  2. #2
    I could stop if I wanted to
    Join Date
    2006-07
    Posts
    233
    Login to Give a bone
    0

    Default Re: Create circle from information supplied

    I've got a program that does something similar. You select a lin and the circle is placed at the end of the line with a number in it. YOu specify the circle radius and text height along with the starting number. Give it a try it may be waht you are looking for.
    Attached Files Attached Files

  3. #3
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Create circle from information supplied

    1. How are you planning on selecting the lines to add the circle to?
    -- this will determine how you get the right end point of the lines

    After you have done this, and know which end point to offset from, then it shouldn't be to hard. You will get the line, get the angle of the line (reverse if it happens to be the end point of the line instead of the start point) use the 'polar' function to get the offset'ed point, then use the circle command to draw the circle.

    Tip: You may want to turn of osnaps when doing it, and then at the end of you routine, turn them back on.

  4. #4
    Active Member
    Join Date
    2006-10
    Posts
    80
    Login to Give a bone
    0

    Default Re: Create circle from information supplied

    The ideas are:
    1) Select the all the lines that I want to add the circle to
    2) Remove entity that is not related to from selection set
    3) Convert all lines (selection set) to polylines
    Q: How to write lisp that can convert lines to polylines?

  5. #5
    I could stop if I wanted to
    Join Date
    2006-07
    Posts
    233
    Login to Give a bone
    0

    Default Re: Create circle from information supplied

    This will change lines and arcs to PolyLines.

    Code:
    (defun C:L2P ()
      (setvar "CMDECHO" 0)
      (setq	SS1
    	 (ssget	"X"
    		'((-4 . "<OR") (0 . "LINE") (0 . "ARC") (-4 . "OR>"))
    	 )
      )
    					;end setq
      (if (not SS1)
        (alert "No Lines Found")
        (progn (setq N     (sslength SS1)
    		 SSNEW (ssadd)
    	   )
    	   (prompt "\n")
    	   (setq COUNT 0)
    	   (setq SMEMBER (ssname SS1 COUNT))
    	   (while SMEMBER
    	     (prompt "\r Lines Remaining to Alter: ")
    	     (princ N)
    	     (prompt ".   ")
    	     (command "change" SMEMBER "" "p" "c" "m" "")
    	     (command "PEDIT" SMEMBER "Y" "X")
    	     (ssadd (entlast) SSNEW)
    	     (setq COUNT (+ 1 COUNT))
    	     (setq SMEMBER (ssname SS1 COUNT))
    	     (setq N (- N 1))
    	   )
    	   (setvar "CMDECHO" 1)
    	   (prompt "\n ")
    	   (princ "\rPreparing to Change Entity Colors to BYLAYER ...")
    	   (command "change" SSNEW "" "p" "c" "bylayer" "")
        ); end of progn
      ); end of if
      (princ)
    )

  6. #6
    Active Member
    Join Date
    2006-10
    Posts
    80
    Login to Give a bone
    0

    Default Re: Create circle from information supplied

    I've tried to write the routine but got error when i've tested it in autocad2004.The routine requires that the tips be selected by layer name.Then the user need to select non tip entity by crossing window. The user supplies circle radius, offset distance, clockwise or counter clockwise, and approximate start location by selecting a tip.
    Here I've attached my routine. Please kindly help me on solve this problem. Thanks.
    Attached Files Attached Files

  7. #7
    Active Member
    Join Date
    2006-10
    Posts
    80
    Login to Give a bone
    0

    Default Re: Create circle from information supplied

    Anyone can help on lisp that create a circle at each tip like in the drawing that I've attached (Eg_00.dwg) in first thread? I really need help with this lisp. Any help be greatly appreciated!
    Last edited by noadea; 2007-01-17 at 11:00 AM.

Similar Threads

  1. why we can not create a wipeout from a circle or spline?
    By duyen.nguyenthien in forum AutoCAD General
    Replies: 8
    Last Post: 2011-04-22, 04:17 PM
  2. gathering all the information to create a family?
    By lzaras in forum Revit Architecture - Families
    Replies: 2
    Last Post: 2011-04-14, 02:54 PM
  3. Need to create an information board for the plant netwrok
    By singh.robbie in forum VBA/COM Interop
    Replies: 1
    Last Post: 2010-01-25, 07:41 PM
  4. Does CAD create a log of changed information on drawings?
    By BRENDA_GZZ_GOMEZ in forum AutoCAD General
    Replies: 10
    Last Post: 2007-05-24, 03:12 PM
  5. Existing Doors supplied by the factory?
    By DaveP in forum Revit Architecture - General
    Replies: 22
    Last Post: 2005-07-27, 10:22 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
  •