Eng-Tips is the largest forum for Engineering Professionals on the Internet.

Members share and learn making Eng-Tips Forums the best source of engineering information on the Internet!

  • Congratulations dmapguru on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lisp help needed.

Status
Not open for further replies.

DSRT

Mechanical
Joined
Feb 24, 2004
Messages
37
Location
US
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")))
)
)
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top