Jump to content

Angle, Distance Lisp Routine


Recommended Posts

Posted

Hi People,

 

I know there is an angle/distance lsp routine out there as I have used it at my past jobs. Does anyone know if there is one posted on this site?

 

Its a simple routine. Pick end point, select backsite point, enter angle, enter distance, and on and on.

 

Lsp could also be known as continuous traverse??

 

Thanks

Posted

From June 2, 2006:

 

After you initiate the Line or Pline command and click on screen to set your starting point, type @156'

 

No LISP required; this is part of built-in AutoCAD commands.

Posted

Hi Tyke, Couldnt find it on the website.

 

RenderMan, I've used the @100

 

I need to start my traverse at the end point of the line, backsite the line I am set up on, which will set the angle at "0". then I can enter the 95d03'45" angle at a distance of 354.65.

 

I should have swiped the lisp from my previous job!

Posted

Things like this ... ?

 

If not , just clarify your goal with more details .

 

(defun c:Test (/ p)
 ;;; Tharwat 28. Sep. 2012 ;;;
 (if (and (setq p (getpoint "\n Specify start point of line :"))
          (setq a (cond ((getangle (strcat "\n Specify Angle in Degree "
                                           (if a
                                             (strcat "< " (rtos a 2) " >")
                                             ""
                                           )
                                           ":"
                                   )
                         )
                        )
                        (t
                         (if a
                           a
                           nil
                         )
                        )
                  )
          )
          (setq d (cond ((getdist (strcat "\n Specify Distance "
                                          (if d
                                            (strcat "< " (rtos d 2) " >")
                                            ""
                                          )
                                          ":"
                                  )
                         )
                        )
                        (t
                         (if d
                           d
                           nil
                         )
                        )
                  )
          )
     )
   (entmake (list '(0 . "LINE")
                  (cons 10 (trans p 0 1))
                  (cons 11 (polar p a d))
            )
   )
   (princ)
 )
 (princ)
)

Posted
Hi People,

 

I know there is an angle/distance lsp routine out there as I have used it at my past jobs. Does anyone know if there is one posted on this site?

 

Its a simple routine. Pick end point, select backsite point, enter angle, enter distance, and on and on.

 

Lsp could also be known as continuous traverse??

 

Thanks

 

 

Try this one, i got it from somewhere i cant remember where :

 

;Tip1741:  BD.LSP           Bearing/Distance lines         (c)2001, Joon Hong  $50 Bonus Winner
(defun C:BD  ()
 (setvar "cmdecho" 0)
 (initget 1)
 (setq PT (getpoint "\nPick a starting point: "))
 (initget 1 "NE NW SE SW")
 (setq BR (getkword "\nPick bearing (NE/NW/SE/SW): "))
 (setq OPT (strcase BR))
 (initget 1)
 (setq LEN (getreal "\nType the length: "))
 (setq DEG (getstring "\nType the degree: ")
       minx (getstring "\nType the minute: ")
       SEC (getstring "\nType the second: "))
 (if (= DEG "")
   (setq DEG "0"))
 (if (= minx "")
   (setq minx "0"))
 (if (= SEC "")
   (setq SEC "0"))
 (cond ((= "SW" OPT)
        (setvar "angbase" (cvunit 270 "degree" "radian"))
        (setvar "angdir" 1))
       ((= "SE" OPT)
        (setvar "angbase" (cvunit 270 "degree" "radian"))
        (setvar "angdir" 0))
       ((= "NW" OPT)
        (setvar "angbase" (cvunit 90 "degree" "radian"))
        (setvar "angdir" 0))
       ((= "NE" OPT)
        (setvar "angbase" (cvunit 90 "degree" "radian"))
        (setvar "angdir" 1)))
 (command "line" PT (strcat "@" (rtos LEN) "<" DEG "d" minx "'" SEC "\"") "")
 (setvar "angbase" 0)
 (setvar "angdir" 0)
 (setvar "cmdecho" 1)
 (princ))
(princ "\nType 'BD' to draw lines with bearings")
(princ)

Posted

If you do a bit of arithmetic first, you can find out the bearings of the lines and use the lisps being offered.

 

However if you have to do it all by drawing until you can get your lisp, then it is really quite simple. Draw the first line. Copy it onto itself and rotate the line by the turned angle (going in the required direction) and then make that rotated line the correct length. etc., etc.

Posted

I believe that as long the current UCS is aligned with the base line, there is nothing to prevent the usage of relative coordinates; for sure, the units for angles had to be set accordingly, too.

Please check the Object option of UCS command - select the base line close to the end where you want the origin of your custom coordinates system.

Posted

Alternatively, if you had enabled the Polar Tracking feature, there is the option to provide the polar angle as absolute value or relative to the last segment.

Posted

My 5 cents worth first nod684

 

Its easier to do ddd.mmss and convert only need 1 getreal.
(setq DEG (getstring "\nType the degree: ")
       minx (getstring "\nType the minute: ")
       SEC (getstring "\nType the second: "))

(setq DEGbrg  (getreal "\nType the degree DDD.MMSS : ")

(setq DEG = You take the DEGbrg fix, subtract *100 fix subtract divide 60 subtract divide 3600 so end up with decimal angle. Just need your units variables set correct. ) No cad at moment.

 

2nd part pick line near start end of new line this returns exist angle then you can enter swing angle which is added to existing line angle and a polar gives new pt and so on. You would have an option like "pick start line or new pt pick blank screen or press enter so then asks pick start point with true bearings entered. You may need a back bearing entered as well depends what BRG's you are entering.

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