termal007 Posted December 9, 2011 Posted December 9, 2011 hi i have 1000 polyline , i want all my polyline in the Middle polilne rotate To the desired size what can i do ? it is many poline and i doing with command autocad is very Time-consuming . please help me one file attached Drawing1.dwg Quote
alanjt Posted December 9, 2011 Posted December 9, 2011 You'll have to elaborate a bit more on this. Your DWG just shows neatly laid out plines. What's the begin and end result? Quote
ReMark Posted December 9, 2011 Posted December 9, 2011 There are 8281 polylines. What happen to the remainder? Are you rotating each polyline by its own midpoint? What does "rotate to desired size" mean? Resizing the lines would involve scaling them wouldn't it? Or did you mean to use the word "side"? Quote
eldon Posted December 9, 2011 Posted December 9, 2011 There are 8281 polylines. What happen to the remainder? But if you join all joining polylines, you end up with 1333 polylines. They might be road cross section profiles, so to rotate them would indicate that the Earth was tilting. Very curious Quote
ReMark Posted December 9, 2011 Posted December 9, 2011 "What we've got here is (a) failure to communicate" Quote
Dadgad Posted December 10, 2011 Posted December 10, 2011 "What we've got here is (a) failure to communicate" I'm shakin' it boss! Quote
termal007 Posted December 10, 2011 Author Posted December 10, 2011 hi ; sorry for late it's absolutly is Cross sectin and i want Earth line is rotate to 2 degree or 3 degree ! but it will takes much time to all rotate by one click and one click may i can doing faster !!!!!! please help i hope try everybody underestand my question But if you join all joining polylines, you end up with 1333 polylines. They might be road cross section profiles, so to rotate them would indicate that the Earth was tilting. Very curious Quote
eldon Posted December 10, 2011 Posted December 10, 2011 If I did not have a handy lisp routine to do what you are wanting, I would rotate the whole lot in one Rotate, and then move them, one by one, back to the grid layout. Quote
Tharwat Posted December 10, 2011 Posted December 10, 2011 Hope this would help you with your work , and the routine would rotate each polyline into 2 degrees . (defun c:TesT (/ selectionset integr selectionsetname point1 point2 basepoint) ;;; Tharwat 10. Dec. 2011 ;;; (vl-load-com) (if (setq selectionset (ssget "_:L" '((0 . "LWPOLYLINE")))) (repeat (setq intger (sslength selectionset)) (setq selectionsetname (ssname selectionset (setq intger (1- intger))) ) (setq point1 (vlax-curve-getstartpoint selectionsetname)) (setq point2 (vlax-curve-getendpoint selectionsetname)) (if (> (cadr point1) (cadr point2)) (setq basepoint point2) (setq basepoint point1) ) (vla-rotate (vlax-ename->vla-object selectionsetname) (vlax-3d-point basepoint) 0.0349066 ) ) (princ "\n *** < No Polylines were selected > *** ") ) (princ) ) Quote
termal007 Posted December 10, 2011 Author Posted December 10, 2011 thank u Tharwat but i don't know how to worked ; when i run in load Lisp (lsp) ; what type in command bar in Autocad command bar to loaded ? Quote
Tharwat Posted December 10, 2011 Posted December 10, 2011 Read this ..... http://lee-mac.com/runlisp.html Quote
termal007 Posted December 10, 2011 Author Posted December 10, 2011 thank u sir but this ERROR in my command Autocad commmand bar "error : malformed list on input " so ; what can i di !? Quote
Tharwat Posted December 10, 2011 Posted December 10, 2011 thank u sir but this ERROR in my command Autocad commmand bar "error : malformed list on input " so ; what can i di !? Re-copy the code once again , because the error indicates that you have missed one or more parenthesis and try again . Quote
termal007 Posted December 10, 2011 Author Posted December 10, 2011 thank u Tharwat i try and thank so much my guy sorry ; one question again if i want to 3 degree or other degree ; so what can i do !! but important i want change to base rotate for any polyline in my CAD ; this lisp u doing by one base !!!? that's right ? Quote
Tharwat Posted December 10, 2011 Posted December 10, 2011 Try this ... First you would enter Angle degree and then select the polylines to rotate them . (defun c:TesT (/ degree selectionset integr selectionsetname point1 point2 basepoint ) ;;; Tharwat 10. Dec. 2011 ;;; (vl-load-com) (if (and (setq degree (getangle "\n Enter your desire angle :")) (setq selectionset (ssget "_:L" '((0 . "LWPOLYLINE")))) ) (repeat (setq intger (sslength selectionset)) (setq selectionsetname (ssname selectionset (setq intger (1- intger))) ) (setq point1 (vlax-curve-getstartpoint selectionsetname)) (setq point2 (vlax-curve-getendpoint selectionsetname)) (if (> (cadr point1) (cadr point2)) (setq basepoint point2) (setq basepoint point1) ) (vla-rotate (vlax-ename->vla-object selectionsetname) (vlax-3d-point basepoint) degree ) ) (princ "\n *** < No Polylines were selected > *** ") ) (princ) ) Quote
termal007 Posted December 11, 2011 Author Posted December 11, 2011 thank u Tharwat i just one question ; i want rotate every polyline by change bases ; it means i need one polyline by with its based and one polyline again with bases; so u think 1000 polyline and you wanted to rotated by one command "Rotate"(in command bar to Autocad") and try again . it takes much time !!!!! so what can i do ? Quote
Tharwat Posted December 11, 2011 Posted December 11, 2011 thank u Tharwat i just one question ; i want rotate every polyline by change bases ; it means i need one polyline by with its based and one polyline again with bases; so u think 1000 polyline and you wanted to rotated by one command "Rotate"(in command bar to Autocad") and try again . it takes much time !!!!! so what can i do ? Why you're repeating the same question for many times ? and can you tell me where can I find the base point of the Polyline ? Were you able to invoke the routine ? Quote
eldon Posted December 11, 2011 Posted December 11, 2011 I think that the trouble here is that there is not enough information given. There are 1333 sets of polylines, seemingly set out on a grid in most cases, but the grid centres are not given. The OP must show where each of the 1333 base points for rotation are. With the information given, the point of rotation could be the left hand end of the polyline, the right hand of the polyline, or a point half way between the left hand end and the right hand end, but I suspect that none of these is the proper base for rotation. More information is needed Tharwat's routine rotates the polylines about the end with the lowest y value. Quote
ReMark Posted December 11, 2011 Posted December 11, 2011 I think the OP is saying "Don't give me what I asked for, give me what I need." LOL 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.