Autocad Lisp Draw Arc Center Radius Start End

How to draw arc clockwise?

fredericklim

I found when I drawing Arc the direction is always counter-clockwise, how to change the direction to clockwise?

Comments

  • Roy Klein Gebbinck

    Change the ANGDIR. Note that 'internally' the direction of an arc is always CCW.

  • fredericklim

    I changed ANGDIR from 0 to 1 but no effect, I use Center-Start--End to draw the arc, but still in CCW direction.

  • Steven_g

    In Autocad holding the Ctrl key whilst selecting points will reverse the arc direction, unfortunately this doesn't work in Bricscad??? The only method I can think of in Bricscad is to rotate the UCS around the X axis by 180 degrees (but don't forget to turn it back), and only if you aren't worried about entity normals, because the arc's will be upside down!

  • Roy Klein Gebbinck

  • rkmcswain

    @Steven_g said:
    In Autocad holding the Ctrl key whilst selecting points will reverse the arc direction, unfortunately this doesn't work in Bricscad???

    But that is only if you specify certain options, such as starting with the center point.

    Either way, the arc is still internally defined as counterclockwise based on the start and end angles, as @Roy Klein Gebbinck said.

  • Anthony Apostolaros

    Perhaps the Center-Start-End method is the problem? It requires you to pick a single point to establish both the radius and the start point of the arc. That's fine if the esnap point that's convenient for setting the radius happens to be the clockwise end of the arc. But often that's not the case.

    If you draw the arc by a Center-Radius-Start-End method, you can set the radius without picking the start point -- it doesn't even have to be a point on the arc. Then pick a point to specify the direction from the center to the CW end of the arc, and then the same for the CCW end.

    (defun c:AA () ; arc by center-radius-start-end ; Pre-input 3 points, calculate first 2 points to pass to the Arc command: (setq Ctr (getpoint "Center point: ")) (setq Rad (getdist "Radius: " Ctr)) ;numerical distance, or point as distance from Ctr (setq Pt1 (getpoint "Start of arc sweep: ")) (setq Dir (angle Ctr Pt1)) ;calculate direction of start point vector from Ctr (setq Start (polar Ctr Dir Rad)) ;start point is at Rad distance & Dir direction from Ctr ; Let the built-in Arc command prompt for the 3rd point: (command "ARC" "C" Ctr Start) ;command, mode, & first two points (while (> (getvar "cmdactive") 0) (command pause)) ;pause for input of third point (sssetfirst nil (ssget "L")) )

  • Steven_g

    Or just create a clockwise version by reversing the input points.
    (defun c:CSE () ; clockwise arc by center-start-end (setq Ctr (getpoint "Center point: ")) (setq End (getpoint "Start point: ")) (setq Sta (getpoint "End of arc: ")) (command "_ARC" "_C" Ctr Sta End) )

  • fredericklim

    C> @Steven_g said:

    Or just create a clockwise version by reversing the input points.
    (defun c:CSE () ; clockwise arc by center-start-end (setq Ctr (getpoint "Center point: ")) (setq End (getpoint "Start point: ")) (setq Sta (getpoint "End of arc: ")) (command "_ARC" "_C" Ctr Sta End) )

    Cool! How to use it?

  • Steven_g

    This should get you the started loading the Lisp into Bricscad
    b-k-g.nl/loading-lisp-programs.html
    Once thats done just type "CSE" (from the first line of the code) you can alter that if you want something more memorable.

  • fredericklim

    @Steven_g said:
    This should get you the started loading the Lisp into Bricscad
    b-k-g.nl/loading-lisp-programs.html
    Once thats done just type "CSE" (from the first line of the code) you can alter that if you want something more memorable.

    Many Thanks! Although I cannot see the arc while I drawing it, it works!

    @Anthony Apostolaros said:
    Perhaps the Center-Start-End method is the problem? It requires you to pick a single point to establish both the radius and the start point of the arc. That's fine if the esnap point that's convenient for setting the radius happens to be the clockwise end of the arc. But often that's not the case.

    If you draw the arc by a Center-Radius-Start-End method, you can set the radius without picking the start point -- it doesn't even have to be a point on the arc. Then pick a point to specify the direction from the center to the CW end of the arc, and then the same for the CCW end.

    (defun c:AA () ; arc by center-radius-start-end ; Pre-input 3 points, calculate first 2 points to pass to the Arc command: (setq Ctr (getpoint "Center point: ")) (setq Rad (getdist "Radius: " Ctr)) ;numerical distance, or point as distance from Ctr (setq Pt1 (getpoint "Start of arc sweep: ")) (setq Dir (angle Ctr Pt1)) ;calculate direction of start point vector from Ctr (setq Start (polar Ctr Dir Rad)) ;start point is at Rad distance & Dir direction from Ctr ; Let the built-in Arc command prompt for the 3rd point: (command "ARC" "C" Ctr Start) ;command, mode, & first two points (while (> (getvar "cmdactive") 0) (command pause)) ;pause for input of third point (sssetfirst nil (ssget "L")) )

    I am not sure the different between the function and the build-in CSE, it seems same with extra radius parameter.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

peaseheathence.blogspot.com

Source: https://forum.bricsys.com/discussion/34046/how-to-draw-arc-clockwise

0 Response to "Autocad Lisp Draw Arc Center Radius Start End"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel