pegasus Posted March 21, 2023 Posted March 21, 2023 (edited) hello, an existing lisp is not doing enough for me. For example, I can't make arc and circle or more amorphous lines, because they make straight polylines. I struggle with setting the thickness I want each time. what I have in mind is to convert a polyline line I want to the thickness I want. Could you help? (defun c:1mm_pline ( / oldlt) (setq oldlt (getvar 'celtype)) (command "layer" "s" "Layer1" "") (setvar 'celtype "hidden") (setvar 'CELTSCALE 1) (setvar 'plinewid 0.7) (setq pt (getpoint "\nPline start point: ")) (command "_pline" pt) (while (= (getvar "cmdactive") 1 ) (command (getpoint (getvar 'lastpoint))) ) (if (= (getvar "cmdactive")0) (progn (setq plent (vlax-ename->vla-object (entlast))) (if (vlax-method-applicable-p plent 'offset) (progn (vla-offset plent 0.5) (setq en1 (vlax-ename->vla-object (entlast))) (vla-put-Constantwidth en1 0) (vla-put-linetypescale en1 1) (vla-put-linetype en1 "Continuous") (vla-offset plent -0.5) (setq en2 (vlax-ename->vla-object (entlast))) (vla-put-Constantwidth en2 0) (vla-put-linetypescale en2 1) (vla-put-linetype en2 "Continuous"))))) (setvar 'celtype oldlt) (setvar 'CELTSCALE 1) (setvar 'plinewid 0.0) (princ ) ) Edited March 21, 2023 by SLW210 Please use Code Tags!! Quote
tombu Posted March 21, 2023 Posted March 21, 2023 Your code will only run if Layer1 is in the drawing and is limited like you said. I'd recommend modifying this similar lisp that converts a polyline to a wide dashed polyline with two solid polylines offset to each side like Railroad tracks were often displayed on old drawings. Got it from the old T-Square Graphics site 1998-2002 which isn't there anymore. Give it a try. rrl.lsp Quote
devitg Posted March 21, 2023 Posted March 21, 2023 10 hours ago, pegasus said: what I have in mind is to convert a polyline line I want to the thickness I want. @pegasus do you mean some like it? I made it by given Arc and Line options when PLINE (defun c:1mm_pline ( / oldlt) (setq oldlt (getvar 'celtype)) (command "layer" "m" "Layer1" ""); the M option make or set the layer (setvar 'celtype "hidden"); it has to be loaded (setvar 'CELTSCALE 1) (setvar 'plinewid 0.7) (setq pt (getpoint "\nPline start point: ")) (command "_pline" pt) (while (= (getvar "cmdactive") 1 ) (command (getpoint (getvar 'lastpoint))) ) (if (= (getvar "cmdactive")0) (progn (setq plent (vlax-ename->vla-object (entlast)))) (if (vlax-method-applicable-p plent 'offset) (progn (vla-offset plent 0.5) (setq en1 (vlax-ename->vla-object (entlast))) (vla-put-Constantwidth en1 0) (vla-put-linetypescale en1 1) (vla-put-linetype en1 "Continuous") (vla-offset plent -0.5) (setq en2 (vlax-ename->vla-object (entlast))) (vla-put-Constantwidth en2 0) (vla-put-linetypescale en2 1) (vla-put-linetype en2 "Continuous") ) ) ) ) (setvar 'celtype oldlt) (setvar 'CELTSCALE 1) (setvar 'plinewid 0.0) (princ ) ) 3 lines poly.dwg like tracks.lsp 1 Quote
devitg Posted March 21, 2023 Posted March 21, 2023 8 hours ago, tombu said: Give it a try. Seem to be RAILROAD is not at ACAD.lin , on new versions , TRACKS could be used 1 Quote
BIGAL Posted March 22, 2023 Posted March 22, 2023 (edited) Please WIDTH, thickness is something altogether different in Autocad. What is problem with draw 1 pline then offset twice and change original pline width and linetype ? I would use like a custom linetype like one I have "equal" which is a equal draw solid and gap. Change LTSCALE and lengthens or shortens central pline dashed pline. Should add if common sizes then just type a size eg 300 then all values are known +- 150 and width = 270. Edited March 22, 2023 by BIGAL 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.