AutoCAD - AutoLISP help

AutoCAD - AutoLISP help

Anonymous
Not applicable
933 Views
5 Replies
Message 1 of 6

AutoCAD - AutoLISP help

Anonymous
Not applicable

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.

 

autolisp.png

0 Likes
934 Views
5 Replies
Replies (5)
Message 2 of 6

CodeDing
Advisor
Advisor

@Anonymous,

 

As a student, you should probably know mostly where to get started if you have been assigned this. If not, then perhaps you have not payed enough attention in class?

It looks as though this piece could probably be completed fairly simply.

First just calculate and set your variables with (setq ...)

You may need to reference some Arithmetic Functions.

Then, to calculate more points you might need some help from Geometric Functions.

After that, just connect the dots essentially.

Best of luck,

~DD

0 Likes
Message 3 of 6

Kent1Cooper
Consultant
Consultant

I don't think there's enough information there.  There is nothing by which to vertically position either the semi-circle "dip" in the top or the rounded-tip "point" at the bottom, nor to determine the angle between the straight edges of that point, nor to horizontally position the small semi-circle insets on either side of it, nor to determine the radii of the three things at the bottom [which clearly are not the same R as up near the top].  No one is going to be able to write an AutoLisp routine to draw such a thing without that additional information, presumably as proportions of a, or something.  Also, with h1 being defined as b/3 - 5, with 5 being an absolute value and not determined somehow from a, the whole thing is only going to work within a certain range of values of a [for example, if a is less than 15, h1 will be negative, which doesn't seem an intended possibility].

Kent Cooper, AIA
0 Likes
Message 4 of 6

Anonymous
Not applicable

What is this mistake? The compiler shows that it is good.

 

22222.png

0 Likes
Message 5 of 6

CodeDing
Advisor
Advisor

I usually get that error when I have pasted code directly into the command line and am missing a right parenthesis ")"

0 Likes
Message 6 of 6

Kent1Cooper
Consultant
Consultant

It's missing a final right parenthesis.  I see in the command-line part of the image that it looks like one has been typed, but still needs Enter/space to actually feed it in.

 

[What does this have to do with Message 1?]

Kent Cooper, AIA
0 Likes