Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Centerline lisp

  1. #1
    100 Club
    Join Date
    2005-01
    Posts
    115

    Default Centerline lisp

    Looking for a lisp that will draw a center line after selecting 2 points and places the CL symbol using Romans font.
    Mac

  2. #2
    AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL
    Posts
    1,095

    Default Re: Centerline lisp

    What about a linetype?
    Code:
     *CL,---- CL ---- - ---- CL ---- - ---- CL ---- 
    A,6.6,-.06,["C",STANDARD,S=.1,R=0.0,X=-0.04,Y=-0.025],-.01,["L",STANDARD,S=.1,R=0.0,X=-0.01,Y=-.065],-.07,6.6,-.05,.07,-.05
    Tom Beauford P.S.M. - Civil 2013 on Windows 7 Pro
    Design Analysis - Leon County Public Works/Engineering
    2280 Miccosukee Rd. Tallahassee, FL 32308-5310
    Ph# (850)606-1516

  3. #3
    Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    2,383

    Default Re: Centerline lisp

    I interpreted the OP very differently... Perhaps the OP can post a picture of specifically what is being requested?
    "Potential has a shelf life." - Margaret Atwood

  4. #4
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Hartford, Michigan
    Posts
    3,086

    Default Re: Centerline lisp

    I interpreted select 2 points to get proper rotation, and place a centerline symbol adjacent to the line. I'll await further pictorial information.
    Christopher T. Cowgill, P.E.
    WIGHTMAN & ASSOCIATES, INC.
    ENGINEERING <> SURVEYING <> ARCHITECTURE
    AutoDesk Infrastructure Design Suite Premium 2013 x64
    Windows 7 Pro x64

  5. #5
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,210

    Default Re: Centerline lisp

    Sorry friends I know nothing about labeling lines
    maybe it will be the answer
    Code:
    (defun C:test(/ ang mp p1 p2)
    ; Convert value in radians to degrees
    (defun rtd (a)
      (* 180.0 (/ a pi))
    )
      
    (if (and (setq p1 (getpoint "\nStart point: "))
    	 (setq p2 (getpoint p1 "\nEnd point: ")))
      (progn
        ;; align text
    (setq ang (angle p1 p2)
    	  ang
    	      (cond ((< (/ pi 2) ang (* pi 1.5)) (+ pi ang))
    		    (T ang)
    	      )
          ang (rtd ang)
        )
    (setq mp (mapcar '(lambda(a b) (/ (+ a b) 2.0)) p1 p2))
    (command "._line" "_non" p1 "_non" p2 "")
    (command "._chprop"  "L" "" "LT" "Center" "")));<-- cnange linetype here 
    (command "._mtext" "_non" mp "_J" "_MC"  "R" (rtos ang) "_W" "0" "\\U+2104" "")
    (command "._chprop"  "L" "" "Color" "1" "" );<-- cnange color here or remove this line
      (princ)
      )
    ~'J'~
    Last edited by fixo; 2012-02-17 at 11:06 PM. Reason: extrafluous double quotes removed
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  6. #6
    Active Member
    Join Date
    2001-12
    Posts
    54

    Default Re: Centerline lisp

    Quote Originally Posted by fixo View Post
    Sorry friends I know nothing about labeling lines
    maybe it will be the answer
    Code:
    (defun C:test(/ ang mp p1 p2)
    ; Convert value in radians to degrees
    (defun rtd (a)
      (* 180.0 (/ a pi))
    )
      
    (if (and (setq p1 (getpoint "\nStart point: "))
    	 (setq p2 (getpoint p1 "\nEnd point: ")))
      (progn
        ;; align text
    (setq ang (angle p1 p2)
    	  ang
    	      (cond ((< (/ pi 2) ang (* pi 1.5)) (+ pi ang))
    		    (T ang)
    	      )
          ang (rtd ang)
        )
    (setq mp (mapcar '(lambda(a b) (/ (+ a b) 2.0)) p1 p2))
    (command "._line" "_non" p1 "_non" p2 "")
    (command "._chprop"  "L" "" "LT" "Center" "" "")));<-- cnange linetype here 
    (command "._mtext" "_non" mp "_J" "_MC"  "R" (rtos ang) "_W" "0" "\\U+2104" "")
    (command "._chprop"  "L" "" "Color" "1" "" "");<-- cnange color here or remove this line
      (princ)
      )
    ~'J'~
    Hey Fixo ! ! I like it !! nice work !!
    Steve

  7. #7
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,210

    Default Re: Centerline lisp

    You're quite welcome, Steve
    I removed double quotes in the code above
    Cheers

    ~'J'~
    Last edited by fixo; 2012-02-17 at 11:08 PM.
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  8. #8
    100 Club
    Join Date
    2005-01
    Posts
    115

    Default Re: Centerline lisp

    ccowgill has the interpretation correct,
    now that I think about it, after selecting each point it would be nice to be able to extend the line type if desired. I could make a dynamic block, but it seems a lisp would be more efficient. her is a dwg with the center line and notation.

    regards
    Attached Files Attached Files
    Mac

  9. #9
    100 Club
    Join Date
    2005-01
    Posts
    115

    Default Re: Centerline lisp

    Gave this a test drive, very nice!
    how can I get the text to be at the end of the line and text rotation always same as line?
    Mac

  10. #10
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,210

    Default Re: Centerline lisp

    will be back in tomorrow only
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

Page 1 of 2 12 LastLast

Similar Threads

  1. Centerline Part 2
    By Mac Demer in forum AutoLISP
    Replies: 4
    Last Post: 2012-02-22, 08:29 PM
  2. Centerline Symbol????
    By Fatboy in forum Revit Architecture - General
    Replies: 2
    Last Post: 2007-06-06, 01:15 PM
  3. Centerline: How to?
    By Firmso in forum Revit Architecture - General
    Replies: 2
    Last Post: 2007-03-04, 11:41 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
  •