Jump to content

how to Rotate 1000 line by one click ?


Recommended Posts

Posted

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

  • Replies 20
  • Created
  • Last Reply

Top Posters In This Topic

  • Tharwat

    6

  • termal007

    6

  • ReMark

    3

  • eldon

    3

Top Posters In This Topic

Posted

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?

Posted

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"?

Posted
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 :?

Posted

"What we've got here is (a) failure to communicate"

Posted
"What we've got here is (a) failure to communicate"

 

I'm shakin' it boss!

Posted

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 :?

Posted

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. :)

Posted

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)
)

Posted

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 ?

Posted

thank u sir

 

but this ERROR in my command Autocad commmand bar "error : malformed list on input "

 

 

 

so ; what can i di !?

Posted
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 .

Posted

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 ?

Posted

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)
)

Posted

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 ?

Posted
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 ?

Posted

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 :cry:

 

Tharwat's routine rotates the polylines about the end with the lowest y value.

Posted

I think the OP is saying "Don't give me what I asked for, give me what I need." LOL

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...