jan_ek Posted September 17, 2014 Share Posted September 17, 2014 Have anyone tried to create a command which draws a polyline according to coordinates of points and the radius of bending? It means that the command draws, for example, a polyline like in attachment, arguments are points marked on yellow and diameter of arch (for example), alternatively there could be also a commend closing polyline. I have read about the way of counting a radius according to "bulge". I am not sure how I should start - what should be counted into a radius? I would be very grateful for any help or comments. Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted September 17, 2014 Share Posted September 17, 2014 Well, if you have all dimensions set, then correct array of dimensions is required in order to get correct array of points - future vertices, and for arced segments I suggest that you use fillet command - it's also required correct array of selected dimensions... But all in all, I would draw that pline manually faster than with possible quirkiness ab obtain correct arrays from sel. sets... Quote Link to comment Share on other sites More sharing options...
asos2000 Posted September 17, 2014 Share Posted September 17, 2014 In case of Rs are equal for Pline we can entmake Pline (attached) then use fillit command (setq obj (entlast)) (command "fillet" "P" "r" 30 obj) Entmake Min Codes CAB.LSP Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted September 17, 2014 Share Posted September 17, 2014 try this (defun c:test () (entmake '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (8 . "0") (100 . "AcDbPolyline") (90 . ;Number of vertices (10 176.0636632716071 279.6390112374238); 10 =Vertex coordinates (in OCS), multiple entries; one entry for each vertex (10 346.0636632716071 279.6390112374238) (42 . 0.414213562373095); 42=Bulge (multiple entries; one entry for each vertex) (optional; default = 0) (10 376.0636632716071 309.6390112374238) (10 376.0636632716071 449.6390112374237) (42 . -0.414213562373095) (10 406.0636632716071 479.6390112374238) (10 568.0354241512509 479.6390112374238) (42 . 0.131490546050545) (10 583.0188770098191 483.6487026506627) (10 821.2389076067196 620.9829165365836) (70 . 0);Polyline flag (bit-coded); default is 0: 1 = Closed; ) ) (princ) ) HTH m.badran Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 18, 2014 Share Posted September 18, 2014 A slight variation on above the point list could come from somewhere else execl etc. (defun make_sq () (setq vertexList (list (list -3.25 -3.25 0.) (list 3.25 -3.25 0.) (list 3.25 3.25 0.) (list -3.25 3.25 0.) )) (entmakex (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 90 (length vertexList)) (cons 70 1) ; 1 closed : 0 open (cons 8 "0") (cons 38 0.0) (cons 210 (list 0.0 0.0 1.0)) ) (mapcar '(lambda (pt) (cons 10 pt)) vertexList) ) ) ) Quote Link to comment Share on other sites More sharing options...
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.