positive_X Posted September 12, 2016 Posted September 12, 2016 (edited) Hello , I am learning AutoLISP ; and have 20 + custom coordinate systems ( UCS ) at an angle & would like to learn AutoLISP to automate these . Using UCS 3point that seems to ignore (& stop) at the second point : ;; TESTing 20160911 ; Create UCS 'tipped' towards Point "ReflNN_1" (setq point1 '(0 0 0) point2 '((/ (sqrt(+ (expt 20.8125 2.0) (expt 20.8125 2.0))) 2.0) (- 63.0 0.625) 0) point3 '(0 0 1)) ;; from UCS 'horizonatally' to the (command "_.ucs" "_3p" point1 point2 point3) ;; UCS Origin , Positive X Axis , Positive Y Orientation _ the Refel , Tip the UCS towards THE Point , UCS Positive Z direction unit (command "_.ucs" "_na" "_s" "Refl25_1_TEST") ;; end_TESTing 20160911 Edited September 12, 2016 by positive_X Quote
positive_X Posted September 12, 2016 Author Posted September 12, 2016 Claculating the numbers manually for setq works : ;; TESTing 20160911 ; Create UCS 'tipped' towards Point "ReflNN_1" active in Array_Reflector25_1 ; foc_z @ 63.0 ; (20.8125 20.8125 0.625) (setq point1 '(0 0 0) point2 '(-14.716659883445020351592573286307 62.375 0) point3 '(0 0 1)) ;; from UCS 'horizonatally' to the (command "_.ucs" "_3p" point1 point2 point3) ;; UCS Origin , Positive X Axis , Positive Y Orientation _ the Refel , Tip the UCS towards THE Point , UCS Positive Z direction unit (command "_.ucs" "_na" "_s" "Refl25_1_TEST") ;; end_TESTing 20160911 however , I would like to calculate in the setq , in order to further automate it . Quote
BKT Posted September 12, 2016 Posted September 12, 2016 Interesting. I couldn't get point2 to be properly created either when I used the quote (') instead of list, but if I went ahead and used list I got it to work: (setq point1 '(0 0 0) point2 (list (/ (sqrt (+ (expt 20.8125 2.0) (expt 20.8125 2.0))) 2.0) (- 63.0 0.625) 0) point3 '(0 0 1)) I hope someone will come along and explain why... BKT Quote
BKT Posted September 12, 2016 Posted September 12, 2016 Just got back from Lee Mac's amazing site, and the explanation for use of the apostrophe and the quote function is described in depth. http://www.lee-mac.com/quote.html Thanks again, Lee Mac! Quote
Lee Mac Posted September 12, 2016 Posted September 12, 2016 Just got back from Lee Mac's amazing site, and the explanation for use of the apostrophe and the quote function is described in depth. http://www.lee-mac.com/quote.html Thanks again, Lee Mac! You're welcome - glad it was clear! Quote
positive_X Posted September 13, 2016 Author Posted September 13, 2016 (edited) Just got back from Lee Mac's amazing site, and the explanation for use of the apostrophe and the quote function is described in depth. http://www.lee-mac.com/quote.html Thanks again, Lee Mac! You're welcome - glad it was clear! Thank you both very much . . My trig was incorrect ; I need to halve the angle not a horiz. dist . (I still need the horiz dist though) . .. Now I need to learn more about how to handle angles in AutoLISP . And how to handle arrays of data in AutoLISP . ... My task is to create MANY User Coordinate Systems ( UCS ) es at 'double' angles : The FIRST is rotated in the World Coordinate System ( WCS ) , origin at a known point WCS (x1 y1 z1) (MANY of these) & with the X axis 'heading' towards the WCS origin (0 0 0) , my AutoLISP works for that ; then while active in this (these many ucs es) , the SECOND UCS Z axis is 'tipped' [ 1 / 2 ] of the way 'rotated' towards a (single) know point WCS (x_important y_important z_important) . {I did this manually by drawing an arc then a line to the mid_of , in order to define the 'second' ucs .} ... And I am just learning AutoLISP ... Edited September 13, 2016 by positive_X Quote
BIGAL Posted September 13, 2016 Posted September 13, 2016 Interesting did a quick copy and paste to see what was happening. Command: (setq point2 '((/ (sqrt(+ (expt 20.8125 2.0) (expt 20.8125 2.0))) 2.0) (- 63.0 0.625) 0)) ((/ (SQRT (+ (EXPT 20.8125 2.0) (EXPT 20.8125 2.0))) 2.0) (- 63.0 0.625) 0) Command: !point2 ((/ (SQRT (+ (EXPT 20.8125 2.0) (EXPT 20.8125 2.0))) 2.0) (- 63.0 0.625) 0) 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.