×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Lisp help needed.

Lisp help needed.

Lisp help needed.

(OP)
Can you find anything wrong with this lip routine?
;WELD1.LSP
;Program to draw leaders and insert weld symbols

(Defun C:WELD1 (/ scale asz p1 p2 blipsav orthosav layersav)
  (setvar "cmdecho" 0)
  (setvar "attdia" 0)
  (setvar "blipmode" 0)
  (setq orthosav (getvar "orthomode"))
   (setvar "orthomode" 0)
  (command "layer" "S" "dim" "")
  (setq SCALE (getvar "ltscale")
        ASZ (* 0.18 SCALE)
        P1 (getpoint "\nLeader Start")
        P2 (getpoint P1 "\nLeader end"))
 (setsym)
 (setq symtest (findfile (strcat symbol ".DWG")))
 (if symtest
   (progn
      (command "line" P1 P2 "")
      (command "insert" "arrow" P1 scale "" (/ (* (angle P1 P2) 180.0) pi))
      (command "insert" symbol P2 scale "" 0)
   )
      (prompt "\n *ERROR*  Invalid Symbol Name ")
 )
 (setvar "orthomode" orthosav)
 (setvar "cmdecho" 1)
 (setvar "attdia" 1)
 (princ)
)

(defun setsym ()
 (setq symbol (strcat "w" wtype wside whand)
       spacing (getstring "\n Include length/spacing? <N> "))
       (if (/= spacing "") (setq symbol (strcat symbol "c")))
       (if (= wside "B")
        (progn
         (setq stagger (getstring "\n Stagger Welds? <N> "))
         (if (/= "" stagger) (setq symbol (strcat symbol "s")))
        )
       )
)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources