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

Thread: Dashed Line Lisp Needed

  1. #1
    Member
    Join Date
    2016-04
    Posts
    34
    Login to Give a bone
    0

    Default Dashed Line Lisp Needed

    Hi, I need a lisp to Convert my Polyline into a Dashed Line, The Lisp has to Ask me "Select Object" , "Length of Segment" & "Length of Spacing".
    If anyone can write down that lisp for me, i'd be very thankful to him.
    Thanks

  2. #2
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: Dashed Line Lisp Needed

    Look into the code posted in reply #4 from here :
    http://www.autolisp.com/forum/autoca...his-lisp-exist

    HTH, M.R.

  3. #3
    Member
    Join Date
    2016-04
    Posts
    34
    Login to Give a bone
    0

    Default Re: Dashed Line Lisp Needed

    i checked that lisp, It ask for object, then interval, then gap, but it creates just one segment, what i mean it breaks the line and create one segment seperately.
    What i want is a dashed line lisp, not a lisp that breaks the line, and can not repeat the same lisp thousand times for breaking segment.

  4. #4
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Dashed Line Lisp Needed

    Quote Originally Posted by Sameer Ahmed View Post
    i checked that lisp, It ask for object, then interval, then gap, but it creates just one segment, what i mean it breaks the line and create one segment seperately.
    What i want is a dashed line lisp, not a lisp that breaks the line, and can not repeat the same lisp thousand times for breaking segment.
    So what you're saying is you want a lisp to create a linetype, not one that breaks the polyline into segments?

  5. #5
    Member
    Join Date
    2016-04
    Posts
    34
    Login to Give a bone
    0

    Default Re: Dashed Line Lisp Needed

    Yes, It has to create a line type and has to ask me , Line Segment Length and Gap Length , It has to be one polyline.

  6. #6
    Member
    Join Date
    2016-04
    Posts
    34
    Login to Give a bone
    0

    Default Re: Dashed Line Lisp Needed

    Yes, A Linetype Lisp, has to convert any polyline to line type , when the command runs, It has to ask "Select Object" means existing polyline in drawing,,,,,,,,,,,,,,,,"Enter Length of Segment" means the Dash Length,,,,,,,,,,,,, then "Enter Space/Gap Length" means the spacing Length"

    I can create a linetype, but i don't want to repeat this every time, i want my work to be faster.

  7. #7
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Dashed Line Lisp Needed

    You don't convert a polyline to a linetype. You need to read up on creating and using linetypes, both are quick and easy for simple linetypes. Make sure you understand how they are affected by ltscale, psltscale, msltscale & plinegen. Make Linetype With Embedded Characters makes complex linetypes quick and simple.

  8. #8
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Dashed Line Lisp Needed

    Quote Originally Posted by marko_ribar View Post
    Look into the code posted in reply #4 from here :
    http://www.autolisp.com/forum/autoca...his-lisp-exist

    HTH, M.R.
    Nice code, had to update with command-s for it to run in 2015 and added undo. This could come in handy.

  9. #9
    Member
    Join Date
    2016-04
    Posts
    34
    Login to Give a bone
    0

    Default Re: Dashed Line Lisp Needed

    Wonderful, It is what i need, but one polyline, not broken segments. i checked segments with Li command, it is LWPOLYLINE, means OK, but thats not one line, those are seperate dashes.
    Last edited by Sameer Ahmed; 2016-04-04 at 06:27 PM.

  10. #10
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: Dashed Line Lisp Needed

    Code:
    (defun c:setdashedlinetype ( / len gap ss i curve cc fname f )
      (vl-load-com)
      (initget 7)
      (setq len (getdist "\nPick or specify length of dash : "))
      (initget 7)
      (setq gap (getdist "\nPick or specify gap between dashes : "))
      (setq fname (vl-filename-mktemp nil nil ".lin"))
      (setq f (open fname "w"))
      (write-line "*DSH,Dsh - - - - - - - - - - - - - - - - - - - - " f)
      (write-line (strcat "A," (rtos len 2 50) "," (rtos (- gap) 2 50)) f)
      (close f)
      (command "_.-style" "dsh" "simplex.shx")
      (while (> (getvar 'cmdactive) 0) (command ""))
      (command "_.-linetype" "l" "DSH" fname)
      (while (> (getvar 'cmdactive) 0) (command ""))
      (if (setq ss (ssget "_:L" '((0 . "POLYLINE,LWPOLYLINE,SPLINE,HELIX,LINE,XLINE,RAY,CIRCLE,ELLIPSE,ARC"))))
        (progn
          (setq i -1)
          (while (setq curve (ssname ss (setq i (1+ i))))
            (vla-copy (vlax-ename->vla-object curve))
            (setq cc (entlast))
            (setq ccl (cons cc ccl))
            (command "_.change" cc "" "p" "lt" "DSH" "c" 1 "")
          )
          (command "_.-style" "Standard")
          (while (> (getvar 'cmdactive) 0) (command ""))
          (sssetfirst nil ss)
        )
        (progn
          (command "_.-style" "Standard")
          (while (> (getvar 'cmdactive) 0) (command ""))
          (prompt "\nInvalid selection set - empty set - restart routine")
        )
      )
      (princ)
    )
    
    (defun c:removedashedlinetype nil
      (foreach cc ccl
        (entdel cc)
      )
      (command "_.-purge" "lt" "DSH" "n" "_.-purge" "st" "dsh" "n")
      (setq ccl nil)
      (princ)
    )
    
    (defun c:sdlt nil (c:setdashedlinetype))
    (defun c:rdlt nil (c:removedashedlinetype))
    HTH, M.R.
    Last edited by marko_ribar; 2016-04-07 at 07:47 PM.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 11
    Last Post: 2019-01-09, 09:55 AM
  2. Dashed Symbolic line
    By ftonelli in forum Revit - Platform
    Replies: 1
    Last Post: 2010-03-03, 12:00 PM
  3. 4x8 dashed fill pattern needed
    By jontramos in forum Revit Architecture - General
    Replies: 9
    Last Post: 2010-01-12, 02:23 PM
  4. Selected Dashed line help
    By Gezza-01 in forum AutoCAD General
    Replies: 2
    Last Post: 2008-03-26, 01:15 PM
  5. Dashed line footings
    By dalewww in forum Revit Architecture - General
    Replies: 4
    Last Post: 2005-02-09, 09:43 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
  •