TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: rugaroo on October 08, 2004, 11:31:26 PM
-
Ok, it has been a while since I have been able to sit down and write anything.
Here is what I am having a problem with:
(http://www.civildraftingservices.com/helppic.png)
Now I know that this is a simple math question, but for me to turn it into lisp is a little bit harder than I thought.
Ok, the following vars are know A, B, C, C2.
If the user draws a line from the corner of AC to BC, but then wants to insert a point or node at the corner of C2 and B+X, if the distance and angle of C2 is know, how would I get it to insert the point in the manner of:
command: line
command:From: pt1 <-User given pnt ~ AC
command:To: pt2 <-User given pnt ~ BC
command:point
command:Place point: <-Point to be calculated from the known length of C2 which is a var that is stored in the lisp, along with the angle of the line from using getangle between pt1 and pt2.
I dont have any code or anything cause it is all written on paper right now...lisp and paper just dont work too well together. lol. but I just cant seem to calculate the point for the node. how could i generate this point so i can store it and use it as needed??[/code]
-
If I understand your question correctly I believe you can use the polar function.
(polar pt ang dist)
So it might look something like this;
(polar p2 (angle pt2 pt1) c2)
Nice graphic rug. :D
-
as always mark..you have helped me yet again :)..thanks...you will see the results soon.