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
|
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
Look into the code posted in reply #4 from here :
http://www.autolisp.com/forum/autoca...his-lisp-exist
HTH, M.R.
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.
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.
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.
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.
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.
HTH, M.R.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))
Last edited by marko_ribar; 2016-04-07 at 07:47 PM.