×
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

slot routine

slot routine

slot routine

(OP)
i have been trying to create a lisp program that will draw a slot but am having problems with it not sure where the problem is
it will not draw the slot to correct size
any help would be appricated

thanks

(defun C:SLOT  (/ A B B1 B2 C D PW)
  (setq PW (getvar"PLINEWID"))
  (initget 1)
  (setq B1 (getdist "\nLength of slot: "))
  (setq B2 (/ B1 2.0))
  (setq B (list B2 0.0))
  (initget 1)
  (setq C (list 0.0 (getdist "\nWidth of slot: ")))
  (initget 1)
  (while
   (setq A (getpoint "\nInsertion point: "))
   (setq D (list (- (car A) (/ (car B) 2)) (- (cadr A) (/ (cadr C) 2))))
   (setvar "PLINEWID" 0)
   (command "_.pline"
            D
            (mapcar '+ D B)
            "_a"
            (mapcar '+ D B C)
            "_l"
            (mapcar '+ D C)
            "_a"
            "_cl")
   );while
   (setvar "PLINEWID" PW)
  (princ)
)

RE: slot routine

I did not check your code but there are a lot of slot routines on the internet that may be a little handier.

"Everybody is ignorant, only on different subjects." — Will Rogers

RE: slot routine

(OP)
could you possibly point me to some
I have looked...

RE: slot routine

I had no trouble with your lisp routine.  What trouble were you having?

RE: slot routine

rwbaker,

Here is a problem that I usually run into. If you have your OSNAPS on, the LISP routine will generally give you a strange result. I loaded your LISP and tried it. It seemed to draw a single line. I shut off the OSNAPS and then it seemed to run correctly. If you need to be able to pick points as you are using the LISP, I simply add in the lines to shut off the OSNAPS and then turn them on before and after each pickpoint. See if that helps for you.

Also, I noticed that the slots do not come out to the correct length. The width is right, but, the length is too short. You may need to review the Pline geometry to make sure that it is correct.

Hope this helps,
Paul

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