Arek Adamczuk Posted January 8, 2019 Posted January 8, 2019 Hello. I am a student and I need your help. My task is to write a program in AutoLISP that draws parts but I have no idea how to do it. The program in the simplest version which is only possible - I know that for some of you it's a bit of a job, so if it was possible, I would ask for help. I will try to repay somehow . Greetings. Sorry for my English. Quote
BIGAL Posted January 9, 2019 Posted January 9, 2019 You need to start with the basics then use simple command method as a start. Keep using polar to work out new points and drawing objects like a circle then trim to clean up. look up the help for explanation of the commands below. There is some missing distances in the sketch you will have to make some choices.  Getpoint Getreal or Getdist Polar to work out new points  (setq pt1 (getpoint "Pick lower left point")) (setq a (getreal "Enter length A")) (setq b (/ a 0.6)) (setq h (getreal "Enter offset H")) (setq h1 (- (/ b 3.0) 5.0))  (setq pt2 (polar pt1 0.0 b)) (setq pt3 (polar pt2 (/ pi 2.0) a)) (setq pt4 (polar pt3 pi b))  (command "line" pt1 pt2 pt3 pt4 pt1 "") 1 Quote
Arek Adamczuk Posted January 9, 2019 Author Posted January 9, 2019 Thanks ;). What is this mistake? The compiler shows that it is good. Â Quote
BIGAL Posted January 11, 2019 Posted January 11, 2019 The new version of Cadtutor double lines when I paste if you just copy and paste it will not work as it will skip over the getpoint and getreal. Paste it to vlide and run from there. If you paste a line at a time it will work just a quirk with copy and pasting to command line you have to know how many lines you can paste takes experience. I tested this version and it works.  (setq pt1 (getpoint "Pick lower left point")) (setq a (getreal "Enter length A")) (setq h (getreal "Enter offset H")) (setq b (/ a 0.6)) (setq h1 (- (/ b 3.0) 5.0)) (setq pt2 (polar pt1 0.0 b)) (setq pt3 (polar pt2 (/ pi 2.0) a)) (setq pt4 (polar pt3 pi  b)) (setvar "osmode" 0) (command "line" pt1 pt2 pt3 pt4 pt1 "") Quote
Recommended Posts
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.